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:
authorTon Roosendaal <ton@blender.org>2009-02-16 15:14:04 +0300
committerTon Roosendaal <ton@blender.org>2009-02-16 15:14:04 +0300
commit4154e48c053caf947f2668a168ce38aa10b8481b (patch)
tree294c3173648572d6669a8c85e08a459ba0075ce1 /source/blender/editors/space_sequencer
parentf6df8e1860d44d6b4d2c9048b0fb0ebdbfd850d3 (diff)
2.5
Proper integration of File-selecting in WM. The communication flow was flawed. :) Main problem was that filewindow can change the screen context entirely, and should not do this directly on a call inside an operator. Another problem was that the operator ownership was handed over to SpaceFile, which is asking for problems if you want to execute the operator with proper context later on. Solution is simple; window handlers already are valid owners of operators and can manage context, so instead of directly talking to the 'file space', you give the operator to a new handler this way: WM_event_add_fileselect(C, op); This handler then listens to events (OPEN, EXEC, CANCEL) sent by the WM or by the filewindow itself. This way local context operators (like "open new image in imagewindow") will survive a full-window fileselector fine, and in future also secondary windows browsing files. Two bugfixes included in this commit too: - Add sequence menus in Sequencer used wrong context. - When handler executes operators, it sets stored context now by first checking if this is still valid.
Diffstat (limited to 'source/blender/editors/space_sequencer')
-rw-r--r--source/blender/editors/space_sequencer/sequencer_header.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/editors/space_sequencer/sequencer_header.c b/source/blender/editors/space_sequencer/sequencer_header.c
index 32a60f1fb54..71d7ff728d3 100644
--- a/source/blender/editors/space_sequencer/sequencer_header.c
+++ b/source/blender/editors/space_sequencer/sequencer_header.c
@@ -146,7 +146,7 @@ static uiBlock *seq_viewmenu(bContext *C, ARegion *ar, void *arg_unused)
//static uiBlock *seq_selectmenu(bContext *C, ARegion *ar, void *arg_unused)
static void seq_selectmenu(bContext *C, uiMenuItem *head, void *arg_unused)
{
- uiMenuContext(head, WM_OP_INVOKE_DEFAULT);
+ uiMenuContext(head, WM_OP_INVOKE_REGION_WIN);
uiMenuItemEnumO(head, "Strips to the Left", 0, "SEQUENCER_OT_select_active_side", "side", SEQ_SIDE_LEFT);
uiMenuItemEnumO(head, "Strips to the Right", 0, "SEQUENCER_OT_select_active_side", "side", SEQ_SIDE_RIGHT);
@@ -212,7 +212,7 @@ static uiBlock *seq_markermenu(bContext *C, ARegion *ar, void *arg_unused)
//static uiBlock *seq_addmenu_effectmenu(bContext *C, ARegion *ar, void *arg_unused)
static void seq_addmenu_effectmenu(bContext *C, uiMenuItem *head, void *arg_unused)
{
- uiMenuContext(head, WM_OP_INVOKE_DEFAULT);
+ uiMenuContext(head, WM_OP_INVOKE_REGION_WIN);
uiMenuItemEnumO(head, "", 0, "SEQUENCER_OT_add_effect_strip", "type", SEQ_ADD);
uiMenuItemEnumO(head, "", 0, "SEQUENCER_OT_add_effect_strip", "type", SEQ_SUB);
@@ -238,7 +238,7 @@ static void seq_addmenu(bContext *C, uiMenuItem *head, void *arg_unused)
uiMenuLevel(head, "Effects...", seq_addmenu_effectmenu);
uiMenuSeparator(head);
- uiMenuContext(head, WM_OP_INVOKE_DEFAULT);
+ uiMenuContext(head, WM_OP_INVOKE_REGION_WIN);
#ifdef WITH_FFMPEG
uiMenuItemBooleanO(head, "Audio (RAM)", 0, "SEQUENCER_OT_add_sound_strip", "hd", FALSE);
@@ -263,7 +263,7 @@ static void seq_editmenu(bContext *C, uiMenuItem *head, void *arg_unused)
Scene *scene= CTX_data_scene(C);
Editing *ed= seq_give_editing(scene, FALSE);
- uiMenuContext(head, WM_OP_INVOKE_DEFAULT);
+ uiMenuContext(head, WM_OP_INVOKE_REGION_WIN);
uiMenuItemEnumO(head, "", 0, "TFM_OT_transform", "mode", TFM_TRANSLATION);
uiMenuItemEnumO(head, "", 0, "TFM_OT_transform", "mode", TFM_TIME_EXTEND);