UI: Allow spawning file browser dialog from regular file browser editor
When some path property was displayed in the File Browser, clicking the icon to open a file browser dialog to choose a file/directory would show an error. While this makes sense when you are already in a file browser dialog (we don't support such nested file browser dialogs), allow it when the file browser is opened as a normal editor, not as a dialog.
This commit is contained in:
parent
10a06dfd11
commit
6e4e5f6484
|
@ -268,8 +268,9 @@ static int file_browse_invoke(bContext *C, wmOperator *op, const wmEvent *event)
|
|||
FileBrowseOp *fbo;
|
||||
char *str;
|
||||
|
||||
if (CTX_wm_space_file(C)) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot activate a file selector, one already open");
|
||||
const SpaceFile *sfile = CTX_wm_space_file(C);
|
||||
if (sfile && sfile->op) {
|
||||
BKE_report(op->reports, RPT_ERROR, "Cannot activate a file selector dialog, one already open");
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue