I have created a plugin with two separate algorithms. When I open one algorithm (either under plugins menu or through the button at the top) the second one also opens automatically. However, if I open an algorithm in the processing toolbox only the one selected opens. How do I stop both algorithms opening at the same time? Is it related to def unload?
class PluginPlugin(object):
def __init__(self, iface): self.provider = None self.iface = iface def initProcessing(self): """Init Processing provider for QGIS >= 3.8.""" self.provider = PluginProvider() QgsApplication.processingRegistry().addProvider(self.provider) def initGui(self): self.initProcessing() icon = os.path.join(os.path.join(cmd_folder, 'logo.png')) self.action = QAction( QIcon(icon), u"Algorithm 1", self.iface.mainWindow()) self.action.triggered.connect(self.run) self.iface.addPluginToMenu(u"&Plugin", self.action) self.iface.addToolBarIcon(self.action) self.action = QAction( QIcon(icon), u"Algorithm 2", self.iface.mainWindow()) self.action.triggered.connect(self.run) self.iface.addPluginToMenu(u"&Plugin", self.action) self.iface.addToolBarIcon(self.action) def unload(self): QgsApplication.processingRegistry().removeProvider(self.provider) self.iface.removePluginMenu(u"&Plugin", self.action) self.iface.removeToolBarIcon(self.action) def run(self): processing.execAlgorithmDialog("Plugin:Algorithm 1") processing.execAlgorithmDialog("Plugin:Algorithm 2") """Run method that performs all the real work"""