(Menu) Create menu_entries_pop

This commit is contained in:
twinaphex 2014-09-01 05:03:19 +02:00
parent 3ef89c64db
commit 5e88f487e9
3 changed files with 13 additions and 10 deletions

View File

@ -514,12 +514,6 @@ static void menu_common_setting_push_current_menu(file_list_t *list,
}
}
static void menu_action_cancel(void)
{
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
driver.menu->need_refresh = true;
}
static int menu_common_core_setting_toggle(unsigned setting, unsigned action)
{
unsigned index = setting - MENU_SETTINGS_CORE_OPTION_START;
@ -1340,8 +1334,7 @@ static int menu_settings_iterate(unsigned action)
break;
case MENU_ACTION_CANCEL:
if (file_list_get_size(driver.menu->menu_stack) > 1)
menu_action_cancel();
menu_entries_pop();
break;
case MENU_ACTION_SELECT:
{
@ -2057,8 +2050,7 @@ static int menu_common_iterate(unsigned action)
break;
case MENU_ACTION_CANCEL:
if (file_list_get_size(driver.menu->menu_stack) > 1)
menu_action_cancel();
menu_entries_pop();
break;
case MENU_ACTION_OK:

View File

@ -69,6 +69,15 @@ void menu_entries_push_perfcounter(menu_handle_t *menu,
id + i, 0);
}
void menu_entries_pop(void)
{
if (file_list_get_size(driver.menu->menu_stack) > 1)
{
file_list_pop(driver.menu->menu_stack, &driver.menu->selection_ptr);
driver.menu->need_refresh = true;
}
}
int menu_entries_push(menu_handle_t *menu,
const char *path, const char *label,
unsigned menu_type)
@ -802,3 +811,4 @@ void menu_entries_push_info(void)
{
file_list_push(driver.menu->menu_stack, "", "help", 0, 0);
}

View File

@ -24,5 +24,6 @@ int menu_entries_push(menu_handle_t *menu, const char *path,
void menu_entries_push_info(void);
int menu_parse_check(unsigned menu_type);
int menu_parse_and_resolve(void);
void menu_entries_pop(void);
#endif