18 |
18 |
19 class InlineDialog(RefactoringDialogBase, Ui_InlineDialog): |
19 class InlineDialog(RefactoringDialogBase, Ui_InlineDialog): |
20 """ |
20 """ |
21 Class implementing the Inline dialog. |
21 Class implementing the Inline dialog. |
22 """ |
22 """ |
23 def __init__(self, refactoring, title, inliner, parent = None): |
23 def __init__(self, refactoring, title, inliner, parent=None): |
24 """ |
24 """ |
25 Constructor |
25 Constructor |
26 |
26 |
27 @param refactoring reference to the main refactoring object |
27 @param refactoring reference to the main refactoring object |
28 (Refactoring) |
28 (Refactoring) |
29 @param title title of the dialog (string) |
29 @param title title of the dialog (string) |
30 @param inliner reference to the inliner object |
30 @param inliner reference to the inliner object |
31 (rope.refactor.inline.InlineMethod, |
31 (rope.refactor.inline.InlineMethod, |
32 rope.refactor.inline.InlineVariable |
32 rope.refactor.inline.InlineVariable |
33 or rope.refactor.inline.InlineParameter) |
33 or rope.refactor.inline.InlineParameter) |
34 @param parent reference to the parent widget (QWidget) |
34 @param parent reference to the parent widget (QWidget) |
35 """ |
35 """ |
36 RefactoringDialogBase.__init__(self, refactoring, title, parent) |
36 RefactoringDialogBase.__init__(self, refactoring, title, parent) |
77 @param handle reference to the task handle |
77 @param handle reference to the task handle |
78 (rope.base.taskhandle.TaskHandle) |
78 (rope.base.taskhandle.TaskHandle) |
79 @return reference to the Changes object (rope.base.change.ChangeSet) |
79 @return reference to the Changes object (rope.base.change.ChangeSet) |
80 """ |
80 """ |
81 try: |
81 try: |
82 if isinstance(self.__inliner, |
82 if isinstance(self.__inliner, |
83 rope.refactor.inline.InlineParameter): |
83 rope.refactor.inline.InlineParameter): |
84 opts = { |
84 opts = { |
85 "in_hierarchy" : self.hierarchyCheckBox.isChecked(), |
85 "in_hierarchy": self.hierarchyCheckBox.isChecked(), |
86 } |
86 } |
87 else: |
87 else: |
88 opts = { |
88 opts = { |
89 "remove" : self.removeCheckBox.isChecked(), |
89 "remove": self.removeCheckBox.isChecked(), |
90 "only_current" : self.currentCheckBox.isChecked(), |
90 "only_current": self.currentCheckBox.isChecked(), |
91 } |
91 } |
92 changes = self.__inliner.get_changes(task_handle=handle, **opts) |
92 changes = self.__inliner.get_changes(task_handle=handle, **opts) |
93 return changes |
93 return changes |
94 except Exception as err: |
94 except Exception as err: |
95 self._refactoring.handleRopeError(err, self._title, handle) |
95 self._refactoring.handleRopeError(err, self._title, handle) |