Merge branch 'blender-v4.2-release'
This commit is contained in:
@@ -236,6 +236,7 @@ static int rna_Operator_props_dialog_popup(bContext *C,
|
||||
const int width,
|
||||
const char *title,
|
||||
const char *confirm_text,
|
||||
const bool cancel_default,
|
||||
const char *text_ctxt,
|
||||
const bool translate)
|
||||
{
|
||||
@@ -246,7 +247,8 @@ static int rna_Operator_props_dialog_popup(bContext *C,
|
||||
op,
|
||||
width,
|
||||
title ? std::make_optional<std::string>(title) : std::nullopt,
|
||||
confirm_text ? std::make_optional<std::string>(confirm_text) : std::nullopt);
|
||||
confirm_text ? std::make_optional<std::string>(confirm_text) : std::nullopt,
|
||||
cancel_default);
|
||||
}
|
||||
|
||||
static int keymap_item_modifier_flag_from_args(bool any, int shift, int ctrl, int alt, int oskey)
|
||||
@@ -913,6 +915,7 @@ void RNA_api_wm(StructRNA *srna)
|
||||
parm,
|
||||
"Confirm Text",
|
||||
"Optional text to show instead to the default \"OK\" confirmation button text");
|
||||
RNA_def_property(func, "cancel_default", PROP_BOOLEAN, PROP_NONE);
|
||||
api_ui_item_common_translation(func);
|
||||
|
||||
/* invoke enum */
|
||||
|
||||
@@ -747,7 +747,8 @@ int WM_operator_props_popup_confirm_ex(bContext *C,
|
||||
wmOperator *op,
|
||||
const wmEvent *event,
|
||||
std::optional<std::string> title = std::nullopt,
|
||||
std::optional<std::string> confirm_text = std::nullopt);
|
||||
std::optional<std::string> confirm_text = std::nullopt,
|
||||
bool cancel_default = false);
|
||||
|
||||
/**
|
||||
* Same as #WM_operator_props_popup but call the operator first,
|
||||
@@ -761,7 +762,8 @@ int WM_operator_props_dialog_popup(bContext *C,
|
||||
wmOperator *op,
|
||||
int width,
|
||||
std::optional<std::string> title = std::nullopt,
|
||||
std::optional<std::string> confirm_text = std::nullopt);
|
||||
std::optional<std::string> confirm_text = std::nullopt,
|
||||
bool cancel_default = false);
|
||||
|
||||
int WM_operator_redo_popup(bContext *C, wmOperator *op);
|
||||
int WM_operator_ui_popup(bContext *C, wmOperator *op, int width);
|
||||
|
||||
@@ -1769,7 +1769,8 @@ static int wm_operator_props_popup_ex(bContext *C,
|
||||
const bool do_call,
|
||||
const bool do_redo,
|
||||
std::optional<std::string> title = std::nullopt,
|
||||
std::optional<std::string> confirm_text = std::nullopt)
|
||||
std::optional<std::string> confirm_text = std::nullopt,
|
||||
const bool cancel_default = false)
|
||||
{
|
||||
if ((op->type->flag & OPTYPE_REGISTER) == 0) {
|
||||
BKE_reportf(op->reports,
|
||||
@@ -1792,7 +1793,7 @@ static int wm_operator_props_popup_ex(bContext *C,
|
||||
/* If we don't have global undo, we can't do undo push for automatic redo,
|
||||
* so we require manual OK clicking in this popup. */
|
||||
if (!do_redo || !(U.uiflag & USER_GLOBALUNDO)) {
|
||||
return WM_operator_props_dialog_popup(C, op, 300, title, confirm_text);
|
||||
return WM_operator_props_dialog_popup(C, op, 300, title, confirm_text, cancel_default);
|
||||
}
|
||||
|
||||
UI_popup_block_ex(C, wm_block_create_redo, nullptr, wm_block_redo_cancel_cb, op, op);
|
||||
@@ -1808,9 +1809,10 @@ int WM_operator_props_popup_confirm_ex(bContext *C,
|
||||
wmOperator *op,
|
||||
const wmEvent * /*event*/,
|
||||
std::optional<std::string> title,
|
||||
std::optional<std::string> confirm_text)
|
||||
std::optional<std::string> confirm_text,
|
||||
const bool cancel_default)
|
||||
{
|
||||
return wm_operator_props_popup_ex(C, op, false, false, title, confirm_text);
|
||||
return wm_operator_props_popup_ex(C, op, false, false, title, confirm_text, cancel_default);
|
||||
}
|
||||
|
||||
int WM_operator_props_popup_confirm(bContext *C, wmOperator *op, const wmEvent * /*event*/)
|
||||
@@ -1832,7 +1834,8 @@ int WM_operator_props_dialog_popup(bContext *C,
|
||||
wmOperator *op,
|
||||
int width,
|
||||
std::optional<std::string> title,
|
||||
std::optional<std::string> confirm_text)
|
||||
std::optional<std::string> confirm_text,
|
||||
const bool cancel_default)
|
||||
{
|
||||
wmOpPopUp *data = MEM_new<wmOpPopUp>(__func__);
|
||||
data->op = op;
|
||||
@@ -1844,7 +1847,7 @@ int WM_operator_props_dialog_popup(bContext *C,
|
||||
data->icon = ALERT_ICON_NONE;
|
||||
data->size = WM_POPUP_SIZE_SMALL;
|
||||
data->position = WM_POPUP_POSITION_MOUSE;
|
||||
data->cancel_default = false;
|
||||
data->cancel_default = cancel_default;
|
||||
data->mouse_move_quit = false;
|
||||
data->include_properties = true;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user