summaryrefslogtreecommitdiff
path: root/gtk2_ardour
diff options
context:
space:
mode:
authorPaul Davis <paul@linuxaudiosystems.com>2012-10-18 13:43:25 +0000
committerPaul Davis <paul@linuxaudiosystems.com>2012-10-18 13:43:25 +0000
commit37f2f8981ff44aa3cd1e46fbe9de02bba428d58e (patch)
tree020dc48f72f4da9f5d1e969463627f025e94249f /gtk2_ardour
parentaa3fe77d7f2618838c165b1dceb4632ccf867b52 (diff)
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
Diffstat (limited to 'gtk2_ardour')
-rw-r--r--gtk2_ardour/ardour_ui.cc13
1 files changed, 13 insertions, 0 deletions
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;