UI: restore quit confirmation when dialog disabled

This commit is contained in:
Campbell Barton 2018-03-23 17:31:33 +01:00
parent 15af75d79e
commit a7e4268bee
1 changed files with 11 additions and 0 deletions

View 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;
}