From 22378926f0b87ab3698f397bf60a28d969d343ff Mon Sep 17 00:00:00 2001 From: Ondrej Mosnacek Date: Feb 17 2021 14:27:17 +0000 Subject: framework/sealert: add "Last Seen" column to alert list Add a new column showing the date & time when the denial was last seen for convenience. Note that the "Last Seen" string is already translated so this doesn't require a translation update. Resolves: https://pagure.io/setroubleshoot/issue/52 Signed-off-by: Ondrej Mosnacek --- diff --git a/framework/gui/browser.glade b/framework/gui/browser.glade index 4522572..12af989 100644 --- a/framework/gui/browser.glade +++ b/framework/gui/browser.glade @@ -47,7 +47,7 @@ John Dennis <jdennis@redhat.com> False SETroubleshoot Alert List center - 825 + 975 400 True setroubleshoot_icon.png diff --git a/framework/src/setroubleshoot/browser.py b/framework/src/setroubleshoot/browser.py index 23dd5a1..be2a80e 100644 --- a/framework/src/setroubleshoot/browser.py +++ b/framework/src/setroubleshoot/browser.py @@ -277,7 +277,7 @@ class BrowserApplet: self.alert_list_window.hide() self.empty_load() self.load_data() - self.liststore = Gtk.ListStore(int, str, str, str, int, str) + self.liststore = Gtk.ListStore(int, str, str, str, int, str, str) self.make_treeview() self.troubleshoot_visible = False self.current_alert = -1 @@ -304,7 +304,7 @@ class BrowserApplet: def make_treeview(self): tmsort = Gtk.TreeModelSort(model=self.liststore) - cols = [_("#"), _("Source Process"), _("Attempted Access"), _("On this"), _("Occurred"), _("Status")] + cols = [_("#"), _("Source Process"), _("Attempted Access"), _("On this"), _("Occurred"), _("Last Seen"), _("Status")] self.treeview.set_model(tmsort) x = 0 for c in cols: @@ -861,7 +861,9 @@ class BrowserApplet: else: status = _("Notify") - self.liststore.append([ctr, spath, ",".join(alert.sig.access), tpath, alert.report_count, status]) + last_seen = alert.last_seen_date.format("%F %T") + + self.liststore.append([ctr, spath, ",".join(alert.sig.access), tpath, alert.report_count, last_seen, status]) ctr = ctr + 1 def on_list_all_button_clicked(self, widget):