evolution r36801 - branches/gnome-2-24/plugins/mail-notification



Author: sragavan
Date: Wed Nov 19 05:55:06 2008
New Revision: 36801
URL: http://svn.gnome.org/viewvc/evolution?rev=36801&view=rev

Log:
2008-11-19  Srinivasa Ragavan  <sragavan novell com>

	** Fix for BNC bug #434320

	* plugins/mail-notification/mail-notification.c: When the popup is
	clicked close the status icon.




Modified:
   branches/gnome-2-24/plugins/mail-notification/ChangeLog
   branches/gnome-2-24/plugins/mail-notification/mail-notification.c

Modified: branches/gnome-2-24/plugins/mail-notification/mail-notification.c
==============================================================================
--- branches/gnome-2-24/plugins/mail-notification/mail-notification.c	(original)
+++ branches/gnome-2-24/plugins/mail-notification/mail-notification.c	Wed Nov 19 05:55:06 2008
@@ -56,6 +56,7 @@
 
 static gboolean enabled = FALSE;
 static GtkWidget *get_cfg_widget (void);
+static GStaticMutex mlock = G_STATIC_MUTEX_INIT;
 
 /**
  * each part should "implement" its own "public" functions:
@@ -441,6 +442,24 @@
 	g_object_unref (menu);
 }
 
+static void 
+notifyActionCallback (NotifyNotification *n, gchar *label, gpointer a)
+{
+	g_static_mutex_lock (&mlock);
+	
+	gtk_status_icon_set_visible (status_icon, FALSE);
+	g_object_unref (status_icon);
+
+	if (blink_timeout_id) {
+		g_source_remove (blink_timeout_id);
+		blink_timeout_id = 0;
+	}
+
+	status_icon = NULL;
+	status_count = 0;	
+	g_static_mutex_unlock (&mlock);
+}
+
 static void
 new_notify_status (EMEventTargetFolder *t)
 {
@@ -487,6 +506,7 @@
 
 			notify_notification_set_urgency (notify, NOTIFY_URGENCY_NORMAL);
 			notify_notification_set_timeout (notify, NOTIFY_EXPIRES_DEFAULT);
+			notify_notification_add_action(notify, "default", "Default", notifyActionCallback, NULL, NULL);
 			g_timeout_add (500, notification_callback, notify);
 		}
 	}
@@ -835,7 +855,6 @@
 int e_plugin_lib_enable (EPluginLib *ep, int enable);
 GtkWidget *e_plugin_lib_get_configure_widget (EPlugin *epl);
 
-static GStaticMutex mlock = G_STATIC_MUTEX_INIT;
 
 void
 org_gnome_mail_new_notify (EPlugin *ep, EMEventTargetFolder *t)



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