Start making parseable drives work in Load Content

This commit is contained in:
twinaphex 2016-12-13 00:50:39 +01:00
parent 5723c79dac
commit fc73e82e43
6 changed files with 102 additions and 83 deletions

View File

@ -61,6 +61,7 @@
#include "platform_linux.h" #include "platform_linux.h"
#ifdef HAVE_MENU #ifdef HAVE_MENU
#include "../../menu/menu_driver.h"
#include "../../menu/menu_display.h" #include "../../menu/menu_display.h"
#include "../../menu/menu_entries.h" #include "../../menu/menu_entries.h"
#endif #endif
@ -1857,24 +1858,29 @@ static int frontend_linux_parse_drive_list(void *data)
menu_entries_append_enum(list, menu_entries_append_enum(list,
app_dir, app_dir,
msg_hash_to_str(MSG_APPLICATION_DIR), msg_hash_to_str(MSG_APPLICATION_DIR),
MSG_APPLICATION_DIR, FILE_TYPE_DIRECTORY, 0, 0); MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
MENU_SETTING_ACTION, 0, 0);
menu_entries_append_enum(list, menu_entries_append_enum(list,
internal_storage_app_path, internal_storage_app_path,
msg_hash_to_str(MSG_EXTERNAL_APPLICATION_DIR), msg_hash_to_str(MSG_EXTERNAL_APPLICATION_DIR),
MSG_EXTERNAL_APPLICATION_DIR, MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
FILE_TYPE_DIRECTORY, 0, 0); MENU_SETTING_ACTION, 0, 0);
menu_entries_append_enum(list, menu_entries_append_enum(list,
internal_storage_path, internal_storage_path,
msg_hash_to_str(MSG_INTERNAL_STORAGE), msg_hash_to_str(MSG_INTERNAL_STORAGE),
MSG_INTERNAL_STORAGE, FILE_TYPE_DIRECTORY, 0, 0); MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
MENU_SETTING_ACTION, 0, 0);
menu_entries_append_enum(list, menu_entries_append_enum(list,
"/storage", "/storage",
msg_hash_to_str(MSG_REMOVABLE_STORAGE), msg_hash_to_str(MSG_REMOVABLE_STORAGE),
MSG_REMOVABLE_STORAGE, FILE_TYPE_DIRECTORY, 0, 0); MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
MENU_SETTING_ACTION, 0, 0);
#endif #endif
menu_entries_append_enum(list, "/", "", menu_entries_append_enum(list, "/",
MSG_UNKNOWN, FILE_TYPE_DIRECTORY, 0, 0); msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
MENU_SETTING_ACTION, 0, 0);
#endif #endif
return 0; return 0;

View File

@ -1153,3 +1153,5 @@ MSG_HASH(MENU_ENUM_LABEL_SHADER_PIPELINE_SNOW,
"shader_pipeline_snow") "shader_pipeline_snow")
MSG_HASH(MENU_ENUM_LABEL_INPUT_UNIFIED_MENU_CONTROLS, MSG_HASH(MENU_ENUM_LABEL_INPUT_UNIFIED_MENU_CONTROLS,
"unified_menu_controls") "unified_menu_controls")
MSG_HASH(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
"detect_core_list_push_dir")

View File

@ -71,6 +71,7 @@ typedef struct
#endif #endif
/* FIXME - Global variables, refactor */ /* FIXME - Global variables, refactor */
static char filebrowser_label[PATH_MAX_LENGTH];
static char detect_content_path[PATH_MAX_LENGTH]; static char detect_content_path[PATH_MAX_LENGTH];
unsigned rpl_entry_selection_ptr = 0; unsigned rpl_entry_selection_ptr = 0;
unsigned rdb_entry_start_game_selection_ptr = 0; unsigned rdb_entry_start_game_selection_ptr = 0;
@ -294,7 +295,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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);
@ -302,7 +303,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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;
@ -326,7 +327,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = 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));
@ -344,7 +345,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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;
@ -352,7 +353,6 @@ 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_CONTENT_LIST: case ACTION_OK_DL_CONTENT_LIST:
menu_displaylist_reset_filebrowser();
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;
@ -360,6 +360,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;
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;
@ -367,7 +368,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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;
@ -377,7 +378,7 @@ int generic_action_ok_displaylist_push(const char *path,
case ACTION_OK_DL_RECORD_CONFIGFILE: case ACTION_OK_DL_RECORD_CONFIGFILE:
{ {
global_t *global = global_get_ptr(); global_t *global = global_get_ptr();
menu_displaylist_reset_filebrowser(); 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;
@ -386,7 +387,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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;
@ -394,7 +395,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
info_path = path; info_path = path;
@ -402,7 +403,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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;
@ -410,7 +411,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
info.type = type; info.type = type;
info.directory_ptr = idx; info.directory_ptr = idx;
info_path = settings->directory.libretro; info_path = settings->directory.libretro;
@ -418,7 +419,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = 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;
@ -426,7 +427,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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));
@ -500,7 +501,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
fill_pathname_join(tmp, fill_pathname_join(tmp,
settings->path.content_database, settings->path.content_database,
path, sizeof(tmp)); path, sizeof(tmp));
@ -513,7 +514,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
fill_pathname_join(tmp, settings->directory.cursor, fill_pathname_join(tmp, settings->directory.cursor,
path, sizeof(tmp)); path, sizeof(tmp));
@ -1424,6 +1425,18 @@ static int generic_action_ok(const char *path,
command_event(CMD_EVENT_RESUME, NULL); command_event(CMD_EVENT_RESUME, NULL);
break; break;
case ACTION_OK_SET_DIRECTORY: case ACTION_OK_SET_DIRECTORY:
flush_type = MENU_SETTINGS;
{
rarch_setting_t *setting = menu_setting_find(filebrowser_label);
if (setting)
{
setting_set_with_string_representation(
setting, action_path);
ret = menu_setting_generic(setting, false);
}
}
break;
case ACTION_OK_SET_PATH: case ACTION_OK_SET_PATH:
flush_type = MENU_SETTINGS; flush_type = MENU_SETTINGS;
{ {
@ -2700,7 +2713,6 @@ static int action_ok_shader_apply_changes(const char *path,
static int action_ok_lookup_setting(const char *path, static int action_ok_lookup_setting(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)
{ {
menu_displaylist_reset_filebrowser();
return menu_setting_set(type, label, MENU_ACTION_OK, false); return menu_setting_set(type, label, MENU_ACTION_OK, false);
} }
@ -3106,11 +3118,21 @@ static int action_ok_scan_directory_list(const char *path,
entry_idx, ACTION_OK_DL_SCAN_DIR_LIST); entry_idx, ACTION_OK_DL_SCAN_DIR_LIST);
} }
static int action_ok_push_random_dir(const char *path,
const char *label, unsigned type, size_t idx, size_t entry_idx)
{
settings_t *settings = config_get_ptr();
return generic_action_ok_displaylist_push(path, path,
msg_hash_to_str(MENU_ENUM_LABEL_DETECT_CORE_LIST),
type, idx,
entry_idx, ACTION_OK_DL_CONTENT_LIST);
}
static int action_ok_push_downloads_dir(const char *path, 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();
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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_DETECT_CORE_LIST), msg_hash_to_str(MENU_ENUM_LABEL_DETECT_CORE_LIST),
type, idx, type, idx,
@ -3134,6 +3156,7 @@ int action_ok_push_generic_list(const char *path,
int action_ok_push_filebrowser_list_dir_select(const char *path, int action_ok_push_filebrowser_list_dir_select(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)
{ {
strlcpy(filebrowser_label, label, sizeof(filebrowser_label));
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_FILE_BROWSER_SELECT_DIR); entry_idx, ACTION_OK_DL_FILE_BROWSER_SELECT_DIR);
} }
@ -3799,6 +3822,9 @@ static int menu_cbs_init_bind_ok_compare_label(menu_file_list_cbs_t *cbs,
case MENU_ENUM_LABEL_DETECT_CORE_LIST: case MENU_ENUM_LABEL_DETECT_CORE_LIST:
BIND_ACTION_OK(cbs, action_ok_push_content_list); BIND_ACTION_OK(cbs, action_ok_push_content_list);
break; break;
case MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR:
BIND_ACTION_OK(cbs, action_ok_push_random_dir);
break;
case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST: case MENU_ENUM_LABEL_DOWNLOADED_FILE_DETECT_CORE_LIST:
BIND_ACTION_OK(cbs, action_ok_push_downloads_dir); BIND_ACTION_OK(cbs, action_ok_push_downloads_dir);
break; break;

View File

@ -3200,15 +3200,7 @@ static int menu_displaylist_parse_options_remappings(
return 0; return 0;
} }
enum filebrowser_enums unsigned filebrowser_types = 0;
{
FILEBROWSER_NONE = 0,
FILEBROWSER_SELECT_DIR,
FILEBROWSER_SCAN_DIR,
FILEBROWSER_SELECT_COLLECTION
};
static 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)
@ -3561,7 +3553,7 @@ static int menu_displaylist_parse_generic(
true, settings->show_hidden_files, true, false); true, settings->show_hidden_files, true, false);
#ifdef HAVE_LIBRETRODB #ifdef HAVE_LIBRETRODB
if (BIT32_GET(filebrowser_types, FILEBROWSER_SCAN_DIR)) if (filebrowser_types == FILEBROWSER_SCAN_DIR)
menu_entries_prepend(info->list, menu_entries_prepend(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_THIS_DIRECTORY), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_SCAN_THIS_DIRECTORY),
msg_hash_to_str(MENU_ENUM_LABEL_SCAN_THIS_DIRECTORY), msg_hash_to_str(MENU_ENUM_LABEL_SCAN_THIS_DIRECTORY),
@ -3569,7 +3561,7 @@ static int menu_displaylist_parse_generic(
FILE_TYPE_SCAN_DIRECTORY, 0 ,0); FILE_TYPE_SCAN_DIRECTORY, 0 ,0);
#endif #endif
if (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_DIR)) if (filebrowser_types == FILEBROWSER_SELECT_DIR)
menu_entries_prepend(info->list, menu_entries_prepend(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_USE_THIS_DIRECTORY),
msg_hash_to_str(MENU_ENUM_LABEL_USE_THIS_DIRECTORY), msg_hash_to_str(MENU_ENUM_LABEL_USE_THIS_DIRECTORY),
@ -3641,9 +3633,9 @@ static int menu_displaylist_parse_generic(
if (!is_dir) if (!is_dir)
{ {
if (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_DIR)) if (filebrowser_types == FILEBROWSER_SELECT_DIR)
continue; continue;
if (BIT32_GET(filebrowser_types, FILEBROWSER_SCAN_DIR)) if (filebrowser_types == FILEBROWSER_SCAN_DIR)
continue; continue;
} }
@ -3653,7 +3645,7 @@ static int menu_displaylist_parse_generic(
if (*info->path && !path_is_compressed) if (*info->path && !path_is_compressed)
path = path_basename(path); path = path_basename(path);
if (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_COLLECTION)) if (filebrowser_types == FILEBROWSER_SELECT_COLLECTION)
{ {
if (is_dir) if (is_dir)
file_type = FILE_TYPE_DIRECTORY; file_type = FILE_TYPE_DIRECTORY;
@ -3738,9 +3730,9 @@ static int menu_displaylist_parse_generic(
} }
/* We don't want to show 'filter by extension' for this. */ /* We don't want to show 'filter by extension' for this. */
if (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_DIR)) if (filebrowser_types == FILEBROWSER_SELECT_DIR)
goto end; goto end;
if (BIT32_GET(filebrowser_types, FILEBROWSER_SCAN_DIR)) if (filebrowser_types == FILEBROWSER_SCAN_DIR)
goto end; goto end;
if (!extensions_honored) if (!extensions_honored)
@ -3926,8 +3918,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;
menu_displaylist_reset_filebrowser();
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),
@ -3942,7 +3933,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)))
{ {
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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),
@ -3958,7 +3949,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)))
{ {
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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),
@ -3993,7 +3984,7 @@ static bool menu_displaylist_push_internal(
{ {
settings_t *settings = config_get_ptr(); settings_t *settings = config_get_ptr();
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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),
@ -4082,11 +4073,6 @@ static bool menu_displaylist_push(menu_displaylist_ctx_entry_t *entry)
return true; return true;
} }
void menu_displaylist_reset_filebrowser(void)
{
BIT32_CLEAR_ALL(filebrowser_types);
}
static void menu_displaylist_parse_playlist_history( static void menu_displaylist_parse_playlist_history(
menu_handle_t *menu, menu_handle_t *menu,
menu_displaylist_info_t *info, menu_displaylist_info_t *info,
@ -4264,24 +4250,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
break; break;
} }
switch (type)
{
case DISPLAYLIST_FILE_BROWSER_SCAN_DIR:
menu_displaylist_reset_filebrowser();
BIT32_SET(filebrowser_types, FILEBROWSER_SCAN_DIR);
break;
case DISPLAYLIST_FILE_BROWSER_SELECT_DIR:
menu_displaylist_reset_filebrowser();
BIT32_SET(filebrowser_types, FILEBROWSER_SELECT_DIR);
break;
case DISPLAYLIST_FILE_BROWSER_SELECT_COLLECTION:
menu_displaylist_reset_filebrowser();
BIT32_SET(filebrowser_types, FILEBROWSER_SELECT_COLLECTION);
break;
default:
break;
}
switch (type) switch (type)
{ {
case DISPLAYLIST_NONE: case DISPLAYLIST_NONE:
@ -5552,6 +5520,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
info->need_refresh = true; info->need_refresh = true;
break; break;
case DISPLAYLIST_LOAD_CONTENT_LIST: case DISPLAYLIST_LOAD_CONTENT_LIST:
if (frontend_driver_parse_drive_list(info->list) != 0)
menu_entries_append_enum(info->list, "/",
msg_hash_to_str(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR),
MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR,
MENU_SETTING_ACTION, 0, 0);
menu_entries_append_enum(info->list, menu_entries_append_enum(info->list,
msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DETECT_CORE_LIST), msg_hash_to_str(MENU_ENUM_LABEL_VALUE_DETECT_CORE_LIST),
msg_hash_to_str(MENU_ENUM_LABEL_DETECT_CORE_LIST), msg_hash_to_str(MENU_ENUM_LABEL_DETECT_CORE_LIST),
@ -6063,7 +6037,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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),
@ -6102,7 +6076,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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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));
@ -6113,14 +6087,14 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
ext_name[0] = '\0'; ext_name[0] = '\0';
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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;
@ -6131,7 +6105,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
(void)attr; (void)attr;
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
info->type_default = FILE_TYPE_SHADER_PRESET; info->type_default = FILE_TYPE_SHADER_PRESET;
#ifdef HAVE_CG #ifdef HAVE_CG
@ -6152,7 +6126,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();
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
info->type_default = FILE_TYPE_SHADER; info->type_default = FILE_TYPE_SHADER;
(void)attr; (void)attr;
@ -6171,12 +6145,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
} }
break; break;
case DISPLAYLIST_VIDEO_FILTERS: case DISPLAYLIST_VIDEO_FILTERS:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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};
@ -6200,37 +6174,37 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data)
} }
break; break;
case DISPLAYLIST_AUDIO_FILTERS: case DISPLAYLIST_AUDIO_FILTERS:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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:
menu_displaylist_reset_filebrowser(); filebrowser_types = FILEBROWSER_NONE;
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;

View File

@ -159,6 +159,14 @@ 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;
@ -205,6 +213,8 @@ 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

View File

@ -833,6 +833,7 @@ enum msg_hash_enums
MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST, MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST,
MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST, MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST,
MENU_LABEL(FILE_DETECT_CORE_LIST_PUSH_DIR),
MENU_LABEL(DOWNLOADED_FILE_DETECT_CORE_LIST), MENU_LABEL(DOWNLOADED_FILE_DETECT_CORE_LIST),
MENU_ENUM_LABEL_VALUE_SEARCH, MENU_ENUM_LABEL_VALUE_SEARCH,