From f537c9badf76e7a8f03770b0e94e5db05cd2c44e Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Tue, 6 Mar 2007 20:38:02 +0000 Subject: [PATCH] generate correct time remaining in treeview --- src/delugegtk.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/src/delugegtk.py b/src/delugegtk.py index 19fd92cb7..139c02e3a 100644 --- a/src/delugegtk.py +++ b/src/delugegtk.py @@ -326,10 +326,12 @@ class DelugeGTK: def time(column, cell, model, iter, data): time = int(model.get_value(iter, data)) - if time <= 0: - cell.set_property('text', '-') - return - time_str = dcommon.ftime(time) + if time < 0: + time_str = _("Infinity") + elif time == 0: + time_str = "-" + else: + time_str = dcommon.ftime(time) cell.set_property('text', time_str) @@ -597,7 +599,7 @@ class DelugeGTK: dlrate = int(state['download_rate']) ulrate = int(state['upload_rate']) try: - eta = dcommon.get_eta(state["total_size"], state["total_download"], state["download_rate"]) + eta = dcommon.get_eta(state["total_size"], state["total_done"], state["download_rate"]) except ZeroDivisionError: eta = -1 share = float(self.calc_share_ratio(unique_id, state))