Some little enhancements for the Mercurial host fingerprint dialog.

Mon, 23 Jan 2017 17:53:07 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Mon, 23 Jan 2017 17:53:07 +0100
changeset 5441
cd5343be7d72
parent 5439
7ae65fa937a3
child 5442
43d42a54cf50

Some little enhancements for the Mercurial host fingerprint dialog.

Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py	Mon Jan 23 11:54:21 2017 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgUserConfigHostFingerprintDialog.py	Mon Jan 23 17:53:07 2017 +0100
@@ -117,12 +117,21 @@
         @param txt current text
         @type str
         """
+        if txt != txt.strip():
+            # get rid of whitespace
+            txt = txt.strip()
+            self.fingerprintEdit.setText(txt)
+        
         if txt.startswith(tuple(
             [h + ":" for h in
              HgUserConfigHostFingerprintDialog.supportedHashes])):
             parts = txt.split(":", 1)
             if len(parts) == 2:
                 self.fingerprintEdit.setText(parts[1])
+                hashIndex = self.hashComboBox.findText(parts[0].strip())
+                if hashIndex > -1:
+                    self.hashComboBox.setCurrentIndex(hashIndex)
+        
         self.__updateOkButton()
     
     def getData(self):
@@ -137,7 +146,7 @@
         else:
             fingerprint = "{0}:{1}".format(
                 self.hashComboBox.currentText(),
-                self.fingerprintEdit.text()
+                self.fingerprintEdit.text().strip()
             )
         
-        return self.hostEdit.text(), fingerprint
+        return self.hostEdit.text().strip(), fingerprint

eric ide

mercurial