Don't show hidden controls inline in the mixer-strip
[ardour.git] / gtk2_ardour / plugin_selector.cc
index 294d0f937125bbff137246591a7794ea26b1648a..3f03a218e523237612f3e779d202a36d71db6728 100644 (file)
@@ -32,6 +32,7 @@
 #include <gtkmm/notebook.h>
 #include <gtkmm/stock.h>
 #include <gtkmm/table.h>
+#include <gtkmm/treestore.h>
 
 #include "gtkmm2ext/utils.h"
 
@@ -44,6 +45,7 @@
 
 #include "plugin_selector.h"
 #include "gui_thread.h"
+#include "ui_config.h"
 
 #include "pbd/i18n.h"
 
@@ -59,7 +61,7 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        : ArdourDialog (_("Plugin Manager"), true, false)
        , search_clear_button (Stock::CLEAR)
        , manager (mgr)
-       , inhibit_refill (false)
+       , _inhibit_refill (false)
 {
        set_name ("PluginSelectorWindow");
        add_events (Gdk::KEY_PRESS_MASK|Gdk::KEY_RELEASE_MASK);
@@ -67,10 +69,12 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        _plugin_menu = 0;
        in_row_change = false;
 
+       //anytime the list changes ( Status, Tags, or scanned plugins ) we need to rebuild redirect-box plugin selector menu
        manager.PluginListChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::build_plugin_menu, this), gui_context());
-       manager.PluginListChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::refill, this), gui_context());
-       manager.PluginStatusesChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::plugin_status_changed, this, _1, _2, _3), gui_context());
-       manager.PluginTagsChanged.connect(plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::tags_changed, this, _1, _2, _3), gui_context());
+
+       //these are used to update the info of specific entries, while they are being edited
+       manager.PluginStatusChanged.connect (plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::plugin_status_changed, this, _1, _2, _3), gui_context());
+       manager.PluginTagChanged.connect(plugin_list_changed_connection, invalidator (*this), boost::bind (&PluginSelector::tags_changed, this, _1, _2, _3), gui_context());
 
        plugin_model = Gtk::ListStore::create (plugin_columns);
        plugin_display.set_model (plugin_model);
@@ -120,7 +124,7 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        added_list.set_headers_visible (true);
        added_list.set_reorderable (false);
 
-       for (int i = 2; i <=7; i++) {
+       for (int i = 2; i <= 7; ++i) {
                Gtk::TreeView::Column* column = plugin_display.get_column(i);
                if (column) {
                        column->set_sort_column(i);
@@ -147,15 +151,17 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        search_entry.signal_changed().connect (sigc::mem_fun (*this, &PluginSelector::search_entry_changed));
        search_clear_button.signal_clicked().connect (sigc::mem_fun (*this, &PluginSelector::search_clear_button_clicked));
 
-       _search_name_checkbox = manage (new CheckButton (_("Name")));
-       _search_name_checkbox->set_active();
+       _search_name_checkbox = manage (new ArdourButton (_("Name"), ArdourButton::led_default_elements, true));
+       _search_name_checkbox->set_active(true);
+       _search_name_checkbox->set_name ("pluginlist filter button");
 
-       _search_tags_checkbox = manage (new CheckButton (_("Tags")));
-       _search_tags_checkbox->set_active();
+       _search_tags_checkbox = manage (new ArdourButton (_("Tags"), ArdourButton::led_default_elements, true));
+       _search_tags_checkbox->set_active(true);
+       _search_tags_checkbox->set_name ("pluginlist filter button");
 
-       _search_ignore_checkbox = manage (new CheckButton(_("Ignore Filters when searching")));
-       _search_ignore_checkbox->set_active();
-       _search_ignore_checkbox->signal_toggled().connect (sigc::mem_fun (*this, &PluginSelector::set_sensitive_widgets));
+       _search_ignore_checkbox = manage (new ArdourButton(_("Ignore Filters when searching"), ArdourButton::led_default_elements, true));
+       _search_ignore_checkbox->set_active(true);
+       _search_ignore_checkbox->set_name ("pluginlist filter button");
 
        Gtk::Label* search_help_label1 = manage (new Label(
                _("All search terms must be matched."), Gtk::ALIGN_LEFT));
@@ -181,13 +187,12 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        search_frame->add (*search_table);
        search_frame->show_all ();
 
-       _search_name_checkbox->signal_clicked().connect (sigc::mem_fun (*this, &PluginSelector::refill));
-       _search_tags_checkbox->signal_clicked().connect (sigc::mem_fun (*this, &PluginSelector::refill));
+       _search_name_checkbox->signal_clicked.connect (sigc::mem_fun (*this, &PluginSelector::refill));
+       _search_tags_checkbox->signal_clicked.connect (sigc::mem_fun (*this, &PluginSelector::refill));
+       _search_ignore_checkbox->signal_clicked.connect (sigc::mem_fun (*this, &PluginSelector::set_sensitive_widgets));
 
        /* FILTER */
 
-       Gtk::Table* filter_table = manage(new Gtk::Table(1, 10));
-
        Gtk::RadioButtonGroup fil_radio_group;
 
        _fil_effects_radio = manage (new RadioButton (fil_radio_group, _("Show Effects Only")));
@@ -197,57 +202,40 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        _fil_hidden_radio = manage (new RadioButton (fil_radio_group, _("Show Hidden Only")));
        _fil_all_radio = manage (new RadioButton (fil_radio_group, _("Show All")));
 
-#ifndef MIXBUS
-       _fil_all_radio->set_active ();
-#endif
-
-       _fil_type_combo = manage (new ComboBoxText);
-       _fil_type_combo->append_text (_("Show All Formats"));
-       _fil_type_combo->append_text (X_("VST"));
+       //_fil_type_combo = manage (new ComboBoxText);
+       _fil_type_combo.append_text_item (_("Show All Formats"));
+       _fil_type_combo.append_text_item (X_("VST"));
 #ifdef AUDIOUNIT_SUPPORT
-       _fil_type_combo->append_text (X_("AudioUnit"));
+       _fil_type_combo.append_text_item (X_("AudioUnit"));
 #endif
 #ifdef LV2_SUPPORT
-       _fil_type_combo->append_text (X_("LV2"));
+       _fil_type_combo.append_text_item (X_("LV2"));
 #endif
-       _fil_type_combo->append_text (X_("LUA"));
-       _fil_type_combo->append_text (X_("LADSPA"));
-       _fil_type_combo->set_active_text (_("Show All Formats"));
-
-       _fil_creator_combo = manage (new ComboBoxText);
-       //note: _fil_creator_combo menu gets filled in build_plugin_menu
-
-       _fil_channel_combo = manage (new ComboBoxText);
-       _fil_channel_combo->append_text (_("Audio I/O"));
-       _fil_channel_combo->append_text (_("Mono Audio I/O"));
-       _fil_channel_combo->append_text (_("Stereo Audio I/O"));
-       _fil_channel_combo->append_text (_("MIDI I/O (only)"));
-       _fil_channel_combo->append_text (_("Show All I/O"));
-#ifdef MIXBUS
-       _fil_channel_combo->set_active_text (_("Audio I/O"));
-#else
-       _fil_channel_combo->set_active_text (_("Show All I/O"));
-#endif
-
-       int p = 0;
-       filter_table->attach (*_fil_effects_radio,       2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_instruments_radio,   2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_utils_radio,         2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_favorites_radio,     2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_hidden_radio,        2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_all_radio,           2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_type_combo,          2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_creator_combo,       2, 3, p, p+1, FILL, FILL); p++;
-       filter_table->attach (*_fil_channel_combo,       2, 3, p, p+1, FILL, FILL); p++;
-
-       filter_table->set_border_width (4);
-       filter_table->set_col_spacings (4);
-       filter_table->set_row_spacings (4);
+       _fil_type_combo.append_text_item (X_("Lua"));
+       _fil_type_combo.append_text_item (X_("LADSPA"));
+       _fil_type_combo.set_text (_("Show All Formats"));
+
+       /* note: _fil_creator_combo menu gets filled in build_plugin_menu */
+       _fil_creator_combo.set_text_ellipsize (Pango::ELLIPSIZE_END);
+       _fil_creator_combo.set_layout_ellipsize_width (PANGO_SCALE * 160 * UIConfiguration::instance ().get_ui_scale ());
+
+       VBox* filter_vbox = manage (new VBox);
+       filter_vbox->pack_start (*_fil_effects_radio,     false, false);
+       filter_vbox->pack_start (*_fil_instruments_radio, false, false);
+       filter_vbox->pack_start (*_fil_utils_radio,       false, false);
+       filter_vbox->pack_start (*_fil_favorites_radio,   false, false);
+       filter_vbox->pack_start (*_fil_hidden_radio,      false, false);
+       filter_vbox->pack_start (*_fil_all_radio,         false, false);
+       filter_vbox->pack_start (_fil_type_combo,         false, false);
+       filter_vbox->pack_start (_fil_creator_combo,      false, false);
+
+       filter_vbox->set_border_width (4);
+       filter_vbox->set_spacing (4);
 
        Frame* filter_frame = manage (new Frame);
        filter_frame->set_name ("BaseFrame");
        filter_frame->set_label (_("Filter"));
-       filter_frame->add (*filter_table);
+       filter_frame->add (*filter_vbox);
        filter_frame->show_all ();
 
        _fil_effects_radio->signal_clicked().connect (sigc::mem_fun (*this, &PluginSelector::refill));
@@ -256,9 +244,8 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        _fil_favorites_radio->signal_clicked().connect (sigc::mem_fun (*this, &PluginSelector::refill));
        _fil_hidden_radio->signal_clicked().connect (sigc::mem_fun (*this, &PluginSelector::refill));
 
-       _fil_type_combo->signal_changed().connect (sigc::mem_fun (*this, &PluginSelector::refill));
-       _fil_creator_combo->signal_changed().connect (sigc::mem_fun (*this, &PluginSelector::refill));
-       _fil_channel_combo->signal_changed().connect (sigc::mem_fun (*this, &PluginSelector::refill));
+       _fil_type_combo.StateChanged.connect (sigc::mem_fun (*this, &PluginSelector::refill));
+       _fil_creator_combo.StateChanged.connect (sigc::mem_fun (*this, &PluginSelector::refill));
 
        /* TAG entry */
 
@@ -270,7 +257,7 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        tag_entry = manage (new Gtk::Entry);
        tag_entry_connection = tag_entry->signal_changed().connect (sigc::mem_fun (*this, &PluginSelector::tag_entry_changed));
 
-       Gtk::Button* tag_reset_button = manage (new Button (_("Reset")));
+       tag_reset_button = manage (new Button (_("Reset")));
        tag_reset_button->signal_clicked().connect (sigc::mem_fun (*this, &PluginSelector::tag_reset_button_clicked));
 
        Gtk::Label* tagging_help_label1 = manage (new Label(
@@ -282,7 +269,7 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        Gtk::Label* tagging_help_label3 = manage (new Label(
                _("Ex: \"dynamic de-esser vocal\" applies 3 Tags."), Gtk::ALIGN_LEFT));
 
-       p = 0;
+       int p = 0;
        tagging_table->attach (*tag_entry,           0, 1, p, p+1, FILL|EXPAND, FILL);
        tagging_table->attach (*tag_reset_button,    1, 2, p, p+1, FILL, FILL); p++;
        tagging_table->attach (*tagging_help_label1, 0, 2, p, p+1, FILL, FILL); p++;
@@ -334,6 +321,7 @@ PluginSelector::PluginSelector (PluginManager& mgr)
        plugin_display.grab_focus();
 
        build_plugin_menu ();
+       display_selection_changed ();
 }
 
 PluginSelector::~PluginSelector ()
@@ -386,6 +374,9 @@ PluginSelector::show_this_plugin (const PluginInfoPtr& info, const std::string&
 
                /* user asked to ignore filters */
                if (maybe_show && _search_ignore_checkbox->get_active()) {
+                       if (manager.get_status (info) == PluginManager::Hidden) {
+                               return false;
+                       }
                        return true;
                }
        }
@@ -410,85 +401,42 @@ PluginSelector::show_this_plugin (const PluginInfoPtr& info, const std::string&
                return false;
        }
 
-       if (manager.get_status (info) == PluginManager::Hidden) {
-               if (!_fil_hidden_radio->get_active() && !_fil_all_radio->get_active()) {
-                       return false;
-               }
+       if (!_fil_hidden_radio->get_active() && manager.get_status (info) == PluginManager::Hidden) {
+               return false;
        }
 
        /* Filter "type" combobox */
 
-       if (_fil_type_combo->get_active_text() == X_("VST") && PluginManager::to_generic_vst(info->type) != LXVST) {
+       if (_fil_type_combo.get_text() == X_("VST") && PluginManager::to_generic_vst(info->type) != LXVST) {
                return false;
        }
 
-       if (_fil_type_combo->get_active_text() == X_("AudioUnit") && info->type != AudioUnit) {
+       if (_fil_type_combo.get_text() == X_("AudioUnit") && info->type != AudioUnit) {
                return false;
        }
 
 #ifdef LV2_SUPPORT
-       if (_fil_type_combo->get_active_text() == X_("LV2") && info->type != LV2) {
+       if (_fil_type_combo.get_text() == X_("LV2") && info->type != LV2) {
                return false;
        }
 #endif
 
-       if (_fil_type_combo->get_active_text() == X_("LUA") && info->type != Lua) {
+       if (_fil_type_combo.get_text() == X_("Lua") && info->type != Lua) {
                return false;
        }
 
-       if (_fil_type_combo->get_active_text() == X_("LADSPA") && info->type != LADSPA) {
+       if (_fil_type_combo.get_text() == X_("LADSPA") && info->type != LADSPA) {
                return false;
        }
 
        /* Filter "creator" combobox */
 
-       if (_fil_creator_combo->get_active_text() != _("Show All Creators")) {
-               string cmp = info->creator;
-               if (cmp.length() > MAX_CREATOR_LEN) {
-                       cmp = cmp.substr (0, MAX_CREATOR_LEN);
-                       cmp.append("...");
-               }
-               if (_fil_creator_combo->get_active_text() != cmp) {
+       if (_fil_creator_combo.get_text() != _("Show All Creators")) {
+               if (_fil_creator_combo.get_text() != info->creator) {
                        return false;
                }
        }
 
-       /* Filter "I/O" combobox */
-
-       if (_fil_channel_combo->get_active_text() != _("Show All I/O") || info->reconfigurable_io ()) {
-
-#if 0
-               if (info->reconfigurable_io ()) {
-                       return true; // who knows.... ?
-               }
-#endif
-
-               if (_fil_channel_combo->get_active_text() == _("Audio I/O")) {
-                       if ((info->n_inputs.n_audio() == 0 || info->n_outputs.n_audio() == 0)) {
-                               return false;
-                       }
-               }
-
-               if (_fil_channel_combo->get_active_text() == _("Mono Audio I/O")) {
-                       if (info->n_inputs.n_audio() != 1 || info->n_outputs.n_audio() != 1) {
-                               return false;
-                       }
-               }
-
-               if (_fil_channel_combo->get_active_text() == _("Stereo Audio I/O")) {
-                       if (info->n_inputs.n_audio() != 2 || info->n_outputs.n_audio() != 2) {
-                               return false;
-                       }
-               }
-
-               if (_fil_channel_combo->get_active_text() == _("MIDI I/O (only)")) {
-                       if ((info->n_inputs.n_audio() != 0 || info->n_outputs.n_audio() == 0)) {
-                               return false;
-                       }
-               }
-
-       }
-
        return true;
 }
 
@@ -502,16 +450,17 @@ PluginSelector::setup_search_string (string& searchstr)
 void
 PluginSelector::set_sensitive_widgets ()
 {
-       if (_search_ignore_checkbox->get_active() && (search_entry.get_text() != "")) {
+       if (_search_ignore_checkbox->get_active() && !search_entry.get_text().empty()) {
                _fil_effects_radio->set_sensitive(false);
                _fil_instruments_radio->set_sensitive(false);
                _fil_utils_radio->set_sensitive(false);
                _fil_favorites_radio->set_sensitive(false);
                _fil_hidden_radio->set_sensitive(false);
                _fil_all_radio->set_sensitive(false);
-               _fil_type_combo->set_sensitive(false);
-               _fil_creator_combo->set_sensitive(false);
-               _fil_channel_combo->set_sensitive(false);
+               _inhibit_refill = true;
+               _fil_type_combo.set_sensitive(false);
+               _fil_creator_combo.set_sensitive(false);
+               _inhibit_refill = false;
        } else {
                _fil_effects_radio->set_sensitive(true);
                _fil_instruments_radio->set_sensitive(true);
@@ -519,16 +468,20 @@ PluginSelector::set_sensitive_widgets ()
                _fil_favorites_radio->set_sensitive(true);
                _fil_hidden_radio->set_sensitive(true);
                _fil_all_radio->set_sensitive(true);
-               _fil_type_combo->set_sensitive(true);
-               _fil_creator_combo->set_sensitive(true);
-               _fil_channel_combo->set_sensitive(true);
+               _inhibit_refill = true;
+               _fil_type_combo.set_sensitive(true);
+               _fil_creator_combo.set_sensitive(true);
+               _inhibit_refill = false;
+       }
+       if (!search_entry.get_text().empty()) {
+               refill ();
        }
 }
 
 void
 PluginSelector::refill ()
 {
-       if (inhibit_refill) {
+       if (_inhibit_refill) {
                return;
        }
 
@@ -536,6 +489,15 @@ PluginSelector::refill ()
 
        in_row_change = true;
 
+       plugin_display.set_model (Glib::RefPtr<Gtk::TreeStore>(0));
+
+       int sort_col;
+       SortType sort_type;
+       bool sorted = plugin_model->get_sort_column_id (sort_col, sort_type);
+
+       /* Disable sorting to gain performance */
+       plugin_model->set_sort_column (-2, SORT_ASCENDING);
+
        plugin_model->clear ();
 
        setup_search_string (searchstr);
@@ -549,6 +511,11 @@ PluginSelector::refill ()
        lua_refiller (searchstr);
 
        in_row_change = false;
+
+       plugin_display.set_model (plugin_model);
+       if (sorted) {
+               plugin_model->set_sort_column (sort_col, sort_type);
+       }
 }
 
 void
@@ -572,7 +539,6 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& searc
                        newrow[plugin_columns.name] = name;
 
                        newrow[plugin_columns.type_name] = type;
-                       newrow[plugin_columns.category] = (*i)->category;
 
                        /* Creator */
                        string creator = (*i)->creator;
@@ -615,7 +581,7 @@ PluginSelector::refiller (const PluginInfoList& plugs, const::std::string& searc
                        } else {
                                snprintf (buf, sizeof(buf), "%d / %d", (*i)->n_inputs.n_audio(), (*i)->n_outputs.n_audio());
                                newrow[plugin_columns.audio_io] = buf;
-                               snprintf (buf, sizeof(buf), "%d / %d", (*i)->n_inputs.n_audio(), (*i)->n_outputs.n_audio());
+                               snprintf (buf, sizeof(buf), "%d / %d", (*i)->n_inputs.n_midi(), (*i)->n_outputs.n_midi());
                                newrow[plugin_columns.midi_io] = buf;
                        }
 
@@ -705,6 +671,10 @@ PluginSelector::load_plugin (PluginInfoPtr pi)
 void
 PluginSelector::btn_add_clicked()
 {
+       if (plugin_display.get_selection()->count_selected_rows() == 0) {
+               /* may happen with ctrl + double-click un-selecting but activating a row */
+               return;
+       }
        std::string name;
        PluginInfoPtr pi;
        TreeModel::Row newrow = *(amodel->append());
@@ -745,12 +715,14 @@ PluginSelector::display_selection_changed()
                tag_entry->set_text (tags);
 
                tag_entry->set_sensitive (true);
+               tag_reset_button->set_sensitive (true);
                btn_add->set_sensitive (true);
 
        } else {
                tag_entry->set_text ("");
 
                tag_entry->set_sensitive (false);
+               tag_reset_button->set_sensitive (false);
                btn_add->set_sensitive (false);
        }
        tag_entry_connection.unblock ();
@@ -816,8 +788,8 @@ PluginSelector::run ()
                manager.save_statuses();
        }
 
-       if (_need_menu_rebuild) {
-               build_plugin_menu();
+       if ( _need_tag_save || _need_status_save || _need_menu_rebuild ) {
+               manager.PluginListChanged();  //emit signal
        }
 
        return (int) r;
@@ -832,17 +804,13 @@ PluginSelector::search_clear_button_clicked ()
 void
 PluginSelector::tag_reset_button_clicked ()
 {
-       /* XXX: this should probably be a backend function
-        * -> remove "category" from GUI and code-dup to set
-        * factory tags in PluginManager */
        if (plugin_display.get_selection()->count_selected_rows() != 0) {
                TreeModel::Row row = *(plugin_display.get_selection()->get_selected());
-               std::string str = row[plugin_columns.category];
-               std::transform (str.begin(), str.end(), str.begin(), ::tolower);
-
                ARDOUR::PluginInfoPtr pi = row[plugin_columns.plugin];
-               manager.set_tags (pi->type, pi->unique_id, str, true, true);
+               manager.reset_tags (pi);
+               display_selection_changed ();
                _need_tag_save = true;
+               _need_menu_rebuild = true;
        }
 }
 
@@ -850,7 +818,9 @@ void
 PluginSelector::search_entry_changed ()
 {
        set_sensitive_widgets();
-       refill ();
+       if (search_entry.get_text().empty()) {
+               refill ();
+       }
 }
 
 void
@@ -860,9 +830,10 @@ PluginSelector::tag_entry_changed ()
                TreeModel::Row row = *(plugin_display.get_selection()->get_selected());
 
                ARDOUR::PluginInfoPtr pi = row[plugin_columns.plugin];
-               manager.set_tags (pi->type, pi->unique_id, tag_entry->get_text(), false);
+               manager.set_tags (pi->type, pi->unique_id, tag_entry->get_text(), pi->name, PluginManager::FromGui);
 
                _need_tag_save = true;
+               _need_menu_rebuild = true;
        }
 }
 
@@ -877,11 +848,6 @@ PluginSelector::tags_changed (PluginType t, std::string unique_id, std::string t
                }
                row[plugin_columns.tags] = tags;
        }
-
-       /* A plugin's tags change while the user is entering them.
-        * defer a rebuilding of the "tag" menu until the dialog is closed.
-        */
-       _need_menu_rebuild = true;
 }
 
 void
@@ -895,12 +861,17 @@ PluginSelector::plugin_status_changed (PluginType t, std::string uid, PluginMana
                        (*i)[plugin_columns.hidden] = (stat == PluginManager::Hidden) ? true : false;
 
                        /* if plug was hidden, remove it from the view */
-                       if (stat==PluginManager::Hidden) {
+                       if (stat == PluginManager::Hidden) {
+                               if (!_fil_hidden_radio->get_active() && !_fil_all_radio->get_active()) {
+                                       plugin_model->erase(i);
+                               }
+                       } else if (_fil_hidden_radio->get_active()) {
                                plugin_model->erase(i);
                        }
-
-                       /* plugin menu must be re-built to accommodate Hidden and Favorite plugins */
-                       build_plugin_menu();
+                       /* if no longer a favorite, remove it from the view */
+                       if (stat != PluginManager::Favorite && _fil_favorites_radio->get_active()) {
+                                       plugin_model->erase(i);
+                       }
 
                        return;
                }
@@ -1062,11 +1033,11 @@ PluginSelector::create_favs_menu (PluginInfoList& all_plugs)
 Gtk::Menu*
 PluginSelector::create_by_creator_menu (ARDOUR::PluginInfoList& all_plugs)
 {
-       inhibit_refill = true;
-       _fil_creator_combo->clear();
-       _fil_creator_combo->append_text (_("Show All Creators"));
-       _fil_creator_combo->set_active_text (_("Show All Creators"));
-       inhibit_refill = false;
+       _inhibit_refill = true;
+       _fil_creator_combo.clear_items ();
+       _fil_creator_combo.append_text_item (_("Show All Creators"));
+       _fil_creator_combo.set_text (_("Show All Creators"));
+       _inhibit_refill = false;
 
        using namespace Menu_Helpers;
 
@@ -1085,32 +1056,12 @@ PluginSelector::create_by_creator_menu (ARDOUR::PluginInfoList& all_plugs)
                if (manager.get_status (*i) == PluginManager::Hidden) continue;
 
                string creator = (*i)->creator;
-               string::size_type pos = 0;
-
-               if ((*i)->type == ARDOUR::LADSPA) {
-                       /* stupid LADSPA creator strings */
-#ifdef PLATFORM_WINDOWS
-                       while (pos < creator.length() && creator[pos] > -2 && creator[pos] < 256 && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
-#else
-                       while (pos < creator.length() && (isalnum (creator[pos]) || isspace (creator[pos]))) ++pos;
-#endif
-               } else {
-                       pos = creator.length ();
-               }
 
                /* If there were too few characters to create a
                 * meaningful name, mark this creator as 'Unknown'
                 */
-               if (creator.length() < 2 || pos < 3) {
+               if (creator.length() < 2) {
                        creator = "Unknown";
-               } else{
-                       creator = creator.substr (0, pos);
-               }
-
-               /* trim the creator length so we don't make a giant pulldown menu */
-               if (creator.length() > MAX_CREATOR_LEN) {
-                       creator = creator.substr (0, MAX_CREATOR_LEN);
-                       creator.append("...");
                }
 
                SubmenuMap::iterator x;
@@ -1119,7 +1070,7 @@ PluginSelector::create_by_creator_menu (ARDOUR::PluginInfoList& all_plugs)
                        submenu = x->second;
                } else {
 
-                       _fil_creator_combo->append_text(creator);
+                       _fil_creator_combo.append_text_item (creator);
 
                        submenu = new Gtk::Menu;
                        by_creator_items.push_back (MenuElem (creator, *manage (submenu)));
@@ -1147,7 +1098,7 @@ PluginSelector::create_by_tags_menu (ARDOUR::PluginInfoList& all_plugs)
        by_tags->set_name("ArdourContextMenu");
        MenuList& by_tags_items = by_tags->items();
 
-       std::vector<std::string> all_tags = manager.get_all_tags(false);
+       std::vector<std::string> all_tags = manager.get_all_tags (PluginManager::NoHidden);
        for (vector<string>::iterator t = all_tags.begin(); t != all_tags.end(); ++t) {
                Gtk::Menu *submenu = new Gtk::Menu;
                by_tags_items.push_back (MenuElem (*t, *manage (submenu)));
@@ -1169,12 +1120,11 @@ PluginSelector::create_by_tags_menu (ARDOUR::PluginInfoList& all_plugs)
                        Gtk::Menu* submenu;
                        if ((x = tags_submenu_map.find (*t)) != tags_submenu_map.end()) {
                                submenu = x->second;
-                       } else {
+                               string typ = GetPluginTypeStr(*i);
+                               MenuElem elem ((*i)->name + typ, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
+                               elem.get_child()->set_use_underline (false);
+                               submenu->items().push_back (elem);
                        }
-                       string typ = GetPluginTypeStr(*i);
-                       MenuElem elem ((*i)->name + typ, (sigc::bind (sigc::mem_fun (*this, &PluginSelector::plugin_chosen_from_menu), *i)));
-                       elem.get_child()->set_use_underline (false);
-                       submenu->items().push_back (elem);
                }
        }
        return by_tags;
@@ -1222,6 +1172,7 @@ PluginSelector::favorite_changed (const std::string& path)
                manager.set_status (pi->type, pi->unique_id, status);
 
                _need_status_save = true;
+               _need_menu_rebuild = true;
        }
        in_row_change = false;
 }
@@ -1254,6 +1205,7 @@ PluginSelector::hidden_changed (const std::string& path)
                manager.set_status (pi->type, pi->unique_id, status);
 
                _need_status_save = true;
+               _need_menu_rebuild = true;
        }
        in_row_change = false;
 }