aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk/empathy-status-icon.c
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@gmail.com>2007-12-06 22:31:58 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2007-12-06 22:31:58 +0800
commite0de4a5f2a254beef02021573c57543dfd33311f (patch)
treee515549717771ce1d566a004aec1df6669264207 /libempathy-gtk/empathy-status-icon.c
parent17b31a900a57de69d2a222683dea403b2d8a3346 (diff)
downloadgsoc2013-empathy-e0de4a5f2a254beef02021573c57543dfd33311f.tar
gsoc2013-empathy-e0de4a5f2a254beef02021573c57543dfd33311f.tar.gz
gsoc2013-empathy-e0de4a5f2a254beef02021573c57543dfd33311f.tar.bz2
gsoc2013-empathy-e0de4a5f2a254beef02021573c57543dfd33311f.tar.lz
gsoc2013-empathy-e0de4a5f2a254beef02021573c57543dfd33311f.tar.xz
gsoc2013-empathy-e0de4a5f2a254beef02021573c57543dfd33311f.tar.zst
gsoc2013-empathy-e0de4a5f2a254beef02021573c57543dfd33311f.zip
Add a preference option to disable/enable NM support.
2007-12-06 Xavier Claessens <xclaesse@gmail.com> * data/empathy.schemas.in: * libempathy-gtk/empathy-preferences.c: * libempathy-gtk/empathy-preferences.glade: * libempathy-gtk/empathy-preferences.h: * libempathy-gtk/empathy-status-icon.c: * libempathy/empathy-idle.c: * libempathy/empathy-idle.h: Add a preference option to disable/enable NM support. svn path=/trunk/; revision=468
Diffstat (limited to 'libempathy-gtk/empathy-status-icon.c')
-rw-r--r--libempathy-gtk/empathy-status-icon.c30
1 files changed, 27 insertions, 3 deletions
diff --git a/libempathy-gtk/empathy-status-icon.c b/libempathy-gtk/empathy-status-icon.c
index 4421ddc85..cca41d5dd 100644
--- a/libempathy-gtk/empathy-status-icon.c
+++ b/libempathy-gtk/empathy-status-icon.c
@@ -140,6 +140,19 @@ static void status_icon_event_free (StatusIconEvent *event
G_DEFINE_TYPE (EmpathyStatusIcon, empathy_status_icon, G_TYPE_OBJECT);
static void
+status_icon_notify_use_nm_cb (EmpathyConf *conf,
+ const gchar *key,
+ gpointer user_data)
+{
+ EmpathyStatusIconPriv *priv = GET_PRIV (user_data);
+ gboolean use_nm;
+
+ if (empathy_conf_get_bool (conf, key, &use_nm)) {
+ empathy_idle_set_use_nm (priv->idle, use_nm);
+ }
+}
+
+static void
empathy_status_icon_class_init (EmpathyStatusIconClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -154,13 +167,11 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
{
EmpathyStatusIconPriv *priv;
GList *pendings, *l;
+ gboolean use_nm;
priv = GET_PRIV (icon);
priv->icon = gtk_status_icon_new ();
- priv->idle = empathy_idle_new ();
- empathy_idle_set_auto_away (priv->idle, TRUE);
- empathy_idle_set_auto_disconnect (priv->idle, TRUE);
priv->manager = empathy_contact_manager_new ();
priv->mc = empathy_mission_control_new ();
priv->text_filter = empathy_filter_new ("org.gnome.Empathy.ChatFilter",
@@ -169,6 +180,19 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
MC_FILTER_PRIORITY_DIALOG,
MC_FILTER_FLAG_INCOMING);
+ /* Setup EmpathyIdle */
+ priv->idle = empathy_idle_new ();
+ empathy_conf_get_bool (empathy_conf_get (),
+ EMPATHY_PREFS_USE_NM,
+ &use_nm);
+ empathy_conf_notify_add (empathy_conf_get (),
+ EMPATHY_PREFS_USE_NM,
+ status_icon_notify_use_nm_cb,
+ icon);
+ empathy_idle_set_auto_away (priv->idle, TRUE);
+ empathy_idle_set_use_nm (priv->idle, use_nm);
+
+
status_icon_create_menu (icon);
status_icon_idle_notify_cb (icon);