10 import os |
10 import os |
11 import contextlib |
11 import contextlib |
12 |
12 |
13 from PyQt6.QtCore import QObject, QCoreApplication |
13 from PyQt6.QtCore import QObject, QCoreApplication |
14 |
14 |
15 from E5Gui.E5Application import e5App |
15 from E5Gui.EricApplication import ericApp |
16 |
16 |
17 import Preferences |
17 import Preferences |
18 from Preferences.Shortcuts import readShortcuts |
18 from Preferences.Shortcuts import readShortcuts |
19 |
19 |
20 from VcsPlugins.vcsSubversion.SvnUtilities import getConfigPath, getServersPath |
20 from VcsPlugins.vcsSubversion.SvnUtilities import getConfigPath, getServersPath |
139 |
139 |
140 def prepareUninstall(): |
140 def prepareUninstall(): |
141 """ |
141 """ |
142 Module function to prepare for an uninstallation. |
142 Module function to prepare for an uninstallation. |
143 """ |
143 """ |
144 if not e5App().getObject("PluginManager").isPluginLoaded( |
144 if not ericApp().getObject("PluginManager").isPluginLoaded( |
145 "PluginVcsSubversion"): |
145 "PluginVcsSubversion"): |
146 Preferences.Prefs.settings.remove("Subversion") |
146 Preferences.Prefs.settings.remove("Subversion") |
147 |
147 |
148 |
148 |
149 class VcsSubversionPlugin(QObject): |
149 class VcsSubversionPlugin(QObject): |
166 } |
166 } |
167 |
167 |
168 from VcsPlugins.vcsSubversion.ProjectHelper import SvnProjectHelper |
168 from VcsPlugins.vcsSubversion.ProjectHelper import SvnProjectHelper |
169 self.__projectHelperObject = SvnProjectHelper(None, None) |
169 self.__projectHelperObject = SvnProjectHelper(None, None) |
170 with contextlib.suppress(KeyError): |
170 with contextlib.suppress(KeyError): |
171 e5App().registerPluginObject( |
171 ericApp().registerPluginObject( |
172 pluginTypename, self.__projectHelperObject, pluginType) |
172 pluginTypename, self.__projectHelperObject, pluginType) |
173 readShortcuts(pluginName=pluginTypename) |
173 readShortcuts(pluginName=pluginTypename) |
174 |
174 |
175 def getProjectHelper(self): |
175 def getProjectHelper(self): |
176 """ |
176 """ |
184 """ |
184 """ |
185 Public slot to initialize the VCS toolbar. |
185 Public slot to initialize the VCS toolbar. |
186 |
186 |
187 @param ui reference to the main window (UserInterface) |
187 @param ui reference to the main window (UserInterface) |
188 @param toolbarManager reference to a toolbar manager object |
188 @param toolbarManager reference to a toolbar manager object |
189 (E5ToolBarManager) |
189 (EricToolBarManager) |
190 """ |
190 """ |
191 if self.__projectHelperObject: |
191 if self.__projectHelperObject: |
192 self.__projectHelperObject.initToolbar(ui, toolbarManager) |
192 self.__projectHelperObject.initToolbar(ui, toolbarManager) |
193 |
193 |
194 def activate(self): |
194 def activate(self): |
272 |
272 |
273 def prepareUninstall(self): |
273 def prepareUninstall(self): |
274 """ |
274 """ |
275 Public method to prepare for an uninstallation. |
275 Public method to prepare for an uninstallation. |
276 """ |
276 """ |
277 e5App().unregisterPluginObject(pluginTypename) |
277 ericApp().unregisterPluginObject(pluginTypename) |
278 |
278 |
279 def prepareUnload(self): |
279 def prepareUnload(self): |
280 """ |
280 """ |
281 Public method to prepare for an unload. |
281 Public method to prepare for an unload. |
282 """ |
282 """ |
283 if self.__projectHelperObject: |
283 if self.__projectHelperObject: |
284 self.__projectHelperObject.removeToolbar( |
284 self.__projectHelperObject.removeToolbar( |
285 self.__ui, e5App().getObject("ToolbarManager")) |
285 self.__ui, ericApp().getObject("ToolbarManager")) |
286 e5App().unregisterPluginObject(pluginTypename) |
286 ericApp().unregisterPluginObject(pluginTypename) |