(Menu entries cbs) Move another entry over

This commit is contained in:
twinaphex 2014-10-12 01:27:53 +02:00
parent d09d0eb0bf
commit 4dade7cc0b
2 changed files with 20 additions and 8 deletions

View File

@ -283,14 +283,6 @@ static int menu_setting_ok_toggle(unsigned type,
return 0;
}
else if (!strcmp(label, "history_list") ||
menu_common_type_is(label, type) == MENU_FILE_DIRECTORY
)
{
menu_entries_push(driver.menu->menu_stack,
"", label, type, driver.menu->selection_ptr);
return 0;
}
else if (
menu_common_type_is(label, type) == MENU_SETTINGS ||
!strcmp(label, "core_list") ||

View File

@ -17,15 +17,31 @@
#include "menu_entries.h"
#include "backend/menu_backend.h"
/* TODO - return with error values. */
static int action_ok_push_content_list(const char *path,
const char *label, unsigned type, size_t index)
{
if (!driver.menu)
return 0;
menu_entries_push(driver.menu->menu_stack,
g_settings.menu_content_directory, label, MENU_FILE_DIRECTORY,
driver.menu->selection_ptr);
return 0;
}
static int action_ok_push_history_or_path_list(const char *path,
const char *label, unsigned type, size_t index)
{
if (!driver.menu)
return 0;
menu_entries_push(driver.menu->menu_stack,
"", label, type, driver.menu->selection_ptr);
return 0;
}
void menu_entries_cbs_init(void *data,
const char *path, const char *label,
unsigned type, size_t index)
@ -48,4 +64,8 @@ void menu_entries_cbs_init(void *data,
!strcmp(label, "detect_core_list")
)
cbs->action_ok = action_ok_push_content_list;
else if (!strcmp(label, "history_list") ||
menu_common_type_is(label, type) == MENU_FILE_DIRECTORY
)
cbs->action_ok = action_ok_push_history_or_path_list;
}