PluginWizardDataUriEncoder.py

branch
eric7
changeset 61
6bd4923cc47f
parent 60
ef8a968ccd87
child 62
65920ee523b0
equal deleted inserted replaced
60:ef8a968ccd87 61:6bd4923cc47f
134 134
135 def __handle(self): 135 def __handle(self):
136 """ 136 """
137 Private method to handle the wizards action. 137 Private method to handle the wizards action.
138 """ 138 """
139 from WizardDataUriEncoder.DataUriEncoderWizardDialog import (
140 DataUriEncoderWizardDialog,
141 )
142
139 editor = ericApp().getObject("ViewManager").activeWindow() 143 editor = ericApp().getObject("ViewManager").activeWindow()
140 144
141 if editor is None: 145 if editor is None:
142 EricMessageBox.critical( 146 EricMessageBox.critical(
143 self.__ui, 147 self.__ui,
144 self.tr("No current editor"), 148 self.tr("No current editor"),
145 self.tr("Please open or create a file first."), 149 self.tr("Please open or create a file first."),
146 ) 150 )
147 else: 151 else:
148 from WizardDataUriEncoder.DataUriEncoderWizardDialog import (
149 DataUriEncoderWizardDialog,
150 )
151
152 dlg = DataUriEncoderWizardDialog(None) 152 dlg = DataUriEncoderWizardDialog(None)
153 if dlg.exec() == QDialog.DialogCode.Accepted: 153 if dlg.exec() == QDialog.DialogCode.Accepted:
154 code = dlg.getCode() 154 code = dlg.getCode()
155 if code: 155 if code:
156 line, index = editor.getCursorPosition() 156 line, index = editor.getCursorPosition()
159 editor.insertAt(code, line, index) 159 editor.insertAt(code, line, index)
160 editor.endUndoAction() 160 editor.endUndoAction()
161 161
162 162
163 # 163 #
164 # eflag: noqa = M801 164 # eflag: noqa = M801, U200

eric ide

mercurial