From 37f2f8981ff44aa3cd1e46fbe9de02bba428d58e Mon Sep 17 00:00:00 2001 From: Paul Davis Date: Thu, 18 Oct 2012 13:43:25 +0000 Subject: [PATCH] if a session is altered, ask about saving it BEFORE moving on to the new session dialog (fixes #5086) git-svn-id: svn://localhost/ardour2/branches/3.0@13306 d708f5d6-7413-0410-9779-e7cbd77b26cf --- gtk2_ardour/ardour_ui.cc | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/gtk2_ardour/ardour_ui.cc b/gtk2_ardour/ardour_ui.cc index 3b9c4799f6..37343c1e18 100644 --- a/gtk2_ardour/ardour_ui.cc +++ b/gtk2_ardour/ardour_ui.cc @@ -2438,6 +2438,19 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri int ret = -1; bool likely_new = false; + /* deal with any existing DIRTY session now, rather than later. don't + * treat a non-dirty session this way, so that it stays visible + * as we bring up the new session dialog. + */ + + if (_session && _session->dirty()) { + if (unload_session (false)) { + /* unload cancelled by user */ + return 0; + } + ARDOUR_COMMAND_LINE::session_name = ""; + } + if (!load_template.empty()) { should_be_new = true; template_name = load_template;