RefactoringRope/RenameDialog.py

changeset 48
de33dc93a3ac
parent 46
a726d19facfc
child 50
a29c3d2e6dc0
child 55
d501156be247
equal deleted inserted replaced
47:34abdb88158e 48:de33dc93a3ac
6 """ 6 """
7 Module implementing the Rename dialog. 7 Module implementing the Rename dialog.
8 """ 8 """
9 9
10 from PyQt4.QtCore import pyqtSlot 10 from PyQt4.QtCore import pyqtSlot
11 from PyQt4.QtGui import QDialogButtonBox, QAbstractButton, QMessageBox 11 from PyQt4.QtGui import QDialogButtonBox, QAbstractButton
12 12
13 from E5Gui.E5Application import e5App 13 from E5Gui.E5Application import e5App
14 from E5Gui import E5MessageBox
14 15
15 from Ui_RenameDialog import Ui_RenameDialog 16 from Ui_RenameDialog import Ui_RenameDialog
16 from RefactoringDialogBase import RefactoringDialogBase 17 from RefactoringDialogBase import RefactoringDialogBase
17 18
18 19
95 sline, sindex = aw.lineIndexFromPosition(start) 96 sline, sindex = aw.lineIndexFromPosition(start)
96 eline, eindex = aw.lineIndexFromPosition(end) 97 eline, eindex = aw.lineIndexFromPosition(end)
97 aw.ensureLineVisible(sline) 98 aw.ensureLineVisible(sline)
98 aw.gotoLine(sline) 99 aw.gotoLine(sline)
99 aw.setSelection(sline, sindex, eline, eindex) 100 aw.setSelection(sline, sindex, eline, eindex)
100 ans = QMessageBox.question(self, self.trUtf8("Rename"), 101 ans = E5MessageBox.yesNo(self,
101 self.trUtf8("<p>Is the highlighted code a match?</p>"), 102 self.trUtf8("Rename"),
102 QMessageBox.StandardButtons(\ 103 self.trUtf8("""<p>Is the highlighted code a match?</p>"""),
103 QMessageBox.No | \ 104 yesDefault=True)
104 QMessageBox.Yes),
105 QMessageBox.Yes)
106 aw.setCursorPosition(cline, cindex) 105 aw.setCursorPosition(cline, cindex)
107 aw.ensureCursorVisible() 106 aw.ensureCursorVisible()
108 107
109 return ans == QMessageBox.Yes 108 return ans
110 109
111 def _calculateChanges(self, handle): 110 def _calculateChanges(self, handle):
112 """ 111 """
113 Protected method to calculate the changes. 112 Protected method to calculate the changes.
114 113

eric ide

mercurial