diff options
author | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-02-15 11:51:24 +0100 |
---|---|---|
committer | Jiri Moskovcak <jmoskovc@redhat.com> | 2010-02-15 11:51:24 +0100 |
commit | ff954f994bba93c4664c6ef0bd1bbbe492ffb21a (patch) | |
tree | 52a8c919596d4d5d89f38f5f6261978d7f76ce5b | |
parent | 1e62058198dfc1d299117742c4bddc7441c2f076 (diff) | |
download | abrt-ff954f994bba93c4664c6ef0bd1bbbe492ffb21a.tar.gz abrt-ff954f994bba93c4664c6ef0bd1bbbe492ffb21a.tar.xz abrt-ff954f994bba93c4664c6ef0bd1bbbe492ffb21a.zip |
GUI: enabled column sorting rhbz#541853
-rw-r--r-- | src/Gui/CCMainWindow.py | 38 |
1 files changed, 24 insertions, 14 deletions
diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index c0666f07..dfcfaf15 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -65,12 +65,18 @@ class MainWindow(): #init the dumps treeview self.dlist = self.wTree.get_widget("tvDumps") #rows of items with: - #icon, package_name, application, date, crash_rate, user, is_reported, ?object? - self.dumpsListStore = gtk.ListStore(gtk.gdk.Pixbuf, str,str,str,str,str,bool, object) - # set filter - modelfilter = self.dumpsListStore.filter_new() - modelfilter.set_visible_func(self.filter_dumps, None) - self.dlist.set_model(modelfilter) + ICON_COL = 0 + PACKAGE_COL = 1 + APPLICATION_COL = 2 + TIME_STR_COL = 3 + CRASH_RATE_COL = 4 + USER_COL = 5 + IS_REPORTED_COL = 6 + UNIX_TIME_COL = 7 + DUMP_OBJECT_COL = 8 + #icon, package_name, application, date, crash_rate, user, is_reported, time_in_sec ?object? + self.dumpsListStore = gtk.ListStore(gtk.gdk.Pixbuf, str,str,str,str,str,bool, int, object) + self.dlist.set_model(self.dumpsListStore) # add pixbuff separatelly icon_column = gtk.TreeViewColumn(_("Icon")) icon_column.cell = gtk.CellRendererPixbuf() @@ -79,13 +85,17 @@ class MainWindow(): icon_column.pack_start(icon_column.cell, False) icon_column.set_attributes(icon_column.cell, pixbuf=(n-1), cell_background_set=6) # =============================================== - columns = [None]*4 - columns[0] = gtk.TreeViewColumn(_("Package")) - columns[1] = gtk.TreeViewColumn(_("Application")) - columns[2] = gtk.TreeViewColumn(_("Date")) - columns[3] = gtk.TreeViewColumn(_("Crash count")) - column = gtk.TreeViewColumn(_("User")) - columns.append(column) + columns = [] + columns.append(gtk.TreeViewColumn(_("Package"))) + columns[-1].set_sort_column_id(PACKAGE_COL) + columns.append(gtk.TreeViewColumn(_("Application"))) + columns[-1].set_sort_column_id(APPLICATION_COL) + columns.append(gtk.TreeViewColumn(_("Date"))) + columns[-1].set_sort_column_id(UNIX_TIME_COL) + columns.append(gtk.TreeViewColumn(_("Crash count"))) + columns[-1].set_sort_column_id(CRASH_RATE_COL) + columns.append(gtk.TreeViewColumn(_("User"))) + columns[-1].set_sort_column_id(USER_COL) # create list for column in columns: n = self.dlist.append_column(column) @@ -205,7 +215,7 @@ class MainWindow(): except Exception, ex: user = "UID: %s" % entry.getUID() n = self.dumpsListStore.append([icon, entry.getPackage(), entry.getExecutable(), - entry.getTime("%c"), entry.getCount(), user, entry.isReported(), entry]) + entry.getTime("%c"), entry.getCount(), user, entry.isReported(), entry.getTime(""), entry]) # activate the first row if any.. if n: # we can use (0,) as path for the first row, but what if API changes? |