X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=gtk2_ardour%2Fstartup.cc;h=b481e434d14de5438438fed8c3b7f94bdd299aa2;hb=d53af10c9261172c57dbc66b6b4d1143b37bbcae;hp=4410410ef8d326cd6a703216d579d7870a1640dc;hpb=d57546dea2e23cc31f5c2c46fa43b7aa82935677;p=ardour.git diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc index 4410410ef8..b481e434d1 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,34 +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); } - -#ifdef __APPLE__ - setup_prerelease_page (); -#endif - + setup_new_user_page (); setup_first_time_config_page (); setup_monitoring_choice_page (); @@ -119,46 +119,11 @@ ArdourStartup::~ArdourStartup () bool ArdourStartup::required () { - return !Glib::file_test (been_here_before_path(), Glib::FILE_TEST_EXISTS); -} - -std::string -ArdourStartup::been_here_before_path () -{ - return Glib::build_filename (user_config_directory (), ".a" PROGRAM_VERSION); -} - -void -ArdourStartup::setup_prerelease_page () -{ - VBox* vbox = manage (new VBox); - Label* label = manage (new Label); - label->set_markup (string_compose (_("Welcome to this BETA release of Ardour %1\n\n\ -Ardour %1 has been released for Linux but because of the lack of testers,\n\ -it is still at the beta stage on OS X. So, a few guidelines:\n\ -\n\ -1) Please do NOT use this software with the expectation that it is stable or reliable\n\ - though it may be so, depending on your workflow.\n\ -2) Please do NOT use the forums at ardour.org to report issues.\n\ -3) Please DO use the bugtracker at http://tracker.ardour.org/ to report issues\n\ - making sure to note the product version number as %1-beta.\n\ -4) Please DO use the ardour-users mailing list to discuss ideas and pass on comments.\n\ -5) Please DO join us on IRC for real time discussions about ardour3. You\n\ - can get there directly from Ardour via the Help->Chat menu option.\n\ -\n\ -Full information on all the above can be found on the support page at\n\ -\n\ - http://ardour.org/support\n\ -"), VERSIONSTRING)); + if (Glib::file_test (ARDOUR::been_here_before_path (), Glib::FILE_TEST_EXISTS)) { + return false; + } - vbox->set_border_width (12); - vbox->pack_start (*label, false, false, 12); - vbox->show_all (); - - append_page (*vbox); - set_page_type (*vbox, ASSISTANT_PAGE_CONTENT); - set_page_title (*vbox, _("This is a BETA RELEASE")); - set_page_complete (*vbox, true); + return true; } void @@ -202,7 +167,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 (); } @@ -289,6 +254,9 @@ Please choose whichever one is right for your setup.\n\n\ set_page_title (mon_vbox, _("Monitoring Choices")); set_page_header_image (mon_vbox, icon_pixbuf); + monitor_via_hardware_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed)); + monitor_via_ardour_button.signal_toggled().connect (sigc::mem_fun (*this, &ArdourStartup::config_changed)); + /* user could just click on "Forward" if default * choice is correct. */ @@ -370,13 +338,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 @@ -397,6 +384,14 @@ ArdourStartup::on_delete_event (GdkEventAny*) void ArdourStartup::on_apply () { + /* file-chooser button does not emit 'current_folder_changed' signal + * when a folder from the dropdown or the sidebar is chosen. + * -> explicitly poll for the dir as suggested by the gtk documentation. + */ + if (default_dir_chooser && default_dir_chooser->get_filename() != Config->get_default_session_parent_dir ()) { + config_modified = true; + } + if (config_modified) { if (default_dir_chooser) { @@ -419,10 +414,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 (); } @@ -433,6 +428,3 @@ ArdourStartup::move_along_now () { on_apply (); } - - -