diff options
author | Campbell Barton <ideasman42@gmail.com> | 2009-01-26 12:13:15 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2009-01-26 12:13:15 +0300 |
commit | bf05827319f07d7a7b34ff34d0556cb54f6284d9 (patch) | |
tree | 316ef06abbd79f761dfb467937c1392132d053d8 /source/blender/windowmanager/intern/wm_operators.c | |
parent | 87627374000b7de7445736a7239a3f2b168ce7eb (diff) |
* Added WM_operator_filesel which can be used for an operators invoke function (like WM_operator_confirm).
It opens the files selector if "filename" property has not been set, else it executes the operator directly. Brecht, you might want to check, currently only sequencer add operators use it.
* Added back Effects menu back, replaced SEQUENCER_OT_add_color_strip with SEQUENCER_OT_add_effect_strip.
* Made sequencer header use operator UI functions.
* gcc complains when char's are used as array indicies when they are not explicitly signed/unsigned, corrected previous change for vpaint to silence this error.
Diffstat (limited to 'source/blender/windowmanager/intern/wm_operators.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index d5fb3bce2e2..fe9fe2e29a4 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -236,6 +236,26 @@ int WM_operator_confirm(bContext *C, wmOperator *op, wmEvent *event) return OPERATOR_RUNNING_MODAL; } +/* op->invoke, opens fileselect if filename property not set, otherwise executes */ +int WM_operator_filesel(bContext *C, wmOperator *op, wmEvent *event) +{ + if (RNA_property_is_set(op->ptr, "filename")) { + return WM_operator_call(C, op); + } else { + SpaceFile *sfile; + + ED_screen_full_newspace(C, CTX_wm_area(C), SPACE_FILE); + + /* settings for filebrowser */ + sfile= (SpaceFile*)CTX_wm_space_data(C); + sfile->op = op; + ED_fileselect_set_params(sfile, FILE_BLENDER, op->type->name, "", 0, 0, 0); + + /* screen and area have been reset already in ED_screen_full_newspace */ + return OPERATOR_RUNNING_MODAL; + } +} + /* op->poll */ int WM_operator_winactive(bContext *C) { |