[epiphany] Don't omit notifications for downloads



commit fab4ce42cdef5d1046b0f17d77dbca9dc384962d
Author: Diego Escalante Urrelo <diegoe gnome org>
Date:   Tue Dec 15 02:31:52 2009 -0500

    Don't omit notifications for downloads
    
    If a download is finished while the GtkStatusIcon for DownloadView is not
    embedded the finished notification for such download is missed and user is
    left wondering what happened with his/her download.
    This makes notifications show whether there is or not a GtkStatusIcon to
    attach to.
    
    Bug #604599

 embed/downloader-view.c |   35 +++++++++++------------------------
 1 files changed, 11 insertions(+), 24 deletions(-)
---
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index b23d042..59653c5 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -75,7 +75,6 @@ struct _DownloaderViewPrivate
 #endif
 
 	guint source_id;
-	guint notification_timeout;
 };
 
 enum
@@ -199,7 +198,7 @@ remove_download (WebKitDownload *download,
 	WebKitDownloadStatus status;
 
 	g_signal_handlers_disconnect_matched
-		(download, G_SIGNAL_MATCH_DATA ,
+		(download, G_SIGNAL_MATCH_DATA,
 		 0, 0, NULL, NULL, view);
 
 	status = webkit_download_get_status (download);
@@ -272,11 +271,6 @@ downloader_view_finalize (GObject *object)
 		priv->source_id = 0;
 	}
 	
-	if (priv->notification_timeout != 0)
-	{
-		g_source_remove (priv->notification_timeout);
-	}
-
 	g_hash_table_destroy (dv->priv->downloads_hash);
 
 	G_OBJECT_CLASS (downloader_view_parent_class)->finalize (object);
@@ -622,30 +616,23 @@ update_buttons_timeout_cb (DownloaderView *dv)
 }
 
 #ifdef HAVE_LIBNOTIFY
-static gboolean
-queue_show_notification (DownloaderView *dv)
-{
-	if (gtk_status_icon_is_embedded (dv->priv->status_icon))
-	{
-		notify_notification_show (dv->priv->notification, NULL);
-		dv->priv->notification_timeout = 0;
-		return FALSE;
-	}
-
-	return TRUE;
-}
-
 static void
 show_notification_window (DownloaderView *dv)
 {
 	if (gtk_status_icon_is_embedded (dv->priv->status_icon))
-		notify_notification_show (dv->priv->notification, NULL);
+	{
+		notify_notification_attach_to_status_icon
+						(dv->priv->notification,
+						 dv->priv->status_icon);
+	}
 	else
 	{
-		if (dv->priv->notification_timeout != 0)
-			g_source_remove (dv->priv->notification_timeout);
-		dv->priv->notification_timeout = g_timeout_add_seconds (1, (GSourceFunc) queue_show_notification, dv);
+		notify_notification_attach_to_status_icon
+						(dv->priv->notification,
+						 NULL);
 	}
+
+	notify_notification_show (dv->priv->notification, NULL);
 }
 #endif
 



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