aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-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);