diff -r 70b4fb448811 -r 8ae4e95f5fa6 RefactoringRope/Refactoring.py --- a/RefactoringRope/Refactoring.py Fri Sep 22 19:47:36 2017 +0200 +++ b/RefactoringRope/Refactoring.py Sat Sep 23 12:01:48 2017 +0200 @@ -1133,7 +1133,6 @@ ## Use function refactoring ##################################################### - # TODO: continue from here def __useFunction(self): """ Private slot to use a function wherever possible. @@ -1158,24 +1157,20 @@ line, index, line1, index1 = aw.getSelection() offset = self.__getOffset(aw, line, index) - import rope.refactor.usefunction - resource = rope.base.libutils.path_to_resource( - self.__project, filename) - try: - user = rope.refactor.usefunction.UseFunction( - self.__project, resource, offset) - except Exception as err: - self.handleRopeError(err, title) - return - from UseFunctionDialog import UseFunctionDialog - self.dlg = UseFunctionDialog(self, title, user, parent=self.__ui) - self.dlg.show() + dlg = UseFunctionDialog(self, title, filename, offset, + parent=self.__ui) + changeGroup = dlg.getChangeGroupName() + self.__refactoringDialogs[changeGroup] = dlg + dlg.finished.connect( + lambda: self.__refactoringDialogClosed(changeGroup)) + dlg.show() ##################################################### ## Introduce refactorings ##################################################### + # TODO: continue from here def __introduceFactoryMethod(self): """ Private slot to introduce a factory method or global function.