--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitRevisionSelectionDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitRevisionSelectionDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -17,11 +17,20 @@ """ Class implementing a dialog to select a revision. """ - def __init__(self, tagsList, branchesList, trackingBranchesList=None, - noneLabel="", showBranches=True, showHead=True, parent=None): + + def __init__( + self, + tagsList, + branchesList, + trackingBranchesList=None, + noneLabel="", + showBranches=True, + showHead=True, + parent=None, + ): """ Constructor - + @param tagsList list of tags (list of strings) @param branchesList list of branches (list of strings) @param trackingBranchesList list of remote branches (list of strings) @@ -33,29 +42,28 @@ """ super().__init__(parent) self.setupUi(self) - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(False) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) + self.tagCombo.addItems(sorted(tagsList)) self.branchCombo.addItems(["master"] + sorted(branchesList)) - + self.tipButton.setVisible(showHead) self.branchButton.setVisible(showBranches) self.branchCombo.setVisible(showBranches) - + if noneLabel: self.noneButton.setText(noneLabel) - + if trackingBranchesList is not None: self.remoteBranchCombo.addItems(sorted(trackingBranchesList)) else: self.remoteBranchButton.setVisible(False) self.remoteBranchCombo.setVisible(False) - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + def __updateOK(self): """ Private slot to update the OK button. @@ -69,86 +77,85 @@ enabled = self.branchCombo.currentText() != "" elif self.remoteBranchButton.isChecked(): enabled = self.remoteBranchCombo.currentText() != "" - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(enabled) + @pyqtSlot(bool) def on_revButton_toggled(self, checked): """ Private slot to handle changes of the rev 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_branchButton_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_remoteBranchButton_toggled(self, checked): """ Private slot to handle changes of the Remote Branch select button. - + @param checked state of the button (boolean) """ self.__updateOK() - + @pyqtSlot(str) def on_revEdit_textChanged(self, txt): """ Private slot to handle changes of the rev edit. - + @param txt text of the edit (string) """ 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 (string) """ 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 (string) """ self.__updateOK() - + @pyqtSlot(str) def on_remoteBranchCombo_editTextChanged(self, txt): """ Private slot to handle changes of the Remote Branch combo. - + @param txt text of the combo (string) """ self.__updateOK() - + def getRevision(self): """ Public method to retrieve the selected revision. - + @return selected revision (string) """ if self.revButton.isChecked(): @@ -163,5 +170,5 @@ rev = "HEAD" else: rev = "" - + return rev