ocarina: Add a tooltip column to the liststore

The tooltip is the filepath of the selected track.  This should help me
figure out what some non-tagged tracks are...

Signed-off-by: Bryan Schumaker <bjschuma@gmail.com>
This commit is contained in:
Bryan Schumaker 2012-02-05 17:50:09 -05:00
parent f72447decc
commit a3c8128bbe
2 changed files with 10 additions and 7 deletions

View File

@ -30,6 +30,7 @@ void SongList::insert(libsaria::Track *track)
4, track->get_artist().c_str(),
5, track->get_album().c_str(),
6, track->get_year(),
7, track->get_filepath().c_str(),
-1);
ins_next++;
}

View File

@ -21,13 +21,14 @@ struct column_info {
};
static struct column_info columns[] = {
column_info( "Id", G_TYPE_LONG, 2, false),
column_info( "#", G_TYPE_INT, 20, true),
column_info( "Title", G_TYPE_STRING, 300, true),
column_info("Length", G_TYPE_STRING, 60, true),
column_info("Artist", G_TYPE_STRING, 125, true),
column_info( "Album", G_TYPE_STRING, 125, true),
column_info( "Year", G_TYPE_INT, 50, true),
column_info( "Id", G_TYPE_LONG, 2, false),
column_info( "#", G_TYPE_INT, 20, true),
column_info( "Title", G_TYPE_STRING, 300, true),
column_info( "Length", G_TYPE_STRING, 60, true),
column_info( "Artist", G_TYPE_STRING, 125, true),
column_info( "Album", G_TYPE_STRING, 125, true),
column_info( "Year", G_TYPE_INT, 50, true),
column_info("Filepath", G_TYPE_STRING, 2, false),
};
#define NUM_COLUMNS (sizeof(columns) / sizeof(column_info))
@ -73,6 +74,7 @@ static GtkWidget *setup_treeview(GtkTreeModel *model, SongList *list)
GTK_CONNECT(treeview, "button-release-event", songlist_button_click, list);
gtk_tree_view_set_rules_hint(GTK_TREE_VIEW(treeview), TRUE);
gtk_tree_view_set_model(GTK_TREE_VIEW(treeview), model);
gtk_tree_view_set_tooltip_column(GTK_TREE_VIEW(treeview), 7);
return treeview;
}