UI: restore quit confirmation when dialog disabled
authorCampbell Barton <ideasman42@gmail.com>
Fri, 23 Mar 2018 16:31:33 +0000 (17:31 +0100)
committerCampbell Barton <ideasman42@gmail.com>
Fri, 23 Mar 2018 16:32:13 +0000 (17:32 +0100)
source/blender/windowmanager/intern/wm_operators.c

index 1c21069879a453aa569579632932cd5fbffca068..814d88238170c257f0905def76c2187f21aaeedb 100644 (file)
@@ -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;
 }