From 50d5877601938c67e696bccb378945a25e143209 Mon Sep 17 00:00:00 2001 From: David Robillard Date: Fri, 11 Mar 2011 00:14:23 +0000 Subject: Hide replaced plugins from context menu and load plugin window. git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@3068 a436a847-0d15-0410-975c-d299462d15a1 --- src/gui/LoadPluginWindow.cpp | 4 ++++ src/gui/PatchCanvas.cpp | 6 ++++++ 2 files changed, 10 insertions(+) diff --git a/src/gui/LoadPluginWindow.cpp b/src/gui/LoadPluginWindow.cpp index 2c1d9ae7..3952397a 100644 --- a/src/gui/LoadPluginWindow.cpp +++ b/src/gui/LoadPluginWindow.cpp @@ -252,6 +252,10 @@ LoadPluginWindow::set_row(Gtk::TreeModel::Row& row, SharedPtr plugi void LoadPluginWindow::add_plugin(SharedPtr plugin) { + if (plugin->slv2_plugin() && slv2_plugin_is_replaced(plugin->slv2_plugin())) { + return; + } + Gtk::TreeModel::iterator iter = _plugins_liststore->append(); Gtk::TreeModel::Row row = *iter; _rows.insert(make_pair(plugin->uri(), iter)); diff --git a/src/gui/PatchCanvas.cpp b/src/gui/PatchCanvas.cpp index 8f76e281..bd4c83e1 100644 --- a/src/gui/PatchCanvas.cpp +++ b/src/gui/PatchCanvas.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include "raul/log.hpp" #include "flowcanvas/Canvas.hpp" #include "flowcanvas/Ellipse.hpp" @@ -336,6 +337,11 @@ PatchCanvas::add_plugin(SharedPtr p) _internal_menu->items().push_back(Gtk::Menu_Helpers::MenuElem(p->human_name(), sigc::bind(sigc::mem_fun(this, &PatchCanvas::load_plugin), p))); } else if (_plugin_menu && p->type() == Plugin::LV2 && p->slv2_plugin()) { + if (slv2_plugin_is_replaced(p->slv2_plugin())) { + info << (boost::format("[Menu] LV2 plugin <%s> hidden") % p->uri()) << endl; + return; + } + SLV2PluginClass pc = slv2_plugin_get_class(p->slv2_plugin()); SLV2Value class_uri = slv2_plugin_class_get_uri(pc); const char* class_uri_str = slv2_value_as_string(class_uri); -- cgit v1.2.1