PluginWizardDataUriEncoder.py

branch
eric7
changeset 44
1ab3e76972e6
parent 41
f7634f688a52
child 47
2d49cd593939
diff -r dbb86ed48634 -r 1ab3e76972e6 PluginWizardDataUriEncoder.py
--- a/PluginWizardDataUriEncoder.py	Wed Jun 02 17:20:11 2021 +0200
+++ b/PluginWizardDataUriEncoder.py	Wed Jun 02 17:30:01 2021 +0200
@@ -9,19 +9,19 @@
 
 import os
 
-from PyQt5.QtCore import QObject, QTranslator
-from PyQt5.QtWidgets import QDialog
+from PyQt6.QtCore import QObject, QTranslator
+from PyQt6.QtWidgets import QDialog
 
-from E5Gui.E5Application import e5App
-from E5Gui.E5Action import E5Action
-from E5Gui import E5MessageBox
+from EricWidgets.EricApplication import ericApp
+from EricGui.EricAction import EricAction
+from EricWidgets import EricMessageBox
 
 # Start-of-Header
 name = "Base64 Data URI Encoder Wizard Plug-in"
 author = "Detlev Offenbach <detlev@die-offenbachs.de>"
 autoactivate = True
 deactivateable = True
-version = "3.2.0"
+version = "1.0.0"
 className = "WizardDataUriEncoderPlugin"
 packageName = "WizardDataUriEncoder"
 shortDescription = "Wizard for the creation of code for a base64 data URI."
@@ -44,7 +44,8 @@
         """
         Constructor
         
-        @param ui reference to the user interface object (UI.UserInterface)
+        @param ui reference to the user interface object
+        @type UserInterface
         """
         QObject.__init__(self, ui)
         
@@ -58,7 +59,8 @@
         """
         Public method to activate this plug-in.
         
-        @return tuple of None and activation status (boolean)
+        @return tuple of None and activation status
+        @rtype (None, bool)
         """
         self.__initAction()
         self.__initMenu()
@@ -72,7 +74,7 @@
         menu = self.__ui.getMenu("wizards")
         if menu:
             menu.removeAction(self.__action)
-        self.__ui.removeE5Actions([self.__action], 'wizards')
+        self.__ui.removeEricActions([self.__action], 'wizards')
     
     def __loadTranslator(self):
         """
@@ -88,7 +90,7 @@
                 loaded = translator.load(translation, locale_dir)
                 if loaded:
                     self.__translator = translator
-                    e5App().installTranslator(self.__translator)
+                    ericApp().installTranslator(self.__translator)
                 else:
                     print("Warning: translation file '{0}' could not be"
                           " loaded.".format(translation))
@@ -98,7 +100,7 @@
         """
         Private method to initialize the action.
         """
-        self.__action = E5Action(
+        self.__action = EricAction(
             self.tr('Base64 Data Uri Encoder Wizard'),
             self.tr('Base&64 Data Uri Encoder Wizard...'),
             0, 0, self,
@@ -112,7 +114,7 @@
         ))
         self.__action.triggered.connect(self.__handle)
         
-        self.__ui.addE5Actions([self.__action], 'wizards')
+        self.__ui.addEricActions([self.__action], 'wizards')
 
     def __initMenu(self):
         """
@@ -126,10 +128,10 @@
         """
         Private method to handle the wizards action.
         """
-        editor = e5App().getObject("ViewManager").activeWindow()
+        editor = ericApp().getObject("ViewManager").activeWindow()
         
         if editor is None:
-            E5MessageBox.critical(
+            EricMessageBox.critical(
                 self.__ui,
                 self.tr('No current editor'),
                 self.tr('Please open or create a file first.'))
@@ -138,7 +140,7 @@
                 DataUriEncoderWizardDialog
             )
             dlg = DataUriEncoderWizardDialog(None)
-            if dlg.exec() == QDialog.Accepted:
+            if dlg.exec() == QDialog.DialogCode.Accepted:
                 code = dlg.getCode()
                 if code:
                     line, index = editor.getCursorPosition()

eric ide

mercurial