Hint that plugin-scan may wait for user-interaction after 30sec

This commit is contained in:
Robin Gareus 2021-07-17 01:08:05 +02:00
parent 1ef0c49aee
commit 4d15326a78
Signed by: rgareus
GPG Key ID: A090BCE02CF57F04
2 changed files with 16 additions and 0 deletions

View File

@ -54,7 +54,12 @@ PluginScanDialog::PluginScanDialog (bool just_cached, bool v, Gtk::Window* paren
vbox->set_size_request(400,-1);
message.set_padding (12, 12);
timeout_info.set_padding (12, 12);
vbox->pack_start (message);
vbox->pack_start (timeout_info);
timeout_info.set_markup (string_compose ("<span weight=\"bold\">%1</span>", _("Scan takes a long time, check for popup dialogs.")));
timeout_info.set_no_show_all ();
cancel_button.set_name ("EditorGTKButton");
cancel_button.signal_clicked().connect (sigc::mem_fun (*this, &PluginScanDialog::cancel_plugin_scan));
@ -187,10 +192,14 @@ PluginScanDialog::plugin_scan_timeout (int timeout)
if (timeout > 0) {
pbar.set_sensitive (true);
if (timeout < scan_timeout / 2 || (scan_timeout - timeout) > 300) {
timeout_info.show ();
}
if (timeout < scan_timeout) {
pbar.set_text(_("Scan Timeout"));
} else {
pbar.set_text(_("Scanning"));
timeout_info.hide ();
}
timeout_button.set_sensitive (timeout < scan_timeout);
all_timeout_button.set_sensitive (timeout < scan_timeout);
@ -202,11 +211,15 @@ PluginScanDialog::plugin_scan_timeout (int timeout)
pbar.pulse ();
timeout_button.set_sensitive (false);
tbox.show();
if (timeout <= -300) {
timeout_info.show ();
}
} else {
pbar.set_sensitive (false);
timeout_button.set_sensitive (false);
all_timeout_button.set_sensitive (false);
tbox.hide();
timeout_info.hide ();
}
ARDOUR_UI::instance()->gui_idle_handler ();
@ -217,6 +230,8 @@ PluginScanDialog::message_handler (std::string type, std::string plugin, bool ca
{
DEBUG_TRACE (DEBUG::GuiStartup, string_compose (X_("plugin scan message: %1 cancel? %2\n"), type, can_cancel));
timeout_info.hide ();
if (type == X_("closeme") && !is_mapped()) {
return;
}

View File

@ -34,6 +34,7 @@ class PluginScanDialog : public ArdourDialog
private:
Gtk::Label message;
Gtk::Label timeout_info;
Gtk::ProgressBar pbar;
Gtk::HBox tbox;
Gtk::Button timeout_button;