diff options
author | Campbell Barton <ideasman42@gmail.com> | 2019-03-15 04:45:41 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2019-03-15 06:53:08 +0300 |
commit | 3400fe3ecee99cb6a74455943f2755e6f22ef047 (patch) | |
tree | d38e6d65b73f32d4b7685f2010e3f70df45994a0 /source/blender/windowmanager/intern | |
parent | 388ff003e28bb8077d3dbd300e7e1f6beccea263 (diff) |
Tool System: split UI label from tool identifiers
Prepare for exposing tool registration to the Python API.
- Generated tools can use their own prefix so naming collisions
won't happen between hard coded & generated tools.
- Add-on authors can use the add-on name as a prefix.
Currently the names match, renaming will happen next.
Diffstat (limited to 'source/blender/windowmanager/intern')
-rw-r--r-- | source/blender/windowmanager/intern/wm_keymap_utils.c | 4 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_toolsystem.c | 6 |
2 files changed, 5 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_keymap_utils.c b/source/blender/windowmanager/intern/wm_keymap_utils.c index b387cd0cfa8..6e70511ce63 100644 --- a/source/blender/windowmanager/intern/wm_keymap_utils.c +++ b/source/blender/windowmanager/intern/wm_keymap_utils.c @@ -69,7 +69,7 @@ wmKeyMapItem *WM_keymap_add_panel(wmKeyMap *keymap, const char *idname, int type /* tool wrapper for WM_keymap_add_item */ wmKeyMapItem *WM_keymap_add_tool(wmKeyMap *keymap, const char *idname, int type, int val, int modifier, int keymodifier) { - wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_tool_set_by_name", type, val, modifier, keymodifier); + wmKeyMapItem *kmi = WM_keymap_add_item(keymap, "WM_OT_tool_set_by_id", type, val, modifier, keymodifier); RNA_string_set(kmi->ptr, "name", idname); return kmi; } @@ -169,7 +169,7 @@ wmKeyMap *WM_keymap_guess_opname(const bContext *C, const char *opname) if (STRPREFIX(opname, "WM_OT") || STRPREFIX(opname, "ED_OT_undo")) { - if (STREQ(opname, "WM_OT_tool_set_by_name")) { + if (STREQ(opname, "WM_OT_tool_set_by_id")) { km = WM_keymap_guess_from_context(C); } diff --git a/source/blender/windowmanager/intern/wm_toolsystem.c b/source/blender/windowmanager/intern/wm_toolsystem.c index 1c8bea19952..75bcee562a0 100644 --- a/source/blender/windowmanager/intern/wm_toolsystem.c +++ b/source/blender/windowmanager/intern/wm_toolsystem.c @@ -728,11 +728,11 @@ static void toolsystem_refresh_screen_from_active_tool( } } -bToolRef *WM_toolsystem_ref_set_by_name( +bToolRef *WM_toolsystem_ref_set_by_id( bContext *C, WorkSpace *workspace, const bToolKey *tkey, const char *name, bool cycle) { - wmOperatorType *ot = WM_operatortype_find("WM_OT_tool_set_by_name", false); + wmOperatorType *ot = WM_operatortype_find("WM_OT_tool_set_by_id", false); /* On startup, Python operatores are not yet loaded. */ if (ot == NULL) { return NULL; @@ -775,7 +775,7 @@ static void toolsystem_reinit_with_toolref( .space_type = tref->space_type, .mode = tref->mode, }; - WM_toolsystem_ref_set_by_name(C, workspace, &tkey, tref->idname, false); + WM_toolsystem_ref_set_by_id(C, workspace, &tkey, tref->idname, false); } static const char *toolsystem_default_tool(const bToolKey *tkey) |