Remove lines in the module parameter table, and make the elements uneditable
[bertos.git] / wizard / BFolderPage.py
index 5a0a9566e9392571e337793748e8ee8b61729cef..f92b457743b4c47290ef9103a4836e6d3641fb5c 100644 (file)
@@ -25,7 +25,8 @@ class BFolderPage(BWizardPage):
 
     def _initializeAttributes(self):
         self._projectName = ""
-        self._destinationFolder = ""
+        self._destinationFolder = os.path.expanduser("~")
+        self.pageContent.directoryEdit.setText(self._destinationFolder)
     
     def _connectSignals(self):
         self.connect(self.pageContent.nameEdit, SIGNAL("textChanged(const QString)"), self._nameChanged)
@@ -41,7 +42,7 @@ class BFolderPage(BWizardPage):
         self._setProjectPath()
     
     def _setProjectPath(self):
-        if self._destinationFolder <> "" and self._projectName <> "":
+        if self._destinationFolder != "" and self._projectName <> "":
             if not self._destinationFolder.endswith(os.sep):
                 self._destinationFolder += os.sep
             self.pageContent.projectPath.setText(self._destinationFolder + self._projectName + "/")
@@ -50,8 +51,13 @@ class BFolderPage(BWizardPage):
         self.emit(SIGNAL("completeChanged()"))
     
     def _selectDirectory(self):
-        directory = QFileDialog.getExistingDirectory(self, self.tr("Open Directory"), "", QFileDialog.ShowDirsOnly)
-        self.pageContent.directoryEdit.setText(directory)
+        directory = unicode(QFileDialog.getExistingDirectory(self, self.tr("Open Directory"), "", QFileDialog.ShowDirsOnly))
+        if len(directory) == "":
+            self.pageContent.directoryEdit.setText(directory)
     
     def isComplete(self):
-        return self.pageContent.projectPath.text() != "None"
\ No newline at end of file
+        if self.pageContent.projectPath.text() != "None":
+            self._projectInfoStore("PROJECT_PATH", self.pageContent.projectPath.text())
+            return True
+        else:
+            return False
\ No newline at end of file