Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py

branch
5_4_x
changeset 3335
0e973a74be62
parent 3160
209a07d7e401
--- a/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py	Wed Mar 05 20:02:28 2014 +0100
+++ b/Plugins/VcsPlugins/vcsPySvn/SvnNewProjectOptionsDialog.py	Thu Mar 06 18:31:52 2014 +0100
@@ -53,9 +53,29 @@
         self.networkPath = "localhost/"
         self.localProtocol = True
         
-        self.vcsProjectDirEdit.setText(Utilities.toNativeSeparators(
-            Preferences.getMultiProject("Workspace") or
-            Utilities.getHomeDir()))
+        ipath = Preferences.getMultiProject("Workspace") or \
+            Utilities.getHomeDir()
+        self.__initPaths = [
+            Utilities.fromNativeSeparators(ipath),
+            Utilities.fromNativeSeparators(ipath) + "/",
+        ]
+        self.vcsProjectDirEdit.setText(
+            Utilities.toNativeSeparators(self.__initPaths[0]))
+        
+        self.resize(self.width(), self.minimumSizeHint().height())
+        
+        self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(False)
+    
+    @pyqtSlot(str)
+    def on_vcsProjectDirEdit_textChanged(self, txt):
+        """
+        Private slot to handle a change of the project directory.
+        
+        @param txt name of the project directory (string)
+        """
+        self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(
+            bool(txt) and
+            Utilities.fromNativeSeparators(txt) not in self.__initPaths)
         
     @pyqtSlot()
     def on_vcsUrlButton_clicked(self):

eric ide

mercurial