[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [26139] trunk/blender/source/blender/ editors/space_file: Fix for crash in file selector using the 'Open' button - button was using old UI

Matt Ebb matt at mke3.net
Wed Jan 20 13:28:33 CET 2010


Revision: 26139
          http://projects.blender.org/plugins/scmsvn/viewcvs.php?view=rev&root=bf-blender&revision=26139
Author:   broken
Date:     2010-01-20 13:28:33 +0100 (Wed, 20 Jan 2010)

Log Message:
-----------
Fix for crash in file selector using the 'Open' button - button was using old UI 
code, changed it to operators

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_file/file_draw.c
    trunk/blender/source/blender/editors/space_file/file_intern.h

Modified: trunk/blender/source/blender/editors/space_file/file_draw.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_draw.c	2010-01-20 12:20:34 UTC (rev 26138)
+++ trunk/blender/source/blender/editors/space_file/file_draw.c	2010-01-20 12:28:33 UTC (rev 26139)
@@ -99,12 +99,6 @@
 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 @@
 	
 	/* 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);

Modified: trunk/blender/source/blender/editors/space_file/file_intern.h
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_intern.h	2010-01-20 12:20:34 UTC (rev 26138)
+++ trunk/blender/source/blender/editors/space_file/file_intern.h	2010-01-20 12:28:33 UTC (rev 26139)
@@ -72,7 +72,7 @@
 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);





More information about the Bf-blender-cvs mailing list