diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/mainwindow.cpp | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 93ca415d..9bbe3da9 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1652,6 +1652,9 @@ void MainWindow::registerPluginTool(IPluginTool *tool, QString name, QMenu *menu connect(action, SIGNAL(triggered()), this, SLOT(toolPluginInvoke()), Qt::QueuedConnection); menu->addAction(action); + if (!m_PluginContainer.isEnabled(tool)) { + action->setVisible(false); + } } void MainWindow::registerPluginTools(std::vector<IPluginTool *> toolPlugins) @@ -1663,14 +1666,6 @@ void MainWindow::registerPluginTools(std::vector<IPluginTool *> toolPlugins) } ); - // TODO: I don't know when this method is called? Maybe the check should be perform when - // the context menu is opened? - // Remove inactive plugins - toolPlugins.erase( - std::remove_if(toolPlugins.begin(), toolPlugins.end(), [this](IPluginTool *plugin) { return !m_PluginContainer.isEnabled(plugin); }), - toolPlugins.end() - ); - // Group the plugins into submenus QMap<QString, QList<QPair<QString, IPluginTool *>>> submenuMap; for (auto toolPlugin : toolPlugins) { |
