aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorXan Lopez <xan@src.gnome.org>2003-11-25 06:46:16 +0800
committerXan Lopez <xan@src.gnome.org>2003-11-25 06:46:16 +0800
commitfca3f31775577d322af2fad9a687b91e177fb8ea (patch)
treeef693245360f266a1be57a86a0105f97358e8667
parent7200cd97ba96357d050ba7015e54a16d421b63d0 (diff)
downloadgsoc2013-epiphany-fca3f31775577d322af2fad9a687b91e177fb8ea.tar
gsoc2013-epiphany-fca3f31775577d322af2fad9a687b91e177fb8ea.tar.gz
gsoc2013-epiphany-fca3f31775577d322af2fad9a687b91e177fb8ea.tar.bz2
gsoc2013-epiphany-fca3f31775577d322af2fad9a687b91e177fb8ea.tar.lz
gsoc2013-epiphany-fca3f31775577d322af2fad9a687b91e177fb8ea.tar.xz
gsoc2013-epiphany-fca3f31775577d322af2fad9a687b91e177fb8ea.tar.zst
gsoc2013-epiphany-fca3f31775577d322af2fad9a687b91e177fb8ea.zip
Use gnome_vfs_format_file_size_for_display to display size, put Unknown
* embed/downloader-view.c: (download_changed_cb): Use gnome_vfs_format_file_size_for_display to display size, put Unknown when size/remaining time are unknown instead of weird numbers.
-rw-r--r--ChangeLog8
-rw-r--r--embed/downloader-view.c22
2 files changed, 21 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index 905de61bb..91fefcaaf 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2003-11-24 Xan Lopez <xan@masilla.org>
+
+ * embed/downloader-view.c: (download_changed_cb):
+
+ Use gnome_vfs_format_file_size_for_display to display size, put
+ Unknown when size/remaining time are unknown instead of weird
+ numbers.
+
2003-11-24 Christian Persch <chpe@cvs.gnome.org>
* embed/ephy-permission-manager.h:
diff --git a/embed/downloader-view.c b/embed/downloader-view.c
index 019466311..049583670 100644
--- a/embed/downloader-view.c
+++ b/embed/downloader-view.c
@@ -30,6 +30,7 @@
#include "ephy-cell-renderer-progress.h"
#include "ephy-stock-icons.h"
+#include <libgnomevfs/gnome-vfs-utils.h>
#include <eggstatusicon.h>
#include <eggtraymanager.h>
#include <gtk/gtktreeview.h>
@@ -269,21 +270,24 @@ download_changed_cb (EphyDownload *download, DownloaderView *dv)
break;
}
- total = ephy_download_get_total_progress (download)/1024;
- if (total <= 1024)
+ total = ephy_download_get_total_progress (download);
+ if (total == -1)
{
- size = g_strdup_printf ("%ld kB", total);
- }
- else if (total <= 1024*1024)
- {
- size = g_strdup_printf ("%ld MB", total/1024);
+ size = g_strdup (_("Unknown"));
}
else
{
- size = g_strdup_printf ("%ld GB", total/(1024*1024));
+ size = gnome_vfs_format_file_size_for_display (total);
}
- remaining = format_interval (remaining_secs);
+ if (remaining_secs < 0)
+ {
+ remaining = g_strdup (_("Unknown"));
+ }
+ else
+ {
+ remaining = format_interval (remaining_secs);
+ }
path = gtk_tree_row_reference_get_path (row_ref);
gtk_tree_model_get_iter (dv->priv->model, &iter, path);