11 from PyQt4.QtGui import QDialogButtonBox, QAbstractButton |
11 from PyQt4.QtGui import QDialogButtonBox, QAbstractButton |
12 |
12 |
13 from Ui_ExtractDialog import Ui_ExtractDialog |
13 from Ui_ExtractDialog import Ui_ExtractDialog |
14 from RefactoringDialogBase import RefactoringDialogBase |
14 from RefactoringDialogBase import RefactoringDialogBase |
15 |
15 |
|
16 |
16 class ExtractDialog(RefactoringDialogBase, Ui_ExtractDialog): |
17 class ExtractDialog(RefactoringDialogBase, Ui_ExtractDialog): |
17 """ |
18 """ |
18 Class implementing the Extract dialog. |
19 Class implementing the Extract dialog. |
19 """ |
20 """ |
20 def __init__(self, refactoring, title, extractor, parent=None): |
21 def __init__(self, refactoring, title, extractor, parent=None): |
22 Constructor |
23 Constructor |
23 |
24 |
24 @param refactoring reference to the main refactoring object |
25 @param refactoring reference to the main refactoring object |
25 (Refactoring) |
26 (Refactoring) |
26 @param title title of the dialog (string) |
27 @param title title of the dialog (string) |
27 @param extractor reference to the extractor object |
28 @param extractor reference to the extractor object |
28 (rope.refactor.extract.ExtractMethod or |
29 (rope.refactor.extract.ExtractMethod or |
29 rope.refactor.extract.ExtractVariable) |
30 rope.refactor.extract.ExtractVariable) |
30 @param parent reference to the parent widget (QWidget) |
31 @param parent reference to the parent widget (QWidget) |
31 """ |
32 """ |
32 RefactoringDialogBase.__init__(self, refactoring, title, parent) |
33 RefactoringDialogBase.__init__(self, refactoring, title, parent) |
33 self.setupUi(self) |
34 self.setupUi(self) |
68 @param handle reference to the task handle |
69 @param handle reference to the task handle |
69 (rope.base.taskhandle.TaskHandle) |
70 (rope.base.taskhandle.TaskHandle) |
70 @return reference to the Changes object (rope.base.change.ChangeSet) |
71 @return reference to the Changes object (rope.base.change.ChangeSet) |
71 """ |
72 """ |
72 try: |
73 try: |
73 changes = self.__extractor.get_changes(self.newNameEdit.text(), |
74 changes = self.__extractor.get_changes(self.newNameEdit.text(), |
74 similar=self.similarCheckBox.isChecked(), |
75 similar=self.similarCheckBox.isChecked(), |
75 global_=self.globalCheckBox.isChecked()) |
76 global_=self.globalCheckBox.isChecked()) |
76 return changes |
77 return changes |
77 except Exception as err: |
78 except Exception as err: |
78 self._refactoring.handleRopeError(err, self._title, handle) |
79 self._refactoring.handleRopeError(err, self._title, handle) |
79 return None |
80 return None |