diff options
author | Andrea Weikert <elubie@gmx.net> | 2012-10-27 22:31:52 +0400 |
---|---|---|
committer | Andrea Weikert <elubie@gmx.net> | 2012-10-27 22:31:52 +0400 |
commit | 8a6797d6a9a6fcc8f49961cf785b6748e9c5c520 (patch) | |
tree | 72c10e54bdb8795b9c3494e7b131f12f152e0ed8 /source/blender/editors | |
parent | 89b7e2257884388de36c7e963a6ba4de17986b89 (diff) |
== file browser ==
PATCH: [#32989] Activate backup files filter in File Browser
Contributed by Georg Kronthaler, many thanks!
(I just moved the icon to a different place reserved for file browser icons)
* enables the filtering of backup files in the file browser
* adds a 'filter backup files'-icon to the filter buttons
* adds new icons for backup files in list and thumbnail view
* enables file preview for the backup files
Diffstat (limited to 'source/blender/editors')
-rw-r--r-- | source/blender/editors/include/UI_icons.h | 5 | ||||
-rw-r--r-- | source/blender/editors/space_file/file_draw.c | 2 | ||||
-rw-r--r-- | source/blender/editors/space_file/filelist.c | 14 |
3 files changed, 13 insertions, 8 deletions
diff --git a/source/blender/editors/include/UI_icons.h b/source/blender/editors/include/UI_icons.h index b3efcf1cd54..e400e44e944 100644 --- a/source/blender/editors/include/UI_icons.h +++ b/source/blender/editors/include/UI_icons.h @@ -799,13 +799,12 @@ DEF_ICON(NDOF_TRANS) DEF_ICON(LAYER_USED) DEF_ICON(LAYER_ACTIVE) #ifndef DEF_ICON_BLANK_SKIP + /* available */ DEF_ICON(BLANK254) DEF_ICON(BLANK255) DEF_ICON(BLANK256) DEF_ICON(BLANK257) DEF_ICON(BLANK257b) - - /* available */ DEF_ICON(BLANK258) DEF_ICON(BLANK259) DEF_ICON(BLANK260) @@ -890,8 +889,8 @@ DEF_ICON(FORWARD) DEF_ICON(BLANK313) DEF_ICON(BLANK314) DEF_ICON(BLANK315) - DEF_ICON(BLANK316) #endif +DEF_ICON(FILE_BACKUP) DEF_ICON(DISK_DRIVE) /* SHADING / TEXT */ diff --git a/source/blender/editors/space_file/file_draw.c b/source/blender/editors/space_file/file_draw.c index 66a255f9a47..fb438ae45fb 100644 --- a/source/blender/editors/space_file/file_draw.c +++ b/source/blender/editors/space_file/file_draw.c @@ -257,7 +257,7 @@ static int get_file_icon(struct direntry *file) else if (file->flags & BLENDERFILE) return ICON_FILE_BLEND; else if (file->flags & BLENDERFILE_BACKUP) - return ICON_FILE_BLEND; + return ICON_FILE_BACKUP; else if (file->flags & IMAGEFILE) return ICON_FILE_IMAGE; else if (file->flags & MOVIEFILE) diff --git a/source/blender/editors/space_file/filelist.c b/source/blender/editors/space_file/filelist.c index 562fcfd633d..7f0af36d5d6 100644 --- a/source/blender/editors/space_file/filelist.c +++ b/source/blender/editors/space_file/filelist.c @@ -143,7 +143,8 @@ typedef struct FolderList { #define SPECIAL_IMG_FONTFILE 8 #define SPECIAL_IMG_UNKNOWNFILE 9 #define SPECIAL_IMG_LOADING 10 -#define SPECIAL_IMG_MAX SPECIAL_IMG_LOADING + 1 +#define SPECIAL_IMG_BACKUP 11 +#define SPECIAL_IMG_MAX SPECIAL_IMG_BACKUP + 1 static ImBuf *gSpecialFileImages[SPECIAL_IMG_MAX]; @@ -683,6 +684,9 @@ ImBuf *filelist_geticon(struct FileList *filelist, int index) else if (file->flags & IMAGEFILE) { ibuf = gSpecialFileImages[SPECIAL_IMG_LOADING]; } + else if (file->flags & BLENDERFILE_BACKUP) { + ibuf = gSpecialFileImages[SPECIAL_IMG_BACKUP]; + } return ibuf; } @@ -817,8 +821,10 @@ int ED_file_extension_icon(const char *relname) { int type = file_extension_type(relname); - if (type == BLENDERFILE || type == BLENDERFILE_BACKUP) + if (type == BLENDERFILE) return ICON_FILE_BLEND; + else if (type == BLENDERFILE_BACKUP) + return ICON_FILE_BACKUP; else if (type == IMAGEFILE) return ICON_FILE_IMAGE; else if (type == MOVIEFILE) @@ -1303,7 +1309,7 @@ static void thumbnails_startjob(void *tjv, short *stop, short *do_update, float if (limg->flags & IMAGEFILE) { limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_IMAGE); } - else if (limg->flags & BLENDERFILE) { + else if (limg->flags & (BLENDERFILE | BLENDERFILE_BACKUP)) { limg->img = IMB_thumb_manage(limg->path, THB_NORMAL, THB_SOURCE_BLEND); } else if (limg->flags & MOVIEFILE) { @@ -1360,7 +1366,7 @@ void thumbnails_start(struct FileList *filelist, const struct bContext *C) tj->filelist = filelist; for (idx = 0; idx < filelist->numfiles; idx++) { if (!filelist->filelist[idx].image) { - if ( (filelist->filelist[idx].flags & (IMAGEFILE | MOVIEFILE | BLENDERFILE)) ) { + if ( (filelist->filelist[idx].flags & (IMAGEFILE | MOVIEFILE | BLENDERFILE | BLENDERFILE_BACKUP)) ) { FileImage *limg = MEM_callocN(sizeof(struct FileImage), "loadimage"); BLI_strncpy(limg->path, filelist->filelist[idx].path, FILE_MAX); limg->index = idx; |