diff options
author | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-12-05 22:15:24 +0800 |
---|---|---|
committer | Guillaume Desmottes <guillaume.desmottes@collabora.co.uk> | 2011-12-06 16:30:33 +0800 |
commit | 84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0 (patch) | |
tree | 22ed9274ffed430ce9719292483e90ac738cc1f6 /libempathy-gtk | |
parent | b6c4b1de387c53ad115b6422e2009596a5cb6dd0 (diff) | |
download | gsoc2013-empathy-84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0.tar gsoc2013-empathy-84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0.tar.gz gsoc2013-empathy-84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0.tar.bz2 gsoc2013-empathy-84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0.tar.lz gsoc2013-empathy-84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0.tar.xz gsoc2013-empathy-84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0.tar.zst gsoc2013-empathy-84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0.zip |
log-window: update buttons if contact's caps are updated
https://bugzilla.gnome.org/show_bug.cgi?id=665592
Diffstat (limited to 'libempathy-gtk')
-rw-r--r-- | libempathy-gtk/empathy-log-window.c | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/libempathy-gtk/empathy-log-window.c b/libempathy-gtk/empathy-log-window.c index 65b39f472..51a47c7a3 100644 --- a/libempathy-gtk/empathy-log-window.c +++ b/libempathy-gtk/empathy-log-window.c @@ -2113,6 +2113,14 @@ do_update_buttons_sensitivity (EmpathyLogWindow *self) } static void +contact_capabilities_changed_cb (EmpathyContact *contact, + GParamSpec *spec, + EmpathyLogWindow *self) +{ + do_update_buttons_sensitivity (self); +} + +static void log_window_update_buttons_sensitivity (EmpathyLogWindow *self) { GtkTreeView *view; @@ -2124,7 +2132,13 @@ log_window_update_buttons_sensitivity (EmpathyLogWindow *self) GList *paths; GtkTreePath *path; - tp_clear_object (&self->priv->selected_contact); + if (self->priv->selected_contact != NULL) + { + g_signal_handlers_disconnect_by_func (self->priv->selected_contact, + contact_capabilities_changed_cb, self); + + tp_clear_object (&self->priv->selected_contact); + } view = GTK_TREE_VIEW (self->priv->treeview_who); model = gtk_tree_view_get_model (view); @@ -2168,6 +2182,13 @@ log_window_update_buttons_sensitivity (EmpathyLogWindow *self) self->priv->selected_contact = g_object_ref (self->priv->events_contact); out: + if (self->priv->selected_contact != NULL) + { + tp_g_signal_connect_object (self->priv->selected_contact, + "notify::capabilities", G_CALLBACK (contact_capabilities_changed_cb), + self, 0); + } + do_update_buttons_sensitivity (self); } |