Fixed an issue in the Mercurial log browser dialog that caused the tag action being activated in wrong dialog modes.

Sat, 01 Feb 2014 16:01:51 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 01 Feb 2014 16:01:51 +0100
changeset 3243
bbaa32bb9e63
parent 3242
a7e006073658
child 3244
1a54f34202b8

Fixed an issue in the Mercurial log browser dialog that caused the tag action being activated in wrong dialog modes.

Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py file | annotate | diff | comparison | revisions
--- a/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Feb 01 15:49:04 2014 +0100
+++ b/Plugins/VcsPlugins/vcsMercurial/HgLogBrowserDialog.py	Sat Feb 01 16:01:51 2014 +0100
@@ -965,6 +965,7 @@
         self.__updateDiffButtons()
         self.__updatePhaseAction()
         self.__updateGraftAction()
+        self.__updateTagAction()
     
     def __readStdout(self):
         """
@@ -1066,7 +1067,7 @@
     
     def __updatePhaseAction(self):
         """
-        Private slot to update the status of the phase button.
+        Private slot to update the status of the phase action.
         """
         if self.initialCommandMode == "log":
             # step 1: count entries with changeable phases
@@ -1094,7 +1095,7 @@
     
     def __updateGraftAction(self):
         """
-        Private slot to update the status of the graft button.
+        Private slot to update the status of the graft action.
         """
         if self.__graftAct is not None:
             if self.initialCommandMode == "log":
@@ -1111,6 +1112,15 @@
             else:
                 self.__graftAct.setEnabled(False)
     
+    def __updateTagAction(self):
+        """
+        Private slot to update the status of the graft action.
+        """
+        if self.initialCommandMode == "log":
+            self.__tagAct.setEnabled(len(self.logTree.selectedItems()) == 1)
+        else:
+            self.__tagAct.setEnabled(False)
+    
     def __updateGui(self, itm):
         """
         Private slot to update GUI elements except the diff and phase buttons.
@@ -1145,6 +1155,7 @@
         self.__updateDiffButtons()
         self.__updatePhaseAction()
         self.__updateGraftAction()
+        self.__updateTagAction()
     
     @pyqtSlot()
     def on_logTree_itemSelectionChanged(self):
@@ -1153,13 +1164,11 @@
         """
         if len(self.logTree.selectedItems()) == 1:
             self.__updateGui(self.logTree.selectedItems()[0])
-            self.__tagAct.setEnabled(True)
-        else:
-            self.__tagAct.setEnabled(False)
         
         self.__updateDiffButtons()
         self.__updatePhaseAction()
         self.__updateGraftAction()
+        self.__updateTagAction()
     
     @pyqtSlot()
     def on_nextButton_clicked(self):

eric ide

mercurial