From 973128dc66ce9aed0f62dbabdd2a0f3f7939367b Mon Sep 17 00:00:00 2001 From: Matt Ebb Date: Wed, 20 Jan 2010 12:28:33 +0000 Subject: Fix for crash in file selector using the 'Open' button - button was using old UI code, changed it to operators --- source/blender/editors/space_file/file_draw.c | 19 +++++++------------ source/blender/editors/space_file/file_intern.h | 2 +- 2 files changed, 8 insertions(+), 13 deletions(-) (limited to 'source') 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); -- cgit v1.2.3