[empathy] log-window: update buttons if contact's caps are updated
- From: Guillaume Desmottes <gdesmott src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [empathy] log-window: update buttons if contact's caps are updated
- Date: Tue, 6 Dec 2011 08:30:53 +0000 (UTC)
commit 84fe2ef8b8e152d6a47f42fdd818e84a6e0d48b0
Author: Guillaume Desmottes <guillaume desmottes collabora co uk>
Date: Mon Dec 5 15:15:24 2011 +0100
log-window: update buttons if contact's caps are updated
https://bugzilla.gnome.org/show_bug.cgi?id=665592
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 65b39f4..51a47c7 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);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]