From 8735a8a6bedfd2fbc9d6931c63fb44ccbc8fd011 Mon Sep 17 00:00:00 2001 From: Harley Acheson Date: Sun, 5 May 2024 19:31:20 +0200 Subject: [PATCH] UI: Different Warning for Revert if Unsaved Images Change to the confirmation when reverting the current blend file to include a specific warning if there are unsaved images. Pull Request: https://projects.blender.org/blender/blender/pulls/121288 --- source/blender/windowmanager/intern/wm_files.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/source/blender/windowmanager/intern/wm_files.cc b/source/blender/windowmanager/intern/wm_files.cc index bb3b6474c3e..17804679f86 100644 --- a/source/blender/windowmanager/intern/wm_files.cc +++ b/source/blender/windowmanager/intern/wm_files.cc @@ -3180,10 +3180,16 @@ void WM_OT_open_mainfile(wmOperatorType *ot) static int wm_revert_mainfile_invoke(bContext *C, wmOperator *op, const wmEvent * /*event*/) { + std::string message = IFACE_("Any unsaved changes will be lost."); + if (ED_image_should_save_modified(CTX_data_main(C))) { + message += "\n"; + message += IFACE_("Warning: There are unsaved external image(s)."); + } + return WM_operator_confirm_ex(C, op, IFACE_("Revert to the Saved File"), - IFACE_("Any unsaved changes will be lost."), + message.c_str(), IFACE_("Revert"), ALERT_ICON_WARNING, false);