diff --git a/gtk2_ardour/ardour_ui_session.cc b/gtk2_ardour/ardour_ui_session.cc index 1b6c4baff7..8641e16aff 100644 --- a/gtk2_ardour/ardour_ui_session.cc +++ b/gtk2_ardour/ardour_ui_session.cc @@ -50,6 +50,7 @@ #include "ardour/audioengine.h" #include "ardour/filename_extensions.h" +#include "ardour/plugin_manager.h" #include "ardour/profile.h" #include "ardour/session.h" #include "ardour/session_utils.h" @@ -62,6 +63,7 @@ #include "missing_filesource_dialog.h" #include "missing_plugin_dialog.h" #include "opts.h" +#include "plugin_scan_dialog.h" #include "public_editor.h" #include "save_as_dialog.h" #include "session_dialog.h" @@ -480,9 +482,17 @@ ARDOUR_UI::load_session_stage_two (const std::string& path, const std::string& s } { list const u = new_session->unknown_processors (); + bool scan_now = false; if (!u.empty()) { - MissingPluginDialog d (_session, u); - d.run (); + MissingPluginDialog d (_session, u, PluginManager::instance ().cache_valid ()); + if (d.run () == RESPONSE_YES) { + scan_now = true; + } + } + if (scan_now) { + PluginScanDialog psd (false, true); + psd.start (); + show_plugin_manager (); } } diff --git a/gtk2_ardour/missing_plugin_dialog.cc b/gtk2_ardour/missing_plugin_dialog.cc index 97e7625b0c..163259721f 100644 --- a/gtk2_ardour/missing_plugin_dialog.cc +++ b/gtk2_ardour/missing_plugin_dialog.cc @@ -20,7 +20,10 @@ */ #include + +#include "pbd/compose.h" #include "missing_plugin_dialog.h" + #include "pbd/i18n.h" using namespace Gtk; @@ -28,7 +31,7 @@ using namespace std; using namespace ARDOUR; using namespace PBD; -MissingPluginDialog::MissingPluginDialog (Session * s, list const & plugins) +MissingPluginDialog::MissingPluginDialog (Session* s, list const & plugins, bool cache_valid) : ArdourDialog (_("Missing Plugins"), true, false) { /* This dialog is always shown programatically. Center the window.*/ @@ -36,22 +39,34 @@ MissingPluginDialog::MissingPluginDialog (Session * s, list const & plug set_session (s); - add_button (_("OK"), RESPONSE_OK); - set_default_response (RESPONSE_OK); - - Label* m = manage (new Label); - stringstream t; t << _("This session contains the following plugins that cannot be found on this system:\n\n"); for (list::const_iterator i = plugins.begin(); i != plugins.end(); ++i) { t << *i << "\n"; } + t << _("\nThose plugins will be replaced with inactive stubs.\n"); - t << _("\nThose plugins will be replaced with inactive stubs.\n" - "It is recommended that you install the missing plugins and re-load the session.\n" - "(also check the blacklist, Window > Log and Preferences > Plugins)"); + if (cache_valid) { + add_button (_("OK"), RESPONSE_OK); + set_default_response (RESPONSE_OK); + t << _("It is recommended that you install the missing plugins and re-load the session.\n"); + } else { + t << _("Third party plugins have not yet been indexed.\n"); + t << string_compose (_("Scan %1 plugins now?"), +#ifdef __APPLE__ + _("AudioUnit and VST") +#else + _("VST") +#endif + ); + add_button (_("Yes"), RESPONSE_YES); + add_button (_("No"), RESPONSE_NO); + set_default_response (RESPONSE_YES); + } + + Label* m = manage (new Label); m->set_markup (t.str ()); get_vbox()->pack_start (*m, false, false); diff --git a/gtk2_ardour/missing_plugin_dialog.h b/gtk2_ardour/missing_plugin_dialog.h index ff43275914..570e8bfe24 100644 --- a/gtk2_ardour/missing_plugin_dialog.h +++ b/gtk2_ardour/missing_plugin_dialog.h @@ -30,7 +30,7 @@ namespace ARDOUR { class MissingPluginDialog : public ArdourDialog { public: - MissingPluginDialog (ARDOUR::Session *, std::list const &); + MissingPluginDialog (ARDOUR::Session*, std::list const &, bool); }; #endif /* __gtk_ardour_missing_plugin_dialog_h__ */ diff --git a/gtk2_ardour/plugin_selector.cc b/gtk2_ardour/plugin_selector.cc index f0903d6b97..8c559eecdc 100644 --- a/gtk2_ardour/plugin_selector.cc +++ b/gtk2_ardour/plugin_selector.cc @@ -1237,15 +1237,22 @@ PluginSelector::show_manager () #endif , false, MESSAGE_QUESTION, BUTTONS_YES_NO); + q.set_title (string_compose (_("Discover %1 Plugins?"), #ifdef __APPLE__ - q.set_title (_("Discover VST/AU Plugins?")); - q.set_secondary_text (_("Third party plugins have not yet been indexed. AudioUnit and VST plugins have to be scanned before they can be used. This can also be done manually from Preferences > Plugins. Depending on the number of installed plugins the process can take several minutes.")); -#else - q.set_title (_("Discover VST Plugins?")); - q.set_secondary_text (_("Third party plugins have not yet been indexed. VST plugins have to be scanned before they can be used. This can also be done manually from Preferences > Plugins. Depending on the number of installed plugins the process can take several minutes.")); + _("VST/AU") #endif + _("VST") + )); - if (q.run () == RESPONSE_YES) { + q.set_secondary_text (string_compose (_("Third party plugins have not yet been indexed. %1 plugins have to be scanned before they can be used. This can also be done manually from Window > Plugin Manager. Depending on the number of installed plugins the process can take several minutes."), +#ifdef __APPLE__ + _("AudioUnit and VST") +#else + _("VST") +#endif + )); + + if (q.run () == RESPONSE_YES) { scan_now = true; } }