mirror of
https://git.deluge-torrent.org/deluge
synced 2025-08-03 15:08:40 +00:00
generate correct time remaining in treeview
This commit is contained in:
parent
b9e9599a45
commit
f537c9badf
1 changed files with 7 additions and 5 deletions
|
@ -326,9 +326,11 @@ class DelugeGTK:
|
||||||
|
|
||||||
def time(column, cell, model, iter, data):
|
def time(column, cell, model, iter, data):
|
||||||
time = int(model.get_value(iter, data))
|
time = int(model.get_value(iter, data))
|
||||||
if time <= 0:
|
if time < 0:
|
||||||
cell.set_property('text', '-')
|
time_str = _("Infinity")
|
||||||
return
|
elif time == 0:
|
||||||
|
time_str = "-"
|
||||||
|
else:
|
||||||
time_str = dcommon.ftime(time)
|
time_str = dcommon.ftime(time)
|
||||||
cell.set_property('text', time_str)
|
cell.set_property('text', time_str)
|
||||||
|
|
||||||
|
@ -597,7 +599,7 @@ class DelugeGTK:
|
||||||
dlrate = int(state['download_rate'])
|
dlrate = int(state['download_rate'])
|
||||||
ulrate = int(state['upload_rate'])
|
ulrate = int(state['upload_rate'])
|
||||||
try:
|
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:
|
except ZeroDivisionError:
|
||||||
eta = -1
|
eta = -1
|
||||||
share = float(self.calc_share_ratio(unique_id, state))
|
share = float(self.calc_share_ratio(unique_id, state))
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue