# Copyright 2008 Develer S.r.l. (http://www.develer.com/)
# All rights reserved.
#
-# $Id:$
+# $Id$
#
# Author: Lorenzo Berni <duplo@develer.com>
#
"""
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
"""
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)
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):
"""
if self._destination_folder != "" and self._project_name <> "":
if not self._destination_folder.endswith(os.sep):
- self._destination_folder += "/"
+ self._destination_folder += os.sep
self.pageContent.projectPath.setText(QDir.toNativeSeparators(self._destination_folder + self._project_name))
if os.path.exists(self._destination_folder + self._project_name):
self.pageContent.warningLabel.setVisible(True)
self.pageContent.projectPath.setText("None")
self.pageContent.warningLabel.setVisible(False)
self.pageContent.warningLabel.setText("")
- self.emit(SIGNAL("completeChanged()"))
\ No newline at end of file
+ self.emit(SIGNAL("completeChanged()"))