diff --git a/frontend/menu/backend/menu_common_backend.c b/frontend/menu/backend/menu_common_backend.c index 311d789a0a..f5be7dd9de 100644 --- a/frontend/menu/backend/menu_common_backend.c +++ b/frontend/menu/backend/menu_common_backend.c @@ -1653,31 +1653,13 @@ static int menu_action_ok(const char *dir, && (type == MENU_FILE_USE_DIRECTORY)) { menu_common_setting_set_current_string(setting, dir); - menu_flush_stack_label(driver.menu->menu_stack, "Path Options"); + menu_entries_pop_stack(driver.menu->menu_stack, setting->name); } - else if (setting && !strcmp(setting->name, "input_overlay") - && type == MENU_FILE_PLAIN) + else if ((setting && setting->type == ST_PATH) + && (type == MENU_FILE_PLAIN)) { menu_common_setting_set_current_string_path(setting, dir, path); - menu_flush_stack_label(driver.menu->menu_stack, "settings"); - } - else if (setting && !strcmp(setting->name, "game_history_path") - && type == MENU_FILE_PLAIN) - { - menu_common_setting_set_current_string_path(setting, dir, path); - menu_flush_stack_label(driver.menu->menu_stack, "Path Options"); - } - else if (setting && !strcmp(setting->name, "video_filter") - && type == MENU_FILE_PLAIN) - { - menu_common_setting_set_current_string_path(setting, dir, path); - menu_flush_stack_label(driver.menu->menu_stack, "Video Options"); - } - else if (setting && !strcmp(setting->name, "audio_dsp_plugin") - && type == MENU_FILE_PLAIN) - { - menu_common_setting_set_current_string_path(setting, dir, path); - menu_flush_stack_label(driver.menu->menu_stack, "Audio Options"); + menu_entries_pop_stack(driver.menu->menu_stack, setting->name); } #ifdef HAVE_SHADER_MANAGER else if (!strcmp(menu_label, "video_shader_preset") diff --git a/frontend/menu/menu_entries.c b/frontend/menu/menu_entries.c index a8934304f6..e4c536dff4 100644 --- a/frontend/menu/menu_entries.c +++ b/frontend/menu/menu_entries.c @@ -827,6 +827,25 @@ void menu_flush_stack_type(file_list_t *list, } } +void menu_entries_pop_stack(file_list_t *list, + const char *needle) +{ + const char *path = NULL; + const char *label = NULL; + unsigned type = 0; + + if (!driver.menu) + return; + + driver.menu->need_refresh = true; + file_list_get_last(list, &path, &label, &type); + while (strcmp(needle, label) == 0) + { + file_list_pop(list, &driver.menu->selection_ptr); + file_list_get_last(list, &path, &label, &type); + } +} + void menu_flush_stack_label(file_list_t *list, const char *needle) { diff --git a/frontend/menu/menu_entries.h b/frontend/menu/menu_entries.h index 5176de6e14..0a9fd6960c 100644 --- a/frontend/menu/menu_entries.h +++ b/frontend/menu/menu_entries.h @@ -34,6 +34,7 @@ int menu_parse_check(const char *label, unsigned menu_type); int menu_parse_and_resolve(file_list_t *list, file_list_t *menu_list); void menu_entries_pop(file_list_t *list); +void menu_entries_pop_stack(file_list_t *list, const char *needle); void menu_flush_stack_type(file_list_t *list, unsigned final_type); void menu_flush_stack_label(file_list_t *list, const char *needle); diff --git a/settings_data.c b/settings_data.c index e7fc4136da..6b5762ad3e 100644 --- a/settings_data.c +++ b/settings_data.c @@ -1744,28 +1744,28 @@ rarch_setting_t *setting_data_get_mainmenu(bool regenerate) START_GROUP("Main Menu") START_SUB_GROUP("State") #if defined(HAVE_DYNAMIC) || defined(HAVE_LIBRETRO_MANAGEMENT) - CONFIG_BOOL(lists[0], "core_list", "Core", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[0], "core_list", "Core", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) #endif if (g_extern.history) { - CONFIG_BOOL(lists[1], "history_list", "Load Content (History)", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[1], "history_list", "Load Content (History)", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) } if (driver.menu && g_extern.core_info && core_info_list_num_info_files(g_extern.core_info)) { - CONFIG_BOOL(lists[2], "detect_core_list", "Load Content (Detect Core)", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[2], "detect_core_list", "Load Content (Detect Core)", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) } - CONFIG_BOOL(lists[3], "load_content", "Load Content", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) - CONFIG_BOOL(lists[4], "core_options", "Core Options", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) - CONFIG_BOOL(lists[5], "core_information", "Core Information", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) - CONFIG_BOOL(lists[6], "settings", "Settings", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[3], "load_content", "Load Content", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[4], "core_options", "Core Options", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[5], "core_information", "Core Information", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[6], "settings", "Settings", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) if (g_extern.perfcnt_enable) { - CONFIG_BOOL(lists[7], "performance_counters", "Performance Counters", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[7], "performance_counters", "Performance Counters", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) } if (g_extern.main_is_init && !g_extern.libretro_dummy) { - CONFIG_BOOL(lists[8], "savestate", "Save State", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) - CONFIG_BOOL(lists[9], "loadstate", "Load State", false, "...", "...", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[8], "savestate", "Save State", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) + CONFIG_BOOL(lists[9], "loadstate", "Load State", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) CONFIG_BOOL(lists[10], "take_screenshot", "Take Screenshot", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) CONFIG_BOOL(lists[11], "resume_content", "Resume Content", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler) CONFIG_BOOL(lists[12], "restart_content", "Restart Content", false, "", "", GROUP_NAME, SUBGROUP_NAME, general_write_handler, general_read_handler)