diff -r 3a723d9cfa6a -r 0e973a74be62 Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py --- a/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py Wed Mar 05 20:02:28 2014 +0100 +++ b/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py Thu Mar 06 18:31:52 2014 +0100 @@ -53,10 +53,29 @@ self.networkPath = "localhost/" self.localProtocol = True + ipath = Preferences.getMultiProject("Workspace") or \ + Utilities.getHomeDir() + self.__initPaths = [ + Utilities.fromNativeSeparators(ipath), + Utilities.fromNativeSeparators(ipath) + "/", + ] self.vcsProjectDirEdit.setText( - Utilities.toNativeSeparators( - Preferences.getMultiProject("Workspace") or - Utilities.getHomeDir())) + 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):