when creating a new session after working on one, the "Cancel" button should be a...
authorPaul Davis <paul@linuxaudiosystems.com>
Mon, 29 May 2017 19:35:03 +0000 (15:35 -0400)
committerPaul Davis <paul@linuxaudiosystems.com>
Mon, 29 May 2017 19:35:03 +0000 (15:35 -0400)
This avoids ending up with a null Session pointer in the GUI (#7369)

gtk2_ardour/ardour_ui.cc
gtk2_ardour/ardour_ui_ed.cc

index 7b43f33082784a83042e6860fa8af14b1813fab4..fd3ba20a3a491c796aac46e6d5e20a8e2714f4e2 100644 (file)
@@ -3354,7 +3354,7 @@ ARDOUR_UI::get_session_parameters (bool quit_on_cancel, bool should_be_new, stri
        /* if there is already a session, relabel the button
           on the SessionDialog so that we don't Quit directly
        */
-       cancel_not_quit = (_session != 0);
+       cancel_not_quit = (_session != 0) && !quit_on_cancel;
 
        if (_session && _session->dirty()) {
                if (unload_session (false)) {
index 3eb063993352160034cda192c41a56a88d1acb43..ef0ed7805f7972f06865652ac440b1a3926d3154 100644 (file)
@@ -161,7 +161,7 @@ ARDOUR_UI::install_actions ()
 
        /* the real actions */
 
-       act = global_actions.register_action (main_actions, X_("New"), _("New..."),  hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::get_session_parameters), false, true, "")));
+       act = global_actions.register_action (main_actions, X_("New"), _("New..."),  hide_return (sigc::bind (sigc::mem_fun(*this, &ARDOUR_UI::get_session_parameters), true, true, "")));
 
        global_actions.register_action (main_actions, X_("Open"), _("Open..."),  sigc::mem_fun(*this, &ARDOUR_UI::open_session));
        global_actions.register_action (main_actions, X_("Recent"), _("Recent..."),  sigc::mem_fun(*this, &ARDOUR_UI::open_recent_session));