aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDiego Escalante Urrelo <diegoe@gnome.org>2009-12-15 15:31:52 +0800
committerDiego Escalante Urrelo <diegoe@gnome.org>2009-12-30 04:23:58 +0800
commitfab4ce42cdef5d1046b0f17d77dbca9dc384962d (patch)
treef941e27e7d53dbaadcd4e522f46ec6bb1ceb894f
parent03ad276917dd0ffb1a6098d5d352dee63c89b7f2 (diff)
downloadgsoc2013-epiphany-fab4ce42cdef5d1046b0f17d77dbca9dc384962d.tar
gsoc2013-epiphany-fab4ce42cdef5d1046b0f17d77dbca9dc384962d.tar.gz
gsoc2013-epiphany-fab4ce42cdef5d1046b0f17d77dbca9dc384962d.tar.bz2
gsoc2013-epiphany-fab4ce42cdef5d1046b0f17d77dbca9dc384962d.tar.lz
gsoc2013-epiphany-fab4ce42cdef5d1046b0f17d77dbca9dc384962d.tar.xz
gsoc2013-epiphany-fab4ce42cdef5d1046b0f17d77dbca9dc384962d.tar.zst
gsoc2013-epiphany-fab4ce42cdef5d1046b0f17d77dbca9dc384962d.zip
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
-rw-r--r--embed/downloader-view.c35
1 files changed, 11 insertions, 24 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index b23d0426e..59653c5b0 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