diff options
Diffstat (limited to 'source/blender/windowmanager/intern/wm_event_system.c')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index e142a5f9640..fc0f1496c6a 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -773,12 +773,9 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa case EVT_FILESELECT_OPEN: case EVT_FILESELECT_FULL_OPEN: { - int filetype= FILE_BLENDER; + short flag =0; short display =FILE_SHORTDISPLAY; short filter =0; short sort =FILE_SORTALPHA; char *path= RNA_string_get_alloc(handler->op->ptr, "filename", NULL, 0); - if(RNA_struct_find_property(handler->op->ptr, "filetype")) - filetype= RNA_int_get(handler->op->ptr, "filetype"); - if(event->val==EVT_FILESELECT_OPEN) ED_area_newspace(C, handler->op_area, SPACE_FILE); else @@ -788,7 +785,16 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa sfile= (SpaceFile*)CTX_wm_space_data(C); sfile->op= handler->op; - ED_fileselect_set_params(sfile, filetype, handler->op->type->name, path, 0, FILE_SHORTDISPLAY, 0); + /* XXX for now take the settings from the existing (previous) filebrowser + should be stored in settings and passed via the operator */ + if (sfile->params) { + flag = sfile->params->flag; + filter = sfile->params->filter; + display = sfile->params->display; + sort = sfile->params->sort; + } + + ED_fileselect_set_params(sfile, handler->op->type->name, path, flag, display, filter, sort); MEM_freeN(path); action= WM_HANDLER_BREAK; |