X-Git-Url: https://codewiz.org/gitweb?a=blobdiff_plain;f=wizard%2FBFolderPage.py;h=187557db00b1bbe318f73276ac29ee2ff9a40d97;hb=fdb0cd85313d7f17e5df31bbbeaf1d01838dcc39;hp=f6fcc59dc9b92a96017ce2a8702e3bea44e74d50;hpb=ee8a668a156614bdc803c93874eda0d6580ccc2a;p=bertos.git diff --git a/wizard/BFolderPage.py b/wizard/BFolderPage.py index f6fcc59d..187557db 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,16 @@ 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 + 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) def setProjectPath(self):