diff options
author | Phillip Wood <phillip.wood@dunelm.org.uk> | 2012-06-29 10:08:15 +0100 |
---|---|---|
committer | Christophe Fergeau <cfergeau@redhat.com> | 2013-04-10 15:26:24 +0200 |
commit | 082b030ccc643a717ab17d23a6cd66bbeee43b1f (patch) | |
tree | 25b38c091ab27daa6a03732d437ca350fba1bfb6 | |
parent | 66ebceaf6a54e488d490c0864a2995e4a6d76e5c (diff) |
Display label, year & country.
With just the album title and artist, it is sometimes impossible to
tell the difference between all the releases listed. Adding the
recording label, year and country will help to distinguish between
different versions of the same album.
https://bugzilla.gnome.org/show_bug.cgi?id=674926
-rw-r--r-- | src/sj-main.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/sj-main.c b/src/sj-main.c index 68b479b..ce7992c 100644 --- a/src/sj-main.c +++ b/src/sj-main.c @@ -983,6 +983,7 @@ AlbumDetails* multiple_album_dialog(GList *albums) { COLUMN_TITLE, COLUMN_ARTIST, + COLUMN_YEAR, COLUMN_DETAILS, COLUMN_COUNT }; @@ -992,6 +993,7 @@ AlbumDetails* multiple_album_dialog(GList *albums) GtkCellArea *cell_area = gtk_cell_area_box_new (); GtkCellRenderer *title_renderer = gtk_cell_renderer_text_new (); GtkCellRenderer *artist_renderer = gtk_cell_renderer_text_new (); + GtkCellRenderer *year_renderer = gtk_cell_renderer_text_new (); dialog = GET_WIDGET ("multiple_dialog"); g_assert (dialog != NULL); @@ -1006,6 +1008,7 @@ AlbumDetails* multiple_album_dialog(GList *albums) gtk_tree_view_column_set_title (column, _("Albums")); gtk_tree_view_column_pack_start (column, title_renderer, TRUE); gtk_tree_view_column_pack_start (column, artist_renderer, TRUE); + gtk_tree_view_column_pack_start (column, year_renderer, TRUE); g_object_set(title_renderer, "weight", PANGO_WEIGHT_BOLD, "weight-set", TRUE, NULL); g_object_set(artist_renderer, "style", PANGO_STYLE_ITALIC, "style-set", @@ -1014,12 +1017,15 @@ AlbumDetails* multiple_album_dialog(GList *albums) COLUMN_TITLE); gtk_tree_view_column_add_attribute (column, artist_renderer, "text", COLUMN_ARTIST); + gtk_tree_view_column_add_attribute (column, year_renderer, "text", + COLUMN_YEAR); g_signal_connect (albums_listview, "row-activated", G_CALLBACK (album_row_activated), dialog); albums_store = gtk_list_store_new (COLUMN_COUNT, G_TYPE_STRING, - G_TYPE_STRING, G_TYPE_POINTER); + G_TYPE_STRING, G_TYPE_STRING, + G_TYPE_POINTER); gtk_tree_view_append_column (GTK_TREE_VIEW (albums_listview), column); gtk_tree_view_set_model (GTK_TREE_VIEW (albums_listview), @@ -1036,6 +1042,7 @@ AlbumDetails* multiple_album_dialog(GList *albums) GtkTreeIter iter; AlbumDetails *album = (AlbumDetails*)(albums->data); GString *album_title = g_string_new (album->title); + gchar *release_details = format_release_details (album); if (album->disc_number > 0 && album->disc_count > 0) g_string_append_printf (album_title,_(" (Disc %d/%d)"), @@ -1045,11 +1052,15 @@ AlbumDetails* multiple_album_dialog(GList *albums) gtk_list_store_set (albums_store, &iter, COLUMN_TITLE, album_title->str, COLUMN_ARTIST, album->artist, + COLUMN_YEAR, release_details, COLUMN_DETAILS, album, -1); + g_string_free (album_title, TRUE); + g_free (release_details); } + /* Select the first album */ if (gtk_tree_model_get_iter_first (GTK_TREE_MODEL (albums_store), &iter)) { |