eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py

changeset 8151
8c1445825e7b
parent 8143
2c730d5fd177
child 8218
7c09585bd960
--- a/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py	Thu Mar 04 17:44:41 2021 +0100
+++ b/eric6/Plugins/VcsPlugins/vcsMercurial/QueuesExtension/HgQueuesDefineGuardsDialog.py	Thu Mar 04 17:48:09 2021 +0100
@@ -82,16 +82,18 @@
         """
         Public slot to start the list command.
         """
-        self.on_patchSelector_activated("")
+        self.on_patchSelector_activated(0)
     
-    @pyqtSlot(str)
-    def on_patchSelector_activated(self, patch):
+    @pyqtSlot(int)
+    def on_patchSelector_activated(self, index):
         """
         Private slot to get the list of guards defined for the given patch
         name.
         
-        @param patch selected patch name (empty for current patch)
+        @param index index of the selected entry
+        @type int
         """
+        patch = self.patchSelector.itemText(index)
         if self.__dirtyList:
             res = E5MessageBox.question(
                 self,
@@ -263,5 +265,7 @@
                     .format(error))
             else:
                 self.__dirtyList = False
-                self.on_patchSelector_activated(
-                    self.patchNameLabel.text())
+                index = self.patchSelector.findText(self.patchNameLabel.text())
+                if index == -1:
+                    index = 0
+                self.on_patchSelector_activated(index)

eric ide

mercurial