Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea Weikert <elubie@gmx.net>2009-03-12 09:40:03 +0300
committerAndrea Weikert <elubie@gmx.net>2009-03-12 09:40:03 +0300
commit52dc350c09558e348fa7a702671a8533a68ce850 (patch)
treeb40c0fc752fbf8757e05faa0911ec0a6a2c87734 /source/blender/editors/space_file/file_ops.c
parentc3cf187123c97022b5da53de10efab5ae57b8de0 (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.c28
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;