9 |
9 |
10 from __future__ import unicode_literals |
10 from __future__ import unicode_literals |
11 |
11 |
12 import os |
12 import os |
13 |
13 |
14 from PyQt4.QtCore import QObject, QTranslator |
14 from PyQt5.QtCore import QObject, QTranslator |
15 from PyQt4.QtGui import QDialog |
15 from PyQt5.QtWidgets import QDialog |
16 |
16 |
17 from E5Gui.E5Application import e5App |
17 from E5Gui.E5Application import e5App |
18 from E5Gui.E5Action import E5Action |
18 from E5Gui.E5Action import E5Action |
19 from E5Gui import E5MessageBox |
19 from E5Gui import E5MessageBox |
20 |
20 |
21 # Start-of-Header |
21 # Start-of-Header |
22 name = "Base64 Data URI Encoder Wizard Plug-in" |
22 name = "Base64 Data URI Encoder Wizard Plug-in" |
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
23 author = "Detlev Offenbach <detlev@die-offenbachs.de>" |
24 autoactivate = True |
24 autoactivate = True |
25 deactivateable = True |
25 deactivateable = True |
26 version = "1.0.0" |
26 version = "2.0.0" |
27 className = "WizardDataUriEncoderPlugin" |
27 className = "WizardDataUriEncoderPlugin" |
28 packageName = "WizardDataUriEncoder" |
28 packageName = "WizardDataUriEncoder" |
29 shortDescription = "Wizard for the creation of code for a base64 data URI." |
29 shortDescription = "Wizard for the creation of code for a base64 data URI." |
30 longDescription = \ |
30 longDescription = \ |
31 """This plug-in implements a wizard to generate code for""" \ |
31 """This plug-in implements a wizard to generate code for""" \ |
104 def __initAction(self): |
104 def __initAction(self): |
105 """ |
105 """ |
106 Private method to initialize the action. |
106 Private method to initialize the action. |
107 """ |
107 """ |
108 self.__action = E5Action( |
108 self.__action = E5Action( |
109 self.trUtf8('Base64 Data Uri Encoder Wizard'), |
109 self.tr('Base64 Data Uri Encoder Wizard'), |
110 self.trUtf8('Base&64 Data Uri Encoder Wizard...'), |
110 self.tr('Base&64 Data Uri Encoder Wizard...'), |
111 0, 0, self, |
111 0, 0, self, |
112 'wizards_datauriencoder') |
112 'wizards_datauriencoder') |
113 self.__action.setStatusTip(self.trUtf8( |
113 self.__action.setStatusTip(self.tr( |
114 'Base64 Data Uri Encoder Wizard')) |
114 'Base64 Data Uri Encoder Wizard')) |
115 self.__action.setWhatsThis(self.trUtf8( |
115 self.__action.setWhatsThis(self.tr( |
116 """<b>Base64 Data Uri Encoder Wizard</b>""" |
116 """<b>Base64 Data Uri Encoder Wizard</b>""" |
117 """<p>This wizard opens a dialog for entering all the parameters""" |
117 """<p>This wizard opens a dialog for entering all the parameters""" |
118 """ needed to create code for a base64 encoded data URI.</p>""" |
118 """ needed to create code for a base64 encoded data URI.</p>""" |
119 )) |
119 )) |
120 self.__action.triggered[()].connect(self.__handle) |
120 self.__action.triggered.connect(self.__handle) |
121 |
121 |
122 self.__ui.addE5Actions([self.__action], 'wizards') |
122 self.__ui.addE5Actions([self.__action], 'wizards') |
123 |
123 |
124 def __initMenu(self): |
124 def __initMenu(self): |
125 """ |
125 """ |
136 editor = e5App().getObject("ViewManager").activeWindow() |
136 editor = e5App().getObject("ViewManager").activeWindow() |
137 |
137 |
138 if editor is None: |
138 if editor is None: |
139 E5MessageBox.critical( |
139 E5MessageBox.critical( |
140 self.__ui, |
140 self.__ui, |
141 self.trUtf8('No current editor'), |
141 self.tr('No current editor'), |
142 self.trUtf8('Please open or create a file first.')) |
142 self.tr('Please open or create a file first.')) |
143 else: |
143 else: |
144 from WizardDataUriEncoder.DataUriEncoderWizardDialog import \ |
144 from WizardDataUriEncoder.DataUriEncoderWizardDialog import \ |
145 DataUriEncoderWizardDialog |
145 DataUriEncoderWizardDialog |
146 dlg = DataUriEncoderWizardDialog(None) |
146 dlg = DataUriEncoderWizardDialog(None) |
147 if dlg.exec_() == QDialog.Accepted: |
147 if dlg.exec_() == QDialog.Accepted: |