[network-manager-applet] applet: print message when embedded or removed from the notification area



commit 3bd7214f01138a359c93c940652fd1e3762c4a59
Author: Dan Williams <dcbw redhat com>
Date:   Sat Aug 7 21:57:49 2010 -0500

    applet: print message when embedded or removed from the notification area

 src/applet.c |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/applet.c b/src/applet.c
index d7ab47f..f936a35 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -2974,6 +2974,15 @@ exit_cb (GObject *ignored, gpointer user_data)
 	g_main_loop_quit (applet->loop);
 }
 
+static void
+applet_embedded_cb (GObject *object, GParamSpec *pspec, gpointer user_data)
+{
+	gboolean embedded = gtk_status_icon_is_embedded (GTK_STATUS_ICON (object));
+
+	g_message ("applet now %s the notification area",
+	           embedded ? "embedded in" : "removed from");
+}
+
 static GObject *
 constructor (GType type,
              guint n_props,
@@ -3058,6 +3067,13 @@ constructor (GType type,
 
 	nm_gconf_set_pre_keyring_callback (applet_pre_keyring_callback, applet);
 
+	/* Track embedding to help debug issues where user has removed the
+	 * notification area applet from the panel, and thus nm-applet too.
+	 */
+	g_signal_connect (applet->status_icon, "notify::embedded",
+	                  G_CALLBACK (applet_embedded_cb), NULL);
+	applet_embedded_cb (G_OBJECT (applet->status_icon), NULL, NULL);
+
 	return G_OBJECT (applet);
 
 error:



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]