diff options
author | Campbell Barton <ideasman42@gmail.com> | 2013-03-01 10:17:59 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2013-03-01 10:17:59 +0400 |
commit | 2de9ce794015181c7c6ff9fdaddc166b067399db (patch) | |
tree | 8819628127703f475a479aefed5f5a96b999ce96 /source | |
parent | 2de8dfd7847205aae15831c662aa067f8647bd3a (diff) |
keymap filter by keybindings in the userpreferences.
- optional, select between name/keybinding.
- when key input can't be parsed, alert red to give the user some feedback.
- key shortcut parsing could be improved or swapped out for button which grabs shortcut.
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 4 | ||||
-rw-r--r-- | source/blender/makesrna/intern/rna_space.c | 13 |
2 files changed, 14 insertions, 3 deletions
diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index b8ba58d7a6d..4c28199481f 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -1004,8 +1004,8 @@ typedef struct SpaceUserPref { ListBase regionbase; /* storage of regions for inactive spaces */ int spacetype; - int pad; - + char pad[3]; + char filter_type; char filter[64]; /* search term for filtering in the UI */ } SpaceUserPref; diff --git a/source/blender/makesrna/intern/rna_space.c b/source/blender/makesrna/intern/rna_space.c index 6db863a267b..1f2cf469c5e 100644 --- a/source/blender/makesrna/intern/rna_space.c +++ b/source/blender/makesrna/intern/rna_space.c @@ -3054,13 +3054,24 @@ static void rna_def_space_info(BlenderRNA *brna) static void rna_def_space_userpref(BlenderRNA *brna) { + static EnumPropertyItem filter_type_items[] = { + {0, "NAME", 0, "Name", "Filter based on the operator name"}, + {1, "KEY", 0, "Key-Binding", "Filter based on key bindings"}, + {0, NULL, 0, NULL, NULL}}; + StructRNA *srna; PropertyRNA *prop; srna = RNA_def_struct(brna, "SpaceUserPreferences", "Space"); RNA_def_struct_sdna(srna, "SpaceUserPref"); RNA_def_struct_ui_text(srna, "Space User Preferences", "User preferences space data"); - + + prop = RNA_def_property(srna, "filter_type", PROP_ENUM, PROP_NONE); + RNA_def_property_enum_sdna(prop, NULL, "filter_type"); + RNA_def_property_enum_items(prop, filter_type_items); + RNA_def_property_ui_text(prop, "Filter Type", "Filter method"); + RNA_def_property_update(prop, NC_SPACE | ND_SPACE_NODE, NULL); + prop = RNA_def_property(srna, "filter_text", PROP_STRING, PROP_NONE); RNA_def_property_string_sdna(prop, NULL, "filter"); RNA_def_property_ui_text(prop, "Filter", "Search term for filtering in the UI"); |