diff options
author | Campbell Barton <ideasman42@gmail.com> | 2011-08-15 08:11:55 +0400 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2011-08-15 08:11:55 +0400 |
commit | e4f2234fffff40afa7f74dc33b5e0f8ad1a7d78f (patch) | |
tree | d4931c88124f5ff03deb6189b8a289677a3d0e9c /source/blender/editors/space_file | |
parent | 2c8e1e633c402e677e3f49e8a9c429f59ef6f239 (diff) |
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.
Diffstat (limited to 'source/blender/editors/space_file')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index d4253495e97..4dd97c63d40 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -1159,6 +1159,13 @@ int file_filename_exec(bContext *C, wmOperator *UNUSED(unused)) 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 @@ void FILE_OT_directory(struct wmOperatorType *ot) /* 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) |