offer to scan for plugins at first start.
authorRobin Gareus <robin@gareus.org>
Thu, 16 Jul 2015 19:11:22 +0000 (21:11 +0200)
committerRobin Gareus <robin@gareus.org>
Thu, 16 Jul 2015 19:11:22 +0000 (21:11 +0200)
gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui.h
gtk2_ardour/startup.cc
gtk2_ardour/startup.h

index dea062d9d99f666a8d4f192f63e56ffc948e0523..2f4d19c2a67b303a59f872e2387c1116b2d4f49c 100644 (file)
@@ -231,6 +231,7 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir, UIConfi
        , nsm (0)
        , _was_dirty (false)
        , _mixer_on_top (false)
+       , _initial_verbose_plugin_scan (false)
        , first_time_engine_run (true)
        , roll_controllable (new TransportControllable ("transport roll", *this, TransportControllable::Roll))
        , stop_controllable (new TransportControllable ("transport stop", *this, TransportControllable::Stop))
@@ -917,10 +918,12 @@ ARDOUR_UI::starting ()
        } else  {
                
                if (brand_new_user) {
+                       _initial_verbose_plugin_scan = true;
                        ArdourStartup s;
                        s.present ();
                        main().run();
                        s.hide ();
+                       _initial_verbose_plugin_scan = false;
                        switch (s.response ()) {
                        case Gtk::RESPONSE_OK:
                                break;
@@ -4253,7 +4256,7 @@ ARDOUR_UI::plugin_scan_dialog (std::string type, std::string plugin, bool can_ca
        }
 
        const bool cancelled = PluginManager::instance().cancelled();
-       if (type != X_("closeme") && !ui_config->get_show_plugin_scan_window()) {
+       if (type != X_("closeme") && (!ui_config->get_show_plugin_scan_window()) && !_initial_verbose_plugin_scan) {
                if (cancelled && scan_dlg->is_mapped()) {
                        scan_dlg->hide();
                        gui_idle_handler();
index b6ec8a87991df3428981cb10e7f99382750f41d1..722a0bf5961ed88a803df15f075b1da3cf1b32f5 100644 (file)
@@ -336,6 +336,7 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
        NSM_Client*          nsm;
        bool                _was_dirty;
         bool                _mixer_on_top;
+        bool                _initial_verbose_plugin_scan;
         bool first_time_engine_run;
 
        void goto_editor_window ();
index d4c8686698cdb1cd63a54768341ae828c7e1b831..719e94f2412e515269b25f97b3c2995f022fc393 100644 (file)
 
 #include "ardour/audioengine.h"
 #include "ardour/filesystem_paths.h"
+#include "ardour/filename_extensions.h"
+#include "ardour/plugin_manager.h"
 #include "ardour/recent_sessions.h"
 #include "ardour/session.h"
 #include "ardour/session_state_utils.h"
 #include "ardour/template_utils.h"
-#include "ardour/filename_extensions.h"
 
 #include "ardour_ui.h"
 #include "startup.h"
@@ -343,13 +344,30 @@ void
 ArdourStartup::setup_final_page ()
 {
        string msg = string_compose (_("%1 is ready for use"), PROGRAM_NAME);
-       
-       final_page.set_markup (string_compose ("<span weight=\"bold\" size=\"large\">%1</span>", msg));
-       final_page.show ();
-       final_page_index = append_page (final_page);
-       set_page_complete (final_page, true);
-       set_page_header_image (final_page, icon_pixbuf);
-       set_page_type (final_page, ASSISTANT_PAGE_CONFIRM);
+
+       plugin_disco_button.signal_clicked().connect (sigc::mem_fun(*this, &ArdourStartup::discover_plugins));
+       plugin_disco_button.set_label (_("Scan for Plugins"));
+       plugin_disco_button.show ();
+
+       Gtk::Label* final_label = manage (new Label);
+       final_label->set_markup (string_compose ("<span weight=\"bold\" size=\"large\">%1</span>", msg));
+       final_label->show ();
+
+       VBox* vbox = manage (new VBox);
+       vbox->pack_start (*final_label, true, true);
+       vbox->pack_start (plugin_disco_button, true, false);
+       vbox->show ();
+
+       final_page_index = append_page (*vbox);
+       set_page_complete (*vbox, true);
+       set_page_header_image (*vbox, icon_pixbuf);
+       set_page_type (*vbox, ASSISTANT_PAGE_CONFIRM);
+}
+
+void
+ArdourStartup::discover_plugins () {
+       plugin_disco_button.set_sensitive (false);
+       PluginManager::instance().refresh();
 }
 
 void
index a93a29ef4238f90260bb2b895c7654131aa6d45e..74e0aee6b8835471ad861b5b819f1661dff292c0 100644 (file)
@@ -63,6 +63,7 @@ class ArdourStartup : public Gtk::Assistant {
        void on_apply ();
        void on_cancel ();
        bool on_delete_event (GdkEventAny*);
+       void discover_plugins ();
 
        static ArdourStartup *the_startup;
 
@@ -101,7 +102,7 @@ class ArdourStartup : public Gtk::Assistant {
        /* final page */
 
        void setup_final_page ();
-       Gtk::Label final_page;
+       Gtk::Button plugin_disco_button;
 
        /* always there */