RefactoringRope/RenameDialog.py

changeset 122
3696915ebc80
parent 94
03d6a17c66ac
child 144
bfc6a3b38330
diff -r 5d1648fd695b -r 3696915ebc80 RefactoringRope/RenameDialog.py
--- a/RefactoringRope/RenameDialog.py	Tue Apr 07 21:41:40 2015 +0200
+++ b/RefactoringRope/RenameDialog.py	Tue Apr 07 21:44:49 2015 +0200
@@ -24,7 +24,7 @@
     Class implementing the Rename dialog.
     """
     def __init__(self, refactoring, title, renamer, resource=None,
-                 parent=None):
+                 selectedText='', parent=None):
         """
         Constructor
         
@@ -35,6 +35,7 @@
             (rope.refactor.rename.Rename)
         @param resource reference to a resource object, if the action is to
             be applied to the local file only (rope.base.resources.File)
+        @param selectedText selected text to rename (str)
         @param parent reference to the parent widget (QWidget)
         """
         RefactoringDialogBase.__init__(self, refactoring, title, parent)
@@ -51,6 +52,8 @@
         self.__previewButton = self.buttonBox.addButton(
             self.tr("Preview"), QDialogButtonBox.ActionRole)
         self.__previewButton.setDefault(True)
+        self.newNameEdit.setText(selectedText)
+        self.newNameEdit.selectAll()
         
         msh = self.minimumSizeHint()
         self.resize(max(self.width(), msh.width()), msh.height())

eric ide

mercurial