From ac0c101118b97219b49f35ae6ccd991caa19e79d Mon Sep 17 00:00:00 2001 From: Jonas Holzman Date: Thu, 21 Mar 2024 19:13:17 +0100 Subject: [PATCH 1/2] Improvements to Revert File Operator Confirmation Popup --- source/blender/windowmanager/intern/wm_files.cc | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index f0ff32c72fe..78055de8a43 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -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_QUESTION, + 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; -- 2.30.2 From 4e76f9ae66f982ed49727b1c4f50f6cb20c63558 Mon Sep 17 00:00:00 2001 From: Jonas Holzman Date: Wed, 27 Mar 2024 17:11:00 +0100 Subject: [PATCH 2/2] Implemented Requested Icon Change --- source/blender/windowmanager/intern/wm_files.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index 78055de8a43..d25a00e7dc4 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -3199,7 +3199,7 @@ static int wm_revert_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent IFACE_("Revert to the Saved File"), IFACE_("Any unsaved changes will be lost."), IFACE_("Revert"), - ALERT_ICON_QUESTION, + ALERT_ICON_WARNING, false); } -- 2.30.2