From c7969056a65a74bfa4d7979880ee02a8e89356eb Mon Sep 17 00:00:00 2001 From: Jiri Moskovcak Date: Wed, 23 Jun 2010 14:19:22 +0200 Subject: GUI: add a hostname column --- src/Gui/CCDump.py | 9 +++++++-- src/Gui/CCMainWindow.py | 12 ++++++++---- 2 files changed, 15 insertions(+), 6 deletions(-) (limited to 'src/Gui') diff --git a/src/Gui/CCDump.py b/src/Gui/CCDump.py index 23535bf9..d8a15f9a 100644 --- a/src/Gui/CCDump.py +++ b/src/Gui/CCDump.py @@ -136,12 +136,17 @@ class Dump(): def get_backtrace(self): try: return self.backtrace - except KeyError: + except AttributeError: return None def get_rating(self): try: return self.rating - except KeyError: + except AttributeError: return None + def get_hostname(self): + try: + return self.hostname + except AttributeError: + return None diff --git a/src/Gui/CCMainWindow.py b/src/Gui/CCMainWindow.py index 2bc5db7b..44227149 100644 --- a/src/Gui/CCMainWindow.py +++ b/src/Gui/CCMainWindow.py @@ -53,10 +53,11 @@ class MainWindow(): STATUS_COL = 0 APP_NAME_COL = 1 TIME_STR_COL = 2 - UNIX_TIME_COL = 3 - DUMP_OBJECT_COL = 4 - #is_reported, application_name, date, time_in_sec ?object? - self.dumpsListStore = gtk.ListStore(str, str, str, int, object) + HOSTNAME_COL = 3 + UNIX_TIME_COL = 4 + DUMP_OBJECT_COL = 5 + #is_reported, application_name, hostname, date, time_in_sec ?object? + self.dumpsListStore = gtk.ListStore(str, str, str, str, int, object) self.dlist.set_model(self.dumpsListStore) # add pixbuff separatelly icon_column = gtk.TreeViewColumn(_("Reported")) @@ -69,6 +70,8 @@ class MainWindow(): columns = [] columns.append(gtk.TreeViewColumn(_("Application"))) columns[-1].set_sort_column_id(APP_NAME_COL) + columns.append(gtk.TreeViewColumn(_("Hostname"))) + columns[-1].set_sort_column_id(HOSTNAME_COL) columns.append(gtk.TreeViewColumn(_("Latest Crash"))) columns[-1].set_sort_column_id(UNIX_TIME_COL) # add cells to colums and bind cells to the liststore values @@ -183,6 +186,7 @@ class MainWindow(): for entry in dumplist[::-1]: n = self.dumpsListStore.append([["gtk-no","gtk-yes"][entry.isReported()], entry.getExecutable(), + entry.get_hostname(), entry.getTime("%c"), entry.getTime(), entry]) -- cgit