--- a/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/Plugins/VcsPlugins/vcsMercurial/HgBranchInputDialog.py Wed Jul 13 14:55:47 2022 +0200 @@ -17,44 +17,45 @@ """ Class implementing a dialog to enter the data for a branch operation. """ + def __init__(self, branches, parent=None): """ Constructor - + @param branches branch names to populate the branch list with (list of string) @param parent reference to the parent widget (QWidget) """ super().__init__(parent) self.setupUi(self) - + self.branchComboBox.addItems(sorted(branches)) self.branchComboBox.setEditText("") - - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(False) - + + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(False) + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + @pyqtSlot(str) def on_branchComboBox_editTextChanged(self, txt): """ Private slot handling a change of the branch name. - + @param txt contents of the branch combo box (string) """ - self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok).setEnabled(bool(txt)) - + self.buttonBox.button(QDialogButtonBox.StandardButton.Ok).setEnabled(bool(txt)) + def getData(self): """ Public method to get the data. - + @return tuple of branch name, a flag indicating to commit the branch and a flag indicating to force the branch creation @rtype tuple of (str, bool, bool) """ - return (self.branchComboBox.currentText().replace(" ", "_"), - self.commitCheckBox.isChecked(), - self.forceCheckBox.isChecked()) + return ( + self.branchComboBox.currentText().replace(" ", "_"), + self.commitCheckBox.isChecked(), + self.forceCheckBox.isChecked(), + )