File Browser: Add Zip files as native recognised file type
Differential Revision: https://developer.blender.org/D5683 Reviewers: Brecht
This commit is contained in:
parent
6fc6f2504d
commit
d813cc706d
Notes:
blender-bot
2023-02-14 09:09:43 +01:00
Referenced by issue #69581, Error popups spawned from new FileBrowser are "swallowed" (e.g. Addon import/export errors)
|
@ -1006,6 +1006,9 @@ static int filelist_geticon_ex(const int typeflag,
|
|||
else if (typeflag & FILE_TYPE_TEXT) {
|
||||
return ICON_FILE_TEXT;
|
||||
}
|
||||
else if (typeflag & FILE_TYPE_ARCHIVE) {
|
||||
return ICON_FILE_ARCHIVE;
|
||||
}
|
||||
else if (typeflag & FILE_TYPE_BLENDERLIB) {
|
||||
const int ret = UI_idcode_icon_get(blentype);
|
||||
if (ret != ICON_NONE) {
|
||||
|
@ -2126,6 +2129,9 @@ int ED_path_extension_type(const char *path)
|
|||
else if (BLI_path_extension_check(path, ".abc")) {
|
||||
return FILE_TYPE_ALEMBIC;
|
||||
}
|
||||
else if (BLI_path_extension_check(path, ".zip")) {
|
||||
return FILE_TYPE_ARCHIVE;
|
||||
}
|
||||
else if (BLI_path_extension_check_n(path, ".obj", ".3ds", ".fbx", ".glb", ".gltf", NULL)) {
|
||||
return FILE_TYPE_OBJECT_IO;
|
||||
}
|
||||
|
@ -2183,6 +2189,8 @@ int ED_file_extension_icon(const char *path)
|
|||
return ICON_FILE_3D;
|
||||
case FILE_TYPE_TEXT:
|
||||
return ICON_FILE_TEXT;
|
||||
case FILE_TYPE_ARCHIVE:
|
||||
return ICON_FILE_ARCHIVE;
|
||||
default:
|
||||
return ICON_FILE_BLANK;
|
||||
}
|
||||
|
|
|
@ -199,6 +199,9 @@ short ED_fileselect_set_params(SpaceFile *sfile)
|
|||
if ((prop = RNA_struct_find_property(op->ptr, "filter_text"))) {
|
||||
params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_TEXT : 0;
|
||||
}
|
||||
if ((prop = RNA_struct_find_property(op->ptr, "filter_archive"))) {
|
||||
params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_ARCHIVE : 0;
|
||||
}
|
||||
if ((prop = RNA_struct_find_property(op->ptr, "filter_folder"))) {
|
||||
params->filter |= RNA_property_boolean_get(op->ptr, prop) ? FILE_TYPE_FOLDER : 0;
|
||||
}
|
||||
|
|
|
@ -826,7 +826,7 @@ typedef enum eFileSel_File_Types {
|
|||
FILE_TYPE_FTFONT = (1 << 7),
|
||||
FILE_TYPE_SOUND = (1 << 8),
|
||||
FILE_TYPE_TEXT = (1 << 9),
|
||||
/* 1 << 10 was FILE_TYPE_MOVIE_ICON, got rid of this so free slot for future type... */
|
||||
FILE_TYPE_ARCHIVE = (1 << 10),
|
||||
/** represents folders for filtering */
|
||||
FILE_TYPE_FOLDER = (1 << 11),
|
||||
FILE_TYPE_BTX = (1 << 12),
|
||||
|
|
|
@ -155,6 +155,9 @@ void WM_operator_properties_filesel(wmOperatorType *ot,
|
|||
prop = RNA_def_boolean(
|
||||
ot->srna, "filter_text", (filter & FILE_TYPE_TEXT) != 0, "Filter text files", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_boolean(
|
||||
ot->srna, "filter_archive", (filter & FILE_TYPE_ARCHIVE) != 0, "Filter archive files", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
prop = RNA_def_boolean(
|
||||
ot->srna, "filter_btx", (filter & FILE_TYPE_BTX) != 0, "Filter btx files", "");
|
||||
RNA_def_property_flag(prop, PROP_HIDDEN | PROP_SKIP_SAVE);
|
||||
|
|
Loading…
Reference in New Issue