diff -r cb044ec27c24 -r 4f53795beff0 RefactoringRope/MethodToMethodObjectDialog.py --- a/RefactoringRope/MethodToMethodObjectDialog.py Sat Jun 25 18:06:56 2022 +0200 +++ b/RefactoringRope/MethodToMethodObjectDialog.py Wed Sep 21 15:30:34 2022 +0200 @@ -14,15 +14,15 @@ from .RefactoringDialogBase import RefactoringDialogBase -class MethodToMethodObjectDialog(RefactoringDialogBase, - Ui_MethodToMethodObjectDialog): +class MethodToMethodObjectDialog(RefactoringDialogBase, Ui_MethodToMethodObjectDialog): """ Class implementing the Method To Method object dialog. """ + def __init__(self, refactoring, title, filename, offset, parent=None): """ Constructor - + @param refactoring reference to the main refactoring object @type RefactoringServer @param title title of the dialog @@ -36,42 +36,42 @@ """ RefactoringDialogBase.__init__(self, refactoring, title, parent) self.setupUi(self) - + self._changeGroupName = "MethodToMethodObject" - + self.__filename = filename self.__offset = offset - - self.__okButton = self.buttonBox.button( - QDialogButtonBox.StandardButton.Ok) + + self.__okButton = self.buttonBox.button(QDialogButtonBox.StandardButton.Ok) self.__okButton.setEnabled(False) self.__previewButton = self.buttonBox.addButton( - self.tr("Preview"), QDialogButtonBox.ButtonRole.ActionRole) + self.tr("Preview"), QDialogButtonBox.ButtonRole.ActionRole + ) self.__previewButton.setDefault(True) self.__previewButton.setEnabled(False) - + self.nameEdit.setText("_MethodObject") self.nameEdit.selectAll() - + msh = self.minimumSizeHint() self.resize(max(self.width(), msh.width()), msh.height()) - + @pyqtSlot(str) def on_nameEdit_textChanged(self, text): """ Private slot to react to changes of the name. - + @param text text entered into the edit @type str """ self.__okButton.setEnabled(bool(text)) self.__previewButton.setEnabled(bool(text)) - + @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 """ @@ -79,15 +79,18 @@ self.requestPreview() elif button == self.__okButton: self.applyChanges() - + def _calculateChanges(self): """ Protected method to initiate the calculation of the changes. """ - self._refactoring.sendJson("CalculateMethodObjectChanges", { - "ChangeGroup": self._changeGroupName, - "Title": self._title, - "FileName": self.__filename, - "Offset": self.__offset, - "Name": self.nameEdit.text(), - }) + self._refactoring.sendJson( + "CalculateMethodObjectChanges", + { + "ChangeGroup": self._changeGroupName, + "Title": self._title, + "FileName": self.__filename, + "Offset": self.__offset, + "Name": self.nameEdit.text(), + }, + )