[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [39404] trunk/blender/source/blender/ editors/space_file/file_ops.c: workaround [#28250] Append dialogue will ask to create new directory inside a .blend

Campbell Barton ideasman42 at gmail.com
Mon Aug 15 06:11:56 CEST 2011


Revision: 39404
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=39404
Author:   campbellbarton
Date:     2011-08-15 04:11:55 +0000 (Mon, 15 Aug 2011)
Log Message:
-----------
workaround [#28250] Append dialogue will ask to create new directory inside a .blend

directory button isnt library aware, for now disable it when a libraries loaded.

Modified Paths:
--------------
    trunk/blender/source/blender/editors/space_file/file_ops.c

Modified: trunk/blender/source/blender/editors/space_file/file_ops.c
===================================================================
--- trunk/blender/source/blender/editors/space_file/file_ops.c	2011-08-15 03:41:31 UTC (rev 39403)
+++ trunk/blender/source/blender/editors/space_file/file_ops.c	2011-08-15 04:11:55 UTC (rev 39404)
@@ -1159,6 +1159,13 @@
 	return OPERATOR_FINISHED;
 }
 
+/* TODO, directory operator is non-functional while a library is loaded
+ * until this is properly supported just disable it. */
+static int file_directory_poll(bContext *C)
+{
+	return ED_operator_file_active(C) && filelist_lib(CTX_wm_space_file(C)->files) == NULL;
+}
+
 void FILE_OT_directory(struct wmOperatorType *ot)
 {
 	/* identifiers */
@@ -1169,7 +1176,7 @@
 	/* api callbacks */
 	ot->invoke= file_directory_invoke;
 	ot->exec= file_directory_exec;
-	ot->poll= ED_operator_file_active; /* <- important, handler is on window level */
+	ot->poll= file_directory_poll; /* <- important, handler is on window level */
 }
 
 void FILE_OT_refresh(struct wmOperatorType *ot)




More information about the Bf-blender-cvs mailing list