UI: Improvements to Revert File Operator Confirmation Popup

Larger, more informative confirmation when reverting the current file
to saved version. Title of "Revert to the Saved File", content of
"Any unsaved changes will be lost." and button text of "Revert".

Pull Request: https://projects.blender.org/blender/blender/pulls/119758
This commit is contained in:
Jonas Holzman
2024-03-27 18:39:09 +01:00
committed by Harley Acheson
parent 10bc136a1a
commit 75a9cbed24

View File

@@ -3178,6 +3178,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);
@@ -3209,7 +3220,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;