[gnome-logs/wip/monospace: 10/13] Add timestamp to security events view



commit c33350f462e357929615b6691cfd9673ce5e197c
Author: David King <davidk gnome org>
Date:   Thu Oct 10 16:09:05 2013 +0100

    Add timestamp to security events view

 src/gl-eventview.c |   13 +++++++++++--
 1 files changed, 11 insertions(+), 2 deletions(-)
---
diff --git a/src/gl-eventview.c b/src/gl-eventview.c
index ee2225a..09eee4b 100644
--- a/src/gl-eventview.c
+++ b/src/gl-eventview.c
@@ -478,6 +478,7 @@ insert_journal_query_security (GlJournal *journal,
         GtkWidget *grid;
         GtkWidget *label;
         gchar *markup;
+        gchar *time;
         gboolean rtl;
         GtkWidget *image;
         GlJournalResult result = *(GlJournalResult *)(l->data);
@@ -512,15 +513,23 @@ insert_journal_query_security (GlJournal *journal,
         gtk_style_context_add_class (context, "event-monospace");
         gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5);
         gtk_label_set_ellipsize (GTK_LABEL (label), PANGO_ELLIPSIZE_END);
-        gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
+        gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 2, 1);
+
+        time = gl_util_timestamp_to_display (result.timestamp);
+        label = gtk_label_new (time);
+        gtk_widget_set_hexpand (label, TRUE);
+        gtk_misc_set_alignment (GTK_MISC (label), 1.0, 0.5);
+        gtk_grid_attach (GTK_GRID (grid), label, 1, 0, 1, 1);
 
         rtl = (gtk_widget_get_default_direction () == GTK_TEXT_DIR_RTL);
         image = gtk_image_new_from_icon_name (rtl ? "go-next-rtl-symbolic"
                                                   : "go-next-symbolic",
                                               GTK_ICON_SIZE_MENU);
-        gtk_grid_attach (GTK_GRID (grid), image, 1, 0, 1, 2);
+        gtk_grid_attach (GTK_GRID (grid), image, 2, 0, 1, 2);
 
         gtk_container_add (GTK_CONTAINER (listbox), row);
+
+        g_free (time);
     }
 
     gl_journal_results_free (journal, results);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]