[Bf-blender-cvs] [d7baf8e7e7c] master: UI: change behavior for quit prompt
Campbell Barton
noreply at git.blender.org
Thu Feb 28 03:22:07 CET 2019
Commit: d7baf8e7e7c26bbd577abe5d71a0da2e796cb6ae
Author: Campbell Barton
Date: Thu Feb 28 13:09:56 2019 +1100
Branches: master
https://developer.blender.org/rBd7baf8e7e7c26bbd577abe5d71a0da2e796cb6ae
UI: change behavior for quit prompt
Remove confirmation popup menu, just exit.
Note that this option is mainly for developers or people reviewing
blend files, see D4406 for discussion on reason for keeping this feature
while simplifying how it works.
===================================================================
M release/scripts/startup/bl_ui/space_topbar.py
M source/blender/windowmanager/intern/wm_operators.c
M source/blender/windowmanager/intern/wm_window.c
===================================================================
diff --git a/release/scripts/startup/bl_ui/space_topbar.py b/release/scripts/startup/bl_ui/space_topbar.py
index 937cec9eb29..f0ff5e9a29d 100644
--- a/release/scripts/startup/bl_ui/space_topbar.py
+++ b/release/scripts/startup/bl_ui/space_topbar.py
@@ -621,7 +621,7 @@ class TOPBAR_MT_file(Menu):
layout.separator()
layout.operator_context = 'EXEC_AREA'
- if bpy.data.is_dirty and context.preferences.view.use_quit_dialog:
+ if bpy.data.is_dirty:
layout.operator_context = 'INVOKE_SCREEN' # quit dialog
layout.operator("wm.quit_blender", text="Quit", icon='QUIT')
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index bafcdbf2139..55c257038ad 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -1804,18 +1804,19 @@ static void WM_OT_window_fullscreen_toggle(wmOperatorType *ot)
static int wm_exit_blender_exec(bContext *C, wmOperator *UNUSED(op))
{
- wm_quit_with_optional_confirmation_prompt(C, CTX_wm_window(C));
+ wm_exit_schedule_delayed(C);
return OPERATOR_FINISHED;
}
-static int wm_exit_blender_invoke(bContext *C, wmOperator *op, const wmEvent *event)
+static int wm_exit_blender_invoke(bContext *C, wmOperator *UNUSED(op), const wmEvent *UNUSED(event))
{
if (U.uiflag & USER_QUIT_PROMPT) {
- return wm_exit_blender_exec(C, op);
+ wm_quit_with_optional_confirmation_prompt(C, CTX_wm_window(C));
}
else {
- return WM_operator_confirm(C, op, event);
+ wm_exit_schedule_delayed(C);
}
+ return OPERATOR_FINISHED;
}
static void WM_OT_quit_blender(wmOperatorType *ot)
diff --git a/source/blender/windowmanager/intern/wm_window.c b/source/blender/windowmanager/intern/wm_window.c
index c432dce0757..f41ac7807e2 100644
--- a/source/blender/windowmanager/intern/wm_window.c
+++ b/source/blender/windowmanager/intern/wm_window.c
@@ -473,8 +473,13 @@ void wm_quit_with_optional_confirmation_prompt(bContext *C, wmWindow *win)
* here (this function gets called outside of normal event handling loop). */
CTX_wm_window_set(C, win);
- if ((U.uiflag & USER_QUIT_PROMPT) && !wm->file_saved && !G.background) {
- wm_confirm_quit(C);
+ if (U.uiflag & USER_QUIT_PROMPT) {
+ if (!wm->file_saved && !G.background) {
+ wm_confirm_quit(C);
+ }
+ else {
+ wm_exit_schedule_delayed(C);
+ }
}
else {
wm_exit_schedule_delayed(C);
More information about the Bf-blender-cvs
mailing list