diff -r cb044ec27c24 -r 4f53795beff0 RefactoringRope/ConfirmationDialog.py --- a/RefactoringRope/ConfirmationDialog.py Sat Jun 25 18:06:56 2022 +0200 +++ b/RefactoringRope/ConfirmationDialog.py Wed Sep 21 15:30:34 2022 +0200 @@ -20,11 +20,13 @@ """ Class implementing the Confirmation dialog. """ - def __init__(self, refactoring, title, changeGroupName, method, parameters, - parent=None): + + def __init__( + self, refactoring, title, changeGroupName, method, parameters, parent=None + ): """ Constructor - + @param refactoring reference to the main refactoring object @type RefactoringServer @param title title of the dialog @@ -40,48 +42,50 @@ """ RefactoringDialogBase.__init__(self, refactoring, title, parent) self.setupUi(self) - + self._changeGroupName = changeGroupName - - self.__okButton = self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok) + + self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) self.__previewButton = self.buttonBox.addButton( - self.tr("Preview"), QDialogButtonBox.ButtonRole.ActionRole) + self.tr("Preview"), QDialogButtonBox.ButtonRole.ActionRole + ) self.__previewButton.setDefault(True) - + self.__method = method self.__parameters = parameters - + self._calculateChanges() - + def __processChangeDescription(self, data): """ Private method to process the change description data sent by the refactoring client in order to polish the dialog. - + @param data dictionary containing the data @type dict """ changeDescription = data["Description"] if changeDescription: self.description.setText( - self.tr("Shall the refactoring <b>{0}</b> be done?") - .format(Utilities.html_encode(changeDescription))) + self.tr("Shall the refactoring <b>{0}</b> be done?").format( + Utilities.html_encode(changeDescription) + ) + ) else: self.description.setText( - self.tr("The selected refactoring did not produce any" - " changes.")) + self.tr("The selected refactoring did not produce any" " changes.") + ) self.__okButton.setEnabled(False) self.__previewButton.setEnabled(False) - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + @pyqtSlot(QAbstractButton) def on_buttonBox_clicked(self, button): """ Private slot to act on the button pressed. - + @param button reference to the button pressed @type QAbstractButton """ @@ -89,7 +93,7 @@ self.requestPreview() elif button == self.__okButton: self.applyChanges() - + def _calculateChanges(self): """ Protected method to initiate the calculation of the changes. @@ -98,14 +102,14 @@ self.__parameters["ChangeGroup"] = self._changeGroupName if "Title" not in self.__parameters: self.__parameters["Title"] = self._title - + self._refactoring.sendJson(self.__method, self.__parameters) - + def processChangeData(self, data): """ Public method to process the change data sent by the refactoring client. - + @param data dictionary containing the change data @type dict """