X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fstartup.cc;h=12f98916bf30188048617390943b32bebd83cf7f;hb=65c2e089ab263c83bff7d2e945b80c53f80b749b;hp=d4c8686698cdb1cd63a54768341ae828c7e1b831;hpb=91fac4c96dc6210dcc056da70dc608700d7eb570;p=ardour.git diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index d4c8686698..12f98916bf 100644 --- a/gtk2_ardour/startup.cc +++ b/gtk2_ardour/startup.cc @@ -22,13 +22,16 @@ #include "gtk2ardour-version.h" #endif -#include #include +#include + +#include "pbd/gstdio_compat.h" #include #include #include "pbd/failed_constructor.h" +#include "pbd/scoped_file_descriptor.h" #include "pbd/file_utils.h" #include "pbd/replace_all.h" #include "pbd/whitespace.h" @@ -37,17 +40,18 @@ #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/profile.h" -#include "ardour_ui.h" #include "startup.h" #include "opts.h" #include "engine_dialog.h" -#include "i18n.h" +#include "pbd/i18n.h" #include "utils.h" using namespace std; @@ -75,30 +79,30 @@ ArdourStartup::ArdourStartup () { set_position (WIN_POS_CENTER); set_border_width (12); - - if ((icon_pixbuf = ::get_icon ("ardour_icon_48px")) == 0) { + + if (! (icon_pixbuf = ::get_icon (PROGRAM_NAME "-icon_48px"))) { throw failed_constructor(); } - + list > window_icons; Glib::RefPtr icon; - - if ((icon = ::get_icon ("ardour_icon_16px")) != 0) { + + if ((icon = ::get_icon (PROGRAM_NAME "-icon_16px"))) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_22px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_22px"))) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_32px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_32px"))) { window_icons.push_back (icon); } - if ((icon = ::get_icon ("ardour_icon_48px")) != 0) { + if ((icon = ::get_icon (PROGRAM_NAME "-icon_48px"))) { window_icons.push_back (icon); } if (!window_icons.empty ()) { set_default_icon_list (window_icons); } - + setup_new_user_page (); setup_first_time_config_page (); setup_monitoring_choice_page (); @@ -120,12 +124,12 @@ ArdourStartup::required () */ const int current_version = atoi (PROGRAM_VERSION); - + for (int v = current_version; v != 0; --v) { if (Glib::file_test (ARDOUR::been_here_before_path (v), Glib::FILE_TEST_EXISTS)) { if (v != current_version) { /* older version exists, create the current one */ - ofstream fout (been_here_before_path (current_version).c_str()); + PBD::ScopedFileDescriptor fout (g_open (been_here_before_path (current_version).c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666)); } return false; } @@ -175,7 +179,7 @@ ArdourStartup::default_dir_changed () { Config->set_default_session_parent_dir (default_dir_chooser->get_filename()); // make new session folder chooser point to the new default - new_folder_chooser.set_current_folder (Config->get_default_session_parent_dir()); + new_folder_chooser.set_current_folder (Config->get_default_session_parent_dir()); config_changed (); } @@ -343,13 +347,32 @@ void ArdourStartup::setup_final_page () { string msg = string_compose (_("%1 is ready for use"), PROGRAM_NAME); - - final_page.set_markup (string_compose ("%1", 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 ("%1", msg)); + final_label->show (); + + VBox* vbox = manage (new VBox); + vbox->pack_start (*final_label, true, true); + if (!Profile->get_mixbus()) { + 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 @@ -400,10 +423,10 @@ ArdourStartup::on_apply () /* "touch" the been-here-before path now we've successfully made it through the first time setup (at least) */ - ofstream fout (been_here_before_path().c_str()); + PBD::ScopedFileDescriptor fout (g_open (been_here_before_path ().c_str(), O_CREAT|O_TRUNC|O_RDWR, 0666)); } - + _response = RESPONSE_OK; gtk_main_quit (); }