aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-09-28 14:37:26 +0800
committerGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2012-10-03 18:05:43 +0800
commit257011e356f9f293e5df5032159b9e79cf70d9d6 (patch)
tree6e3314e372fdb8870ae802c786a7be6369eaf07f
parent22eab320c9669b7c6307bf202ca661e12ff8de57 (diff)
downloadgsoc2013-empathy-257011e356f9f293e5df5032159b9e79cf70d9d6.tar
gsoc2013-empathy-257011e356f9f293e5df5032159b9e79cf70d9d6.tar.gz
gsoc2013-empathy-257011e356f9f293e5df5032159b9e79cf70d9d6.tar.bz2
gsoc2013-empathy-257011e356f9f293e5df5032159b9e79cf70d9d6.tar.lz
gsoc2013-empathy-257011e356f9f293e5df5032159b9e79cf70d9d6.tar.xz
gsoc2013-empathy-257011e356f9f293e5df5032159b9e79cf70d9d6.tar.zst
gsoc2013-empathy-257011e356f9f293e5df5032159b9e79cf70d9d6.zip
chat-window: expose the individual mgr as a property
-rw-r--r--src/empathy-chat-window.c39
-rw-r--r--src/empathy-chat-window.h3
2 files changed, 42 insertions, 0 deletions
diff --git a/src/empathy-chat-window.c b/src/empathy-chat-window.c
index 296fc6775..c72b01ede 100644
--- a/src/empathy-chat-window.c
+++ b/src/empathy-chat-window.c
@@ -67,6 +67,11 @@
|| (t1 >= t2 && (t1 - t2) > (G_MAXUINT32/2)) \
)
+enum
+{
+ PROP_INDIVIDUAL_MGR = 1
+};
+
struct _EmpathyChatWindowPriv
{
EmpathyChat *current_chat;
@@ -1955,6 +1960,8 @@ chat_window_focus_out_event_cb (GtkWidget *widget,
G_CALLBACK (contacts_loaded_cb), self, 0);
}
+ g_object_notify (G_OBJECT (self), "individual-manager");
+
return FALSE;
}
@@ -2299,12 +2306,38 @@ chat_window_finalize (GObject *object)
}
static void
+chat_window_get_property (GObject *object,
+ guint property_id,
+ GValue *value,
+ GParamSpec *pspec)
+{
+ EmpathyChatWindow *self = EMPATHY_CHAT_WINDOW (object);
+
+ switch (property_id)
+ {
+ case PROP_INDIVIDUAL_MGR:
+ g_value_set_object (value, self->priv->individual_mgr);
+ default:
+ G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
+ break;
+ }
+}
+
+static void
empathy_chat_window_class_init (EmpathyChatWindowClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
+ GParamSpec *spec;
+ object_class->get_property = chat_window_get_property;
object_class->finalize = chat_window_finalize;
+ spec = g_param_spec_object ("individual-manager", "individual-manager",
+ "EmpathyIndividualManager",
+ EMPATHY_TYPE_INDIVIDUAL_MANAGER,
+ G_PARAM_READABLE | G_PARAM_STATIC_STRINGS);
+ g_object_class_install_property (object_class, PROP_INDIVIDUAL_MGR, spec);
+
g_type_class_add_private (object_class, sizeof (EmpathyChatWindowPriv));
}
@@ -2793,3 +2826,9 @@ empathy_chat_window_get_nb_chats (EmpathyChatWindow *self,
if (nb_private != NULL)
*nb_private = _nb_private;
}
+
+EmpathyIndividualManager *
+empathy_chat_window_get_individual_manager (EmpathyChatWindow *self)
+{
+ return self->priv->individual_mgr;
+}
diff --git a/src/empathy-chat-window.h b/src/empathy-chat-window.h
index 2be55cdf8..054469dfa 100644
--- a/src/empathy-chat-window.h
+++ b/src/empathy-chat-window.h
@@ -82,6 +82,9 @@ EmpathyChat * empathy_chat_window_find_chat (TpAccount *account,
EmpathyChatWindow * empathy_chat_window_present_chat (EmpathyChat *chat,
gint64 timestamp);
+EmpathyIndividualManager * empathy_chat_window_get_individual_manager (
+ EmpathyChatWindow *self);
+
G_END_DECLS
#endif