summaryrefslogtreecommitdiffstats
path: root/src/gui/Ephraim.vala
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/Ephraim.vala')
-rw-r--r--src/gui/Ephraim.vala24
1 files changed, 24 insertions, 0 deletions
diff --git a/src/gui/Ephraim.vala b/src/gui/Ephraim.vala
index 0b50ff4..998439d 100644
--- a/src/gui/Ephraim.vala
+++ b/src/gui/Ephraim.vala
@@ -24,6 +24,30 @@ public class Ephraim {
unowned Gtk.TreeView rosterView = builder.get_object("Roster") as Gtk.TreeView;
rosterView.set_model(roster);
+ rosterView.query_tooltip.connect((x, y, keyboard_tip, tooltip) => {
+ Gtk.TreeIter iter;
+
+ if(!rosterView.get_tooltip_context(out x, out y, keyboard_tip, null, null, out iter))
+ return false;
+
+ Value value;
+ roster.get_value(iter, 0, out value);
+
+ Contact? c = value.get_object() as Contact;
+ if(c == null)
+ return false;
+
+ Gee.Map.Entry<string, Contact.Resource>? r = c.get_resource_with_highest_priority();
+
+ if(r == null)
+ return false;
+
+ tooltip.set_text("Resource: " + r.key);
+
+ return true;
+ });
+ rosterView.has_tooltip = true;
+
rosterView.append_column(new Gtk.TreeViewColumn.with_attributes("Contact", new CellRendererContact(), "contact", 0, null));
window.visible = true;