gui/playlist: Change headers to "Playlists" and "Dynamic"

One word labels are always better.  I move the "Favorites" and "Hidden"
playlists under the "Playlists" header because they're manually
configured by the user.

Signed-off-by: Anna Schumaker <Anna@NoWheyCreamery.com>
This commit is contained in:
Anna Schumaker 2016-08-22 12:06:03 -04:00
parent ef8a764780
commit afbf9e0b1a
2 changed files with 19 additions and 18 deletions

View File

@ -350,19 +350,19 @@ void gui_playlist_init()
__playlist_set(&parent, "History", "document-open-recent", PL_SYSTEM);
__playlist_set_size(&parent, "History");
/* Add "User Playlists" header. */
/* Add "Playlists" header and playlists. */
gtk_tree_store_insert(p_store, &parent, NULL, -1);
gtk_tree_store_insert(p_store, &parent, NULL, -1);
__playlist_set(&parent, "<big>User Playlists</big>", "emblem-documents", 0);
__playlist_set(&parent, "<big>Playlists</big>", "emblem-documents", 0);
__playlist_add(&parent, "Favorites", "emblem-favorite", PL_SYSTEM);
__playlist_add(&parent, "Hidden", "window-close", PL_SYSTEM);
/* Add "System Playlists" header. */
/* Add "Dynamic" header. */
gtk_tree_store_insert(p_store, &parent, NULL, -1);
gtk_tree_store_insert(p_store, &parent, NULL, -1);
__playlist_set(&parent, "<big>System Playlists</big>", "emblem-system", 0);
__playlist_set(&parent, "<big>Dynamic</big>", "emblem-system", 0);
/* Add playlists. */
__playlist_add(&parent, "Favorites", "emblem-favorite", PL_SYSTEM);
__playlist_add(&parent, "Hidden", "window-close", PL_SYSTEM);
__playlist_add(&parent, "Most Played", "go-up", PL_SYSTEM);
__playlist_add(&parent, "Least Played", "go-down", PL_SYSTEM);
__playlist_add(&parent, "Unplayed", "audio-x-generic", PL_SYSTEM);
@ -448,7 +448,7 @@ void gui_playlist_add_user(struct playlist *playlist)
gtk_tree_model_get_iter_first(GTK_TREE_MODEL(p_store), &parent);
do {
name = __playlist_name(&parent);
match = string_match(name, "User Playlists");
match = string_match(name, "Playlists");
g_free(name);
if (match)
@ -463,6 +463,7 @@ void gui_playlist_add_user(struct playlist *playlist)
do {
name = __playlist_name(&sibling);
match = g_utf8_collate(name, playlist->pl_name) >= 0;
match = match && !(__playlist_type(&sibling) == PL_SYSTEM);
g_free(name);
if (match) {

View File

@ -67,6 +67,16 @@ static void test_playlist_sidebar()
gtk_tree_path_down(path);
gtk_tree_selection_select_path(selection, path);
g_assert_cmpuint(gtk_tree_selection_count_selected_rows(selection), ==, 1);
g_assert_cmpstr(gui_playlist_cur(), ==, "Favorites");
gtk_tree_path_next(path);
gtk_tree_selection_select_path(selection, path);
g_assert_cmpuint(gtk_tree_selection_count_selected_rows(selection), ==, 1);
g_assert_cmpstr(gui_playlist_cur(), ==, "Hidden");
gtk_tree_path_next(path);
gtk_tree_selection_select_path(selection, path);
g_assert_cmpuint(gtk_tree_selection_count_selected_rows(selection), ==, 1);
g_assert_cmpstr(gui_playlist_cur(), ==, "Test");
gtk_tree_path_up(path);
@ -79,18 +89,8 @@ static void test_playlist_sidebar()
gtk_tree_selection_select_path(selection, path);
g_assert_cmpuint(gtk_tree_selection_count_selected_rows(selection), ==, 0);
gtk_tree_path_down(path);
gtk_tree_selection_select_path(selection, path);
g_assert_cmpuint(gtk_tree_selection_count_selected_rows(selection), ==, 1);
g_assert_cmpstr(gui_playlist_cur(), ==, "Favorites");
gtk_tree_path_next(path);
gtk_tree_selection_select_path(selection, path);
g_assert_cmpuint(gtk_tree_selection_count_selected_rows(selection), ==, 1);
g_assert_cmpstr(gui_playlist_cur(), ==, "Hidden");
/* Most played and least played are both filtered out */
gtk_tree_path_next(path);
gtk_tree_path_down(path);
gtk_tree_selection_select_path(selection, path);
g_assert_cmpuint(gtk_tree_selection_count_selected_rows(selection), ==, 1);
g_assert_cmpstr(gui_playlist_cur(), ==, "Unplayed");