dstar wrote:
Would it work to modify _display_data to operate on a copy of its data argument that's had inactive torrents removed? If so, you could bind a key to a method that toggles a variable, and check that at the beginning of _display_data to determine whether or not to display inactive torrents.
I'm not at all familiar with python, so I'm not sure if that would work or not. It looks like it might, but I could be wrong.
Worked like a charm. I renamed the data argument to data_arg, and added this at the beginning of _display_data (and some other code elsewhere to toggle show_inactive when I hit the spacebar):
Code:
if self.show_inactive:
data = data_arg
else:
data = [x for x in data_arg if (x[3] > 0 or x[4] > 0) and (x[9] > 100 or x[8] > 100)]
data.sort(lambda a,b: cmp(a[1],b[1]) or cmp(a[13],b[13]) or cmp(b[2],a[2]) or cmp(b[9],a[9]) or cmp(b[8],a[8]) or cmp(b[4],a[4]) \
or cmp(b[3],a[3]))
I'm checking both that it has a peer, and that it's sending or receiving at least 100 bytes/s. I added the second check because I had several torrents that had clients connecting and disconnecting without actually downloading anything, causing the display to flicker.
Would you be interested in a patch to add this?