From: duplo Date: Wed, 15 Apr 2009 14:18:00 +0000 (+0000) Subject: Store the last used save directory X-Git-Tag: 2.1.0~171 X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=166b09310df7d5829ea832c707278dd38bff8a2d;p=bertos.git Store the last used save directory git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2511 38d2e660-2303-0410-9eaa-f027e97ec537 --- diff --git a/wizard/BFolderPage.py b/wizard/BFolderPage.py index f6fcc59d..4e117445 100644 --- a/wizard/BFolderPage.py +++ b/wizard/BFolderPage.py @@ -4,7 +4,7 @@ # Copyright 2008 Develer S.r.l. (http://www.develer.com/) # All rights reserved. # -# $Id:$ +# $Id$ # # Author: Lorenzo Berni # @@ -34,6 +34,7 @@ class BFolderPage(BWizardPage): """ Overload of the QWizardPage isComplete method. """ + self.setDefaultFolder(self._destination_folder) if self.pageContent.projectPath.text() != "None": self.setProjectInfo("PROJECT_PATH", unicode(self.pageContent.projectPath.text())) return True @@ -91,7 +92,11 @@ class BFolderPage(BWizardPage): Initializes the page attributes to the default values. """ self._project_name = "" - self._destination_folder = os.path.expanduser("~") + stored_folder = self.defaultFolder() + if stored_folder != "": + self._destination_folder = stored_folder + else: + self._destination_folder = os.path.expanduser("~") self.pageContent.directoryEdit.setText(self._destination_folder) def setProjectPath(self): diff --git a/wizard/BWizardPage.py b/wizard/BWizardPage.py index d5346955..e516c69d 100644 --- a/wizard/BWizardPage.py +++ b/wizard/BWizardPage.py @@ -4,7 +4,7 @@ # Copyright 2008 Develer S.r.l. (http://www.develer.com/) # All rights reserved. # -# $Id:$ +# $Id$ # # Author: Lorenzo Berni # @@ -121,6 +121,18 @@ class BWizardPage(QWizardPage): Stores the toolchains in the QSettings. """ self.settingsStore("toolchains", qvariant_converter.convertBoolDict(toolchains)) + + def defaultFolder(self): + """ + Returns the default save folder stored in the QSettings. + """ + return qvariant_converter.getString(self.settingsRetrieve("folder")) + + def setDefaultFolder(self, folder): + """ + Stores the default save folder in the QSettings. + """ + self.settingsStore("folder", qvariant_converter.convertString(folder)) ####