UI: Improvements to Revert File Operator Confirmation Popup #119758
|
@ -3192,6 +3192,17 @@ void WM_OT_open_mainfile(wmOperatorType *ot)
|
|||
/** \name Reload (revert) Main .blend File Operator
|
||||
* \{ */
|
||||
|
||||
static int wm_revert_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
{
|
||||
return WM_operator_confirm_ex(C,
|
||||
op,
|
||||
IFACE_("Revert to the Saved File"),
|
||||
IFACE_("Any unsaved changes will be lost."),
|
||||
IFACE_("Revert"),
|
||||
ALERT_ICON_WARNING,
|
||||
false);
|
||||
}
|
||||
|
||||
static int wm_revert_mainfile_exec(bContext *C, wmOperator *op)
|
||||
{
|
||||
Main *bmain = CTX_data_main(C);
|
||||
|
@ -3223,7 +3234,7 @@ void WM_OT_revert_mainfile(wmOperatorType *ot)
|
|||
ot->idname = "WM_OT_revert_mainfile";
|
||||
ot->description = "Reload the saved file";
|
||||
|
||||
ot->invoke = WM_operator_confirm;
|
||||
ot->invoke = wm_revert_mainfile_invoke;
|
||||
ot->exec = wm_revert_mainfile_exec;
|
||||
ot->poll = wm_revert_mainfile_poll;
|
||||
|
||||
|
|
Loading…
Reference in New Issue