RefactoringRope/RenameDialog.py

branch
eric5
changeset 88
e71619898d0f
parent 86
3339c75dc777
equal deleted inserted replaced
86:3339c75dc777 88:e71619898d0f
7 Module implementing the Rename dialog. 7 Module implementing the Rename dialog.
8 """ 8 """
9 9
10 from __future__ import unicode_literals 10 from __future__ import unicode_literals
11 11
12 from PyQt5.QtCore import pyqtSlot 12 from PyQt4.QtCore import pyqtSlot
13 from PyQt5.QtWidgets import QDialogButtonBox, QAbstractButton 13 from PyQt4.QtGui import QDialogButtonBox, QAbstractButton
14 14
15 from E5Gui.E5Application import e5App 15 from E5Gui.E5Application import e5App
16 from E5Gui import E5MessageBox 16 from E5Gui import E5MessageBox
17 17
18 from Ui_RenameDialog import Ui_RenameDialog 18 from Ui_RenameDialog import Ui_RenameDialog
47 self.__resources = None 47 self.__resources = None
48 48
49 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok) 49 self.__okButton = self.buttonBox.button(QDialogButtonBox.Ok)
50 self.__okButton.setEnabled(False) 50 self.__okButton.setEnabled(False)
51 self.__previewButton = self.buttonBox.addButton( 51 self.__previewButton = self.buttonBox.addButton(
52 self.tr("Preview"), QDialogButtonBox.ActionRole) 52 self.trUtf8("Preview"), QDialogButtonBox.ActionRole)
53 self.__previewButton.setDefault(True) 53 self.__previewButton.setDefault(True)
54 54
55 msh = self.minimumSizeHint() 55 msh = self.minimumSizeHint()
56 self.resize(max(self.width(), msh.width()), msh.height()) 56 self.resize(max(self.width(), msh.width()), msh.height())
57 57
103 aw.ensureLineVisible(sline) 103 aw.ensureLineVisible(sline)
104 aw.gotoLine(sline) 104 aw.gotoLine(sline)
105 aw.setSelection(sline, sindex, eline, eindex) 105 aw.setSelection(sline, sindex, eline, eindex)
106 ans = E5MessageBox.yesNo( 106 ans = E5MessageBox.yesNo(
107 self, 107 self,
108 self.tr("Rename"), 108 self.trUtf8("Rename"),
109 self.tr("""<p>Is the highlighted code a match?</p>"""), 109 self.trUtf8("""<p>Is the highlighted code a match?</p>"""),
110 yesDefault=True) 110 yesDefault=True)
111 aw.setCursorPosition(cline, cindex) 111 aw.setCursorPosition(cline, cindex)
112 aw.ensureCursorVisible() 112 aw.ensureCursorVisible()
113 113
114 return ans 114 return ans

eric ide

mercurial