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



commit 56702ef32b56ae741aff61ebade40f2ec9d198d7
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 6cb4e8c..c362758 100644
--- a/src/applet.c
+++ b/src/applet.c
@@ -2978,6 +2978,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,
@@ -3062,6 +3071,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]