[gnome-logs] Use message catalog in detailed log event view



commit 02eb62acdb07376c20863a72b9b857932a862fa0
Author: David King <davidk gnome org>
Date:   Tue Oct 1 12:44:43 2013 +0100

    Use message catalog in detailed log event view
    
    https://bugzilla.gnome.org/show_bug.cgi?id=709153

 src/gl-eventview.c |   18 ++++++++++++++++++
 1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/src/gl-eventview.c b/src/gl-eventview.c
index 883be1c..c026548 100644
--- a/src/gl-eventview.c
+++ b/src/gl-eventview.c
@@ -151,6 +151,7 @@ on_listbox_row_activated (GtkListBox *listbox,
     gchar *cursor;
     gchar *comm;
     gchar *time;
+    gchar *catalog;
     gsize length;
     guint64 microsec;
     GDateTime *datetime;
@@ -208,6 +209,20 @@ on_listbox_row_activated (GtkListBox *listbox,
         comm = "_COMM=";
     }
 
+    ret = sd_journal_get_catalog (journal, &catalog);
+
+    if (ret == -ENOENT)
+    {
+        g_debug ("No message for this log entry was found in the catalog");
+        catalog = NULL;
+    }
+    else if (ret < 0)
+    {
+        g_warning ("Error while getting message from catalog: %s",
+                   g_strerror (-ret));
+        goto out;
+    }
+
     grid = gtk_grid_new ();
     label = gtk_label_new (strchr (comm, '=') + 1);
     gtk_grid_attach (GTK_GRID (grid), label, 0, 0, 1, 1);
@@ -243,6 +258,9 @@ on_listbox_row_activated (GtkListBox *listbox,
     gtk_grid_attach (GTK_GRID (grid), label, 0, 1, 1, 1);
     g_free (time);
 
+    label = gtk_label_new (catalog);
+    gtk_grid_attach (GTK_GRID (grid), label, 0, 2, 1, 1);
+
     gtk_widget_show_all (grid);
     stack = GTK_STACK (view);
     gtk_stack_add_named (stack, grid, "detailed");


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