diff options
Diffstat (limited to 'source/blender/windowmanager')
-rw-r--r-- | source/blender/windowmanager/intern/wm_event_system.c | 12 | ||||
-rw-r--r-- | source/blender/windowmanager/intern/wm_operators.c | 11 |
2 files changed, 11 insertions, 12 deletions
diff --git a/source/blender/windowmanager/intern/wm_event_system.c b/source/blender/windowmanager/intern/wm_event_system.c index d8e904b7c54..e707d096a60 100644 --- a/source/blender/windowmanager/intern/wm_event_system.c +++ b/source/blender/windowmanager/intern/wm_event_system.c @@ -820,18 +820,8 @@ static int wm_handler_fileselect_call(bContext *C, ListBase *handlers, wmEventHa /* settings for filebrowser, sfile is not operator owner but sends events */ sfile= (SpaceFile*)CTX_wm_space_data(C); sfile->op= handler->op; - - /* 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; - dir = sfile->params->dir; - } - ED_fileselect_set_params(sfile, handler->op->type->name, dir, path, flag, display, filter, sort); + ED_fileselect_set_params(sfile); dir = NULL; MEM_freeN(path); diff --git a/source/blender/windowmanager/intern/wm_operators.c b/source/blender/windowmanager/intern/wm_operators.c index 39114dcfe13..1f1a34ee308 100644 --- a/source/blender/windowmanager/intern/wm_operators.c +++ b/source/blender/windowmanager/intern/wm_operators.c @@ -672,6 +672,8 @@ static int wm_open_mainfile_invoke(bContext *C, wmOperator *op, wmEvent *event) { RNA_string_set(op->ptr, "filename", G.sce); + RNA_boolean_set(op->ptr, "filter_blender", 1); + RNA_boolean_set(op->ptr, "filter_folder", 1); WM_event_add_fileselect(C, op); return OPERATOR_RUNNING_MODAL; @@ -693,6 +695,7 @@ static int wm_open_mainfile_exec(bContext *C, wmOperator *op) static void WM_OT_open_mainfile(wmOperatorType *ot) { + PropertyRNA *prop; ot->name= "Open Blender File"; ot->idname= "WM_OT_open_mainfile"; @@ -700,7 +703,13 @@ static void WM_OT_open_mainfile(wmOperatorType *ot) ot->exec= wm_open_mainfile_exec; ot->poll= WM_operator_winactive; - RNA_def_property(ot->srna, "filename", PROP_STRING, PROP_FILEPATH); + RNA_def_string_file_path(ot->srna, "filename", "", FILE_MAX, "Filename", "File path of blendfile to open."); + + prop= RNA_def_boolean(ot->srna, "filter_blender", 0, "Filter Blendfiles", ""); + RNA_def_property_boolean_sdna(prop, NULL, "filter", BLENDERFILE); + prop= RNA_def_boolean(ot->srna, "filter_folder", 0, "Filter Blendfiles", ""); + RNA_def_property_boolean_sdna(prop, NULL, "filter", FOLDERFILE); + } static int wm_recover_last_session_exec(bContext *C, wmOperator *op) |