mirror of
https://github.com/codex-storage/deluge.git
synced 2025-02-10 02:25:53 +00:00
clean up torrent list creation - plisk
This commit is contained in:
parent
37a502ad40
commit
c5e2b67800
@ -414,8 +414,11 @@ class DelugeGTK:
|
|||||||
"queue_top": self.q_to_top,
|
"queue_top": self.q_to_top,
|
||||||
})
|
})
|
||||||
self.torrent_menu.connect("focus", self.torrent_menu_focus)
|
self.torrent_menu.connect("focus", self.torrent_menu_focus)
|
||||||
# UID, Q#, Status Icon, Name, Size, Progress, Message, Seeders, Peers, DL, UL, ETA, Share
|
# UID, Q#, Status Icon, Name, Size, Progress, Message, Seeders, Peers,
|
||||||
self.torrent_model = gtk.ListStore(int, int, gtk.gdk.Pixbuf, str, str, float, str, int, int, int, int, int, int, str, float)
|
# DL, UL, ETA, Share
|
||||||
|
self.torrent_model = gtk.ListStore(int, gobject.TYPE_UINT,
|
||||||
|
gtk.gdk.Pixbuf, str, gobject.TYPE_UINT64, float, str, int, int,
|
||||||
|
int, int, int, int, gobject.TYPE_UINT, float)
|
||||||
self.torrent_view.set_model(self.torrent_model)
|
self.torrent_view.set_model(self.torrent_model)
|
||||||
self.torrent_view.set_rules_hint(True)
|
self.torrent_view.set_rules_hint(True)
|
||||||
self.torrent_view.set_reorderable(True)
|
self.torrent_view.set_reorderable(True)
|
||||||
@ -473,20 +476,6 @@ class DelugeGTK:
|
|||||||
self.seed_column.set_sort_column_id(TORRENT_VIEW_COL_CONNECTED_SEEDS)
|
self.seed_column.set_sort_column_id(TORRENT_VIEW_COL_CONNECTED_SEEDS)
|
||||||
self.peer_column.set_sort_column_id(TORRENT_VIEW_COL_CONNECTED_PEERS)
|
self.peer_column.set_sort_column_id(TORRENT_VIEW_COL_CONNECTED_PEERS)
|
||||||
|
|
||||||
def long_sort(model, iter1, iter2, data):
|
|
||||||
value1 = long(model.get_value(iter1, data))
|
|
||||||
value2 = long(model.get_value(iter2, data))
|
|
||||||
if value1 < value2:
|
|
||||||
return -1
|
|
||||||
elif value1 > value2:
|
|
||||||
return 1
|
|
||||||
else:
|
|
||||||
return 0
|
|
||||||
|
|
||||||
self.torrent_model.set_sort_func(TORRENT_VIEW_COL_QUEUE, long_sort, TORRENT_VIEW_COL_QUEUE)
|
|
||||||
self.torrent_model.set_sort_func(TORRENT_VIEW_COL_SIZE, long_sort, TORRENT_VIEW_COL_SIZE)
|
|
||||||
self.torrent_model.set_sort_func(TORRENT_VIEW_COL_ETA, long_sort, TORRENT_VIEW_COL_ETA)
|
|
||||||
|
|
||||||
self.torrent_model.set_sort_column_id(TORRENT_VIEW_COL_QUEUE, gtk.SORT_ASCENDING)
|
self.torrent_model.set_sort_column_id(TORRENT_VIEW_COL_QUEUE, gtk.SORT_ASCENDING)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user