From f94eaa7b913ba0b446c9bb324aceb969c4b43ea2 Mon Sep 17 00:00:00 2001 From: Zach Tibbitts Date: Thu, 1 Mar 2007 22:04:22 +0000 Subject: [PATCH] should properly sort columns --- src/delugegtk.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/delugegtk.py b/src/delugegtk.py index ec572bc3c..9853f0dc9 100644 --- a/src/delugegtk.py +++ b/src/delugegtk.py @@ -327,6 +327,19 @@ class DelugeGTK: self.seed_column.set_sort_column_id(6) self.peer_column.set_sort_column_id(8) + 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(3, long_sort, 3) + self.torrent_model.set_sort_func(12, long_sort, 12) + self.torrent_view.get_selection().set_select_function(self.torrent_clicked, full=True) self.torrent_view.connect("button-press-event", self.torrent_view_clicked)