Add hidden ui config for close without asking

This commit is contained in:
itmuckel 2022-05-06 10:11:06 +02:00
parent d7f2c35beb
commit b4edbae7af
2 changed files with 5 additions and 4 deletions

View File

@ -52,14 +52,12 @@
#include "trigger_page.h"
#include "keyboard.h"
#include "keyeditor.h"
#include "splash.h"
#include "rc_option_editor.h"
#include "route_params_ui.h"
#include "time_info_box.h"
#include "trigger_ui.h"
#include "step_entry.h"
#include "opts.h"
#include "utils.h"
#ifdef GDK_WINDOWING_X11
#include <gdk/gdkx.h>
@ -204,7 +202,9 @@ ARDOUR_UI::tab_window_root_drop (GtkNotebook* src,
bool
ARDOUR_UI::idle_ask_about_quit ()
{
if (_session && _session->dirty()) {
const auto ask_before_closing = UIConfiguration::instance ().get_ask_before_closing_last_window ();
if ((_session && _session->dirty ()) || !ask_before_closing) {
finish ();
} else {
/* no session or session not dirty, but still ask anyway */
@ -216,7 +216,7 @@ ARDOUR_UI::idle_ask_about_quit ()
true); /* modal */
msg.set_default_response (Gtk::RESPONSE_YES);
if (msg.run() == Gtk::RESPONSE_YES) {
if (msg.run () == Gtk::RESPONSE_YES) {
finish ();
}
}

View File

@ -138,6 +138,7 @@ UI_CONFIG_VARIABLE (bool, show_triggers_inline, "show-triggers-inline", false)
UI_CONFIG_VARIABLE (bool, one_plugin_window_only, "one-plugin-window-only", false)
UI_CONFIG_VARIABLE (int, default_lower_midi_note, "default-lower-midi-note", 60)
UI_CONFIG_VARIABLE (int, default_upper_midi_note, "default-upper-midi-note", 71)
UI_CONFIG_VARIABLE (bool, ask_before_closing_last_window, "ask-before-closing-last-window", true)
/* these are visibility-type selections in the New Track dialog that we should make persistent for the user's choices */
UI_CONFIG_VARIABLE (bool, show_on_cue_page, "show-on-cue-page", true)