UI: Improved Confirmation Dialog for Clear Recent List #116796

Merged
Harley Acheson merged 2 commits from Harley/blender:ClearRecentWarning into main 2024-01-04 19:31:43 +01:00
1 changed files with 12 additions and 0 deletions

View File

@ -3575,6 +3575,17 @@ void WM_OT_save_mainfile(wmOperatorType *ot)
/** \name Clear Recent Files List Operator
* \{ */
static void wm_clear_recent_files_warning(bContext * /*C*/,
wmOperator * /*op*/,
wmWarningDetails *warning)
{
STRNCPY(warning->message, IFACE_("Remove all items from the Recent Files list"));
STRNCPY(warning->confirm_button, IFACE_("Remove All"));
warning->position = WM_WARNING_POSITION_CENTER;
warning->size = WM_WARNING_SIZE_LARGE;
warning->cancel_default = true;
}
static int wm_clear_recent_files_exec(bContext * /*C*/, wmOperator * /*op*/)
{
wm_history_files_free();
@ -3591,6 +3602,7 @@ void WM_OT_clear_recent_files(wmOperatorType *ot)
ot->invoke = WM_operator_confirm;
ot->exec = wm_clear_recent_files_exec;
ot->warning = wm_clear_recent_files_warning;
}
/** \} */