3 const int NUM_COLS
= 20;
4 const int[] col_ids
= {
5 Gmpc
.MpdData
.ColumnTypes
.MARKUP
,
6 Gmpc
.MpdData
.ColumnTypes
.SONG_ARTIST
, /* album name */
7 Gmpc
.MpdData
.ColumnTypes
.SONG_ALBUM
, /* album name */
8 Gmpc
.MpdData
.ColumnTypes
.SONG_TITLE
, /* song title */
9 Gmpc
.MpdData
.ColumnTypes
.SONG_TITLEFILE
, /* song title */
10 Gmpc
.MpdData
.ColumnTypes
.SONG_GENRE
, /* song genre */
11 Gmpc
.MpdData
.ColumnTypes
.SONG_TRACK
, /* song track */
12 Gmpc
.MpdData
.ColumnTypes
.SONG_NAME
, /* stream name */
13 Gmpc
.MpdData
.ColumnTypes
.SONG_COMPOSER
, /* composer name */
14 Gmpc
.MpdData
.ColumnTypes
.SONG_PERFORMER
, /* performer */
15 Gmpc
.MpdData
.ColumnTypes
.SONG_DATE
, /* date */
16 Gmpc
.MpdData
.ColumnTypes
.SONG_LENGTH_FORMAT
, /* length formatted */
17 Gmpc
.MpdData
.ColumnTypes
.SONG_DISC
, /* disc */
18 Gmpc
.MpdData
.ColumnTypes
.SONG_COMMENT
, /* comment */
19 Gmpc
.MpdData
.ColumnTypes
.ICON_ID
, /* icon id */
20 Gmpc
.MpdData
.ColumnTypes
.SONG_POS
,
21 Gmpc
.MpdData
.ColumnTypes
.SONG_ALBUMARTIST
,
22 Gmpc
.MpdData
.ColumnTypes
.PATH_EXTENSION
, /* Extension */
23 Gmpc
.MpdData
.ColumnTypes
.PATH_DIRECTORY
, /* Directory */
24 Gmpc
.MpdData
.ColumnTypes
.SONG_PRIORITY
,
26 const string[] col_names
= {
49 const bool[] col_enabled
= {
73 const int[] col_position
= {
96 public class Gmpc
.DataView
: Gtk
.TreeView
99 * If we are a play-queue we should treat the content.
100 * slightly different.
101 * e.g. add-replace will be play-crop
103 public bool is_play_queue
{get; set; default=false;}
106 * The name of the treeview.
107 * This is used to store the column layout.
109 public string uid
{get; set; default="default";}
113 * Construction function.
117 // Connect row activated signal.
118 this
.row_activated
.connect(__row_activated
);
123 * Populate the treeview with the right columns.
124 * The treeview should have a name now.
126 public void populate()
128 for(int i
= 0; i
< NUM_COLS
; i
++) {
129 Gtk
.TreeViewColumn col
= new Gtk
.TreeViewColumn();
130 col
.set_title(col_names
[i
]);
132 this
.insert_column(col
, col_position
[i
]);
139 * Internal functions.
141 private void __row_activated(Gtk
.TreePath path
, Gtk
.TreeViewColumn col
)