eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py

branch
eric7
changeset 9028
b3a7f0368163
parent 8881
54e42bc2437a
diff -r f259edcf185a -r b3a7f0368163 eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py
--- a/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py	Sun Apr 17 19:34:09 2022 +0200
+++ b/eric7/Plugins/VcsPlugins/vcsMercurial/HisteditExtension/HgHisteditConfigDialog.py	Wed Apr 20 15:00:51 2022 +0200
@@ -46,6 +46,25 @@
         if bookmarksList is not None:
             self.bookmarkCombo.addItems(sorted(bookmarksList))
         
+        # connect various radio buttons and input fields
+        self.defaultButton.toggled.connect(self.__updateOK)
+        self.outgoingButton.toggled.connect(self.__updateOK)
+        self.revisionButton.toggled.connect(self.__updateOK)
+        self.idButton.toggled.connect(self.__updateOK)
+        self.tagButton.toggled.connect(self.__updateOK)
+        self.branchButton.toggled.connect(self.__updateOK)
+        self.bookmarkButton.toggled.connect(self.__updateOK)
+        self.expressionButton.toggled.connect(self.__updateOK)
+        
+        self.idEdit.textChanged.connect(self.__updateOK)
+        self.expressionEdit.textChanged.connect(self.__updateOK)
+        
+        self.tagCombo.editTextChanged.connect(self.__updateOK)
+        self.branchCombo.editTextChanged.connect(self.__updateOK)
+        self.bookmarkCombo.editTextChanged.connect(self.__updateOK)
+        
+        self.numberSpinBox.valueChanged.connect(self.__updateOK)
+        
         self.idEdit.setText(rev)
         if rev:
             self.revisionButton.setChecked(True)
@@ -57,6 +76,7 @@
         
         self.__updateOK()
     
+    @pyqtSlot()
     def __updateOK(self):
         """
         Private slot to update the OK button.
@@ -72,126 +92,12 @@
                 enabled = enabled and bool(self.branchCombo.currentText())
             elif self.bookmarkButton.isChecked():
                 enabled = enabled and bool(self.bookmarkCombo.currentText())
+            elif self.expressionButton.isChecked():
+                enabled = enabled and bool(self.expressionEdit.text())
         
         self.buttonBox.button(
             QDialogButtonBox.StandardButton.Ok).setEnabled(enabled)
     
-    @pyqtSlot(bool)
-    def on_defaultButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Default select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_outgoingButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Outgoing select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_revisionButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Revision select button.
-        
-        @param checked state of the button
-        @type bool
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_idButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the ID select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_tagButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Tag select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_branch1Button_toggled(self, checked):
-        """
-        Private slot to handle changes of the Branch select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(bool)
-    def on_bookmarkButton_toggled(self, checked):
-        """
-        Private slot to handle changes of the Bookmark select button.
-        
-        @param checked state of the button (boolean)
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(int)
-    def on_numberSpinBox_valueChanged(self, val):
-        """
-        Private slot to handle changes of the Number spin box.
-        
-        @param val value of the spin box
-        @type int
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_idEdit_textChanged(self, txt):
-        """
-        Private slot to handle changes of the ID edit.
-        
-        @param txt text of the edit
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_tagCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Tag combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_branchCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Branch combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
-    @pyqtSlot(str)
-    def on_bookmarkCombo_editTextChanged(self, txt):
-        """
-        Private slot to handle changes of the Bookmark combo.
-        
-        @param txt text of the combo
-        @type str
-        """
-        self.__updateOK()
-    
     def __getRevision(self):
         """
         Private method to generate the revision.
@@ -214,6 +120,8 @@
                 return self.branchCombo.currentText()
             elif self.bookmarkButton.isChecked():
                 return self.bookmarkCombo.currentText()
+            elif self.expressionButton.isChecked():
+                return self.expressionEdit.text()
         
         return ""
     

eric ide

mercurial