summaryrefslogtreecommitdiff
path: root/gtk2_ardour/plugin_selector.cc
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2008-04-26 00:54:24 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2008-04-26 00:54:24 +0000
commit12f2c337e38d910c21127b3cdc50608724471daa (patch)
tree6a66fa7cefd72e4be5958537eada23ae7ec4d0c7 /gtk2_ardour/plugin_selector.cc
parent8d77188f56a2daf2738471a913f71b0f6f689602 (diff)
add "favorites only" filter to plugin manager dialog
git-svn-id: svn://localhost/ardour2/branches/2.0-ongoing@3290 d708f5d6-7413-0410-9779-e7cbd77b26cf
Diffstat (limited to 'gtk2_ardour/plugin_selector.cc')
-rw-r--r--gtk2_ardour/plugin_selector.cc18
1 files changed, 15 insertions, 3 deletions
diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc
index f812ac0f39..b17d9c6079 100644
--- a/gtk2_ardour/plugin_selector.cc
+++ b/gtk2_ardour/plugin_selector.cc
@@ -52,6 +52,7 @@ static const char* _filter_mode_strings[] = {
N_("Type contains"),
N_("Author contains"),
N_("Library contains"),
+ N_("Favorites only"),
0
};
@@ -199,6 +200,10 @@ PluginSelector::show_this_plugin (const PluginInfoPtr& info, const std::string&
std::string compstr;
std::string mode = filter_mode.get_active_text ();
+ if (mode == _("Favorites only")) {
+ return manager->is_a_favorite_plugin (info);
+ }
+
if (!filterstr.empty()) {
if (mode == _("Name contains")) {
@@ -209,8 +214,8 @@ PluginSelector::show_this_plugin (const PluginInfoPtr& info, const std::string&
compstr = info->creator;
} else if (mode == _("Library contains")) {
compstr = info->path;
- }
-
+ }
+
transform (compstr.begin(), compstr.end(), compstr.begin(), ::toupper);
if (compstr.find (filterstr) != string::npos) {
@@ -218,7 +223,6 @@ PluginSelector::show_this_plugin (const PluginInfoPtr& info, const std::string&
} else {
return false;
}
-
}
return true;
@@ -442,6 +446,14 @@ PluginSelector::filter_entry_changed ()
void
PluginSelector::filter_mode_changed ()
{
+ std::string mode = filter_mode.get_active_text ();
+
+ if (mode == _("Favorites only")) {
+ filter_entry.set_sensitive (false);
+ } else {
+ filter_entry.set_sensitive (true);
+ }
+
refill ();
}