aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-01-17 23:03:43 +0800
committerxclaesse <xclaesse@4ee84921-47dd-4033-b63a-18d7a039a3e4>2008-01-17 23:03:43 +0800
commit5b281b7b252fef97d286d905da152028d79177b5 (patch)
tree933773f52e49f792d2f57b1f173566eb016fb52c /libempathy-gtk
parentf2b3513923e47f9f8c8b9f15267270e5e98bf1d1 (diff)
downloadgsoc2013-empathy-5b281b7b252fef97d286d905da152028d79177b5.tar
gsoc2013-empathy-5b281b7b252fef97d286d905da152028d79177b5.tar.gz
gsoc2013-empathy-5b281b7b252fef97d286d905da152028d79177b5.tar.bz2
gsoc2013-empathy-5b281b7b252fef97d286d905da152028d79177b5.tar.lz
gsoc2013-empathy-5b281b7b252fef97d286d905da152028d79177b5.tar.xz
gsoc2013-empathy-5b281b7b252fef97d286d905da152028d79177b5.tar.zst
gsoc2013-empathy-5b281b7b252fef97d286d905da152028d79177b5.zip
Show/Hide main window when chaning corresponding gcong key.
git-svn-id: svn+ssh://svn.gnome.org/svn/empathy/trunk@573 4ee84921-47dd-4033-b63a-18d7a039a3e4
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-status-icon.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/libempathy-gtk/empathy-status-icon.c b/libempathy-gtk/empathy-status-icon.c
index e760305b1..24132e655 100644
--- a/libempathy-gtk/empathy-status-icon.c
+++ b/libempathy-gtk/empathy-status-icon.c
@@ -154,6 +154,19 @@ status_icon_notify_use_nm_cb (EmpathyConf *conf,
}
static void
+status_icon_notify_visibility_cb (EmpathyConf *conf,
+ const gchar *key,
+ gpointer user_data)
+{
+ EmpathyStatusIcon *icon = user_data;
+ gboolean hidden = FALSE;
+
+ if (empathy_conf_get_bool (conf, key, &hidden)) {
+ status_icon_set_visibility (icon, !hidden, FALSE);
+ }
+}
+
+static void
empathy_status_icon_class_init (EmpathyStatusIconClass *klass)
{
GObjectClass *object_class = G_OBJECT_CLASS (klass);
@@ -193,6 +206,11 @@ empathy_status_icon_init (EmpathyStatusIcon *icon)
empathy_idle_set_auto_away (priv->idle, TRUE);
empathy_idle_set_use_nm (priv->idle, use_nm);
+ /* make icon listen and respond to MAIN_WINDOW_HIDDEN changes */
+ empathy_conf_notify_add (empathy_conf_get (),
+ EMPATHY_PREFS_UI_MAIN_WINDOW_HIDDEN,
+ status_icon_notify_visibility_cb,
+ icon);
status_icon_create_menu (icon);
status_icon_idle_notify_cb (icon);