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

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

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sun, 03 Mar 2013 12:42:37 +0100
branch
5_3_x
changeset 2457
34c4f91958ea
parent 2456
3c141610e378
child 2458
078569e55af2

Changed logic of the Mercurial options dialog to disallow entering of the protocol in the URL field.
(grafted from e0b775cb733b8a0a8d89ed10592caa076cc8b057)

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