Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBastien Montagne <bastien@blender.org>2022-08-24 13:11:50 +0300
committerBastien Montagne <bastien@blender.org>2022-08-24 18:11:36 +0300
commit24dc84f15668129c7a7fe0a284f6b2376a473e15 (patch)
treeb7bf7d1c53cedae55c28bfe817094e5b363fa4d7 /source/blender/editors
parente65f0337e94242baf868aa2cd90a0b489e38b087 (diff)
Cleanup: rename new IDTemplate operator to create overrides to `make`.
Matches other operators' names and UI labels better.
Diffstat (limited to 'source/blender/editors')
-rw-r--r--source/blender/editors/interface/interface_intern.h2
-rw-r--r--source/blender/editors/interface/interface_ops.c20
-rw-r--r--source/blender/editors/interface/interface_templates.c20
3 files changed, 20 insertions, 22 deletions
diff --git a/source/blender/editors/interface/interface_intern.h b/source/blender/editors/interface/interface_intern.h
index 8e5a8976389..e7d30fd42ef 100644
--- a/source/blender/editors/interface/interface_intern.h
+++ b/source/blender/editors/interface/interface_intern.h
@@ -1543,7 +1543,7 @@ uiButViewItem *ui_block_view_find_matching_view_item_but_in_old_block(
struct uiListType *UI_UL_cache_file_layers(void);
-struct ID *ui_template_id_liboverride_hierarchy_create(struct bContext *C,
+struct ID *ui_template_id_liboverride_hierarchy_make(struct bContext *C,
struct Main *bmain,
struct ID *owner_id,
struct ID *id,
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c
index c2c4b5f7ead..e170cb46925 100644
--- a/source/blender/editors/interface/interface_ops.c
+++ b/source/blender/editors/interface/interface_ops.c
@@ -798,12 +798,12 @@ static bool override_idtemplate_poll(bContext *C, const bool is_create_op)
return true;
}
-static bool override_idtemplate_create_poll(bContext *C)
+static bool override_idtemplate_make_poll(bContext *C)
{
return override_idtemplate_poll(C, true);
}
-static int override_idtemplate_create_exec(bContext *C, wmOperator *UNUSED(op))
+static int override_idtemplate_make_exec(bContext *C, wmOperator *UNUSED(op))
{
ID *owner_id, *id;
PointerRNA owner_ptr;
@@ -813,7 +813,7 @@ static int override_idtemplate_create_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_CANCELLED;
}
- ID *id_override = ui_template_id_liboverride_hierarchy_create(
+ ID *id_override = ui_template_id_liboverride_hierarchy_make(
C, CTX_data_main(C), owner_id, id, NULL);
if (id_override == NULL) {
@@ -837,18 +837,18 @@ static int override_idtemplate_create_exec(bContext *C, wmOperator *UNUSED(op))
return OPERATOR_FINISHED;
}
-static void UI_OT_override_idtemplate_create(wmOperatorType *ot)
+static void UI_OT_override_idtemplate_make(wmOperatorType *ot)
{
/* identifiers */
- ot->name = "Create Library Override";
- ot->idname = "UI_OT_override_idtemplate_create";
+ ot->name = "Make Library Override";
+ ot->idname = "UI_OT_override_idtemplate_make";
ot->description =
"Create a local override of the selected linked data-block, and its hierarchy of "
"dependencies";
/* callbacks */
- ot->poll = override_idtemplate_create_poll;
- ot->exec = override_idtemplate_create_exec;
+ ot->poll = override_idtemplate_make_poll;
+ ot->exec = override_idtemplate_make_exec;
/* flags */
ot->flag = OPTYPE_UNDO;
@@ -976,7 +976,7 @@ static bool override_idtemplate_menu_poll(const bContext *C_const, MenuType *UNU
static void override_idtemplate_menu_draw(const bContext *UNUSED(C), Menu *menu)
{
uiLayout *layout = menu->layout;
- uiItemO(layout, IFACE_("Make"), ICON_NONE, "UI_OT_override_idtemplate_create");
+ uiItemO(layout, IFACE_("Make"), ICON_NONE, "UI_OT_override_idtemplate_make");
uiItemO(layout, IFACE_("Reset"), ICON_NONE, "UI_OT_override_idtemplate_reset");
uiItemO(layout, IFACE_("Clear"), ICON_NONE, "UI_OT_override_idtemplate_clear");
}
@@ -2486,7 +2486,7 @@ void ED_operatortypes_ui(void)
WM_operatortype_append(UI_OT_override_type_set_button);
WM_operatortype_append(UI_OT_override_remove_button);
- WM_operatortype_append(UI_OT_override_idtemplate_create);
+ WM_operatortype_append(UI_OT_override_idtemplate_make);
WM_operatortype_append(UI_OT_override_idtemplate_reset);
WM_operatortype_append(UI_OT_override_idtemplate_clear);
override_idtemplate_menu();
diff --git a/source/blender/editors/interface/interface_templates.c b/source/blender/editors/interface/interface_templates.c
index 37139e8d078..95952b6e8c8 100644
--- a/source/blender/editors/interface/interface_templates.c
+++ b/source/blender/editors/interface/interface_templates.c
@@ -653,7 +653,7 @@ static void template_id_liboverride_hierarchy_collections_tag_recursive(
}
}
-ID *ui_template_id_liboverride_hierarchy_create(
+ID *ui_template_id_liboverride_hierarchy_make(
bContext *C, Main *bmain, ID *owner_id, ID *id, const char **r_undo_push_label)
{
const char *undo_push_label;
@@ -872,16 +872,16 @@ ID *ui_template_id_liboverride_hierarchy_create(
return id_override;
}
-static void template_id_liboverride_hierarchy_create(bContext *C,
- Main *bmain,
- TemplateID *template_ui,
- PointerRNA *idptr,
- const char **r_undo_push_label)
+static void template_id_liboverride_hierarchy_make(bContext *C,
+ Main *bmain,
+ TemplateID *template_ui,
+ PointerRNA *idptr,
+ const char **r_undo_push_label)
{
ID *id = idptr->data;
ID *owner_id = template_ui->ptr.owner_id;
- ID *id_override = ui_template_id_liboverride_hierarchy_create(
+ ID *id_override = ui_template_id_liboverride_hierarchy_make(
C, bmain, owner_id, id, r_undo_push_label);
if (id_override != NULL) {
@@ -950,8 +950,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
if (id) {
Main *bmain = CTX_data_main(C);
if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
- template_id_liboverride_hierarchy_create(
- C, bmain, template_ui, &idptr, &undo_push_label);
+ template_id_liboverride_hierarchy_make(C, bmain, template_ui, &idptr, &undo_push_label);
}
else {
if (BKE_lib_id_make_local(bmain, id, 0)) {
@@ -972,8 +971,7 @@ static void template_id_cb(bContext *C, void *arg_litem, void *arg_event)
if (id && ID_IS_OVERRIDE_LIBRARY(id)) {
Main *bmain = CTX_data_main(C);
if (CTX_wm_window(C)->eventstate->modifier & KM_SHIFT) {
- template_id_liboverride_hierarchy_create(
- C, bmain, template_ui, &idptr, &undo_push_label);
+ template_id_liboverride_hierarchy_make(C, bmain, template_ui, &idptr, &undo_push_label);
}
else {
BKE_lib_override_library_make_local(id);