# HG changeset patch # User Chris Cannam # Date 1305046588 -3600 # Node ID ba07505d20e29e52826277a8c49aeb430c954e24 # Parent 72a2b4210e509ef6ae1a378469cd17b5060d93d1 Ensure last used template is remembered in settings diff -r 72a2b4210e50 -r ba07505d20e2 main/MainWindow.cpp --- a/main/MainWindow.cpp Tue May 10 13:58:59 2011 +0100 +++ b/main/MainWindow.cpp Tue May 10 17:56:28 2011 +0100 @@ -1654,7 +1654,7 @@ QSettings settings; settings.beginGroup("MainWindow"); QString deflt = settings.value("sessiontemplate", "").toString(); - setDefaultSessionTemplate(deflt == "" ? "default" : ""); + setDefaultSessionTemplate(deflt == "" ? "default" : deflt); settings.endGroup(); QActionGroup *templatesGroup = new QActionGroup(this); @@ -2859,6 +2859,11 @@ } setDefaultSessionTemplate(n); + + QSettings settings; + settings.beginGroup("MainWindow"); + settings.setValue("sessiontemplate", n); + settings.endGroup(); } void @@ -2881,7 +2886,6 @@ void MainWindow::manageSavedTemplates() { - //!!! really we should watch this directory and recreate the menu when it changes ResourceFinder rf; QDesktopServices::openUrl("file:" + rf.getResourceSaveDir("templates")); }