[easytag] Add column for disc number to browser list



commit 138376897831fd20b15e760a3a695889af20907d
Author: Andreas Winkelmann <ml awinkelmann de>
Date:   Mon Dec 24 01:56:20 2012 +0100

    Add column for disc number to browser list

 src/browser.c |  102 +++++++++++++++++++++++++++++++++-----------------------
 src/browser.h |    1 +
 2 files changed, 61 insertions(+), 42 deletions(-)
---
diff --git a/src/browser.c b/src/browser.c
index 1966aba..f0ed91a 100644
--- a/src/browser.c
+++ b/src/browser.c
@@ -1060,6 +1060,7 @@ void Browser_List_Load_File_List (GList *etfilelist, ET_File *etfile_to_select)
                            LIST_FILE_ALBUM_ARTIST,  FileTag->album_artist,
 						   LIST_FILE_ALBUM,         FileTag->album,
                            LIST_FILE_YEAR,          FileTag->year,
+                           LIST_FILE_DISCNO,        FileTag->disc_number,
                            LIST_FILE_TRACK,         track,
                            LIST_FILE_GENRE,         FileTag->genre,
                            LIST_FILE_COMMENT,       FileTag->comment,
@@ -1139,6 +1140,7 @@ void Browser_List_Refresh_Whole_List (void)
                            LIST_FILE_ALBUM_ARTIST,  FileTag->album_artist,
 						   LIST_FILE_ALBUM,         FileTag->album,
                            LIST_FILE_YEAR,          FileTag->year,
+                           LIST_FILE_DISCNO,        FileTag->disc_number,
                            LIST_FILE_TRACK,         track,
                            LIST_FILE_GENRE,         FileTag->genre,
                            LIST_FILE_COMMENT,       FileTag->comment,
@@ -1295,6 +1297,7 @@ void Browser_List_Refresh_File_In_List (ET_File *ETFile)
                        LIST_FILE_ALBUM_ARTIST,  FileTag->album_artist,
 					   LIST_FILE_ALBUM,         FileTag->album,
                        LIST_FILE_YEAR,          FileTag->year,
+                       LIST_FILE_DISCNO,        FileTag->disc_number,
                        LIST_FILE_TRACK,         track,
                        LIST_FILE_GENRE,         FileTag->genre,
                        LIST_FILE_COMMENT,       FileTag->comment,
@@ -3032,7 +3035,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     GtkWidget *PopupMenu;
     gchar *BrowserTree_Titles[] = {N_("Tree")};
     gchar *BrowserList_Titles[] = {N_("File Name"),N_("Title"),N_("Artist"),N_("Album Artist"),N_("Album"),
-                                   N_("Year"),N_("Track"),N_("Genre"),N_("Comment"),
+                                   N_("Year"),N_("Disc"),N_("Track"),N_("Genre"),N_("Comment"),
                                    N_("Composer"),N_("Original Artist"),N_("Copyright"),
                                    N_("URL"),N_("Encoded By")};
     gchar *ArtistList_Titles[]  = {N_("Artist"),N_("# Albums"),N_("# Files")};
@@ -3371,27 +3374,28 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                    GTK_POLICY_AUTOMATIC,GTK_POLICY_AUTOMATIC);
 
     /* The file list */
-    fileListModel = gtk_list_store_new(LIST_COLUMN_COUNT,
-                                       G_TYPE_STRING,
-                                       G_TYPE_POINTER,
-                                       G_TYPE_INT,
-                                       G_TYPE_BOOLEAN,
-                                       G_TYPE_INT,
-                                       GDK_TYPE_COLOR,
-                                       GDK_TYPE_COLOR,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING,
-                                       G_TYPE_STRING);
+    fileListModel = gtk_list_store_new (LIST_COLUMN_COUNT,
+                                        G_TYPE_STRING, /* File name. */
+                                        G_TYPE_POINTER, /* File pointer. */
+                                        G_TYPE_INT, /* File key. */
+                                        G_TYPE_BOOLEAN,	/* File OtherDir. */
+                                        G_TYPE_INT, /* Font weight. */
+                                        GDK_TYPE_COLOR,	/* Row background. */
+                                        GDK_TYPE_COLOR,	/* Row foreground. */
+                                        G_TYPE_STRING, /* Title tag. */
+                                        G_TYPE_STRING, /* Artist tag. */
+                                        G_TYPE_STRING, /* Album artist tag. */
+                                        G_TYPE_STRING, /* Album tag. */
+                                        G_TYPE_STRING, /* Year tag. */
+                                        G_TYPE_STRING, /* Disc/CD number tag. */
+                                        G_TYPE_STRING, /* Track tag. */
+                                        G_TYPE_STRING, /* Genre tag. */
+                                        G_TYPE_STRING, /* Comment tag. */
+                                        G_TYPE_STRING, /* Composer tag. */
+                                        G_TYPE_STRING, /* Orig. artist tag. */
+                                        G_TYPE_STRING, /* Copyright tag. */
+                                        G_TYPE_STRING, /* URL tag. */
+                                        G_TYPE_STRING);	/* Encoded by tag. */
 
     BrowserList = gtk_tree_view_new_with_model(GTK_TREE_MODEL(fileListModel));
     gtk_container_add(GTK_CONTAINER(ScrollWindowFileList), BrowserList);
@@ -3483,26 +3487,40 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
                                         NULL);
     gtk_tree_view_append_column(GTK_TREE_VIEW(BrowserList), column);
 
-    // Column for Track
-    column = gtk_tree_view_column_new();
-    renderer = gtk_cell_renderer_text_new();
-    gtk_tree_view_column_pack_start(column, renderer, FALSE);
-    gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[6]));
-    gtk_tree_view_column_set_attributes(column, renderer,
-                                        "text",           LIST_FILE_TRACK,
-                                        "weight",         LIST_FONT_WEIGHT,
-                                        "background-gdk", LIST_ROW_BACKGROUND,
-                                        "foreground-gdk", LIST_ROW_FOREGROUND,
-                                        NULL);
-    gtk_tree_view_append_column(GTK_TREE_VIEW(BrowserList), column);
+    /* Column for disc/CD number. */
+    column = gtk_tree_view_column_new ();
+    renderer = gtk_cell_renderer_text_new ();
+    gtk_tree_view_column_pack_start (column, renderer, FALSE);
+    gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+    gtk_tree_view_column_set_title (column, _(BrowserList_Titles[6]));
+    gtk_tree_view_column_set_attributes (column, renderer,
+                                         "text", LIST_FILE_DISCNO,
+                                         "weight", LIST_FONT_WEIGHT,
+                                         "background-gdk", LIST_ROW_BACKGROUND,
+                                         "foreground-gdk", LIST_ROW_FOREGROUND,
+                                         NULL);
+    gtk_tree_view_append_column (GTK_TREE_VIEW (BrowserList), column);
+
+    /* Column for track number. */
+    column = gtk_tree_view_column_new ();
+    renderer = gtk_cell_renderer_text_new ();
+    gtk_tree_view_column_pack_start (column, renderer, FALSE);
+    gtk_tree_view_column_set_sizing (column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
+    gtk_tree_view_column_set_title (column, _(BrowserList_Titles[7]));
+    gtk_tree_view_column_set_attributes (column, renderer,
+                                         "text", LIST_FILE_TRACK,
+                                         "weight", LIST_FONT_WEIGHT,
+                                         "background-gdk", LIST_ROW_BACKGROUND,
+                                         "foreground-gdk", LIST_ROW_FOREGROUND,
+                                         NULL);
+    gtk_tree_view_append_column (GTK_TREE_VIEW (BrowserList), column);
 
     // Column for Genre
     column = gtk_tree_view_column_new();
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[7]));
+    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[8]));
     gtk_tree_view_column_set_attributes(column, renderer,
                                         "text",           LIST_FILE_GENRE,
                                         "weight",         LIST_FONT_WEIGHT,
@@ -3516,7 +3534,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[8]));
+    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[9]));
     gtk_tree_view_column_set_attributes(column, renderer,
                                         "text",           LIST_FILE_COMMENT,
                                         "weight",         LIST_FONT_WEIGHT,
@@ -3530,7 +3548,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[9]));
+    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[10]));
     gtk_tree_view_column_set_attributes(column, renderer,
                                         "text",           LIST_FILE_COMPOSER,
                                         "weight",         LIST_FONT_WEIGHT,
@@ -3544,7 +3562,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[10]));
+    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[11]));
     gtk_tree_view_column_set_attributes(column, renderer,
                                         "text",           LIST_FILE_ORIG_ARTIST,
                                         "weight",         LIST_FONT_WEIGHT,
@@ -3558,7 +3576,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[11]));
+    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[12]));
     gtk_tree_view_column_set_attributes(column, renderer,
                                         "text",           LIST_FILE_COPYRIGHT,
                                         "weight",         LIST_FONT_WEIGHT,
@@ -3572,7 +3590,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[12]));
+    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[13]));
     gtk_tree_view_column_set_attributes(column, renderer,
                                         "text",           LIST_FILE_URL,
                                         "weight",         LIST_FONT_WEIGHT,
@@ -3586,7 +3604,7 @@ GtkWidget *Create_Browser_Items (GtkWidget *parent)
     renderer = gtk_cell_renderer_text_new();
     gtk_tree_view_column_pack_start(column, renderer, FALSE);
     gtk_tree_view_column_set_sizing(column, GTK_TREE_VIEW_COLUMN_AUTOSIZE);
-    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[13]));
+    gtk_tree_view_column_set_title(column, _(BrowserList_Titles[14]));
     gtk_tree_view_column_set_attributes(column, renderer,
                                         "text",           LIST_FILE_ENCODED_BY,
                                         "weight",         LIST_FONT_WEIGHT,
diff --git a/src/browser.h b/src/browser.h
index ad1f051..7be49a8 100644
--- a/src/browser.h
+++ b/src/browser.h
@@ -86,6 +86,7 @@ enum
     LIST_FILE_ALBUM_ARTIST,
     LIST_FILE_ALBUM,
     LIST_FILE_YEAR,
+    LIST_FILE_DISCNO,
     LIST_FILE_TRACK,
     LIST_FILE_GENRE,
     LIST_FILE_COMMENT,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]