--- a/src/eric7/Plugins/VcsPlugins/vcsGit/GitBranchPushDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsGit/GitBranchPushDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -17,10 +17,11 @@ """ Class implementing a dialog to select the data for pushing a branch. """ + def __init__(self, branches, remotes, delete=False, parent=None): """ Constructor - + @param branches list of branch names (list of string) @param remotes list of remote names (list of string) @param delete flag indicating a delete branch action (boolean) @@ -28,17 +29,16 @@ """ super().__init__(parent) self.setupUi(self) - - self.__okButton = self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok) - + + self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) + self.__allBranches = self.tr("<all branches>") - + if "origin" in remotes: self.remoteComboBox.addItem("origin") remotes.remove("origin") self.remoteComboBox.addItems(sorted(remotes)) - + if delete: self.branchComboBox.addItem("") else: @@ -48,27 +48,29 @@ self.branchComboBox.addItem("master") branches.remove("master") self.branchComboBox.addItems(sorted(branches)) - + if delete: self.__okButton.setEnabled(False) self.branchComboBox.setEditable(True) - + @pyqtSlot(str) def on_branchComboBox_editTextChanged(self, txt): """ Private slot to handle a change of the branch name. - + @param txt branch name (string) """ self.__okButton.setEnabled(bool(txt)) - + def getData(self): """ Public method to get the selected data. - + @return tuple of selected branch name, remote name and a flag indicating all branches (tuple of two strings and a boolean) """ - return (self.branchComboBox.currentText(), - self.remoteComboBox.currentText(), - self.branchComboBox.currentText() == self.__allBranches) + return ( + self.branchComboBox.currentText(), + self.remoteComboBox.currentText(), + self.branchComboBox.currentText() == self.__allBranches, + )