summaryrefslogtreecommitdiff
path: root/gtk2_ardour/ardour_ui.cc
diff options
context:
space:
mode:
authorRobin Gareus <robin@gareus.org>2014-02-25 14:52:57 +0100
committerRobin Gareus <robin@gareus.org>2014-02-25 14:57:59 +0100
commitd8329d855dab6199afef27cc8635472ddca0fe7b (patch)
treef74e8e82bedda1137c3511d9b521342e0a5e66dc /gtk2_ardour/ardour_ui.cc
parent0708721b4f9fca3967a6f1c436717ff2aca0baec (diff)
implement plugin-scan cancel-button sensitivity
Diffstat (limited to 'gtk2_ardour/ardour_ui.cc')
-rw-r--r--gtk2_ardour/ardour_ui.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index 55572ad392..31e401a0fd 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -306,7 +306,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
ARDOUR::FileSource::AmbiguousFileName.connect_same_thread (forever_connections, boost::bind (&ARDOUR_UI::ambiguous_file, this, _1, _2));
/* also plugin scan messages */
- ARDOUR::PluginScanMessage.connect (forever_connections, MISSING_INVALIDATOR, boost::bind(&ARDOUR_UI::plugin_scan_dialog, this, _1, _2), gui_context());
+ ARDOUR::PluginScanMessage.connect (forever_connections, MISSING_INVALIDATOR, boost::bind(&ARDOUR_UI::plugin_scan_dialog, this, _1, _2, _3), gui_context());
ARDOUR::GUIIdle.connect (forever_connections, MISSING_INVALIDATOR, boost::bind(&ARDOUR_UI::gui_idle_handler, this), gui_context());
@@ -3805,16 +3805,17 @@ ARDOUR_UI::cancel_plugin_scan ()
static MessageDialog *scan_dlg = NULL;
void
-ARDOUR_UI::plugin_scan_dialog (std::string type, std::string plugin)
+ARDOUR_UI::plugin_scan_dialog (std::string type, std::string plugin, bool can_cancel)
{
if (!Config->get_show_plugin_scan_window()) { return; }
+ static Gtk::Button *cancel_button;
if (!scan_dlg) {
scan_dlg = new MessageDialog("", false, MESSAGE_INFO, BUTTONS_NONE);
VBox* vbox = scan_dlg->get_vbox();
vbox->set_size_request(400,-1);
scan_dlg->set_title (_("Scanning for plugins"));
- Gtk::Button *cancel_button = manage(new Gtk::Button(_("Cancel plugin scan")));
+ cancel_button = manage(new Gtk::Button(_("Cancel plugin scan")));
cancel_button->set_name ("EditorGTKButton");
cancel_button->signal_clicked().connect ( mem_fun (*this, &ARDOUR_UI::cancel_plugin_scan) );
@@ -3827,6 +3828,7 @@ ARDOUR_UI::plugin_scan_dialog (std::string type, std::string plugin)
scan_dlg->set_message(type + ": " + Glib::path_get_basename(plugin));
scan_dlg->show_all();
}
+ cancel_button->set_sensitive(can_cancel);
/* due to idle calls, gtk_events_pending() may always return true */
int timeout = 30;