From bfcc9d3ada868953bf1b428c94350b2abf6cf0e0 Mon Sep 17 00:00:00 2001
From: Tydus <Tydus@Tydus.org>
Date: Tue, 19 Feb 2013 09:30:17 +0800
Subject: [PATCH] Add total_wanted_done to core and both uis
---
deluge/core/torrent.py | 1 +
deluge/ui/console/modes/alltorrents.py | 2 ++
deluge/ui/console/modes/column.py | 1 +
deluge/ui/console/modes/torrentdetail.py | 2 +-
deluge/ui/gtkui/torrentview.py | 3 +++
5 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/deluge/core/torrent.py b/deluge/core/torrent.py
index 6336d7a..bfa09ca 100644
a
|
b
|
def _create_status_funcs(self):
|
750 | 750 | "total_seeds": lambda: self.status.num_complete, |
751 | 751 | "total_uploaded": lambda: self.status.all_time_upload, |
752 | 752 | "total_wanted": lambda: self.status.total_wanted, |
| 753 | "total_wanted_done": lambda: self.status.total_wanted_done, |
753 | 754 | "tracker": lambda: self.status.current_tracker, |
754 | 755 | "trackers": lambda: self.trackers, |
755 | 756 | "tracker_status": lambda: self.tracker_status, |
diff --git a/deluge/ui/console/modes/alltorrents.py b/deluge/ui/console/modes/alltorrents.py
index 3dcb30c..6a2e775 100644
a
|
b
|
class FILTER:
|
234 | 234 | |
235 | 235 | column_names_to_state_keys = { |
236 | 236 | "size": "total_wanted", |
| 237 | "done": "total_wanted_done", |
237 | 238 | "downspeed": "download_payload_rate", |
238 | 239 | "upspeed": "upload_payload_rate", |
239 | 240 | "seeders": "num_seeds", |
… |
… |
class FILTER:
|
250 | 251 | |
251 | 252 | reverse_sort_fields = [ |
252 | 253 | "total_wanted", |
| 254 | "total_wanted_done", |
253 | 255 | "download_payload_rate", |
254 | 256 | "upload_payload_rate", |
255 | 257 | "num_seeds", |
diff --git a/deluge/ui/console/modes/column.py b/deluge/ui/console/modes/column.py
index 26d10f6..962ae95 100644
a
|
b
|
def format_queue(qnum):
|
51 | 51 | "#":(("queue",),format_queue), |
52 | 52 | "Name":(("name",),None), |
53 | 53 | "Size":(("total_wanted",),deluge.common.fsize), |
| 54 | "Done":(("total_wanted_done",),deluge.common.fsize), |
54 | 55 | "State":(("state",),None), |
55 | 56 | "Progress":(("progress",),format_utils.format_progress), |
56 | 57 | "Seeders":(("num_seeds","total_seeds"),format_utils.format_seeds_peers), |
diff --git a/deluge/ui/console/modes/torrentdetail.py b/deluge/ui/console/modes/torrentdetail.py
index 4252c4e..a19064d 100644
a
|
b
|
def __init__(self, alltorrentmode, torrentid, stdscr, console_config, encoding=N
|
108 | 108 | "num_seeds","total_seeds","num_peers","total_peers", "active_time", |
109 | 109 | "seeding_time","time_added","distributed_copies", "num_pieces", |
110 | 110 | "piece_length","save_path","file_progress","file_priorities","message", |
111 | | "total_wanted", "tracker_host", "owner"] |
| 111 | "total_wanted", "total_wanted_done", "tracker_host", "owner"] |
112 | 112 | |
113 | 113 | self.file_list = None |
114 | 114 | self.current_file = None |
diff --git a/deluge/ui/gtkui/torrentview.py b/deluge/ui/gtkui/torrentview.py
index cdfbcc8..af1f780 100644
a
|
b
|
def __init__(self):
|
365 | 365 | self.add_func_column(_("Size"), listview.cell_data_size, |
366 | 366 | [gobject.TYPE_UINT64], |
367 | 367 | status_field=["total_wanted"]) |
| 368 | self.add_func_column(_("Done"), listview.cell_data_size, |
| 369 | [gobject.TYPE_UINT64], |
| 370 | status_field=["total_wanted_done"]) |
368 | 371 | self.add_func_column(_("Downloaded"), listview.cell_data_size, |
369 | 372 | [gobject.TYPE_UINT64], |
370 | 373 | status_field=["all_time_download"], default=False) |