2.5
authorTon Roosendaal <ton@blender.org>
Mon, 16 Feb 2009 12:14:04 +0000 (12:14 +0000)
committerTon Roosendaal <ton@blender.org>
Mon, 16 Feb 2009 12:14:04 +0000 (12:14 +0000)
commit4154e48c053caf947f2668a168ce38aa10b8481b
tree294c3173648572d6669a8c85e08a459ba0075ce1
parentf6df8e1860d44d6b4d2c9048b0fb0ebdbfd850d3
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.
source/blender/editors/space_file/file_ops.c
source/blender/editors/space_file/space_file.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_sequencer/sequencer_header.c
source/blender/makesdna/DNA_screen_types.h
source/blender/windowmanager/WM_api.h
source/blender/windowmanager/intern/wm_event_system.c
source/blender/windowmanager/intern/wm_operators.c
source/blender/windowmanager/wm_event_system.h
source/blender/windowmanager/wm_event_types.h