diff options
Diffstat (limited to 'source/blender/editors/space_outliner/outliner.c')
-rw-r--r-- | source/blender/editors/space_outliner/outliner.c | 162 |
1 files changed, 82 insertions, 80 deletions
diff --git a/source/blender/editors/space_outliner/outliner.c b/source/blender/editors/space_outliner/outliner.c index 93dc96cf9c0..b0cd5ae7993 100644 --- a/source/blender/editors/space_outliner/outliner.c +++ b/source/blender/editors/space_outliner/outliner.c @@ -59,6 +59,8 @@ #include "BLI_utildefines.h" #include "BLI_math_base.h" +#include "BLF_api.h" + #if defined WIN32 && !defined _LIBC # include "BLI_fnmatch.h" /* use fnmatch included in blenlib */ #else @@ -448,7 +450,7 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc * in order to not overflow short tselem->nr */ te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_COMBINED)); - te->name= "Combined"; + te->name= _("Combined"); te->directdata= &srl->passflag; /* save cpu cycles, but we add the first to invoke an open/close triangle */ @@ -461,11 +463,11 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_VECTOR)); - te->name= "Vector"; + te->name= _("Vector"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_NORMAL)); - te->name= "Normal"; + te->name= _("Normal"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_UV)); @@ -473,31 +475,31 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_MIST)); - te->name= "Mist"; + te->name= _("Mist"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXOB)); - te->name= "Index Object"; + te->name= _("Index Object"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDEXMA)); - te->name= "Index Material"; + te->name= _("Index Material"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_RGBA)); - te->name= "Color"; + te->name= _("Color"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_DIFFUSE)); - te->name= "Diffuse"; + te->name= _("Diffuse"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SPEC)); - te->name= "Specular"; + te->name= _("Specular"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_SHADOW)); - te->name= "Shadow"; + te->name= _("Shadow"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_AO)); @@ -505,23 +507,23 @@ static void outliner_add_passes(SpaceOops *soops, TreeElement *tenla, ID *id, Sc te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFLECT)); - te->name= "Reflection"; + te->name= _("Reflection"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_REFRACT)); - te->name= "Refraction"; + te->name= _("Refraction"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_INDIRECT)); - te->name= "Indirect"; + te->name= _("Indirect"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_ENVIRONMENT)); - te->name= "Environment"; + te->name= _("Environment"); te->directdata= &srl->passflag; te= outliner_add_element(soops, &tenla->subtree, id, tenla, TSE_R_PASS, LOG2I(SCE_PASS_EMIT)); - te->name= "Emit"; + te->name= _("Emit"); te->directdata= &srl->passflag; } @@ -548,7 +550,7 @@ static void outliner_add_scene_contents(SpaceOops *soops, ListBase *lb, Scene *s TreeElement *tenla= outliner_add_element(soops, lb, sce, te, TSE_R_LAYER_BASE, 0); int a; - tenla->name= "RenderLayers"; + tenla->name= _("RenderLayers"); for(a=0, srl= sce->r.layers.first; srl; srl= srl->next, a++) { TreeElement *tenlay= outliner_add_element(soops, &tenla->subtree, sce, te, TSE_R_LAYER, a); tenlay->name= srl->name; @@ -1540,16 +1542,16 @@ static int outliner_scroll_page_exec(bContext *C, wmOperator *op) void OUTLINER_OT_scroll_page(wmOperatorType *ot) { /* identifiers */ - ot->name= "Scroll Page"; + ot->name= _("Scroll Page"); ot->idname= "OUTLINER_OT_scroll_page"; - ot->description= "Scroll page up or down"; + ot->description= _("Scroll page up or down"); /* callbacks */ ot->exec= outliner_scroll_page_exec; ot->poll= ED_operator_outliner_active; /* properties */ - RNA_def_boolean(ot->srna, "up", 0, "Up", "Scroll up one page."); + RNA_def_boolean(ot->srna, "up", 0, _("Up"), _("Scroll up one page.")); } @@ -1651,9 +1653,9 @@ static int outliner_toggle_visibility_exec(bContext *C, wmOperator *UNUSED(op)) void OUTLINER_OT_visibility_toggle(wmOperatorType *ot) { /* identifiers */ - ot->name= "Toggle Visibility"; + ot->name= _("Toggle Visibility"); ot->idname= "OUTLINER_OT_visibility_toggle"; - ot->description= "Toggle the visibility of selected items"; + ot->description= _("Toggle the visibility of selected items"); /* callbacks */ ot->exec= outliner_toggle_visibility_exec; @@ -1691,9 +1693,9 @@ static int outliner_toggle_selectability_exec(bContext *C, wmOperator *UNUSED(op void OUTLINER_OT_selectability_toggle(wmOperatorType *ot) { /* identifiers */ - ot->name= "Toggle Selectability"; + ot->name= _("Toggle Selectability"); ot->idname= "OUTLINER_OT_selectability_toggle"; - ot->description= "Toggle the selectability"; + ot->description= _("Toggle the selectability"); /* callbacks */ ot->exec= outliner_toggle_selectability_exec; @@ -1728,9 +1730,9 @@ static int outliner_toggle_renderability_exec(bContext *C, wmOperator *UNUSED(op void OUTLINER_OT_renderability_toggle(wmOperatorType *ot) { /* identifiers */ - ot->name= "Toggle Renderability"; + ot->name= _("Toggle Renderability"); ot->idname= "OUTLINER_OT_renderability_toggle"; - ot->description= "Toggle the renderability of selected items"; + ot->description= _("Toggle the renderability of selected items"); /* callbacks */ ot->exec= outliner_toggle_renderability_exec; @@ -1759,9 +1761,9 @@ static int outliner_toggle_expanded_exec(bContext *C, wmOperator *UNUSED(op)) void OUTLINER_OT_expanded_toggle(wmOperatorType *ot) { /* identifiers */ - ot->name= "Expand/Collapse All"; + ot->name= _("Expand/Collapse All"); ot->idname= "OUTLINER_OT_expanded_toggle"; - ot->description= "Expand/Collapse all items"; + ot->description= _("Expand/Collapse all items"); /* callbacks */ ot->exec= outliner_toggle_expanded_exec; @@ -1794,9 +1796,9 @@ static int outliner_toggle_selected_exec(bContext *C, wmOperator *UNUSED(op)) void OUTLINER_OT_selected_toggle(wmOperatorType *ot) { /* identifiers */ - ot->name= "Toggle Selected"; + ot->name= _("Toggle Selected"); ot->idname= "OUTLINER_OT_selected_toggle"; - ot->description= "Toggle the Outliner selection of items"; + ot->description= _("Toggle the Outliner selection of items"); /* callbacks */ ot->exec= outliner_toggle_selected_exec; @@ -1851,9 +1853,9 @@ static int outliner_one_level_exec(bContext *C, wmOperator *op) void OUTLINER_OT_show_one_level(wmOperatorType *ot) { /* identifiers */ - ot->name= "Show/Hide One Level"; + ot->name= _("Show/Hide One Level"); ot->idname= "OUTLINER_OT_show_one_level"; - ot->description= "Expand/collapse all entries by one level"; + ot->description= _("Expand/collapse all entries by one level"); /* callbacks */ ot->exec= outliner_one_level_exec; @@ -1862,7 +1864,7 @@ void OUTLINER_OT_show_one_level(wmOperatorType *ot) /* no undo or registry, UI option */ /* properties */ - RNA_def_boolean(ot->srna, "open", 1, "Open", "Expand all entries one level deep."); + RNA_def_boolean(ot->srna, "open", 1, _("Open"), _("Expand all entries one level deep.")); } /* This is not used anywhere at the moment */ @@ -2616,15 +2618,15 @@ static int outliner_item_activate(bContext *C, wmOperator *op, wmEvent *event) void OUTLINER_OT_item_activate(wmOperatorType *ot) { - ot->name= "Activate Item"; + ot->name= _("Activate Item"); ot->idname= "OUTLINER_OT_item_activate"; - ot->description= "Handle mouse clicks to activate/select items"; + ot->description= _("Handle mouse clicks to activate/select items"); ot->invoke= outliner_item_activate; ot->poll= ED_operator_outliner_active; - RNA_def_boolean(ot->srna, "extend", 1, "Extend", "Extend selection for activation."); + RNA_def_boolean(ot->srna, "extend", 1, _("Extend"), _("Extend selection for activation.")); } /* *********** */ @@ -2679,15 +2681,15 @@ static int outliner_item_openclose(bContext *C, wmOperator *op, wmEvent *event) void OUTLINER_OT_item_openclose(wmOperatorType *ot) { - ot->name= "Open/Close Item"; + ot->name= _("Open/Close Item"); ot->idname= "OUTLINER_OT_item_openclose"; - ot->description= "Toggle whether item under cursor is enabled or closed"; + ot->description= _("Toggle whether item under cursor is enabled or closed"); ot->invoke= outliner_item_openclose; ot->poll= ED_operator_outliner_active; - RNA_def_boolean(ot->srna, "all", 1, "All", "Close or open all items."); + RNA_def_boolean(ot->srna, "all", 1, _("All"), _("Close or open all items.")); } @@ -2749,9 +2751,9 @@ static int outliner_item_rename(bContext *C, wmOperator *UNUSED(op), wmEvent *ev void OUTLINER_OT_item_rename(wmOperatorType *ot) { - ot->name= "Rename Item"; + ot->name= _("Rename Item"); ot->idname= "OUTLINER_OT_item_rename"; - ot->description= "Rename item under cursor"; + ot->description= _("Rename item under cursor"); ot->invoke= outliner_item_rename; @@ -2816,9 +2818,9 @@ static int outliner_show_active_exec(bContext *C, wmOperator *UNUSED(op)) void OUTLINER_OT_show_active(wmOperatorType *ot) { /* identifiers */ - ot->name= "Show Active"; + ot->name= _("Show Active"); ot->idname= "OUTLINER_OT_show_active"; - ot->description= "Adjust the view so that the active Object is shown centered"; + ot->description= _("Adjust the view so that the active Object is shown centered"); /* callbacks */ ot->exec= outliner_show_active_exec; @@ -3046,9 +3048,9 @@ static int outliner_show_hierarchy_exec(bContext *C, wmOperator *UNUSED(op)) void OUTLINER_OT_show_hierarchy(wmOperatorType *ot) { /* identifiers */ - ot->name= "Show Hierarchy"; + ot->name= _("Show Hierarchy"); ot->idname= "OUTLINER_OT_show_hierarchy"; - ot->description= "Open all object entries and close all others"; + ot->description= _("Open all object entries and close all others"); /* callbacks */ ot->exec= outliner_show_hierarchy_exec; @@ -3440,12 +3442,12 @@ static void outliner_del(bContext *C, Scene *scene, ARegion *UNUSED(ar), SpaceOo /* **************************************** */ static EnumPropertyItem prop_object_op_types[] = { - {1, "SELECT", 0, "Select", ""}, - {2, "DESELECT", 0, "Deselect", ""}, - {4, "DELETE", 0, "Delete", ""}, - {6, "TOGVIS", 0, "Toggle Visible", ""}, - {7, "TOGSEL", 0, "Toggle Selectable", ""}, - {8, "TOGREN", 0, "Toggle Renderable", ""}, + {1, "SELECT", 0, N_("Select"), ""}, + {2, "DESELECT", 0, N_("Deselect"), ""}, + {4, "DELETE", 0, N_("Delete"), ""}, + {6, "TOGVIS", 0, N_("Toggle Visible"), ""}, + {7, "TOGSEL", 0, N_("Toggle Selectable"), ""}, + {8, "TOGREN", 0, N_("Toggle Renderable"), ""}, {0, NULL, 0, NULL, NULL} }; @@ -3513,7 +3515,7 @@ static int outliner_object_operation_exec(bContext *C, wmOperator *op) void OUTLINER_OT_object_operation(wmOperatorType *ot) { /* identifiers */ - ot->name= "Outliner Object Operation"; + ot->name= _("Outliner Object Operation"); ot->idname= "OUTLINER_OT_object_operation"; ot->description= ""; @@ -3524,18 +3526,18 @@ void OUTLINER_OT_object_operation(wmOperatorType *ot) ot->flag= 0; - ot->prop= RNA_def_enum(ot->srna, "type", prop_object_op_types, 0, "Object Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_object_op_types), 0, _("Object Operation"), ""); } /* **************************************** */ static EnumPropertyItem prop_group_op_types[] = { - {1, "UNLINK", 0, "Unlink", ""}, - {2, "LOCAL", 0, "Make Local", ""}, - {3, "LINK", 0, "Link Group Objects to Scene", ""}, - {4, "TOGVIS", 0, "Toggle Visible", ""}, - {5, "TOGSEL", 0, "Toggle Selectable", ""}, - {6, "TOGREN", 0, "Toggle Renderable", ""}, + {1, "UNLINK", 0, N_("Unlink"), ""}, + {2, "LOCAL", 0, N_("Make Local"), ""}, + {3, "LINK", 0, N_("Link Group Objects to Scene"), ""}, + {4, "TOGVIS", 0, N_("Toggle Visible"), ""}, + {5, "TOGSEL", 0, N_("Toggle Selectable"), ""}, + {6, "TOGREN", 0, N_("Toggle Renderable"), ""}, {0, NULL, 0, NULL, NULL} }; @@ -3574,7 +3576,7 @@ static int outliner_group_operation_exec(bContext *C, wmOperator *op) void OUTLINER_OT_group_operation(wmOperatorType *ot) { /* identifiers */ - ot->name= "Outliner Group Operation"; + ot->name= _("Outliner Group Operation"); ot->idname= "OUTLINER_OT_group_operation"; ot->description= ""; @@ -3585,14 +3587,14 @@ void OUTLINER_OT_group_operation(wmOperatorType *ot) ot->flag= 0; - ot->prop= RNA_def_enum(ot->srna, "type", prop_group_op_types, 0, "Group Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_group_op_types), 0, _("Group Operation"), ""); } /* **************************************** */ static EnumPropertyItem prop_id_op_types[] = { - {1, "UNLINK", 0, "Unlink", ""}, - {2, "LOCAL", 0, "Make Local", ""}, + {1, "UNLINK", 0, N_("Unlink"), ""}, + {2, "LOCAL", 0, N_("Make Local"), ""}, {0, NULL, 0, NULL, NULL} }; @@ -3640,7 +3642,7 @@ static int outliner_id_operation_exec(bContext *C, wmOperator *op) void OUTLINER_OT_id_operation(wmOperatorType *ot) { /* identifiers */ - ot->name= "Outliner ID data Operation"; + ot->name= _("Outliner ID data Operation"); ot->idname= "OUTLINER_OT_id_operation"; ot->description= ""; @@ -3651,16 +3653,16 @@ void OUTLINER_OT_id_operation(wmOperatorType *ot) ot->flag= 0; - ot->prop= RNA_def_enum(ot->srna, "type", prop_id_op_types, 0, "ID data Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_id_op_types), 0, _("ID data Operation"), ""); } /* **************************************** */ static EnumPropertyItem prop_data_op_types[] = { - {1, "SELECT", 0, "Select", ""}, - {2, "DESELECT", 0, "Deselect", ""}, - {3, "HIDE", 0, "Hide", ""}, - {4, "UNHIDE", 0, "Unhide", ""}, + {1, "SELECT", 0, N_("Select"), ""}, + {2, "DESELECT", 0, N_("Deselect"), ""}, + {3, "HIDE", 0, N_("Hide"), ""}, + {4, "UNHIDE", 0, N_("Unhide"), ""}, {0, NULL, 0, NULL, NULL} }; @@ -3711,7 +3713,7 @@ static int outliner_data_operation_exec(bContext *C, wmOperator *op) void OUTLINER_OT_data_operation(wmOperatorType *ot) { /* identifiers */ - ot->name= "Outliner Data Operation"; + ot->name= _("Outliner Data Operation"); ot->idname= "OUTLINER_OT_data_operation"; ot->description= ""; @@ -3722,7 +3724,7 @@ void OUTLINER_OT_data_operation(wmOperatorType *ot) ot->flag= 0; - ot->prop= RNA_def_enum(ot->srna, "type", prop_data_op_types, 0, "Data Operation", ""); + ot->prop= RNA_def_enum(ot->srna, "type", RNA_enum_items_gettexted(prop_data_op_types), 0, _("Data Operation"), ""); } @@ -3804,9 +3806,9 @@ static int outliner_operation(bContext *C, wmOperator *UNUSED(op), wmEvent *even /* Menu only! Calls other operators */ void OUTLINER_OT_operation(wmOperatorType *ot) { - ot->name= "Execute Operation"; + ot->name= _("Execute Operation"); ot->idname= "OUTLINER_OT_operation"; - ot->description= "Context menu for item operations"; + ot->description= _("Context menu for item operations"); ot->invoke= outliner_operation; @@ -4073,8 +4075,8 @@ void OUTLINER_OT_drivers_add_selected(wmOperatorType *ot) { /* api callbacks */ ot->idname= "OUTLINER_OT_drivers_add_selected"; - ot->name= "Add Drivers for Selected"; - ot->description= "Add drivers to selected items"; + ot->name= _("Add Drivers for Selected"); + ot->description= _("Add drivers to selected items"); /* api callbacks */ ot->exec= outliner_drivers_addsel_exec; @@ -4108,8 +4110,8 @@ void OUTLINER_OT_drivers_delete_selected(wmOperatorType *ot) { /* identifiers */ ot->idname= "OUTLINER_OT_drivers_delete_selected"; - ot->name= "Delete Drivers for Selected"; - ot->description= "Delete drivers assigned to selected items"; + ot->name= _("Delete Drivers for Selected"); + ot->description= _("Delete drivers assigned to selected items"); /* api callbacks */ ot->exec= outliner_drivers_deletesel_exec; @@ -4246,8 +4248,8 @@ void OUTLINER_OT_keyingset_add_selected(wmOperatorType *ot) { /* identifiers */ ot->idname= "OUTLINER_OT_keyingset_add_selected"; - ot->name= "Keying Set Add Selected"; - ot->description= "Add selected items (blue-grey rows) to active Keying Set"; + ot->name= _("Keying Set Add Selected"); + ot->description= _("Add selected items (blue-grey rows) to active Keying Set"); /* api callbacks */ ot->exec= outliner_keyingset_additems_exec; @@ -4283,8 +4285,8 @@ void OUTLINER_OT_keyingset_remove_selected(wmOperatorType *ot) { /* identifiers */ ot->idname= "OUTLINER_OT_keyingset_remove_selected"; - ot->name= "Keying Set Remove Selected"; - ot->description = "Remove selected items (blue-grey rows) from active Keying Set"; + ot->name= _("Keying Set Remove Selected"); + ot->description = _("Remove selected items (blue-grey rows) from active Keying Set"); /* api callbacks */ ot->exec= outliner_keyingset_removeitems_exec; |