9 |
9 |
10 import os |
10 import os |
11 |
11 |
12 from PyQt6.QtCore import pyqtSignal, QObject, QCoreApplication, QDateTime, Qt |
12 from PyQt6.QtCore import pyqtSignal, QObject, QCoreApplication, QDateTime, Qt |
13 |
13 |
14 from E5Gui.E5Application import e5App |
14 from E5Gui.EricApplication import ericApp |
15 |
15 |
16 import Preferences |
16 import Preferences |
17 |
17 |
18 from UiExtensionPlugins.Translator.Translator import Translator |
18 from UiExtensionPlugins.Translator.Translator import Translator |
19 |
19 |
59 |
59 |
60 @return dictionary containing the relevant data |
60 @return dictionary containing the relevant data |
61 """ |
61 """ |
62 icon = ( |
62 icon = ( |
63 os.path.join("UiExtensionPlugins", "Translator", "icons", "flag-dark") |
63 os.path.join("UiExtensionPlugins", "Translator", "icons", "flag-dark") |
64 if e5App().usesDarkPalette() else |
64 if ericApp().usesDarkPalette() else |
65 os.path.join("UiExtensionPlugins", "Translator", "icons", "flag-light") |
65 os.path.join("UiExtensionPlugins", "Translator", "icons", "flag-light") |
66 ) |
66 ) |
67 return { |
67 return { |
68 "translatorPage": [ |
68 "translatorPage": [ |
69 QCoreApplication.translate("TranslatorPlugin", |
69 QCoreApplication.translate("TranslatorPlugin", |
141 error = "" # clear previous error |
141 error = "" # clear previous error |
142 |
142 |
143 global translatorPluginObject |
143 global translatorPluginObject |
144 translatorPluginObject = self |
144 translatorPluginObject = self |
145 |
145 |
146 self.__object = Translator(self, e5App().usesDarkPalette(), self.__ui) |
146 self.__object = Translator(self, ericApp().usesDarkPalette(), self.__ui) |
147 self.__object.activate() |
147 self.__object.activate() |
148 e5App().registerPluginObject("Translator", self.__object) |
148 ericApp().registerPluginObject("Translator", self.__object) |
149 |
149 |
150 return None, True |
150 return None, True |
151 |
151 |
152 def deactivate(self): |
152 def deactivate(self): |
153 """ |
153 """ |
154 Public method to deactivate this plugin. |
154 Public method to deactivate this plugin. |
155 """ |
155 """ |
156 e5App().unregisterPluginObject("Translator") |
156 ericApp().unregisterPluginObject("Translator") |
157 self.__object.deactivate() |
157 self.__object.deactivate() |
158 |
158 |
159 self.__initialize() |
159 self.__initialize() |
160 |
160 |
161 def getPreferencesDefault(self, key): |
161 def getPreferencesDefault(self, key): |