summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Robillard <d@drobilla.net>2011-03-11 00:14:23 +0000
committerDavid Robillard <d@drobilla.net>2011-03-11 00:14:23 +0000
commit50d5877601938c67e696bccb378945a25e143209 (patch)
tree9312639a42501c347346a8af4a3a111ae3957954
parentaae0d7d82bcc60d6977dd11bcdc60579aace04cb (diff)
downloadingen-50d5877601938c67e696bccb378945a25e143209.tar.gz
ingen-50d5877601938c67e696bccb378945a25e143209.tar.bz2
ingen-50d5877601938c67e696bccb378945a25e143209.zip
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
-rw-r--r--src/gui/LoadPluginWindow.cpp4
-rw-r--r--src/gui/PatchCanvas.cpp6
2 files changed, 10 insertions, 0 deletions
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<PluginModel> plugi
void
LoadPluginWindow::add_plugin(SharedPtr<PluginModel> 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 <cassert>
#include <map>
#include <string>
+#include <boost/format.hpp>
#include "raul/log.hpp"
#include "flowcanvas/Canvas.hpp"
#include "flowcanvas/Ellipse.hpp"
@@ -336,6 +337,11 @@ PatchCanvas::add_plugin(SharedPtr<PluginModel> 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);