network-manager-applet r747 - in trunk: . src



Author: dcbw
Date: Fri Jun  6 20:10:37 2008
New Revision: 747
URL: http://svn.gnome.org/viewvc/network-manager-applet?rev=747&view=rev

Log:
2008-06-06  Dan Williams  <dcbw redhat com>

	Patch from Colin Walters <walters verbum org>

	* src/applet.c
		- (status_icon_activate_cb, status_icon_popup_menu_cb): clear any
			notification when the user clicks on the applet icon



Modified:
   trunk/ChangeLog
   trunk/src/applet.c

Modified: trunk/src/applet.c
==============================================================================
--- trunk/src/applet.c	(original)
+++ trunk/src/applet.c	Fri Jun  6 20:10:37 2008
@@ -394,6 +394,17 @@
 	                               applet);
 }
 
+static void
+applet_clear_notify (NMApplet *applet)
+{
+	if (applet->notification == NULL)
+		return;
+
+	notify_notification_close (applet->notification, NULL);
+	g_object_unref (applet->notification);
+	applet->notification = NULL;
+}
+
 void
 applet_do_notify (NMApplet *applet,
                   NotifyUrgency urgency,
@@ -417,10 +428,7 @@
 		return;
 #endif
 
-	if (applet->notification != NULL) {
-		notify_notification_close (applet->notification, NULL);
-		g_object_unref (applet->notification);
-	}
+	applet_clear_notify (applet);
 
 	notify = notify_notification_new (summary, message,
 	                                  icon ? icon : GTK_STOCK_NETWORK, NULL);
@@ -2107,6 +2115,11 @@
 static void
 status_icon_activate_cb (GtkStatusIcon *icon, NMApplet *applet)
 {
+	/* Have clicking on the applet act also as acknowledgement
+	 * of the notification. 
+	 */
+	applet_clear_notify (applet);
+
 	nma_menu_clear (applet);
 	gtk_menu_popup (GTK_MENU (applet->menu), NULL, NULL,
 			gtk_status_icon_position_menu, icon,
@@ -2119,6 +2132,11 @@
                            guint32 activate_time,
                            NMApplet *applet)
 {
+	/* Have clicking on the applet act also as acknowledgement
+	 * of the notification. 
+	 */
+	applet_clear_notify (applet);
+
 	nma_context_menu_update (applet);
 	gtk_menu_popup (GTK_MENU (applet->context_menu), NULL, NULL,
 			gtk_status_icon_position_menu, icon,



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