(GLUI) Playlist tab works now

This commit is contained in:
twinaphex 2015-10-28 21:30:30 +01:00
parent 83441964d3
commit ed1d8583f4
2 changed files with 26 additions and 2 deletions

View File

@ -1156,6 +1156,8 @@ static void glui_list_cache(menu_list_type_t type, unsigned action)
MENU_SETTINGS;
break;
case GLUI_SYSTEM_TAB_PLAYLISTS:
menu_stack->list[stack_size - 1].label =
strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB));
menu_stack->list[stack_size - 1].label =
strdup(menu_hash_to_str(MENU_VALUE_PLAYLISTS_TAB));
menu_stack->list[stack_size - 1].type =

View File

@ -3027,6 +3027,7 @@ int menu_displaylist_push_list(menu_displaylist_info_t *info, unsigned type)
case DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL:
{
bool horizontal = (type == DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL);
if (menu_displaylist_parse_generic(info, horizontal) == 0)
{
info->need_refresh = true;
@ -3074,6 +3075,7 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
uint32_t hash_label = 0;
unsigned type = 0;
menu_displaylist_info_t info = {0};
settings_t *settings = config_get_ptr();
menu_entries_get_last_stack(&path, &label, &type, NULL);
@ -3111,8 +3113,28 @@ int menu_displaylist_push(file_list_t *list, file_list_t *menu_list)
menu_displaylist_push_list_process(&info);
return 0;
case MENU_VALUE_PLAYLISTS_TAB:
if (menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_PLAYLISTS) != 0)
return -1;
info.type = 42;
strlcpy(info.exts, "lpl", sizeof(info.exts));
strlcpy(info.label, menu_hash_to_str(MENU_LABEL_CONTENT_COLLECTION_LIST),
sizeof(info.label));
if (settings->playlist_directory[0] != '\0')
{
strlcpy(info.path, settings->playlist_directory,
sizeof(info.path));
if (menu_displaylist_push_list(&info, DISPLAYLIST_DATABASE_PLAYLISTS_HORIZONTAL) != 0)
return -1;
}
else
{
menu_entries_clear(info.list);
menu_entries_push(info.list,
menu_hash_to_str(MENU_LABEL_VALUE_NO_PLAYLIST_ENTRIES_AVAILABLE),
menu_hash_to_str(MENU_LABEL_NO_PLAYLIST_ENTRIES_AVAILABLE),
MENU_INFO_MESSAGE, 0, 0);
info.need_refresh = true;
info.need_push = true;
}
menu_displaylist_push_list_process(&info);
return 0;
case MENU_VALUE_HORIZONTAL_MENU: