diff options
author | Martin Poirier <theeth@yahoo.com> | 2010-12-06 05:42:59 +0300 |
---|---|---|
committer | Martin Poirier <theeth@yahoo.com> | 2010-12-06 05:42:59 +0300 |
commit | a1fed1e268aa3bd6ad32acf751022e5f12db0233 (patch) | |
tree | 0fd6fe1efdd219d2ceef62bf906996435fe41f1d /source/blender/makesrna/intern | |
parent | a724918cf3997cbd1fc33c663d1a76441c2deeb0 (diff) |
[#25047] Deletion of any custom key map item remove always first one
keymap item id for user defined keymaps wasn't defined properly. This is really old, I'm surprised with didn't catch this before.
Diffstat (limited to 'source/blender/makesrna/intern')
-rw-r--r-- | source/blender/makesrna/intern/rna_wm.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/source/blender/makesrna/intern/rna_wm.c b/source/blender/makesrna/intern/rna_wm.c index bf00f625f42..11aed2127a8 100644 --- a/source/blender/makesrna/intern/rna_wm.c +++ b/source/blender/makesrna/intern/rna_wm.c @@ -612,6 +612,12 @@ static int rna_wmKeyMapItem_name_length(PointerRNA *ptr) return 0; } +static int rna_KeyMapItem_userdefined_get(PointerRNA *ptr) +{ + wmKeyMapItem *kmi= ptr->data; + return kmi->id < 0; +} + static void rna_wmClipboard_get(PointerRNA *ptr, char *value) { char *pbuf; @@ -1679,6 +1685,11 @@ static void rna_def_keyconfig(BlenderRNA *brna) RNA_def_property_ui_text(prop, "Active", "Activate or deactivate item"); RNA_def_property_ui_icon(prop, ICON_CHECKBOX_DEHLT, 1); + prop= RNA_def_property(srna, "is_user_defined", PROP_BOOLEAN, PROP_NONE); + RNA_def_property_clear_flag(prop, PROP_EDITABLE); + RNA_def_property_ui_text(prop, "User Defined", "Is this keymap item user defined (doesn't just override a builtin item)"); + RNA_def_property_boolean_funcs(prop, "rna_KeyMapItem_userdefined_get", NULL); + RNA_api_keymapitem(srna); } |