UI: Improved Confirmation Dialog for Clear Recent List #116796
|
@ -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;
|
||||
}
|
||||
|
||||
/** \} */
|
||||
|
|
Loading…
Reference in New Issue