diff --git a/frontend/drivers/platform_linux.c b/frontend/drivers/platform_linux.c index 6ca9c5c0b8..7d92d2aec2 100644 --- a/frontend/drivers/platform_linux.c +++ b/frontend/drivers/platform_linux.c @@ -61,6 +61,7 @@ #include "platform_linux.h" #ifdef HAVE_MENU +#include "../../menu/menu_driver.h" #include "../../menu/menu_display.h" #include "../../menu/menu_entries.h" #endif @@ -1857,24 +1858,29 @@ static int frontend_linux_parse_drive_list(void *data) menu_entries_append_enum(list, app_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, internal_storage_app_path, msg_hash_to_str(MSG_EXTERNAL_APPLICATION_DIR), - MSG_EXTERNAL_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, internal_storage_path, 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, "/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 - menu_entries_append_enum(list, "/", "", - MSG_UNKNOWN, FILE_TYPE_DIRECTORY, 0, 0); + menu_entries_append_enum(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); #endif return 0; diff --git a/intl/msg_hash_lbl.h b/intl/msg_hash_lbl.h index 3907ab04b3..7d8fd98f7d 100644 --- a/intl/msg_hash_lbl.h +++ b/intl/msg_hash_lbl.h @@ -1153,3 +1153,5 @@ MSG_HASH(MENU_ENUM_LABEL_SHADER_PIPELINE_SNOW, "shader_pipeline_snow") MSG_HASH(MENU_ENUM_LABEL_INPUT_UNIFIED_MENU_CONTROLS, "unified_menu_controls") +MSG_HASH(MENU_ENUM_LABEL_FILE_DETECT_CORE_LIST_PUSH_DIR, + "detect_core_list_push_dir") diff --git a/menu/cbs/menu_cbs_ok.c b/menu/cbs/menu_cbs_ok.c index c9a3ceafd6..e882c92855 100644 --- a/menu/cbs/menu_cbs_ok.c +++ b/menu/cbs/menu_cbs_ok.c @@ -71,6 +71,7 @@ typedef struct #endif /* FIXME - Global variables, refactor */ +static char filebrowser_label[PATH_MAX_LENGTH]; static char detect_content_path[PATH_MAX_LENGTH]; unsigned rpl_entry_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; break; case ACTION_OK_DL_AUDIO_DSP_PLUGIN: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.directory_ptr = idx; info_path = settings->directory.audio_filter; 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; break; case ACTION_OK_DL_SHADER_PASS: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; info_path = settings->directory.video_shader; @@ -326,7 +327,7 @@ int generic_action_ok_displaylist_push(const char *path, dl_type = DISPLAYLIST_GENERIC; break; case ACTION_OK_DL_FILE_BROWSER_SELECT_DIR: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_SELECT_DIR; if (path) strlcpy(menu->deferred_path, path, sizeof(menu->deferred_path)); @@ -344,7 +345,7 @@ int generic_action_ok_displaylist_push(const char *path, dl_type = DISPLAYLIST_GENERIC; break; case ACTION_OK_DL_SHADER_PRESET: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; 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; break; case ACTION_OK_DL_CONTENT_LIST: - menu_displaylist_reset_filebrowser(); info.type = FILE_TYPE_DIRECTORY; info.directory_ptr = idx; info_path = new_path; @@ -360,6 +360,7 @@ int generic_action_ok_displaylist_push(const char *path, dl_type = DISPLAYLIST_GENERIC; break; case ACTION_OK_DL_SCAN_DIR_LIST: + filebrowser_types = FILEBROWSER_SCAN_DIR; info.type = FILE_TYPE_DIRECTORY; info.directory_ptr = idx; info_path = new_path; @@ -367,7 +368,7 @@ int generic_action_ok_displaylist_push(const char *path, dl_type = DISPLAYLIST_FILE_BROWSER_SCAN_DIR; break; case ACTION_OK_DL_REMAP_FILE: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; 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: { global_t *global = global_get_ptr(); - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; info_path = global->record.config_dir; @@ -386,7 +387,7 @@ int generic_action_ok_displaylist_push(const char *path, } break; case ACTION_OK_DL_DISK_IMAGE_APPEND_LIST: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; 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; break; case ACTION_OK_DL_PLAYLIST_COLLECTION: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; info_path = path; @@ -402,7 +403,7 @@ int generic_action_ok_displaylist_push(const char *path, dl_type = DISPLAYLIST_GENERIC; break; case ACTION_OK_DL_CHEAT_FILE: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; 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; break; case ACTION_OK_DL_CORE_LIST: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info.type = type; info.directory_ptr = idx; 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; break; case ACTION_OK_DL_CONTENT_COLLECTION_LIST: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_SELECT_COLLECTION; info.type = type; info.directory_ptr = idx; 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; break; case ACTION_OK_DL_RDB_ENTRY: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; fill_pathname_join_delim(tmp, msg_hash_to_str(MENU_ENUM_LABEL_DEFERRED_RDB_ENTRY_DETAIL), path, '|', sizeof(tmp)); @@ -500,7 +501,7 @@ int generic_action_ok_displaylist_push(const char *path, dl_type = DISPLAYLIST_GENERIC; break; case ACTION_OK_DL_DATABASE_MANAGER_LIST: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; fill_pathname_join(tmp, settings->path.content_database, path, sizeof(tmp)); @@ -513,7 +514,7 @@ int generic_action_ok_displaylist_push(const char *path, dl_type = DISPLAYLIST_GENERIC; break; case ACTION_OK_DL_CURSOR_MANAGER_LIST: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; fill_pathname_join(tmp, settings->directory.cursor, path, sizeof(tmp)); @@ -1424,6 +1425,18 @@ static int generic_action_ok(const char *path, command_event(CMD_EVENT_RESUME, NULL); break; 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: 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, 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); } @@ -3106,11 +3118,21 @@ static int action_ok_scan_directory_list(const char *path, 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, const char *label, unsigned type, size_t idx, size_t entry_idx) { 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, msg_hash_to_str(MENU_ENUM_LABEL_DETECT_CORE_LIST), 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, 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, 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: BIND_ACTION_OK(cbs, action_ok_push_content_list); 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: BIND_ACTION_OK(cbs, action_ok_push_downloads_dir); break; diff --git a/menu/menu_displaylist.c b/menu/menu_displaylist.c index 445fe9e137..fe35b02170 100644 --- a/menu/menu_displaylist.c +++ b/menu/menu_displaylist.c @@ -3200,15 +3200,7 @@ static int menu_displaylist_parse_options_remappings( return 0; } -enum filebrowser_enums -{ - FILEBROWSER_NONE = 0, - FILEBROWSER_SELECT_DIR, - FILEBROWSER_SCAN_DIR, - FILEBROWSER_SELECT_COLLECTION -}; - -static unsigned filebrowser_types = 0; +unsigned filebrowser_types = 0; static int menu_displaylist_parse_playlists( menu_displaylist_info_t *info, bool horizontal) @@ -3561,7 +3553,7 @@ static int menu_displaylist_parse_generic( true, settings->show_hidden_files, true, false); #ifdef HAVE_LIBRETRODB - if (BIT32_GET(filebrowser_types, FILEBROWSER_SCAN_DIR)) + if (filebrowser_types == FILEBROWSER_SCAN_DIR) menu_entries_prepend(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_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); #endif - if (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_DIR)) + if (filebrowser_types == FILEBROWSER_SELECT_DIR) menu_entries_prepend(info->list, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_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 (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_DIR)) + if (filebrowser_types == FILEBROWSER_SELECT_DIR) continue; - if (BIT32_GET(filebrowser_types, FILEBROWSER_SCAN_DIR)) + if (filebrowser_types == FILEBROWSER_SCAN_DIR) continue; } @@ -3653,7 +3645,7 @@ static int menu_displaylist_parse_generic( if (*info->path && !path_is_compressed) path = path_basename(path); - if (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_COLLECTION)) + if (filebrowser_types == FILEBROWSER_SELECT_COLLECTION) { if (is_dir) 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. */ - if (BIT32_GET(filebrowser_types, FILEBROWSER_SELECT_DIR)) + if (filebrowser_types == FILEBROWSER_SELECT_DIR) goto end; - if (BIT32_GET(filebrowser_types, FILEBROWSER_SCAN_DIR)) + if (filebrowser_types == FILEBROWSER_SCAN_DIR) goto end; 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))) { - - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type = 42; strlcpy(info->exts, 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))) { - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type = 42; strlcpy(info->exts, 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))) { - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type = 42; strlcpy(info->exts, 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(); - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type = 42; strlcpy(info->exts, 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; } -void menu_displaylist_reset_filebrowser(void) -{ - BIT32_CLEAR_ALL(filebrowser_types); -} - static void menu_displaylist_parse_playlist_history( menu_handle_t *menu, menu_displaylist_info_t *info, @@ -4264,24 +4250,6 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) 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) { case DISPLAYLIST_NONE: @@ -5552,6 +5520,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) info->need_refresh = true; break; 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, msg_hash_to_str(MENU_ENUM_LABEL_VALUE_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; break; case DISPLAYLIST_DATABASES: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_RDB; strlcpy(info->exts, 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; break; case DISPLAYLIST_DATABASE_CURSORS: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_CURSOR; strlcpy(info->exts, "dbc", sizeof(info->exts)); 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'; - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_PLAIN; if (frontend_driver_get_core_extension(ext_name, sizeof(ext_name))) strlcpy(info->exts, ext_name, sizeof(info->exts)); } break; case DISPLAYLIST_CONFIG_FILES: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_CONFIG; strlcpy(info->exts, "cfg", sizeof(info->exts)); break; @@ -6131,7 +6105,7 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) (void)attr; - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_SHADER_PRESET; #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}; struct string_list *str_list = string_list_new(); - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_SHADER; (void)attr; @@ -6171,12 +6145,12 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) } break; case DISPLAYLIST_VIDEO_FILTERS: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_VIDEOFILTER; strlcpy(info->exts, "filt", sizeof(info->exts)); break; case DISPLAYLIST_IMAGES: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_IMAGE; { union string_list_elem_attr attr = {0}; @@ -6200,37 +6174,37 @@ bool menu_displaylist_ctl(enum menu_displaylist_ctl_state type, void *data) } break; case DISPLAYLIST_AUDIO_FILTERS: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_AUDIOFILTER; strlcpy(info->exts, "dsp", sizeof(info->exts)); break; case DISPLAYLIST_CHEAT_FILES: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_CHEAT; strlcpy(info->exts, "cht", sizeof(info->exts)); break; case DISPLAYLIST_CONTENT_HISTORY: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_PLAIN; strlcpy(info->exts, "lpl", sizeof(info->exts)); break; case DISPLAYLIST_FONTS: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_FONT; strlcpy(info->exts, "ttf", sizeof(info->exts)); break; case DISPLAYLIST_OVERLAYS: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_OVERLAY; strlcpy(info->exts, "cfg", sizeof(info->exts)); break; case DISPLAYLIST_RECORD_CONFIG_FILES: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_RECORD_CONFIG; strlcpy(info->exts, "cfg", sizeof(info->exts)); break; case DISPLAYLIST_REMAP_FILES: - menu_displaylist_reset_filebrowser(); + filebrowser_types = FILEBROWSER_NONE; info->type_default = FILE_TYPE_REMAP; strlcpy(info->exts, "rmp", sizeof(info->exts)); break; diff --git a/menu/menu_displaylist.h b/menu/menu_displaylist.h index d03324acea..dfd2de0d26 100644 --- a/menu/menu_displaylist.h +++ b/menu/menu_displaylist.h @@ -159,6 +159,14 @@ enum menu_displaylist_ctl_state DISPLAYLIST_PENDING_CLEAR }; +enum filebrowser_enums +{ + FILEBROWSER_NONE = 0, + FILEBROWSER_SELECT_DIR, + FILEBROWSER_SCAN_DIR, + FILEBROWSER_SELECT_COLLECTION +}; + typedef struct menu_displaylist_info { 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); +extern unsigned filebrowser_types; + RETRO_END_DECLS #endif diff --git a/msg_hash.h b/msg_hash.h index 7cf689f997..d39f31f06c 100644 --- a/msg_hash.h +++ b/msg_hash.h @@ -833,6 +833,7 @@ enum msg_hash_enums MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_CHEEVOS_LIST, MENU_ENUM_LABEL_DEFERRED_ACCOUNTS_LIST, + MENU_LABEL(FILE_DETECT_CORE_LIST_PUSH_DIR), MENU_LABEL(DOWNLOADED_FILE_DETECT_CORE_LIST), MENU_ENUM_LABEL_VALUE_SEARCH,