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>2009-09-18 01:36:02 +0400
committerBrecht Van Lommel <brechtvanlommel@pandora.be>2009-09-18 01:36:02 +0400
commit69e919530e179c0ac251534003e3ab8f540e82fe (patch)
treef45b87b1d2a31c94540011c3f5f828d073f12cae /source/blender/editors/space_script
parentb572ae2a8bdd4adfc1641a43ca02061b9ae6eff9 (diff)
Keymaps now have a poll() function, rather than adding/removing
their handlers based on notifiers, which is simpler and more reliable. This fixes for example editmode or uv edit keymaps not working when creating a new 3dview or image space.
Diffstat (limited to 'source/blender/editors/space_script')
-rw-r--r--source/blender/editors/space_script/script_ops.c2
-rw-r--r--source/blender/editors/space_script/space_script.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/source/blender/editors/space_script/script_ops.c b/source/blender/editors/space_script/script_ops.c
index 270cc1ffd8f..0e6ea9cf4fd 100644
--- a/source/blender/editors/space_script/script_ops.c
+++ b/source/blender/editors/space_script/script_ops.c
@@ -65,7 +65,7 @@ void script_operatortypes(void)
void script_keymap(wmWindowManager *wm)
{
- ListBase *keymap= WM_keymap_listbase(wm, "Script", SPACE_SCRIPT, 0);
+ wmKeyMap *keymap= WM_keymap_find(wm, "Script", SPACE_SCRIPT, 0);
/* TODO - this is just while we have no way to load a text datablock */
RNA_string_set(WM_keymap_add_item(keymap, "SCRIPT_OT_python_file_run", PKEY, KM_PRESS, KM_CTRL|KM_SHIFT|KM_ALT, 0)->ptr, "path", "test.py");
diff --git a/source/blender/editors/space_script/space_script.c b/source/blender/editors/space_script/space_script.c
index 99233cc5020..a0e73082701 100644
--- a/source/blender/editors/space_script/space_script.c
+++ b/source/blender/editors/space_script/space_script.c
@@ -133,12 +133,12 @@ static SpaceLink *script_duplicate(SpaceLink *sl)
/* add handlers, stuff you only do once or on area/region changes */
static void script_main_area_init(wmWindowManager *wm, ARegion *ar)
{
- ListBase *keymap;
+ wmKeyMap *keymap;
UI_view2d_region_reinit(&ar->v2d, V2D_COMMONVIEW_STANDARD, ar->winx, ar->winy);
/* own keymap */
- keymap= WM_keymap_listbase(wm, "Script", SPACE_SCRIPT, 0); /* XXX weak? */
+ keymap= WM_keymap_find(wm, "Script", SPACE_SCRIPT, 0);
WM_event_add_keymap_handler_bb(&ar->handlers, keymap, &ar->v2d.mask, &ar->winrct);
}