[gnome-logs] Make the Support link in detail view clickable



commit 7de0c549017dcb544c2b5c4405a9cd187c0aac95
Author: Jonathan Kang <jonathan121537 gmail com>
Date:   Wed Oct 14 23:12:56 2015 +0800

    Make the Support link in detail view clickable
    
    Allow users to click the Support link directly to visit it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=756575

 src/gl-eventviewdetail.c |   24 ++++++++++++++++++++----
 1 files changed, 20 insertions(+), 4 deletions(-)
---
diff --git a/src/gl-eventviewdetail.c b/src/gl-eventviewdetail.c
index bf5906c..b86ce01 100644
--- a/src/gl-eventviewdetail.c
+++ b/src/gl-eventviewdetail.c
@@ -249,10 +249,18 @@ gl_event_view_detail_create_detail (GlEventViewDetail *detail)
 
                     if (str_message && *str_message)
                     {
-                        gtk_label_set_text (GTK_LABEL (priv->support_label),
-                                            str_message);
+                        gchar *str_link;
+
+                        /* According to the spec, this should be a URI */
+                        str_link = g_strdup_printf ("<a href=\"%s\">%s</a>",
+                                                    str_message, str_message);
+
+                        gtk_label_set_markup (GTK_LABEL (priv->support_label),
+                                              str_link);
                         gtk_widget_show (priv->support_field_label);
                         gtk_widget_show (priv->support_label);
+
+                        g_free (str_link);
                     }
                 }
                 else
@@ -263,10 +271,18 @@ gl_event_view_detail_create_detail (GlEventViewDetail *detail)
 
                     if (str && *str)
                     {
-                        gtk_label_set_text (GTK_LABEL (priv->support_label),
-                                            str);
+                        gchar *str_link;
+
+                        /* According to the spec, this should be a URI */
+                        str_link = g_strdup_printf ("<a href=\"%s\">%s</a>",
+                                                    str, str);
+
+                        gtk_label_set_markup (GTK_LABEL (priv->support_label),
+                                              str_link);
                         gtk_widget_show (priv->support_field_label);
                         gtk_widget_show (priv->support_label);
+
+                        g_free (str_link);
                     }
 
                     g_free (str);


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