(Menu) Refactor menu_entries_push

This commit is contained in:
twinaphex 2014-09-01 06:01:01 +02:00
parent 2baac0bb71
commit 9ab14a89c3
5 changed files with 15 additions and 20 deletions

View File

@ -542,8 +542,7 @@ static void defer_decision_manual(void)
if (driver.menu)
menu_entries_push(driver.menu->menu_stack,
g_settings.libretro_directory, "deferred_core_list",
MENU_SETTINGS_DEFERRED_CORE, driver.menu->selection_ptr,
MENU_ACTION_OK);
MENU_SETTINGS_DEFERRED_CORE, driver.menu->selection_ptr);
}
static int menu_common_setting_set_perf(unsigned setting, unsigned action,
@ -604,7 +603,7 @@ static void menu_common_setting_set_current_path_selection(
case MENU_ACTION_OK:
menu_entries_push(driver.menu->menu_stack,
start_path, "path_list", type,
driver.menu->selection_ptr, action);
driver.menu->selection_ptr);
break;
case MENU_ACTION_START:
*setting->value.string = '\0';
@ -1346,19 +1345,19 @@ static int menu_settings_iterate(unsigned action)
driver.menu->defer_core = (!strcmp(label, "detect_core_list"));
menu_entries_push(driver.menu->menu_stack,
g_settings.menu_content_directory, "", MENU_FILE_DIRECTORY,
driver.menu->selection_ptr, action);
driver.menu->selection_ptr);
}
else if ((!strcmp(label, "history_list") ||
menu_common_type_is(type) == MENU_FILE_DIRECTORY)
&& action == MENU_ACTION_OK)
menu_entries_push(driver.menu->menu_stack,
"", "", type, driver.menu->selection_ptr, action);
"", "", type, driver.menu->selection_ptr);
else if ((menu_common_type_is(type) == MENU_SETTINGS ||
type == MENU_SETTINGS_CORE || type == MENU_SETTINGS_CONFIG ||
type == MENU_SETTINGS_DISK_APPEND) && action == MENU_ACTION_OK)
menu_entries_push(driver.menu->menu_stack,
dir ? dir : label, "", type,
driver.menu->selection_ptr, action);
driver.menu->selection_ptr);
else if (type == MENU_SETTINGS_CUSTOM_VIEWPORT && action == MENU_ACTION_OK)
{
file_list_push(driver.menu->menu_stack, "", "",
@ -1700,8 +1699,7 @@ static int menu_action_ok(const char *dir, unsigned menu_type)
fill_pathname_join(cat_path, dir, path, sizeof(cat_path));
menu_entries_push(driver.menu->menu_stack,
cat_path, "browser_list", type, driver.menu->selection_ptr,
MENU_ACTION_OK);
cat_path, "browser_list", type, driver.menu->selection_ptr);
}
else
{

View File

@ -311,9 +311,9 @@ static int menu_common_shader_manager_setting_toggle(unsigned id, unsigned actio
menu_common_setting_set_current_boolean(current_setting, action);
}
else if ((id == MENU_SETTINGS_SHADER_PARAMETERS
|| id == MENU_SETTINGS_SHADER_PRESET_PARAMETERS))
|| id == MENU_SETTINGS_SHADER_PRESET_PARAMETERS) && action == MENU_ACTION_OK)
menu_entries_push(driver.menu->menu_stack, "",
"shader_parameters", id, driver.menu->selection_ptr, action);
"shader_parameters", id, driver.menu->selection_ptr);
else if (id >= MENU_SETTINGS_SHADER_PARAMETER_0 && id <= MENU_SETTINGS_SHADER_PARAMETER_LAST)
{
struct gfx_shader *shader = NULL;
@ -361,7 +361,7 @@ static int menu_common_shader_manager_setting_toggle(unsigned id, unsigned actio
case MENU_ACTION_OK:
menu_entries_push(driver.menu->menu_stack,
g_settings.video.shader_dir, "video_shader_preset",
id, driver.menu->selection_ptr, action);
id, driver.menu->selection_ptr);
break;
case MENU_ACTION_START:

View File

@ -827,12 +827,9 @@ void menu_flush_stack_type(unsigned final_type)
void menu_entries_push(file_list_t *list,
const char *path, const char *label, unsigned type,
size_t directory_ptr, unsigned action)
size_t directory_ptr)
{
if (action == MENU_ACTION_OK)
{
file_list_push(list, path, label, type, directory_ptr);
menu_clear_navigation(driver.menu);
driver.menu->need_refresh = true;
}
file_list_push(list, path, label, type, directory_ptr);
menu_clear_navigation(driver.menu);
driver.menu->need_refresh = true;
}

View File

@ -21,7 +21,7 @@
void menu_entries_push(file_list_t *list,
const char *path, const char *label, unsigned type,
size_t directory_ptr, unsigned action);
size_t directory_ptr);
int menu_entries_push_list(menu_handle_t *menu, const char *path,
const char *label, unsigned menu_type);
int menu_parse_check(unsigned menu_type);

View File

@ -1479,7 +1479,7 @@ static void general_write_handler(const void *data)
if (*setting->value.boolean)
{
#ifdef HAVE_MENU
menu_entries_push(driver.menu->menu_stack, "", "help", 0, 0, MENU_ACTION_OK);
menu_entries_push(driver.menu->menu_stack, "", "help", 0, 0);
#endif
*setting->value.boolean = false;
}