diff options
author | Diego Escalante Urrelo <descalante@igalia.com> | 2011-10-12 10:53:04 +0800 |
---|---|---|
committer | Diego Escalante Urrelo <descalante@igalia.com> | 2011-12-21 02:22:20 +0800 |
commit | 90dc93ce73d891a7ddfa85f8236143f64d61a3b3 (patch) | |
tree | f094fea0b642701d65ccbc16ecd92430a7499f02 /lib | |
parent | 00c82e603752cd1a8a51b929b44ef62ee26073f1 (diff) | |
download | gsoc2013-epiphany-90dc93ce73d891a7ddfa85f8236143f64d61a3b3.tar gsoc2013-epiphany-90dc93ce73d891a7ddfa85f8236143f64d61a3b3.tar.gz gsoc2013-epiphany-90dc93ce73d891a7ddfa85f8236143f64d61a3b3.tar.bz2 gsoc2013-epiphany-90dc93ce73d891a7ddfa85f8236143f64d61a3b3.tar.lz gsoc2013-epiphany-90dc93ce73d891a7ddfa85f8236143f64d61a3b3.tar.xz gsoc2013-epiphany-90dc93ce73d891a7ddfa85f8236143f64d61a3b3.tar.zst gsoc2013-epiphany-90dc93ce73d891a7ddfa85f8236143f64d61a3b3.zip |
e-download-widget: update icon every 10%
In some cases trying to get the content-type of a download right at the
start of the transfer won't give us useful information.
To handle this case we query for the content-type and a proper icon
every 10%, hoping that GIO/Soup will make a smarter guess. This is an
arbitrary number that hopes to work with most cases.
Bug #662059
Diffstat (limited to 'lib')
-rw-r--r-- | lib/widgets/ephy-download-widget.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/widgets/ephy-download-widget.c b/lib/widgets/ephy-download-widget.c index 940eda3b7..a70e24816 100644 --- a/lib/widgets/ephy-download-widget.c +++ b/lib/widgets/ephy-download-widget.c @@ -45,6 +45,7 @@ struct _EphyDownloadWidgetPrivate GtkWidget *remaining; GtkWidget *button; GtkWidget *menu; + GtkWidget *icon; }; enum @@ -150,6 +151,11 @@ widget_progress_cb (GObject *object, destination = g_filename_display_basename (webkit_download_get_destination_uri (download)); progress = webkit_download_get_progress (download) * 100; + if (progress % 10 == 0) + gtk_image_set_from_gicon (GTK_IMAGE (widget->priv->icon), + get_gicon_from_download (widget->priv->download), + GTK_ICON_SIZE_LARGE_TOOLBAR); + time = get_remaining_time (download); if (time > 0) @@ -462,6 +468,7 @@ ephy_download_widget_new (EphyDownload *ephy_download) g_free (basename); g_free (dest); + widget->priv->icon = icon; widget->priv->button = button; widget->priv->remaining = remain; widget->priv->menu = menu; |