diff options
author | Andrea Weikert <elubie@gmx.net> | 2009-09-13 13:41:00 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2009-09-13 13:41:00 +0400 |
commit | 78bb6ce0347234d9103453d1242ec8e397d3eb7f (patch) | |
tree | 54d22a5f8b75286a78ee3f153263d910cbd10ddf /source | |
parent | f9694287d9a9a2ca5d031d6fbf4aa05045944ecc (diff) |
2.5 filebrowser
* Fix for space init when loading with pupmenu (without operator) - parameters now get reset
* experimental: made new director operator jump directly into renaming
Diffstat (limited to 'source')
-rw-r--r-- | source/blender/editors/space_file/file_ops.c | 4 | ||||
-rw-r--r-- | source/blender/editors/space_file/filesel.c | 3 | ||||
-rw-r--r-- | source/blender/editors/space_file/space_file.c | 16 | ||||
-rw-r--r-- | source/blender/makesdna/DNA_space_types.h | 1 |
4 files changed, 21 insertions, 3 deletions
diff --git a/source/blender/editors/space_file/file_ops.c b/source/blender/editors/space_file/file_ops.c index e51fd421c8c..9705a36fc75 100644 --- a/source/blender/editors/space_file/file_ops.c +++ b/source/blender/editors/space_file/file_ops.c @@ -705,7 +705,9 @@ int file_directory_new_exec(bContext *C, wmOperator *unused) BLI_join_dirfile(tmpstr, tmpstr, tmpdir); } BLI_recurdir_fileops(tmpstr); - if (!BLI_exists(tmpstr)) { + if (BLI_exists(tmpstr)) { + BLI_strncpy(sfile->params->renamefile, tmpdir, FILE_MAXFILE); + } else { filelist_free(sfile->files); filelist_parent(sfile->files); BLI_strncpy(sfile->params->dir, filelist_dir(sfile->files), FILE_MAX); diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c index f226b3de260..085eecd2a7d 100644 --- a/source/blender/editors/space_file/filesel.c +++ b/source/blender/editors/space_file/filesel.c @@ -154,8 +154,9 @@ short ED_fileselect_set_params(SpaceFile *sfile) if (params->filter != 0) params->flag |= FILE_FILTER; + params->flag |= FILE_HIDE_DOT; + if (params->type == FILE_LOADLIB) { - params->flag |= FILE_HIDE_DOT; params->flag |= RNA_boolean_get(op->ptr, "link") ? FILE_LINK : 0; params->flag |= RNA_boolean_get(op->ptr, "autoselect") ? FILE_AUTOSELECT : 0; params->flag |= RNA_boolean_get(op->ptr, "active_layer") ? FILE_ACTIVELAY : 0; diff --git a/source/blender/editors/space_file/space_file.c b/source/blender/editors/space_file/space_file.c index bceeec1cb55..47839ea0342 100644 --- a/source/blender/editors/space_file/space_file.c +++ b/source/blender/editors/space_file/space_file.c @@ -45,6 +45,7 @@ #include "BLI_blenlib.h" #include "BLI_arithb.h" #include "BLI_rand.h" +#include "BLI_storage_types.h" #include "BKE_colortools.h" #include "BKE_context.h" @@ -154,6 +155,9 @@ static void file_free(SpaceLink *sl) /* spacetype; init callback, area size changes, screen set, etc */ static void file_init(struct wmWindowManager *wm, ScrArea *sa) { + SpaceFile *sfile= (SpaceFile*)sa->spacedata.first; + MEM_freeN(sfile->params); + sfile->params = 0; printf("file_init\n"); } @@ -203,7 +207,17 @@ static void file_refresh(const bContext *C, ScrArea *sa) filelist_readdir(sfile->files); } if(params->sort!=FILE_SORT_NONE) filelist_sort(sfile->files, params->sort); - + + if (params->renamefile[0] != '\0') { + int idx = filelist_find(sfile->files, params->renamefile); + if (idx >= 0) { + struct direntry *file= filelist_file(sfile->files, idx); + if (file) { + file->flags |= EDITING; + } + } + params->renamefile[0] = '\0'; + } if (sfile->layout) sfile->layout->dirty= 1; } diff --git a/source/blender/makesdna/DNA_space_types.h b/source/blender/makesdna/DNA_space_types.h index 97ddb291136..806d12815b5 100644 --- a/source/blender/makesdna/DNA_space_types.h +++ b/source/blender/makesdna/DNA_space_types.h @@ -153,6 +153,7 @@ typedef struct FileSelectParams { char title[24]; /* title, also used for the text of the execute button */ char dir[240]; /* directory */ char file[80]; /* file */ + char renamefile[80]; short type; /* XXXXX for now store type here, should be moved to the operator */ short flag; /* settings for filter, hiding dots files,... */ |