19 # Start-Of-Header |
19 # Start-Of-Header |
20 name = "QInputDialog Wizard Plugin" |
20 name = "QInputDialog 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 = "InputDialogWizard" |
25 className = "InputDialogWizard" |
26 packageName = "__core__" |
26 packageName = "__core__" |
27 shortDescription = "Show the QInputDialog wizard." |
27 shortDescription = "Show the QInputDialog wizard." |
28 longDescription = """This plugin shows the QInputDialog wizard.""" |
28 longDescription = """This plugin shows the QInputDialog 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('QInputDialog Wizard'), |
73 self.tr('QInputDialog Wizard'), |
74 self.trUtf8('Q&InputDialog Wizard...'), 0, 0, self, |
74 self.tr('Q&InputDialog Wizard...'), 0, 0, self, |
75 'wizards_qinputdialog') |
75 'wizards_qinputdialog') |
76 self.action.setStatusTip(self.trUtf8('QInputDialog Wizard')) |
76 self.action.setStatusTip(self.tr('QInputDialog Wizard')) |
77 self.action.setWhatsThis(self.trUtf8( |
77 self.action.setWhatsThis(self.tr( |
78 """<b>QInputDialog Wizard</b>""" |
78 """<b>QInputDialog 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 QInputDialog. The generated code is""" |
80 """ needed to create a QInputDialog. The generated code is""" |
81 """ inserted at the current cursor position.</p>""" |
81 """ 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 """ |
120 editor = e5App().getObject("ViewManager").activeWindow() |
120 editor = e5App().getObject("ViewManager").activeWindow() |
121 |
121 |
122 if editor is None: |
122 if editor is None: |
123 E5MessageBox.critical( |
123 E5MessageBox.critical( |
124 self.__ui, |
124 self.__ui, |
125 self.trUtf8('No current editor'), |
125 self.tr('No current editor'), |
126 self.trUtf8('Please open or create a file first.')) |
126 self.tr('Please open or create a file first.')) |
127 else: |
127 else: |
128 code, ok = self.__callForm(editor) |
128 code, ok = self.__callForm(editor) |
129 if ok: |
129 if ok: |
130 line, index = editor.getCursorPosition() |
130 line, index = editor.getCursorPosition() |
131 # It should be done on this way to allow undo |
131 # It should be done on this way to allow undo |