summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2013-03-04 21:57:29 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2013-03-04 21:57:29 +0000
commit91ff55bd89d44bf6d9ec222ac531f71f5700a91b (patch)
treec79a17351fae25512828475fcb7cda2149cab0e7
parentae85663fa7d8951ea9363eb40bd05c480bae7b92 (diff)
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
-rw-r--r--gtk2_ardour/ardour_ui.cc13
-rw-r--r--gtk2_ardour/ardour_ui.h2
-rw-r--r--gtk2_ardour/startup.cc25
-rw-r--r--libs/ardour/ardour/session.h5
-rw-r--r--libs/ardour/session.cc1
-rw-r--r--libs/ardour/session_state.cc4
6 files changed, 45 insertions, 5 deletions
diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc
index fc4e342fc9..2b981ace8e 100644
--- a/gtk2_ardour/ardour_ui.cc
+++ b/gtk2_ardour/ardour_ui.cc
@@ -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 ();
+}
diff --git a/gtk2_ardour/ardour_ui.h b/gtk2_ardour/ardour_ui.h
index 4a03b2a777..8a2edff1da 100644
--- a/gtk2_ardour/ardour_ui.h
+++ b/gtk2_ardour/ardour_ui.h
@@ -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);
diff --git a/gtk2_ardour/startup.cc b/gtk2_ardour/startup.cc
index e08d89d5fa..c7c9cf8a15 100644
--- a/gtk2_ardour/startup.cc
+++ b/gtk2_ardour/startup.cc
@@ -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 ();
@@ -719,8 +721,25 @@ 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
diff --git a/libs/ardour/ardour/session.h b/libs/ardour/ardour/session.h
index a012aac599..78c95acb33 100644
--- a/libs/ardour/ardour/session.h
+++ b/libs/ardour/ardour/session.h
@@ -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;
diff --git a/libs/ardour/session.cc b/libs/ardour/session.cc
index 3281ff2f98..cb743cca62 100644
--- a/libs/ardour/session.cc
+++ b/libs/ardour/session.cc
@@ -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);
diff --git a/libs/ardour/session_state.cc b/libs/ardour/session_state.cc
index 7857e85f4c..74b56b787e 100644
--- a/libs/ardour/session_state.cc
+++ b/libs/ardour/session_state.cc
@@ -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;