UI: Improvements to Confirmation of Apply Modifier #117156
|
@ -1796,17 +1796,6 @@ static int modifier_apply_exec(bContext *C, wmOperator *op)
|
|||
return modifier_apply_exec_ex(C, op, MODIFIER_APPLY_DATA, false);
|
||||
}
|
||||
|
||||
static void modifier_apply_confirm(bContext * /*C*/,
|
||||
wmOperator * /*op*/,
|
||||
wmConfirmDetails *confirm)
|
||||
{
|
||||
confirm->title = IFACE_("Apply Modifier");
|
||||
confirm->message = IFACE_("Make data single-user, apply modifier, and remove it from the list");
|
||||
confirm->confirm_text = IFACE_("Apply");
|
||||
confirm->position = WM_WARNING_POSITION_MOUSE;
|
||||
confirm->size = WM_WARNING_SIZE_SMALL;
|
||||
}
|
||||
|
||||
static int modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
||||
{
|
||||
int retval;
|
||||
|
@ -1820,7 +1809,14 @@ static int modifier_apply_invoke(bContext *C, wmOperator *op, const wmEvent *eve
|
|||
RNA_property_boolean_set(op->ptr, prop, true);
|
||||
}
|
||||
if (RNA_property_boolean_get(op->ptr, prop)) {
|
||||
return WM_operator_confirm(C, op, nullptr);
|
||||
return WM_operator_confirm_ex(
|
||||
C,
|
||||
op,
|
||||
IFACE_("Apply Modifier"),
|
||||
IFACE_("Make data single-user, apply modifier, and remove it from the list"),
|
||||
IFACE_("Apply"),
|
||||
ALERT_ICON_WARNING,
|
||||
false);
|
||||
}
|
||||
}
|
||||
return modifier_apply_exec(C, op);
|
||||
|
@ -1837,7 +1833,6 @@ void OBJECT_OT_modifier_apply(wmOperatorType *ot)
|
|||
ot->invoke = modifier_apply_invoke;
|
||||
ot->exec = modifier_apply_exec;
|
||||
ot->poll = modifier_apply_poll;
|
||||
ot->confirm = modifier_apply_confirm;
|
||||
|
||||
/* flags */
|
||||
ot->flag = OPTYPE_REGISTER | OPTYPE_UNDO | OPTYPE_INTERNAL;
|
||||
|
|
Loading…
Reference in New Issue