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
path: root/source
diff options
context:
space:
mode:
authorJulian Eisel <eiseljulian@gmail.com>2019-10-16 13:04:56 +0300
committerJulian Eisel <eiseljulian@gmail.com>2019-10-16 15:06:48 +0300
commitb54626364253f6023b2a2fa9d7a4211ea45a3bd4 (patch)
tree2b62dc6fb29ba82b0cd4af75229b2378b88eaadb /source
parenta3f7ae1b968232ddc4fc4a8be02ba25a2fcf04eb (diff)
UI: Remember ID-Filter in-between File Browser calls
This adds the ID-Filters visible on append/link to the settings the file browser remembers, potentially storing them in the Preferences. Artists in the studio here requested this. They typically have to set up the same or similar settings every time, so this saves them from that.
Diffstat (limited to 'source')
-rw-r--r--source/blender/blenkernel/BKE_blender_version.h2
-rw-r--r--source/blender/blenloader/intern/versioning_userdef.c4
-rw-r--r--source/blender/editors/space_file/filesel.c8
-rw-r--r--source/blender/makesdna/DNA_userdef_types.h3
4 files changed, 9 insertions, 8 deletions
diff --git a/source/blender/blenkernel/BKE_blender_version.h b/source/blender/blenkernel/BKE_blender_version.h
index 9bd90f76b79..dfa1b311eb0 100644
--- a/source/blender/blenkernel/BKE_blender_version.h
+++ b/source/blender/blenkernel/BKE_blender_version.h
@@ -27,7 +27,7 @@
* \note Use #STRINGIFY() rather than defining with quotes.
*/
#define BLENDER_VERSION 282
-#define BLENDER_SUBVERSION 0
+#define BLENDER_SUBVERSION 1
/** Several breakages with 280, e.g. collections vs layers. */
#define BLENDER_MINVERSION 280
#define BLENDER_MINSUBVERSION 0
diff --git a/source/blender/blenloader/intern/versioning_userdef.c b/source/blender/blenloader/intern/versioning_userdef.c
index d2192f1e22a..e1ee020940e 100644
--- a/source/blender/blenloader/intern/versioning_userdef.c
+++ b/source/blender/blenloader/intern/versioning_userdef.c
@@ -637,6 +637,10 @@ void BLO_version_defaults_userpref_blend(Main *bmain, UserDef *userdef)
}
}
+ if (!USER_VERSION_ATLEAST(282, 1)) {
+ userdef->file_space_data.filter_id = U_default.file_space_data.filter_id;
+ }
+
/**
* Include next version bump.
*/
diff --git a/source/blender/editors/space_file/filesel.c b/source/blender/editors/space_file/filesel.c
index ba4ccb4fba9..bb3906a961b 100644
--- a/source/blender/editors/space_file/filesel.c
+++ b/source/blender/editors/space_file/filesel.c
@@ -103,10 +103,9 @@ short ED_fileselect_set_params(SpaceFile *sfile)
sizeof(sfile->params->dir),
sizeof(sfile->params->file));
sfile->params->filter_glob[0] = '\0';
- /* set the default thumbnails size */
sfile->params->thumbnail_size = U_default.file_space_data.thumbnail_size;
- /* Show size column by default. */
sfile->params->details_flags = U_default.file_space_data.details_flags;
+ sfile->params->filter_id = U_default.file_space_data.filter_id;
}
params = sfile->params;
@@ -246,9 +245,6 @@ short ED_fileselect_set_params(SpaceFile *sfile)
}
}
- /* For now, always init filterid to 'all true' */
- params->filter_id = FILTER_ID_ALL;
-
if (U.uiflag & USER_HIDE_DOT) {
params->flag |= FILE_HIDE_DOT;
}
@@ -348,6 +344,7 @@ void ED_fileselect_set_params_from_userdef(SpaceFile *sfile)
}
sfile->params->thumbnail_size = sfile_udata->thumbnail_size;
sfile->params->details_flags = sfile_udata->details_flags;
+ sfile->params->filter_id = sfile_udata->filter_id;
/* Combine flags we take from params with the flags we take from userdef. */
sfile->params->flag = (sfile->params->flag & ~PARAMS_FLAGS_REMEMBERED) |
@@ -371,6 +368,7 @@ void ED_fileselect_params_to_userdef(SpaceFile *sfile, int temp_win_size[2])
sfile_udata_new->sort_type = sfile->params->sort;
sfile_udata_new->details_flags = sfile->params->details_flags;
sfile_udata_new->flag = sfile->params->flag & PARAMS_FLAGS_REMEMBERED;
+ sfile_udata_new->filter_id = sfile->params->filter_id;
if (temp_win_size) {
sfile_udata_new->temp_win_sizex = temp_win_size[0];
diff --git a/source/blender/makesdna/DNA_userdef_types.h b/source/blender/makesdna/DNA_userdef_types.h
index b9f43c0e579..c726c5e132e 100644
--- a/source/blender/makesdna/DNA_userdef_types.h
+++ b/source/blender/makesdna/DNA_userdef_types.h
@@ -588,8 +588,7 @@ typedef struct UserDef_FileSpaceData {
int sort_type; /* FileSelectParams.sort */
int details_flags; /* FileSelectParams.details_flags */
int flag; /* FileSelectParams.flag */
-
- char _pad[4];
+ int filter_id; /* FileSelectParams.filter_id */
/** Info used when creating the file browser in a temporary window. */
int temp_win_sizex;