Lines 210-215
Link Here
|
210 |
return queue_peer_seed_sort_function(v2, v4) |
210 |
return queue_peer_seed_sort_function(v2, v4) |
211 |
return queue_peer_seed_sort_function(v1, v3) |
211 |
return queue_peer_seed_sort_function(v1, v3) |
212 |
|
212 |
|
|
|
213 |
def progress_sort(model, iter1, iter2, sort_column_id): |
214 |
progress1 = model[iter1][sort_column_id] |
215 |
progress2 = model[iter2][sort_column_id] |
216 |
# Progress value is equal, so sort on state |
217 |
if progress1 == progress2: |
218 |
state1 = model[iter1][sort_column_id + 1] |
219 |
state2 = model[iter2][sort_column_id + 1] |
220 |
return cmp(state1, state2) |
221 |
return cmp(progress1, progress2) |
222 |
|
223 |
|
213 |
class TorrentView(listview.ListView, component.Component): |
224 |
class TorrentView(listview.ListView, component.Component): |
214 |
"""TorrentView handles the listing of torrents.""" |
225 |
"""TorrentView handles the listing of torrents.""" |
215 |
def __init__(self): |
226 |
def __init__(self): |
Lines 256-262
Link Here
|
256 |
self.add_progress_column(_("Progress"), |
267 |
self.add_progress_column(_("Progress"), |
257 |
status_field=["progress", "state"], |
268 |
status_field=["progress", "state"], |
258 |
col_types=[float, str], |
269 |
col_types=[float, str], |
259 |
function=cell_data_progress) |
270 |
function=cell_data_progress, |
|
|
271 |
sort_func=progress_sort) |
260 |
self.add_func_column(_("Seeders"), listview.cell_data_peer, [int, int], |
272 |
self.add_func_column(_("Seeders"), listview.cell_data_peer, [int, int], |
261 |
status_field=["num_seeds", "total_seeds"], |
273 |
status_field=["num_seeds", "total_seeds"], |
262 |
sort_func=seed_peer_column_sort, default=False) |
274 |
sort_func=seed_peer_column_sort, default=False) |
Lines 265-273
Link Here
|
265 |
sort_func=seed_peer_column_sort, default=False) |
277 |
sort_func=seed_peer_column_sort, default=False) |
266 |
self.add_func_column(_("Seeders") + "/" + _("Peers"), listview.cell_data_ratio, [float], |
278 |
self.add_func_column(_("Seeders") + "/" + _("Peers"), listview.cell_data_ratio, [float], |
267 |
status_field=["seeds_peers_ratio"], default=False) |
279 |
status_field=["seeds_peers_ratio"], default=False) |
268 |
self.add_func_column(_("Down Speed"), listview.cell_data_speed, [float], |
280 |
self.add_func_column(_("Down Speed"), listview.cell_data_speed, [int], |
269 |
status_field=["download_payload_rate"]) |
281 |
status_field=["download_payload_rate"]) |
270 |
self.add_func_column(_("Up Speed"), listview.cell_data_speed, [float], |
282 |
self.add_func_column(_("Up Speed"), listview.cell_data_speed, [int], |
271 |
status_field=["upload_payload_rate"]) |
283 |
status_field=["upload_payload_rate"]) |
272 |
self.add_func_column(_("Down Limit"), listview.cell_data_speed_limit, [float], |
284 |
self.add_func_column(_("Down Limit"), listview.cell_data_speed_limit, [float], |
273 |
status_field=["max_download_speed"], default=False) |
285 |
status_field=["max_download_speed"], default=False) |
Lines 279-285
Link Here
|
279 |
status_field=["ratio"], default=False) |
291 |
status_field=["ratio"], default=False) |
280 |
self.add_func_column(_("Avail"), listview.cell_data_ratio, [float], |
292 |
self.add_func_column(_("Avail"), listview.cell_data_ratio, [float], |
281 |
status_field=["distributed_copies"], default=False) |
293 |
status_field=["distributed_copies"], default=False) |
282 |
self.add_func_column(_("Added"), listview.cell_data_date, [float], |
294 |
self.add_func_column(_("Added"), listview.cell_data_date, [int], |
283 |
status_field=["time_added"], default=False) |
295 |
status_field=["time_added"], default=False) |
284 |
self.add_texticon_column(_("Tracker"), |
296 |
self.add_texticon_column(_("Tracker"), |
285 |
status_field=["tracker_host", "tracker_host"], |
297 |
status_field=["tracker_host", "tracker_host"], |