If no BeRTOS version is selected the Wizard automatically select the latest
[bertos.git] / wizard / BFolderPage.py
index 4e1174457fd71bc7a95d26521068a5ce872625c9..0539c62b5f5ba137e420dbb0b0fabeeda2d3fffb 100644 (file)
@@ -81,7 +81,7 @@ class BFolderPage(BWizardPage):
         """
         Slot called when the project folder is changed using the file dialog.
         """
-        directory = unicode(QFileDialog.getExistingDirectory(self, self.tr("Open Directory"), "", QFileDialog.ShowDirsOnly))
+        directory = unicode(QFileDialog.getExistingDirectory(self, self.tr("Open Directory"), self.pageContent.directoryEdit.text(), QFileDialog.ShowDirsOnly))
         if len(directory) > 0:
             self.pageContent.directoryEdit.setText(directory)
 
@@ -95,6 +95,11 @@ class BFolderPage(BWizardPage):
         stored_folder = self.defaultFolder()
         if stored_folder != "":
             self._destination_folder = stored_folder
+        elif os.name == "nt":
+            from win32com.shell import shell, shellcon
+            self._destination_folder = shell.SHGetFolderPath(0, shellcon.CSIDL_PERSONAL, 0, 0)
+            del shell
+            del shellcon
         else:
             self._destination_folder = os.path.expanduser("~")
         self.pageContent.directoryEdit.setText(self._destination_folder)