forked from bartvdbraak/blender
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.
This commit is contained in:
parent
2c8e1e633c
commit
e4f2234fff
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user