make notice about mismatched session/ardour versions more prominent, since you can guarantee that people are going to do this after release

git-svn-id: svn://localhost/ardour2/branches/3.0@14138 d708f5d6-7413-0410-9779-e7cbd77b26cf
This commit is contained in:
Paul Davis 2013-03-04 21:57:29 +00:00
parent ae85663fa7
commit 91ff55bd89
6 changed files with 45 additions and 5 deletions

View File

@ -234,6 +234,8 @@ ARDOUR_UI::ARDOUR_UI (int *argcp, char **argvp[], const char* localedir)
ARDOUR::Diskstream::DiskOverrun.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::disk_overrun_handler, this), gui_context());
ARDOUR::Diskstream::DiskUnderrun.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::disk_underrun_handler, this), gui_context());
ARDOUR::Session::VersionMismatch.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_format_mismatch, this, _1, _2), gui_context());
/* handle dialog requests */
ARDOUR::Session::Dialog.connect (forever_connections, MISSING_INVALIDATOR, boost::bind (&ARDOUR_UI::session_dialog, this, _1), gui_context());
@ -3721,3 +3723,14 @@ ARDOUR_UI::midi_panic ()
_session->midi_panic();
}
}
void
ARDOUR_UI::session_format_mismatch (std::string xml_path, std::string backup_path)
{
MessageDialog msg (string_compose (_("This is a session from an older version of Ardour.\n\n"
"Ardour has copied the old session file\n\n%1\n\nto\n\n%2\n\n"
"Use %2 with older versions of %3 from now on"),
xml_path, backup_path, PROGRAM_NAME));
msg.run ();
}

View File

@ -642,6 +642,8 @@ class ARDOUR_UI : public Gtkmm2ext::UI, public ARDOUR::SessionHandlePtr
void disk_overrun_handler ();
void disk_underrun_handler ();
void session_format_mismatch (std::string, std::string);
void session_dialog (std::string);
int pending_state_dialog ();
int sr_mismatch_dialog (ARDOUR::framecnt_t, ARDOUR::framecnt_t);

View File

@ -404,6 +404,8 @@ Where would you like new %1 sessions to be stored by default?\n\n\
vbox->pack_start (*txt, false, false);
vbox->pack_start (*hbox, false, true);
cerr << "Setting defaultDIR session dir to [" << Config->get_default_session_parent_dir() << "]\n";
default_dir_chooser->set_current_folder (poor_mans_glob (Config->get_default_session_parent_dir()));
default_dir_chooser->signal_current_folder_changed().connect (sigc::mem_fun (*this, &ArdourStartup::default_dir_changed));
default_dir_chooser->show ();
@ -718,9 +720,26 @@ ArdourStartup::populate_session_templates ()
}
}
void
showmecf (GtkWidget* fc)
{
printf ("current folder just changed to %s\n", gtk_file_chooser_get_current_folder (GTK_FILE_CHOOSER(fc)));
printf ("current filename is currently %s\n", gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(fc)));
printf ("widget name is %s\n", gtk_widget_get_name (fc));
}
void
showmefs (GtkWidget * fcb)
{
printf ("file set, currently %s\n", gtk_file_chooser_get_filename (GTK_FILE_CHOOSER(fcb)));
}
void
ArdourStartup::setup_new_session_page ()
{
g_signal_connect (G_OBJECT(new_folder_chooser.gobj()), "current-folder-changed", G_CALLBACK (showmecf), G_OBJECT(new_folder_chooser.gobj()));
g_signal_connect (G_OBJECT(new_folder_chooser.gobj()), "file-set", G_CALLBACK (showmefs), G_OBJECT(new_folder_chooser.gobj()));
if (!session_hbox.get_children().empty()) {
session_hbox.remove (**session_hbox.get_children().begin());
}
@ -773,11 +792,13 @@ ArdourStartup::setup_new_session_page ()
new_folder_chooser.set_current_folder (session_parent_dir);
new_folder_chooser.add_shortcut_folder (poor_mans_glob (Config->get_default_session_parent_dir()));
} else {
new_folder_chooser.set_current_folder (poor_mans_glob (Config->get_default_session_parent_dir()));
//new_folder_chooser.set_current_folder (poor_mans_glob (Config->get_default_session_parent_dir()));
new_folder_chooser.set_current_folder ("/usr/local");
}
new_folder_chooser.show ();
new_folder_chooser.set_title (_("Select folder for session"));
#ifdef GTKOSX
#ifdef __APPLE__
new_folder_chooser.add_shortcut_folder ("/Volumes");
#endif

View File

@ -845,6 +845,11 @@ class Session : public PBD::StatefulDestructible, public PBD::ScopedConnectionLi
/** Emitted when the session wants Ardour to quit */
static PBD::Signal0<void> Quit;
/** Emitted when Ardour is asked to load a session in an older session
* format, and makes a backup copy.
*/
static PBD::Signal2<void,std::string,std::string> VersionMismatch;
boost::shared_ptr<Port> ltc_input_port() const;
boost::shared_ptr<Port> ltc_output_port() const;

View File

@ -119,6 +119,7 @@ PBD::Signal1<int,boost::shared_ptr<Playlist> > Session::AskAboutPlaylistDeletion
PBD::Signal0<void> Session::Quit;
PBD::Signal0<void> Session::FeedbackDetected;
PBD::Signal0<void> Session::SuccessfulGraphSort;
PBD::Signal2<void,std::string,std::string> Session::VersionMismatch;
static void clean_up_session_event (SessionEvent* ev) { delete ev; }
const SessionEvent::RTeventCallback Session::rt_cleanup (clean_up_session_event);

View File

@ -938,9 +938,7 @@ Session::load_state (string snapshot_name)
if (!Glib::file_test (backup_path, Glib::FILE_TEST_EXISTS)) {
info << string_compose (_("Copying old session file %1 to %2\nUse %2 with %3 versions before 2.0 from now on"),
xmlpath, backup_path, PROGRAM_NAME)
<< endmsg;
VersionMismatch (xmlpath, backup_path);
if (!copy_file (xmlpath, backup_path)) {;
return -1;