diff options
author | Matt Ebb <matt@mke3.net> | 2010-01-20 15:28:33 +0300 |
---|---|---|
committer | Matt Ebb <matt@mke3.net> | 2010-01-20 15:28:33 +0300 |
commit | 973128dc66ce9aed0f62dbabdd2a0f3f7939367b (patch) | |
tree | ef177d97fa6e1b996e6f29f185433e1d80229e70 /source/blender/editors/space_file | |
parent | 1e7858f5a0daf8cc91f33fd16f5d9868945e4881 (diff) |
Fix for crash in file selector using the 'Open' button - button was using old UI
code, changed it to operators
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 19 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_intern.h | 2 |
2 files changed, 8 insertions, 13 deletions
diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 6a3cc040c97..af0bf9413df 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -99,12 +99,6 @@ enum { static void do_file_buttons(bContext *C, void *arg, int event) { switch(event) { - case B_FS_EXEC: - file_exec(C, NULL); /* file_ops.c */ - break; - case B_FS_CANCEL: - file_cancel_exec(C, NULL); /* file_ops.c */ - break; case B_FS_PARENT: file_parent_exec(C, NULL); /* file_ops.c */ break; @@ -226,12 +220,13 @@ void file_draw_buttons(const bContext *C, ARegion *ar) /* Execute / cancel buttons. */ if(loadbutton) { - uiDefBut(block, BUT, B_FS_EXEC, params->title, - max_x - loadbutton, line1_y, loadbutton, btn_h, - params->dir, 0.0, (float)FILE_MAXFILE-1, 0, 0, params->title); - uiDefBut(block, BUT, B_FS_CANCEL, "Cancel", - max_x - loadbutton, line2_y, loadbutton, btn_h, - params->file, 0.0, (float)FILE_MAXFILE-1, 0, 0, "Cancel."); + + uiDefButO(block, BUT, "FILE_OT_execute", WM_OP_EXEC_REGION_WIN, params->title, + max_x - loadbutton, line1_y, loadbutton, btn_h, + params->title); + uiDefButO(block, BUT, "FILE_OT_cancel", WM_OP_EXEC_REGION_WIN, "Cancel", + max_x - loadbutton, line2_y, loadbutton, btn_h, + "Cancel"); } uiEndBlock(C, block); diff --git a/source/blender/editors/space_file/file_intern.h b/source/blender/editors/space_file/file_intern.h index fa99dc6e1ee..58899818b7c 100644 --- a/source/blender/editors/space_file/file_intern.h +++ b/source/blender/editors/space_file/file_intern.h @@ -72,7 +72,7 @@ void FILE_OT_filenum(struct wmOperatorType *ot); void FILE_OT_delete(struct wmOperatorType *ot); void FILE_OT_rename(struct wmOperatorType *ot); -int file_exec(bContext *C, struct wmOperator *unused); +int file_exec(bContext *C, struct wmOperator *exec_op); int file_cancel_exec(bContext *C, struct wmOperator *unused); int file_parent_exec(bContext *C, struct wmOperator *unused); int file_previous_exec(bContext *C, struct wmOperator *unused); |