Plugins/PluginWizardQRegularExpression.py

branch
Py2 comp.
changeset 3484
645c12de6b0c
parent 3178
f25fc1364c88
parent 3345
071afe8be2a1
child 3523
8df1ab89e261
equal deleted inserted replaced
3456:96232974dcdb 3484:645c12de6b0c
19 # Start-Of-Header 19 # Start-Of-Header
20 name = "QRegularExpression Wizard Plugin" 20 name = "QRegularExpression Wizard Plugin"
21 author = "Detlev Offenbach <detlev@die-offenbachs.de>" 21 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
22 autoactivate = True 22 autoactivate = True
23 deactivateable = True 23 deactivateable = True
24 version = "5.4.0" 24 version = "5.5.0"
25 className = "QRegularExpressionWizard" 25 className = "QRegularExpressionWizard"
26 packageName = "__core__" 26 packageName = "__core__"
27 shortDescription = "Show the QRegularExpression wizard." 27 shortDescription = "Show the QRegularExpression wizard."
28 longDescription = """This plugin shows the QRegularExpression wizard.""" 28 longDescription = """This plugin shows the QRegularExpression wizard."""
29 pyqtApi = 2 29 pyqtApi = 2
68 def __initAction(self): 68 def __initAction(self):
69 """ 69 """
70 Private method to initialize the action. 70 Private method to initialize the action.
71 """ 71 """
72 self.action = E5Action( 72 self.action = E5Action(
73 self.trUtf8('QRegularExpression Wizard'), 73 self.tr('QRegularExpression Wizard'),
74 self.trUtf8('QRegularE&xpression Wizard...'), 0, 0, self, 74 self.tr('QRegularE&xpression Wizard...'), 0, 0, self,
75 'wizards_qregularexpression') 75 'wizards_qregularexpression')
76 self.action.setStatusTip(self.trUtf8('QRegularExpression Wizard')) 76 self.action.setStatusTip(self.tr('QRegularExpression Wizard'))
77 self.action.setWhatsThis(self.trUtf8( 77 self.action.setWhatsThis(self.tr(
78 """<b>QRegularExpression Wizard</b>""" 78 """<b>QRegularExpression Wizard</b>"""
79 """<p>This wizard opens a dialog for entering all the parameters""" 79 """<p>This wizard opens a dialog for entering all the parameters"""
80 """ needed to create a QRegularExpression string. The generated""" 80 """ needed to create a QRegularExpression string. The generated"""
81 """ code is inserted at the current cursor position.</p>""" 81 """ code is inserted at the current cursor position.</p>"""
82 )) 82 ))
83 self.action.triggered[()].connect(self.__handle) 83 self.action.triggered.connect(self.__handle)
84 84
85 self.__ui.addE5Actions([self.action], 'wizards') 85 self.__ui.addE5Actions([self.action], 'wizards')
86 86
87 def __initMenu(self): 87 def __initMenu(self):
88 """ 88 """
121 editor = e5App().getObject("ViewManager").activeWindow() 121 editor = e5App().getObject("ViewManager").activeWindow()
122 122
123 if editor is None: 123 if editor is None:
124 E5MessageBox.critical( 124 E5MessageBox.critical(
125 self.__ui, 125 self.__ui,
126 self.trUtf8('No current editor'), 126 self.tr('No current editor'),
127 self.trUtf8('Please open or create a file first.')) 127 self.tr('Please open or create a file first.'))
128 else: 128 else:
129 code, ok = self.__callForm(editor) 129 code, ok = self.__callForm(editor)
130 if ok: 130 if ok:
131 line, index = editor.getCursorPosition() 131 line, index = editor.getCursorPosition()
132 # It should be done on this way to allow undo 132 # It should be done on this way to allow undo

eric ide

mercurial