From 0bc6a319f10f3e7a285af627e5983bd86f6ec847 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Tue, 27 Apr 2010 19:58:31 +0000 Subject: Don't close the plugin manager when an incompatible plugin is selected. Fixes #1194. git-svn-id: svn://localhost/ardour2/branches/3.0@7006 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/plugin_selector.cc | 45 ++++++++++++++++++++++++------------------ 1 file changed, 26 insertions(+), 19 deletions(-) (limited to 'gtk2_ardour/plugin_selector.cc') diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index 890c09ede2..7953290b00 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -63,7 +63,7 @@ static const char* _filter_mode_strings[] = { }; PluginSelector::PluginSelector (PluginManager *mgr) - : ArdourDialog (_("ardour: plugins"), true, false), + : ArdourDialog (_("Plugin Manager"), true, false), filter_button (Stock::CLEAR) { set_position (Gtk::WIN_POS_MOUSE); @@ -442,29 +442,36 @@ PluginSelector::run () { ResponseType r; TreeModel::Children::iterator i; - SelectedPlugins plugins; - r = (ResponseType) Dialog::run (); + bool finish = false; + + while (!finish) { - switch (r) { - case RESPONSE_APPLY: - for (i = amodel->children().begin(); i != amodel->children().end(); ++i) { - PluginInfoPtr pp = (*i)[acols.plugin]; - PluginPtr p = load_plugin (pp); - if (p) { - plugins.push_back (p); + SelectedPlugins plugins; + r = (ResponseType) Dialog::run (); + + switch (r) { + case RESPONSE_APPLY: + for (i = amodel->children().begin(); i != amodel->children().end(); ++i) { + PluginInfoPtr pp = (*i)[acols.plugin]; + PluginPtr p = load_plugin (pp); + if (p) { + plugins.push_back (p); + } } + if (interested_object && !plugins.empty()) { + finish = !interested_object->use_plugins (plugins); + } + + break; + + default: + finish = true; + break; } - if (interested_object && !plugins.empty()) { - interested_object->use_plugins (plugins); - } - - break; - - default: - break; } - + + hide(); amodel->clear(); interested_object = 0; -- cgit v1.2.3