aboutsummaryrefslogtreecommitdiffstats
path: root/embed/downloader-view.c
diff options
context:
space:
mode:
authorPiers Cornwell <piers@myrealbox.com>2004-01-21 22:03:19 +0800
committerChristian Persch <chpe@src.gnome.org>2004-01-21 22:03:19 +0800
commitfce5cd9176a15b7f42aa1707c2e2c25537d8fb1e (patch)
tree37ef339a9572073749126c848c7e6cab813edb24 /embed/downloader-view.c
parent319eec55f2c4d7a946af8a9312e9395bc9ebc611 (diff)
downloadgsoc2013-epiphany-fce5cd9176a15b7f42aa1707c2e2c25537d8fb1e.tar
gsoc2013-epiphany-fce5cd9176a15b7f42aa1707c2e2c25537d8fb1e.tar.gz
gsoc2013-epiphany-fce5cd9176a15b7f42aa1707c2e2c25537d8fb1e.tar.bz2
gsoc2013-epiphany-fce5cd9176a15b7f42aa1707c2e2c25537d8fb1e.tar.lz
gsoc2013-epiphany-fce5cd9176a15b7f42aa1707c2e2c25537d8fb1e.tar.xz
gsoc2013-epiphany-fce5cd9176a15b7f42aa1707c2e2c25537d8fb1e.tar.zst
gsoc2013-epiphany-fce5cd9176a15b7f42aa1707c2e2c25537d8fb1e.zip
Use ngettext for number of downloads and remaining minutes display in the
2004-01-21 Piers Cornwell <piers@myrealbox.com> * embed/downloader-view.c: (update_status_icon), (downloader_view_remove_download): Use ngettext for number of downloads and remaining minutes display in the tooltip of the tray icon.
Diffstat (limited to 'embed/downloader-view.c')
-rw-r--r--embed/downloader-view.c37
1 files changed, 30 insertions, 7 deletions
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 12aadde7b..b0c21fe1f 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -336,24 +336,45 @@ seconds_remaining_total (EphyDownload *download, gpointer data, DownloaderView *
static void
update_status_icon (DownloaderView *dv)
{
- char *tooltip, *remaining;
- int downloads;
+ char *tooltip, *downloadstring, *remainingstring;
+ int downloads, remaining;
dv->priv->remaining_secs = 0;
g_hash_table_foreach (dv->priv->downloads_hash,
(GHFunc) seconds_remaining_total, dv);
- remaining = format_interval (dv->priv->remaining_secs);
+ remaining = (dv->priv->remaining_secs);
+
+ if (remaining < 60)
+ {
+ remainingstring = g_strdup_printf (ngettext ("About %d second left",
+ "About %d seconds left", remaining),
+ remaining);
+ }
+ else
+ {
+ remaining /= 60;
+
+ remainingstring = g_strdup_printf (ngettext ("About %d minute left",
+ "About %d minutes left", remaining),
+ remaining);
+ }
+
downloads = g_hash_table_size (dv->priv->downloads_hash);
- tooltip = g_strdup_printf ("%d downloads, with a total of "
- "%s minutes remaining",
- downloads, remaining);
+
+ downloadstring = g_strdup_printf (ngettext ("%d download",
+ "%d downloads", downloads),
+ downloads);
+
+ tooltip = g_strdup_printf ("%s\n%s",
+ downloadstring, remainingstring);
egg_status_icon_set_tooltip (dv->priv->status_icon,
tooltip, NULL);
g_free (tooltip);
- g_free (remaining);
+ g_free (downloadstring);
+ g_free (remainingstring);
}
static void
@@ -569,6 +590,8 @@ downloader_view_remove_download (DownloaderView *dv, EphyDownload *download)
gtk_tree_row_reference_free (row_ref);
}
+ update_status_icon (dv);
+
/* Close the dialog if there are no more downloads */
if (!g_hash_table_size (dv->priv->downloads_hash))