gui: Use track filepath as tooltip

Signed-off-by: Anna Schumaker <schumaker.anna@gmail.com>
This commit is contained in:
Anna Schumaker 2014-01-29 22:23:07 -05:00 committed by Anna Schumaker
parent d240ff44bc
commit 30c0d97d56
2 changed files with 10 additions and 3 deletions

View File

@ -68,7 +68,7 @@ Gtk::TreeModelFlags PlayqueueModel::get_flags_vfunc() const
int PlayqueueModel::get_n_columns_vfunc() const
{
return 9;
return 10;
}
GType PlayqueueModel::get_column_type_vfunc(int index) const
@ -84,6 +84,7 @@ GType PlayqueueModel::get_column_type_vfunc(int index) const
case 4:
case 6:
case 8:
case 9:
return G_TYPE_STRING;
default:
return 0;
@ -114,6 +115,7 @@ void PlayqueueModel::get_value_uint(struct library::Song &song, int column,
void PlayqueueModel::get_value_str(struct library::Song &song, int column,
Glib::ValueBase &value) const
{
std::stringstream ss;
Glib::Value<std::string> specific;
specific.init(Glib::Value<std::string>::value_type());
@ -134,7 +136,6 @@ void PlayqueueModel::get_value_str(struct library::Song &song, int column,
specific.set(song.genre->primary_key);
break;
case 8:
std::stringstream ss;
if (song.track->play_count == 0)
specific.set("Never");
else {
@ -143,6 +144,9 @@ void PlayqueueModel::get_value_str(struct library::Song &song, int column,
ss << song.track->last_year;
specific.set(ss.str());
}
break;
case 9:
specific.set(song.track->primary_key);
}
value.init(Glib::Value<std::string>::value_type());

View File

@ -20,7 +20,8 @@ public:
QueueColumns()
{ add(q_col_track); add(q_col_title); add(q_col_length);
add(q_col_artist); add(q_col_album); add(q_col_year);
add(q_col_genre); add(q_col_count); add(q_col_played); }
add(q_col_genre); add(q_col_count); add(q_col_played);
add(q_col_path); }
Gtk::TreeModelColumn<unsigned int> q_col_track;
Gtk::TreeModelColumn<std::string> q_col_title;
@ -31,6 +32,7 @@ public:
Gtk::TreeModelColumn<std::string> q_col_genre;
Gtk::TreeModelColumn<unsigned int> q_col_count;
Gtk::TreeModelColumn<std::string> q_col_played;
Gtk::TreeModelColumn<std::string> q_col_path;
} queue_cols;
static unsigned int q_col_width[] = { 20, 300, 60, 100, 100, 45, 100, 60, 1 };
static sort_t q_col_sorts[] = {
@ -169,6 +171,7 @@ OcarinaPage::OcarinaPage(const std::string &name, const std::string &icon,
page_view.append_column("Genre", queue_cols.q_col_genre);
page_view.append_column("Count", queue_cols.q_col_count);
page_view.append_column("Played", queue_cols.q_col_played);
page_view.set_tooltip_column(9);
page_view.signal_row_activated().connect(sigc::mem_fun(*this,
&OcarinaPage::on_row_activated));