Finally XMB starts becoming a bit more useful - hook up database

support to Horizontal Menu
This commit is contained in:
twinaphex 2015-01-25 08:40:05 +01:00
parent 4fc37d4f25
commit e54d1f615d
2 changed files with 28 additions and 2 deletions

View File

@ -155,6 +155,24 @@ int menu_entries_push_horizontal_menu_list(menu_handle_t *menu,
MENU_FILE_CONTENTLIST_ENTRY,
0);
if (info->databases_list)
{
size_t i;
char db_path[PATH_MAX_LENGTH];
for (i = 0; i < info->databases_list->size; i++)
{
struct string_list *strlist = info->databases_list;
fill_pathname_join(db_path, g_settings.content_database, strlist->elems[i].data, sizeof(db_path));
strlcat(db_path, ".rdb", sizeof(db_path));
if (path_file_exists(db_path))
menu_list_push(list, path_basename(db_path), "core_database",
MENU_FILE_RDB, 0);
}
}
menu_list_populate_generic(menu, list, path, label, menu_type);
return 0;

View File

@ -2642,7 +2642,8 @@ static int menu_entries_cbs_init_bind_ok_first(menu_file_list_cbs_t *cbs,
case MENU_FILE_RDB:
if (!strcmp(menu_label, "deferred_database_manager_list"))
cbs->action_ok = action_ok_database_manager_list_deferred;
else if (!strcmp(menu_label, "database_manager_list"))
else if (!strcmp(menu_label, "database_manager_list")
|| !strcmp(menu_label, "Horizontal Menu"))
cbs->action_ok = action_ok_database_manager_list;
else
return -1;
@ -2834,11 +2835,15 @@ static void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs,
const char *path, const char *label, unsigned type, size_t idx)
{
int i;
const char *menu_label = NULL;
rarch_setting_t *setting = menu_action_find_setting(label);
if (!cbs)
return;
menu_list_get_last_stack(driver.menu->menu_list,
NULL, &menu_label, NULL);
cbs->action_toggle = menu_action_setting_set;
switch (type)
@ -2861,6 +2866,9 @@ static void menu_entries_cbs_init_bind_toggle(menu_file_list_cbs_t *cbs,
case MENU_FILE_USE_DIRECTORY:
case MENU_FILE_PLAYLIST_ENTRY:
case MENU_FILE_DOWNLOAD_CORE:
if (!strcmp(menu_label, "Horizontal Menu"))
cbs->action_toggle = action_toggle_mainmenu;
else
cbs->action_toggle = action_toggle_scroll;
break;
case MENU_SETTING_ACTION: