mirror of
https://github.com/CTCaer/RetroArch.git
synced 2024-12-23 03:10:14 +00:00
Move filebrowser-dependent code to menu_filebrowser.c
This commit is contained in:
parent
17a66067b0
commit
f186583728
2
deps/SPIRV-Cross
vendored
2
deps/SPIRV-Cross
vendored
@ -1 +1 @@
|
|||||||
Subproject commit 5c24d99ff22a25ef38e9e39985f80cf57a1e7418
|
Subproject commit 875c32fd39a06f624814effe5eab691b078429f5
|
2
deps/glslang/glslang
vendored
2
deps/glslang/glslang
vendored
@ -1 +1 @@
|
|||||||
Subproject commit a4a4d5e22c375d37bd286106904ef819eafff29b
|
Subproject commit be8462149a3c150fc89db84e57ef06de3ab90d47
|
@ -33,6 +33,7 @@
|
|||||||
#include "../menu_shader.h"
|
#include "../menu_shader.h"
|
||||||
#include "../menu_navigation.h"
|
#include "../menu_navigation.h"
|
||||||
#include "../widgets/menu_dialog.h"
|
#include "../widgets/menu_dialog.h"
|
||||||
|
#include "../widgets/menu_filebrowser.h"
|
||||||
#include "../widgets/menu_input_dialog.h"
|
#include "../widgets/menu_input_dialog.h"
|
||||||
#include "../menu_content.h"
|
#include "../menu_content.h"
|
||||||
|
|
||||||
@ -295,7 +296,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_GENERIC;
|
dl_type = DISPLAYLIST_GENERIC;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_AUDIO_DSP_PLUGIN:
|
case ACTION_OK_DL_AUDIO_DSP_PLUGIN:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->directory.audio_filter;
|
info_path = settings->directory.audio_filter;
|
||||||
info_label = msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN);
|
info_label = msg_hash_to_str(MENU_ENUM_LABEL_AUDIO_DSP_PLUGIN);
|
||||||
@ -303,7 +304,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_SHADER_PASS:
|
case ACTION_OK_DL_SHADER_PASS:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->directory.video_shader;
|
info_path = settings->directory.video_shader;
|
||||||
@ -327,7 +328,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_GENERIC;
|
dl_type = DISPLAYLIST_GENERIC;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_FILE_BROWSER_SELECT_DIR:
|
case ACTION_OK_DL_FILE_BROWSER_SELECT_DIR:
|
||||||
filebrowser_types = FILEBROWSER_SELECT_DIR;
|
filebrowser_set_type(FILEBROWSER_SELECT_DIR);
|
||||||
if (path)
|
if (path)
|
||||||
strlcpy(menu->deferred_path, path,
|
strlcpy(menu->deferred_path, path,
|
||||||
sizeof(menu->deferred_path));
|
sizeof(menu->deferred_path));
|
||||||
@ -345,7 +346,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_GENERIC;
|
dl_type = DISPLAYLIST_GENERIC;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_SHADER_PRESET:
|
case ACTION_OK_DL_SHADER_PRESET:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->directory.video_shader;
|
info_path = settings->directory.video_shader;
|
||||||
@ -360,7 +361,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_GENERIC;
|
dl_type = DISPLAYLIST_GENERIC;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_SCAN_DIR_LIST:
|
case ACTION_OK_DL_SCAN_DIR_LIST:
|
||||||
filebrowser_types = FILEBROWSER_SCAN_DIR;
|
filebrowser_set_type(FILEBROWSER_SCAN_DIR);
|
||||||
info.type = FILE_TYPE_DIRECTORY;
|
info.type = FILE_TYPE_DIRECTORY;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = new_path;
|
info_path = new_path;
|
||||||
@ -368,7 +369,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_FILE_BROWSER_SCAN_DIR;
|
dl_type = DISPLAYLIST_FILE_BROWSER_SCAN_DIR;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_REMAP_FILE:
|
case ACTION_OK_DL_REMAP_FILE:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->directory.input_remapping;
|
info_path = settings->directory.input_remapping;
|
||||||
@ -376,9 +377,9 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_RECORD_CONFIGFILE:
|
case ACTION_OK_DL_RECORD_CONFIGFILE:
|
||||||
|
filebrowser_clear_type();
|
||||||
{
|
{
|
||||||
global_t *global = global_get_ptr();
|
global_t *global = global_get_ptr();
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = global->record.config_dir;
|
info_path = global->record.config_dir;
|
||||||
@ -387,7 +388,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_DISK_IMAGE_APPEND_LIST:
|
case ACTION_OK_DL_DISK_IMAGE_APPEND_LIST:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->directory.menu_content;
|
info_path = settings->directory.menu_content;
|
||||||
@ -395,7 +396,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_PLAYLIST_COLLECTION:
|
case ACTION_OK_DL_PLAYLIST_COLLECTION:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = path;
|
info_path = path;
|
||||||
@ -403,7 +404,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_GENERIC;
|
dl_type = DISPLAYLIST_GENERIC;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_CHEAT_FILE:
|
case ACTION_OK_DL_CHEAT_FILE:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->path.cheat_database;
|
info_path = settings->path.cheat_database;
|
||||||
@ -411,7 +412,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_FILE;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_CORE_LIST:
|
case ACTION_OK_DL_CORE_LIST:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->directory.libretro;
|
info_path = settings->directory.libretro;
|
||||||
@ -419,7 +420,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_CORE;
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_CORE;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_CONTENT_COLLECTION_LIST:
|
case ACTION_OK_DL_CONTENT_COLLECTION_LIST:
|
||||||
filebrowser_types = FILEBROWSER_SELECT_COLLECTION;
|
filebrowser_set_type(FILEBROWSER_SELECT_COLLECTION);
|
||||||
info.type = type;
|
info.type = type;
|
||||||
info.directory_ptr = idx;
|
info.directory_ptr = idx;
|
||||||
info_path = settings->directory.playlist;
|
info_path = settings->directory.playlist;
|
||||||
@ -427,7 +428,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_COLLECTION;
|
dl_type = DISPLAYLIST_FILE_BROWSER_SELECT_COLLECTION;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_RDB_ENTRY:
|
case ACTION_OK_DL_RDB_ENTRY:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
fill_pathname_join_delim(tmp,
|
fill_pathname_join_delim(tmp,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL),
|
msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL),
|
||||||
path, '|', sizeof(tmp));
|
path, '|', sizeof(tmp));
|
||||||
@ -501,7 +502,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_GENERIC;
|
dl_type = DISPLAYLIST_GENERIC;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_DATABASE_MANAGER_LIST:
|
case ACTION_OK_DL_DATABASE_MANAGER_LIST:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
fill_pathname_join(tmp,
|
fill_pathname_join(tmp,
|
||||||
settings->path.content_database,
|
settings->path.content_database,
|
||||||
path, sizeof(tmp));
|
path, sizeof(tmp));
|
||||||
@ -514,7 +515,7 @@ int generic_action_ok_displaylist_push(const char *path,
|
|||||||
dl_type = DISPLAYLIST_GENERIC;
|
dl_type = DISPLAYLIST_GENERIC;
|
||||||
break;
|
break;
|
||||||
case ACTION_OK_DL_CURSOR_MANAGER_LIST:
|
case ACTION_OK_DL_CURSOR_MANAGER_LIST:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
fill_pathname_join(tmp, settings->directory.cursor,
|
fill_pathname_join(tmp, settings->directory.cursor,
|
||||||
path, sizeof(tmp));
|
path, sizeof(tmp));
|
||||||
|
|
||||||
@ -1838,7 +1839,7 @@ static int action_ok_remap_file_save_game(const char *path,
|
|||||||
int action_ok_path_use_directory(const char *path,
|
int action_ok_path_use_directory(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
return generic_action_ok(NULL, label, type, idx, entry_idx,
|
return generic_action_ok(NULL, label, type, idx, entry_idx,
|
||||||
ACTION_OK_SET_DIRECTORY, MSG_UNKNOWN);
|
ACTION_OK_SET_DIRECTORY, MSG_UNKNOWN);
|
||||||
}
|
}
|
||||||
@ -3183,7 +3184,8 @@ static int action_ok_push_downloads_dir(const char *path,
|
|||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
|
||||||
|
filebrowser_clear_type();
|
||||||
return generic_action_ok_displaylist_push(path, settings->directory.core_assets,
|
return generic_action_ok_displaylist_push(path, settings->directory.core_assets,
|
||||||
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
msg_hash_to_str(MENU_ENUM_LABEL_FAVORITES),
|
||||||
type, idx,
|
type, idx,
|
||||||
@ -3215,7 +3217,7 @@ int action_ok_push_filebrowser_list_dir_select(const char *path,
|
|||||||
static int action_ok_push_default(const char *path,
|
static int action_ok_push_default(const char *path,
|
||||||
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
const char *label, unsigned type, size_t idx, size_t entry_idx)
|
||||||
{
|
{
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
|
return generic_action_ok_displaylist_push(path, NULL, label, type, idx,
|
||||||
entry_idx, ACTION_OK_DL_PUSH_DEFAULT);
|
entry_idx, ACTION_OK_DL_PUSH_DEFAULT);
|
||||||
}
|
}
|
||||||
|
@ -3207,8 +3207,6 @@ static int menu_displaylist_parse_options_remappings(
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned filebrowser_types = 0;
|
|
||||||
|
|
||||||
static int menu_displaylist_parse_playlists(
|
static int menu_displaylist_parse_playlists(
|
||||||
menu_displaylist_info_t *info, bool horizontal)
|
menu_displaylist_info_t *info, bool horizontal)
|
||||||
{
|
{
|
||||||
@ -3685,7 +3683,7 @@ static bool menu_displaylist_push_internal(
|
|||||||
}
|
}
|
||||||
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)))
|
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_MUSIC_TAB)))
|
||||||
{
|
{
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type = 42;
|
info->type = 42;
|
||||||
strlcpy(info->exts,
|
strlcpy(info->exts,
|
||||||
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
||||||
@ -3700,7 +3698,7 @@ static bool menu_displaylist_push_internal(
|
|||||||
}
|
}
|
||||||
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB)))
|
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_VIDEO_TAB)))
|
||||||
{
|
{
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type = 42;
|
info->type = 42;
|
||||||
strlcpy(info->exts,
|
strlcpy(info->exts,
|
||||||
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
||||||
@ -3716,7 +3714,7 @@ static bool menu_displaylist_push_internal(
|
|||||||
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)))
|
else if (string_is_equal(label, msg_hash_to_str(MENU_ENUM_LABEL_IMAGES_TAB)))
|
||||||
{
|
{
|
||||||
|
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type = 42;
|
info->type = 42;
|
||||||
strlcpy(info->exts,
|
strlcpy(info->exts,
|
||||||
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
||||||
@ -3751,7 +3749,7 @@ static bool menu_displaylist_push_internal(
|
|||||||
{
|
{
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
|
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type = 42;
|
info->type = 42;
|
||||||
strlcpy(info->exts,
|
strlcpy(info->exts,
|
||||||
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
file_path_str(FILE_PATH_LPL_EXTENSION_NO_DOT),
|
||||||
@ -5814,7 +5812,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_DATABASES:
|
case DISPLAYLIST_DATABASES:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_RDB;
|
info->type_default = FILE_TYPE_RDB;
|
||||||
strlcpy(info->exts,
|
strlcpy(info->exts,
|
||||||
file_path_str(FILE_PATH_RDB_EXTENSION),
|
file_path_str(FILE_PATH_RDB_EXTENSION),
|
||||||
@ -5853,7 +5851,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
info->need_push = true;
|
info->need_push = true;
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_DATABASE_CURSORS:
|
case DISPLAYLIST_DATABASE_CURSORS:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_CURSOR;
|
info->type_default = FILE_TYPE_CURSOR;
|
||||||
strlcpy(info->exts, "dbc", sizeof(info->exts));
|
strlcpy(info->exts, "dbc", sizeof(info->exts));
|
||||||
strlcpy(info->path, settings->directory.cursor, sizeof(info->path));
|
strlcpy(info->path, settings->directory.cursor, sizeof(info->path));
|
||||||
@ -5864,14 +5862,14 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
|
|
||||||
ext_name[0] = '\0';
|
ext_name[0] = '\0';
|
||||||
|
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_PLAIN;
|
info->type_default = FILE_TYPE_PLAIN;
|
||||||
if (frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
|
if (frontend_driver_get_core_extension(ext_name, sizeof(ext_name)))
|
||||||
strlcpy(info->exts, ext_name, sizeof(info->exts));
|
strlcpy(info->exts, ext_name, sizeof(info->exts));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_CONFIG_FILES:
|
case DISPLAYLIST_CONFIG_FILES:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_CONFIG;
|
info->type_default = FILE_TYPE_CONFIG;
|
||||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
@ -5882,7 +5880,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
|
|
||||||
(void)attr;
|
(void)attr;
|
||||||
|
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_SHADER_PRESET;
|
info->type_default = FILE_TYPE_SHADER_PRESET;
|
||||||
|
|
||||||
#ifdef HAVE_CG
|
#ifdef HAVE_CG
|
||||||
@ -5903,7 +5901,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
union string_list_elem_attr attr = {0};
|
union string_list_elem_attr attr = {0};
|
||||||
struct string_list *str_list = string_list_new();
|
struct string_list *str_list = string_list_new();
|
||||||
|
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_SHADER;
|
info->type_default = FILE_TYPE_SHADER;
|
||||||
|
|
||||||
(void)attr;
|
(void)attr;
|
||||||
@ -5922,12 +5920,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_VIDEO_FILTERS:
|
case DISPLAYLIST_VIDEO_FILTERS:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_VIDEOFILTER;
|
info->type_default = FILE_TYPE_VIDEOFILTER;
|
||||||
strlcpy(info->exts, "filt", sizeof(info->exts));
|
strlcpy(info->exts, "filt", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_IMAGES:
|
case DISPLAYLIST_IMAGES:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_IMAGE;
|
info->type_default = FILE_TYPE_IMAGE;
|
||||||
{
|
{
|
||||||
union string_list_elem_attr attr = {0};
|
union string_list_elem_attr attr = {0};
|
||||||
@ -5951,37 +5949,37 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_AUDIO_FILTERS:
|
case DISPLAYLIST_AUDIO_FILTERS:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_AUDIOFILTER;
|
info->type_default = FILE_TYPE_AUDIOFILTER;
|
||||||
strlcpy(info->exts, "dsp", sizeof(info->exts));
|
strlcpy(info->exts, "dsp", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_CHEAT_FILES:
|
case DISPLAYLIST_CHEAT_FILES:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_CHEAT;
|
info->type_default = FILE_TYPE_CHEAT;
|
||||||
strlcpy(info->exts, "cht", sizeof(info->exts));
|
strlcpy(info->exts, "cht", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_CONTENT_HISTORY:
|
case DISPLAYLIST_CONTENT_HISTORY:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_PLAIN;
|
info->type_default = FILE_TYPE_PLAIN;
|
||||||
strlcpy(info->exts, "lpl", sizeof(info->exts));
|
strlcpy(info->exts, "lpl", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_FONTS:
|
case DISPLAYLIST_FONTS:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_FONT;
|
info->type_default = FILE_TYPE_FONT;
|
||||||
strlcpy(info->exts, "ttf", sizeof(info->exts));
|
strlcpy(info->exts, "ttf", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_OVERLAYS:
|
case DISPLAYLIST_OVERLAYS:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_OVERLAY;
|
info->type_default = FILE_TYPE_OVERLAY;
|
||||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_RECORD_CONFIG_FILES:
|
case DISPLAYLIST_RECORD_CONFIG_FILES:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_RECORD_CONFIG;
|
info->type_default = FILE_TYPE_RECORD_CONFIG;
|
||||||
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
strlcpy(info->exts, "cfg", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
case DISPLAYLIST_REMAP_FILES:
|
case DISPLAYLIST_REMAP_FILES:
|
||||||
filebrowser_types = FILEBROWSER_NONE;
|
filebrowser_clear_type();
|
||||||
info->type_default = FILE_TYPE_REMAP;
|
info->type_default = FILE_TYPE_REMAP;
|
||||||
strlcpy(info->exts, "rmp", sizeof(info->exts));
|
strlcpy(info->exts, "rmp", sizeof(info->exts));
|
||||||
break;
|
break;
|
||||||
|
@ -159,14 +159,6 @@ enum menu_displaylist_ctl_state
|
|||||||
DISPLAYLIST_PENDING_CLEAR
|
DISPLAYLIST_PENDING_CLEAR
|
||||||
};
|
};
|
||||||
|
|
||||||
enum filebrowser_enums
|
|
||||||
{
|
|
||||||
FILEBROWSER_NONE = 0,
|
|
||||||
FILEBROWSER_SELECT_DIR,
|
|
||||||
FILEBROWSER_SCAN_DIR,
|
|
||||||
FILEBROWSER_SELECT_COLLECTION
|
|
||||||
};
|
|
||||||
|
|
||||||
typedef struct menu_displaylist_info
|
typedef struct menu_displaylist_info
|
||||||
{
|
{
|
||||||
bool need_sort;
|
bool need_sort;
|
||||||
@ -213,8 +205,6 @@ void menu_displaylist_reset_filebrowser(void);
|
|||||||
|
|
||||||
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data);
|
bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data);
|
||||||
|
|
||||||
extern unsigned filebrowser_types;
|
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -27,28 +27,45 @@
|
|||||||
#include "../../config.h"
|
#include "../../config.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "menu_filebrowser.h"
|
||||||
#include "menu_input_dialog.h"
|
#include "menu_input_dialog.h"
|
||||||
|
|
||||||
|
#include "../menu_driver.h"
|
||||||
|
#include "../menu_displaylist.h"
|
||||||
|
#include "../menu_navigation.h"
|
||||||
|
|
||||||
#include "../../configuration.h"
|
#include "../../configuration.h"
|
||||||
#include "../../frontend/frontend_driver.h"
|
#include "../../frontend/frontend_driver.h"
|
||||||
#include "../../paths.h"
|
#include "../../paths.h"
|
||||||
#include "../menu_driver.h"
|
|
||||||
#include "../menu_navigation.h"
|
static enum filebrowser_enums filebrowser_types = FILEBROWSER_NONE;
|
||||||
|
|
||||||
|
void filebrowser_clear_type(void)
|
||||||
|
{
|
||||||
|
filebrowser_types = FILEBROWSER_NONE;
|
||||||
|
}
|
||||||
|
|
||||||
|
void filebrowser_set_type(enum filebrowser_enums type)
|
||||||
|
{
|
||||||
|
filebrowser_types = type;
|
||||||
|
}
|
||||||
|
|
||||||
int filebrowser_parse(void *data, void *data2,
|
int filebrowser_parse(void *data, void *data2,
|
||||||
enum menu_displaylist_ctl_state type,
|
unsigned type_data,
|
||||||
bool extensions_honored)
|
bool extensions_honored)
|
||||||
{
|
{
|
||||||
size_t i, list_size;
|
size_t i, list_size;
|
||||||
unsigned files_count = 0;
|
bool path_is_compressed = false;
|
||||||
unsigned dirs_count = 0;
|
bool filter_ext = false;
|
||||||
bool path_is_compressed = false;
|
struct string_list *str_list = NULL;
|
||||||
bool filter_ext = false;
|
unsigned items_found = 0;
|
||||||
struct string_list *str_list = NULL;
|
unsigned files_count = 0;
|
||||||
unsigned items_found = 0;
|
unsigned dirs_count = 0;
|
||||||
settings_t *settings = config_get_ptr();
|
settings_t *settings = config_get_ptr();
|
||||||
menu_handle_t *menu = (menu_handle_t*)data;
|
menu_handle_t *menu = (menu_handle_t*)data;
|
||||||
menu_displaylist_info_t *info= (menu_displaylist_info_t*)data2;
|
menu_displaylist_info_t *info = (menu_displaylist_info_t*)data2;
|
||||||
|
enum menu_displaylist_ctl_state type = (enum menu_displaylist_ctl_state)
|
||||||
|
type_data;
|
||||||
|
|
||||||
if (string_is_empty(info->path))
|
if (string_is_empty(info->path))
|
||||||
{
|
{
|
||||||
@ -62,7 +79,8 @@ int filebrowser_parse(void *data, void *data2,
|
|||||||
filter_ext =
|
filter_ext =
|
||||||
settings->menu.navigation.browser.filter.supported_extensions_enable;
|
settings->menu.navigation.browser.filter.supported_extensions_enable;
|
||||||
|
|
||||||
if (string_is_equal(info->label, msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE)))
|
if (string_is_equal(info->label,
|
||||||
|
msg_hash_to_str(MENU_ENUM_LABEL_SCAN_FILE)))
|
||||||
filter_ext = false;
|
filter_ext = false;
|
||||||
|
|
||||||
if (extensions_honored)
|
if (extensions_honored)
|
||||||
@ -176,8 +194,9 @@ int filebrowser_parse(void *data, void *data2,
|
|||||||
file_type = FILE_TYPE_PLAYLIST_COLLECTION;
|
file_type = FILE_TYPE_PLAYLIST_COLLECTION;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!is_dir && (settings->multimedia.builtin_mediaplayer_enable ||
|
if (!is_dir &&
|
||||||
settings->multimedia.builtin_imageviewer_enable))
|
(settings->multimedia.builtin_mediaplayer_enable ||
|
||||||
|
settings->multimedia.builtin_imageviewer_enable))
|
||||||
{
|
{
|
||||||
switch (path_is_media_type(path))
|
switch (path_is_media_type(path))
|
||||||
{
|
{
|
||||||
|
@ -24,12 +24,22 @@
|
|||||||
|
|
||||||
#include <retro_common_api.h>
|
#include <retro_common_api.h>
|
||||||
|
|
||||||
#include "../menu_displaylist.h"
|
|
||||||
|
|
||||||
RETRO_BEGIN_DECLS
|
RETRO_BEGIN_DECLS
|
||||||
|
|
||||||
|
enum filebrowser_enums
|
||||||
|
{
|
||||||
|
FILEBROWSER_NONE = 0,
|
||||||
|
FILEBROWSER_SELECT_DIR,
|
||||||
|
FILEBROWSER_SCAN_DIR,
|
||||||
|
FILEBROWSER_SELECT_COLLECTION
|
||||||
|
};
|
||||||
|
|
||||||
|
void filebrowser_clear_type(void);
|
||||||
|
|
||||||
|
void filebrowser_set_type(enum filebrowser_enums type);
|
||||||
|
|
||||||
int filebrowser_parse(void *data, void *data2,
|
int filebrowser_parse(void *data, void *data2,
|
||||||
enum menu_displaylist_ctl_state type,
|
unsigned type,
|
||||||
bool extensions_honored);
|
bool extensions_honored);
|
||||||
|
|
||||||
RETRO_END_DECLS
|
RETRO_END_DECLS
|
||||||
|
Loading…
Reference in New Issue
Block a user