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:
authorBrecht Van Lommel <brechtvanlommel@pandora.be>2011-06-06 17:35:43 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2011-06-06 17:35:43 +0400
commit4d254f23ca5964147823307e3bff8d7c3f663e00 (patch)
treec761e4f1c01eb21a6a498403a9e0950dd8ec29de /source/blender/makesrna/intern/rna_wm.c
parent111b0bf698fccb6c877aa139aed525e005caf8dd (diff)
Keymaps: fix keymap items created in python being added with the python
operator names instead of the internal names. This wasn't really noticeable, expect that it broke automatically looking up shortcuts for display in menus.
Diffstat (limited to 'source/blender/makesrna/intern/rna_wm.c')
-rw-r--r--source/blender/makesrna/intern/rna_wm.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c
index fc3039c8752..7ea4701dec3 100644
--- a/source/blender/makesrna/intern/rna_wm.c
+++ b/source/blender/makesrna/intern/rna_wm.c
@@ -1048,6 +1048,7 @@ static StructRNA* rna_MacroOperator_refine(PointerRNA *opr)
static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, const char *idname, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)
{
// wmWindowManager *wm = CTX_wm_manager(C);
+ char idname_bl[OP_MAX_TYPENAME];
int modifier= 0;
/* only on non-modal maps */
@@ -1056,6 +1057,8 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons
return NULL;
}
+ WM_operator_bl_idname(idname_bl, idname);
+
if(shift) modifier |= KM_SHIFT;
if(ctrl) modifier |= KM_CTRL;
if(alt) modifier |= KM_ALT;
@@ -1063,7 +1066,7 @@ static wmKeyMapItem *rna_KeyMap_item_new(wmKeyMap *km, ReportList *reports, cons
if(any) modifier = KM_ANY;
- return WM_keymap_add_item(km, idname, type, value, modifier, keymodifier);
+ return WM_keymap_add_item(km, idname_bl, type, value, modifier, keymodifier);
}
static wmKeyMapItem *rna_KeyMap_item_new_modal(wmKeyMap *km, bContext *C, ReportList *reports, const char *propvalue_str, int type, int value, int any, int shift, int ctrl, int alt, int oskey, int keymodifier)