UI: Improved Operator Confirmations #104670

Merged
Harley Acheson merged 23 commits from Harley/blender:ConfirmDialogs into main 2024-01-04 18:42:34 +01:00
1 changed files with 6 additions and 8 deletions
Showing only changes of commit cc7d9d32c5 - Show all commits

View File

@ -2691,21 +2691,19 @@ void WM_OT_read_homefile(wmOperatorType *ot)
static void read_factory_warning(bContext *C, wmOperator * /*op*/, wmWarningDetails *warning)
{
STRNCPY(warning->title, IFACE_("Load factory default startup file and preferences."));
STRNCPY(warning->message,
IFACE_("To make changes to preferences permanent, use \"Save Preferences\""));
warning->icon = ALERT_ICON_BLENDER;
warning->confirm_default = true;
warning->cancel_default = false;
if (wm_file_or_session_data_has_unsaved_changes(CTX_data_main(C), CTX_wm_manager(C))) {
STRNCPY(warning->message,
STRNCPY(warning->message2,
IFACE_("WARNING: Your file is unsaved. Proceeding will abandon your changes"));
warning->icon = ALERT_ICON_WARNING;
warning->confirm_default = false;
warning->cancel_default = true;
}
else {
STRNCPY(warning->message,
IFACE_("To make changes to preferences permanent, use \"Save Preferences\""));
warning->icon = ALERT_ICON_BLENDER;
warning->confirm_default = true;
warning->cancel_default = false;
}
STRNCPY(warning->confirm_button, IFACE_("Load"));
warning->size = WM_WARNING_SIZE_LARGE;