diff options
author | Jonny Lamb <jonny.lamb@collabora.co.uk> | 2010-09-30 23:01:20 +0800 |
---|---|---|
committer | Emilio Pozuelo Monfort <emilio.pozuelo@collabora.co.uk> | 2010-11-16 00:59:11 +0800 |
commit | 6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab (patch) | |
tree | 95dfca4b432c31c83e16c73ab22a887d9d869f1d /libempathy-gtk/empathy-individual-view.c | |
parent | 33d6d9dfbdeac6050a63912a9944b54e5c50d95f (diff) | |
download | gsoc2013-empathy-6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab.tar gsoc2013-empathy-6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab.tar.gz gsoc2013-empathy-6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab.tar.bz2 gsoc2013-empathy-6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab.tar.lz gsoc2013-empathy-6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab.tar.xz gsoc2013-empathy-6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab.tar.zst gsoc2013-empathy-6f9a0ae2e8dc6d71bc15bdc703cffec8851367ab.zip |
contact: enable showing a phone next to contacts who are on phones
The future!
Signed-off-by: Jonny Lamb <jonny.lamb@collabora.co.uk>
Diffstat (limited to 'libempathy-gtk/empathy-individual-view.c')
-rw-r--r-- | libempathy-gtk/empathy-individual-view.c | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-individual-view.c b/libempathy-gtk/empathy-individual-view.c index 6eb301d34..94e60a41c 100644 --- a/libempathy-gtk/empathy-individual-view.c +++ b/libempathy-gtk/empathy-individual-view.c @@ -1192,6 +1192,36 @@ individual_view_avatar_cell_data_func (GtkTreeViewColumn *tree_column, } static void +individual_view_phone_cell_data_func (GtkTreeViewColumn *tree_column, + GtkCellRenderer *cell, + GtkTreeModel *model, + GtkTreeIter *iter, + EmpathyIndividualView *view) +{ + gboolean is_group; + gboolean is_active; + gchar **types; + + gtk_tree_model_get (model, iter, + EMPATHY_INDIVIDUAL_STORE_COL_IS_GROUP, &is_group, + EMPATHY_INDIVIDUAL_STORE_COL_IS_ACTIVE, &is_active, + EMPATHY_INDIVIDUAL_STORE_COL_CLIENT_TYPES, &types, + -1); + + g_object_set (cell, + "visible", + !is_group + && types != NULL + && g_strv_length (types) > 0 + && !tp_strdiff (types[0], "phone"), + NULL); + + g_strfreev (types); + + individual_view_cell_set_background (view, cell, is_group, is_active); +} + +static void individual_view_text_cell_data_func (GtkTreeViewColumn *tree_column, GtkCellRenderer *cell, GtkTreeModel *model, @@ -1833,6 +1863,15 @@ individual_view_constructed (GObject *object) gtk_tree_view_column_add_attribute (col, cell, "compact", EMPATHY_INDIVIDUAL_STORE_COL_COMPACT); + /* Phone Icon */ + cell = gtk_cell_renderer_pixbuf_new (); + gtk_tree_view_column_pack_start (col, cell, FALSE); + gtk_tree_view_column_set_cell_data_func (col, cell, + (GtkTreeCellDataFunc) individual_view_phone_cell_data_func, + view, NULL); + + g_object_set (cell, "visible", FALSE, "icon-name", "phone", NULL); + /* Audio Call Icon */ cell = empathy_cell_renderer_activatable_new (); gtk_tree_view_column_pack_start (col, cell, FALSE); |