def unload(self) -> None: """Removes the plugin menu item and icon from QGIS GUI.""" for action in self.actions: iface.removePluginMenu(tr(plugin_name()), action) iface.removeToolBarIcon(action) teardown_logger(plugin_name())
def unload(self): ''' Here we put all the actions to be performed when the plugin is unloaded ''' # iface.mapCanvas().unsetMapTool(self.mapTool) '''Remove menus and buttons''' iface.removeToolBarIcon(self.toolAction) iface.removePluginMenu("what3words", self.toolAction) iface.removePluginMenu("what3words", self.zoomToAction) '''Remove qgiscommons menus''' removeSettingsMenu("what3words") removeHelpMenu("what3words") removeAboutMenu("what3words") '''Remove the main plugin widget''' iface.removeDockWidget(self.zoomToDialog) '''Remove processing provider''' if processingOk: Processing.removeProvider(self.provider) '''Remove tests''' try: from what3words.tests import testerplugin from qgistester.tests import removeTestModule removeTestModule(testerplugin, "what3words") except: pass
def unload(self): iface.removeToolBarIcon(self.action) del self.action close_report_dialog() # unhook from exception handling global old_show_exception qgis.utils.showException = old_show_exception
def unload(self): """Removes the buildings plugin.""" # Close dockwidget and delete widget completely if self.is_active: self.dockwidget.close() self.dockwidget.setParent(None) del self.dockwidget try: dw = self.dockwidget if dw is not None: for row in range(0, (dw.lst_options.count()), 1): if dw.lst_options.item(row).text() == "Buildings": dw.lst_options.takeItem(row) dw.frames = {} if dw.stk_options.count() == 2: dw.stk_options.setCurrentIndex(1) dw.stk_options.removeWidget(dw.stk_options.currentWidget()) dw.stk_options.setCurrentIndex(0) # Remove main toolbar for action in self.actions: iface.removePluginMenu( self.tr(u"&Building Maintenance"), action) iface.removeToolBarIcon(action) del self.main_toolbar for toolbar in iface.mainWindow().findChildren( QToolBar, "Building Tools"): iface.mainWindow().removeToolBar(toolbar) # Setting parent to None, deletes the widget completely toolbar.setParent(None) # Remove action triggering toolbar from ToolBar menu toolbar_menu = iface.mainWindow().findChildren( QMenu, "mToolbarMenu")[0] for act in toolbar_menu.actions(): if act.text() == u"Building Tools": toolbar_menu.removeAction(act) except KeyError: pass # Remove Dockwidget from Panel menu panel = iface.mainWindow().findChildren(QMenu, "mPanelMenu")[0] for act in panel.actions(): if act.text() == u"Buildings": panel.removeAction(act) # Delete the mainWindow reference to the buildings dockwidget for dock in iface.mainWindow().findChildren( QDockWidget, u"BuildingsDockWidgetBase"): dock.setParent(None)
def unload(self): QgsApplication.processingRegistry().removeProvider(self.provider) iface.removePluginWebMenu(u"&Mappia", self.shareAction) iface.removeToolBarIcon(self.shareAction) iface.removePluginWebMenu(u"&Mappia", self.viewAction) iface.removeToolBarIcon(self.viewAction) iface.removePluginWebMenu(u"&Mappia", self.reportAction) iface.removeToolBarIcon(self.reportAction)