diff options
author | Andrea Weikert <elubie@gmx.net> | 2009-03-12 09:40:03 +0300 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2009-03-12 09:40:03 +0300 |
commit | 52dc350c09558e348fa7a702671a8533a68ce850 (patch) | |
tree | b40c0fc752fbf8757e05faa0911ec0a6a2c87734 /source/blender/editors/space_file/file_ops.c | |
parent | c3cf187123c97022b5da53de10efab5ae57b8de0 (diff) |
2.5 filebrowser
- add refresh filelist operator and button in header
Diffstat (limited to 'source/blender/editors/space_file/file_ops.c')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index bb25fb62702..4725014a4b1 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -569,6 +569,34 @@ void FILE_OT_parent(struct wmOperatorType *ot) ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ } + +int file_refresh_exec(bContext *C, wmOperator *unused) +{ + SpaceFile *sfile= (SpaceFile*)CTX_wm_space_data(C); + + if(sfile->params) { + filelist_setdir(sfile->files, sfile->params->dir); + filelist_free(sfile->files); + sfile->params->active_file = -1; + } + ED_area_tag_redraw(CTX_wm_area(C)); + + return OPERATOR_FINISHED; + +} + + +void FILE_OT_refresh(struct wmOperatorType *ot) +{ + /* identifiers */ + ot->name= "Refresh Filelist"; + ot->idname= "FILE_OT_refresh"; + + /* api callbacks */ + ot->exec= file_refresh_exec; + ot->poll= ED_operator_file_active; /* <- important, handler is on window level */ +} + struct ARegion *file_buttons_region(struct ScrArea *sa) { ARegion *ar; |