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 <montagne29@wanadoo.fr>2012-09-23 00:07:30 +0400
committerBastien Montagne <montagne29@wanadoo.fr>2012-09-23 00:07:30 +0400
commit89d6cc7e23a26a3036bfa52592303e6d745edd09 (patch)
tree726618736eb8383f62741883c3232400d5d6359a /source/blender/makesrna/intern/rna_wm.c
parente5d74d224798a0484a9c7306faa3fc0826bb1c35 (diff)
Make "name" member of RNA KeymapItem struct return the translated name of the underlying operator. Else, op names are usually not translated in keymap part of the user preferences! Thx to Miklós Pomsár for pointing this bug. :)
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index 847641770e1..d8753f4ff43 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -765,14 +765,14 @@ static void rna_wmKeyMapItem_name_get(PointerRNA *ptr, char *value)
{
wmKeyMapItem *kmi = ptr->data;
wmOperatorType *ot = WM_operatortype_find(kmi->idname, 1);
- strcpy(value, ot ? ot->name : kmi->idname);
+ strcpy(value, ot ? RNA_struct_ui_name(ot->srna) : kmi->idname);
}
static int rna_wmKeyMapItem_name_length(PointerRNA *ptr)
{
wmKeyMapItem *kmi = ptr->data;
wmOperatorType *ot = WM_operatortype_find(kmi->idname, 1);
- return strlen(ot ? ot->name : kmi->idname);
+ return strlen(ot ? RNA_struct_ui_name(ot->srna) : kmi->idname);
}
static int rna_KeyMapItem_userdefined_get(PointerRNA *ptr)
@@ -1793,7 +1793,7 @@ static void rna_def_keyconfig(BlenderRNA *brna)
* fallback on the operator ID */
prop = RNA_def_property(srna, "name", PROP_STRING, PROP_NONE);
RNA_def_property_clear_flag(prop, PROP_EDITABLE);
- RNA_def_property_ui_text(prop, "Name", "Name of operator to call on input event");
+ RNA_def_property_ui_text(prop, "Name", "Name of operator (translated) to call on input event");
RNA_def_property_string_funcs(prop, "rna_wmKeyMapItem_name_get", "rna_wmKeyMapItem_name_length", NULL);
prop = RNA_def_property(srna, "properties", PROP_POINTER, PROP_NONE);