def unload(self): """Removes the plugin menu item and icon from QGIS GUI.""" PlanetClient.getInstance().log_out() self.provider.updateLayerWidgets() removeSettingsMenu(P_E, self.iface.removePluginWebMenu) # removeHelpMenu(P_E, self.iface.removePluginWebMenu) removeAboutMenu(P_E, self.iface.removePluginWebMenu) for action in self.actions: self.iface.removePluginWebMenu( self.tr('&{0}'.format(P_E)), action) self.iface.removeToolBarIcon(action) # remove the toolbar if self.toolbar is not None: del self.toolbar remove_inspector() remove_explorer() remove_orders_monitor() remove_tasking_widget() sys.excepthook = self.qgis_hook QgsProject.instance().projectSaved.disconnect(self.project_saved) QgsProject.instance().layersAdded.disconnect(self.layers_added) QgsProject.instance().layerRemoved.disconnect(self.layer_removed)
def unload(self): self.iface.mapCanvas().unsetMapTool(self.mapTool) self.iface.removeToolBarIcon(self.toolAction) self.iface.removePluginMenu("what3words", self.toolAction) self.iface.removePluginMenu("what3words", self.zoomToAction) removeSettingsMenu("what3words") removeHelpMenu("what3words") removeAboutMenu("what3words") self.iface.removeDockWidget(self.zoomToDialog) if processingOk: Processing.removeProvider(self.provider) try: from what3words.tests import testerplugin from qgistester.tests import removeTestModule removeTestModule(testerplugin, "what3words") except: pass try: from lessons import removeLessonsFolder folder = os.path.join(pluginPath, '_lessons') removeLessonsFolder(folder) except: pass
def unload(self): actions = self.iface.mainWindow().menuBar().actions() for action in actions: if action.menu().objectName() == 'mPluginMenu': menuPlugin = action.menu() menuPlugin.removeAction(self.actionRunWizard) if utils.isRepositoryInDirectory(): menuPlugin.removeAction(self.actionPluginManager) removeSettingsMenu('Boundless Connect') removeHelpMenu('Boundless Connect') removeAboutMenu('Boundless Connect') self.dockWidget.hide() try: from boundlessconnect.tests import testerplugin from qgistester.tests import removeTestModule removeTestModule(testerplugin, 'Boundless Connect') except Exception as e: pass try: from lessons import removeLessonsFolder folder = os.path.join(pluginPath, '_lessons') removeLessonsFolder(folder) except: pass
def unload(self): """Removes the plugin menu item and icon from QGIS GUI.""" self.provider.logoutLayerWidgets() # Delete the contents of the thumbnail temp directory if os.path.exists(TEMP_CACHE_DIR) and 'p_thumbcache' in TEMP_CACHE_DIR: for f_name in os.listdir(TEMP_CACHE_DIR): f_path = os.path.join(TEMP_CACHE_DIR, f_name) try: shutil.rmtree(f_path) except OSError: os.remove(f_path) # noinspection PyBroadException # try: # from .tests import testerplugin # from qgistester.tests import removeTestModule # removeTestModule(testerplugin, P_E) # except: # pass # noinspection PyBroadException # try: # from lessons import removeLessonsFolder # folder = os.path.join(pluginPath, "_lessons") # removeLessonsFolder(folder) # except: # pass # unregisterFunctions() removeSettingsMenu(P_E, self.iface.removePluginWebMenu) # removeHelpMenu(P_E, self.iface.removePluginWebMenu) removeAboutMenu(P_E, self.iface.removePluginWebMenu) for action in self.actions: self.iface.removePluginWebMenu(self.tr('&{0}'.format(P_E)), action) self.iface.removeToolBarIcon(action) # remove the toolbar if self.toolbar is not None: del self.toolbar if self.dock_widget is not None: setPluginSetting(DOCK_SHOWN_STATE, self.dock_widget.isVisible(), namespace=SETTINGS_NAMESPACE) self.iface.removeDockWidget(self.dock_widget) del self.dock_widget sys.excepthook = self.qgis_hook QgsProject.instance().projectSaved.disconnect(self.project_saved)
def unload(self): try: from .tests import testerplugin from qgistester.tests import removeTestModule removeTestModule(testerplugin, "boundlessbasemaps") except: pass self.iface.removePluginMenu("Basemaps", self.helpAction) self.iface.removePluginMenu("Basemaps", self.setupAction) removeSettingsMenu("Basemaps")
def unload(self): self.explorer.deleteLater() removeSettingsMenu("GeoServer", self.iface.removePluginWebMenu) removeHelpMenu("GeoServer", self.iface.removePluginWebMenu) removeAboutMenu("GeoServer", self.iface.removePluginWebMenu) self.iface.removePluginWebMenu(u"GeoServer", self.explorerAction) layerwatcher.disconnectLayerWasAdded() try: from qgistester.tests import removeTestModule from geoserverexplorer.test import testplugin removeTestModule(testplugin, "GeoServer") except Exception as ex: pass
def unload(self): self.iface.removeWebToolBarIcon(self.action) self.iface.removePluginWebMenu("Web App Builder", self.action) removeSettingsMenu("Web App Builder", self.iface.removePluginWebMenu) removeHelpMenu("Web App Builder", self.iface.removePluginWebMenu) removeAboutMenu("Web App Builder", self.iface.removePluginWebMenu) removeTempFolder() try: from webappbuilder.tests import testerplugin from qgistester.tests import removeTestModule removeTestModule(testerplugin, "Web App Builder") except: pass
def unload(self): self.doAdd = False self.iface.mapCanvas().unsetMapTool(self.mapTool) self.iface.removeToolBarIcon(self.loadImagesAction) self.iface.removeToolBarIcon(self.loadImagesManAction) self.iface.removeToolBarIcon(self.stopLoadImagesAction) self.iface.removeToolBarIcon(self.removeImagesAction) self.iface.removePluginMenu("geotiffloader", self.loadImagesAction) self.iface.removePluginMenu("geotiffloader", self.loadImagesManAction) self.iface.removePluginMenu("geotiffloader", self.stopLoadImagesAction) self.iface.removePluginMenu("geotiffloader", self.removeImagesAction) removeSettingsMenu("geotiffloader") removeHelpMenu("geotiffloader") removeAboutMenu("geotiffloader")
def unload(self): pem.removePkiTempFiles(self.explorer.catalogs()) self.explorer.deleteLater() removeSettingsMenu("GeoServer", self.iface.removePluginWebMenu) removeHelpMenu("GeoServer", self.iface.removePluginWebMenu) removeAboutMenu("GeoServer", self.iface.removePluginWebMenu) self.iface.removePluginWebMenu(u"GeoServer", self.explorerAction) if processingOk: Processing.removeProvider(self.provider) layerwatcher.disconnectLayerWasAdded() try: from qgistester.tests import removeTestModule from geoserverexplorer.test import testplugin from geoserverexplorer.test import testpkiplugin removeTestModule(testplugin, "GeoServer") removeTestModule(testpkiplugin, "PKI GeoServer") except Exception as ex: pass
def unload(self): self.iface.removePluginMenu("Lessons", self.action) del self.action removeSettingsMenu("Lessons") removeHelpMenu("Lessons") removeAboutMenu("Lessons") tempDir = os.path.join(QDir.tempPath(), "lessons" , "lesson") if QDir(tempDir).exists(): shutil.rmtree(tempDir, True) try: from qgistester.tests import removeTestModule from lessons.test import testerplugin removeTestModule(testerplugin, "Lessons") except Exception as e: pass
def unload(self): self.iface.removePluginMenu("Lessons", self.action) del self.action removeSettingsMenu("Lessons") removeHelpMenu("Lessons") removeAboutMenu("Lessons") tempDir = os.path.join(QDir.tempPath(), "lessons", "lesson") if QDir(tempDir).exists(): shutil.rmtree(tempDir, True) try: from qgistester.tests import removeTestModule from lessons.test import testerplugin removeTestModule(testerplugin, "Lessons") except Exception as e: pass
def unload(self): navigatorInstance.setVisible(False) self.iface.removePluginMenu("&GeoGig", self.explorerAction) removeHelpMenu("GeoGig") removeAboutMenu("GeoGig") removeSettingsMenu("GeoGig") #removeTempFolder() clearDiffFiles() self.iface.mapCanvas().extentsChanged.disconnect(refreshGeogigLayers) QgsProject.instance().layersWillBeRemoved.disconnect(layersRemoved) QgsProject.instance().legendLayersAdded.disconnect(onLayersLoaded) sys.excepthook = utils.qgis_excepthook QgsSettings().setValue("askToSaveMemoryLayers", self.askToSaveMemoryLayers, section=QgsSettings.App)
def unload(self): navigatorInstance.setVisible(False) try: QgsMapLayerRegistry.instance().layerWasAdded.disconnect(trackLayer) QgsMapLayerRegistry.instance().layerRemoved.disconnect( layerRemoved) except: pass self.menu.deleteLater() self.toolButton.deleteLater() self.iface.removePluginMenu("&GeoGig", self.explorerAction) self.iface.removePluginMenu("&GeoGig", self.toolAction) layers = list(QgsMapLayerRegistry.instance().mapLayers().values()) for layer in layers: removeLayerActions(layer) removeNonexistentTrackedLayers() removeTempFolder() try: from qgistester.tests import removeTestModule from geogig.tests import testplugin removeTestModule(testplugin, "GeoGig Light") except Exception as e: pass try: from lessons import removeLessonsFolder removeLessonsFolder(folder, "geogig") except: pass removeHelpMenu("GeoGig") removeAboutMenu("GeoGig") removeSettingsMenu("GeoGig")
def unload(self): navigatorInstance.setVisible(False) try: QgsMapLayerRegistry.instance().layerWasAdded.disconnect(trackLayer) QgsMapLayerRegistry.instance().layerRemoved.disconnect(layerRemoved) except: pass self.menu.deleteLater() self.toolButton.deleteLater() self.iface.removePluginMenu("&GeoGig", self.explorerAction) self.iface.removePluginMenu("&GeoGig", self.toolAction) layers = list(QgsMapLayerRegistry.instance().mapLayers().values()) for layer in layers: removeLayerActions(layer) removeNonexistentTrackedLayers() removeTempFolder() try: from qgistester.tests import removeTestModule from geogig.tests import testplugin removeTestModule(testplugin, "GeoGig Light") except Exception as e: pass try: from lessons import removeLessonsFolder removeLessonsFolder(folder, "geogig") except: pass removeHelpMenu("GeoGig") removeAboutMenu("GeoGig") removeSettingsMenu("GeoGig")