[Bf-blender-cvs] [a7e4268beed] master: UI: restore quit confirmation when dialog disabled

Campbell Barton noreply at git.blender.org
Fri Mar 23 17:33:53 CET 2018


Commit: a7e4268beeda8e49cd93af375b125c72e6f2ac93
Author: Campbell Barton
Date:   Fri Mar 23 17:31:33 2018 +0100
Branches: master
https://developer.blender.org/rBa7e4268beeda8e49cd93af375b125c72e6f2ac93

UI: restore quit confirmation when dialog disabled

===================================================================

M	source/blender/windowmanager/intern/wm_operators.c

===================================================================

diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c
index 1c21069879a..814d8823817 100644
--- a/source/blender/windowmanager/intern/wm_operators.c
+++ b/source/blender/windowmanager/intern/wm_operators.c
@@ -2166,12 +2166,23 @@ static int wm_exit_blender_exec(bContext *C, wmOperator *UNUSED(op))
 	return OPERATOR_FINISHED;
 }
 
+static int wm_exit_blender_invoke(bContext *C, wmOperator *op, const wmEvent *event)
+{
+	if (U.uiflag & USER_QUIT_PROMPT) {
+		return wm_exit_blender_exec(C, op);
+	}
+	else {
+		return WM_operator_confirm(C, op, event);
+	}
+}
+
 static void WM_OT_quit_blender(wmOperatorType *ot)
 {
 	ot->name = "Quit Blender";
 	ot->idname = "WM_OT_quit_blender";
 	ot->description = "Quit Blender";
 
+	ot->invoke = wm_exit_blender_invoke;
 	ot->exec = wm_exit_blender_exec;
 }



More information about the Bf-blender-cvs mailing list