Store the last used save directory
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 15 Apr 2009 14:18:00 +0000 (14:18 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Wed, 15 Apr 2009 14:18:00 +0000 (14:18 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@2511 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/BFolderPage.py
wizard/BWizardPage.py

index f6fcc59dc9b92a96017ce2a8702e3bea44e74d50..4e1174457fd71bc7a95d26521068a5ce872625c9 100644 (file)
@@ -4,7 +4,7 @@
 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
 # All rights reserved.
 #
-# $Id:$
+# $Id$
 #
 # Author: Lorenzo Berni <duplo@develer.com>
 #
@@ -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):
index d53469551a41a7281dfdf225b7f1a56c3dd8b9ea..e516c69d72b9cb2eab57eb51dcef64316cda6c63 100644 (file)
@@ -4,7 +4,7 @@
 # Copyright 2008 Develer S.r.l. (http://www.develer.com/)
 # All rights reserved.
 #
-# $Id:$
+# $Id$
 #
 # Author: Lorenzo Berni <duplo@develer.com>
 #
@@ -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))
 
     ####