Changed logic of the Mercurial options dialog to disallow entering of the protocol in the URL field.

Sun, 03 Mar 2013 12:42:37 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 03 Mar 2013 12:42:37 +0100
changeset 2453
e0b775cb733b
parent 2452
fd1cd8a279db
child 2454
8dbea2d54422

Changed logic of the Mercurial options dialog to disallow entering of the protocol in the URL field.

Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py file | annotate | diff | comparison | revisions
Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.ui file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py	Sun Mar 03 12:36:51 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.py	Sun Mar 03 12:42:37 2013 +0100
@@ -10,7 +10,7 @@
 import os
 
 from PyQt4.QtCore import pyqtSlot, QDir
-from PyQt4.QtGui import QDialog
+from PyQt4.QtGui import QDialog, QDialogButtonBox
 
 from E5Gui.E5Completers import E5DirCompleter
 from E5Gui import E5FileDialog
@@ -101,6 +101,16 @@
                 self.vcsUrlEdit.setText(self.networkPath)
                 self.localProtocol = False
     
+    @pyqtSlot(str)
+    def on_vcsUrlEdit_textChanged(self, txt):
+        """
+        Private slot to handle changes of the URL.
+        
+        @param txt current text of the line edit (string)
+        """
+        enable = "://" not in txt
+        self.buttonBox.button(QDialogButtonBox.Ok).setEnabled(enable)
+    
     def getData(self):
         """
         Public slot to retrieve the data entered into the dialog.
--- a/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.ui	Sun Mar 03 12:36:51 2013 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgNewProjectOptionsDialog.ui	Sun Mar 03 12:42:37 2013 +0100
@@ -54,7 +54,7 @@
      <item row="1" column="1">
       <widget class="QLineEdit" name="vcsUrlEdit">
        <property name="toolTip">
-        <string>Enter the url path of the repository</string>
+        <string>Enter the url path of the repository (without protocol part)</string>
        </property>
       </widget>
      </item>

eric ide

mercurial