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:
authorLukas Tönne <lukas.toenne@gmail.com>2014-06-25 19:40:51 +0400
committerLukas Tönne <lukas.toenne@gmail.com>2014-06-25 19:42:01 +0400
commit42959f05a467028e4b8835e495ceb604eb7ea1d7 (patch)
tree13fe8c3818b84be000f45be2420553ace5670dd0 /source/blender/editors/interface/interface_handlers.c
parentf430127bbd1ec808745ea82bbf19bff71975cb53 (diff)
Fix T40759: "Add Shortcut" operator was leaving new keymap items on
cancel.
Diffstat (limited to 'source/blender/editors/interface/interface_handlers.c')
-rw-r--r--source/blender/editors/interface/interface_handlers.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/source/blender/editors/interface/interface_handlers.c b/source/blender/editors/interface/interface_handlers.c
index 9189f14dd7c..e04fef329b1 100644
--- a/source/blender/editors/interface/interface_handlers.c
+++ b/source/blender/editors/interface/interface_handlers.c
@@ -5564,6 +5564,18 @@ static uiBlock *menu_add_shortcut(bContext *C, ARegion *ar, void *arg)
return block;
}
+static void menu_add_shortcut_cancel(struct bContext *C, void *arg1)
+{
+ uiBut *but = (uiBut *)arg1;
+ wmKeyMap *km;
+ wmKeyMapItem *kmi;
+ IDProperty *prop = (but->opptr) ? but->opptr->data : NULL;
+ int kmi_id = WM_key_event_operator_id(C, but->optype->idname, but->opcontext, prop, true, &km);
+
+ kmi = WM_keymap_item_find_id(km, kmi_id);
+ WM_keymap_remove_item(km, kmi);
+}
+
static void popup_change_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
{
uiBut *but = (uiBut *)arg1;
@@ -5589,7 +5601,7 @@ static void popup_add_shortcut_func(bContext *C, void *arg1, void *UNUSED(arg2))
{
uiBut *but = (uiBut *)arg1;
button_timers_tooltip_remove(C, but);
- uiPupBlock(C, menu_add_shortcut, but);
+ uiPupBlockEx(C, menu_add_shortcut, NULL, menu_add_shortcut_cancel, but);
}
/**