From 0f42e39d7e5cacf48e972b50b882fd955288ffaf Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Thu, 18 Mar 2010 10:40:53 -0400 Subject: [PATCH] Escape URLs in markup. Escape URLs in vendor and product markup. Also rearranged the layout of the new "new label" dialog -- I am still not happy with navigating the templates with this new dialog. I will probably try for a hybrid between this and the 2.2.x dialog. --- data/builder/new-label-dialog.builder | 453 +++++++++++++------------- src/new-label-dialog.c | 10 +- 2 files changed, 237 insertions(+), 226 deletions(-) diff --git a/data/builder/new-label-dialog.builder b/data/builder/new-label-dialog.builder index 9cb16a56..e5914100 100644 --- a/data/builder/new-label-dialog.builder +++ b/data/builder/new-label-dialog.builder @@ -98,258 +98,263 @@ - + + + + + 0 + + + + + True + True + + True - 0 - none + 3 + vertical - + + + + + + + True + Preview + + + False + + + + + True + 9 + vertical + + True - 12 + 7 + 2 + 12 + 6 - + True - 7 - 2 - 12 - 6 - - - True - 0 - Description: - - - 2 - 3 - GTK_FILL - - - - - True - 0 - Page size: - - - 3 - 4 - GTK_FILL - - - - - True - 0 - Label size: - - - 4 - 5 - GTK_FILL - - - - - True - 0 - Layout: - - - 5 - 6 - GTK_FILL - - - - - True - 0 - 0 - Similar products: - - - 6 - 7 - GTK_FILL - - - - - True - 0 - - - 1 - 2 - 2 - 3 - - - - - True - 0 - - - 1 - 2 - 3 - 4 - - - - - True - 0 - - - 1 - 2 - 4 - 5 - - - - - True - 0 - - - 1 - 2 - 5 - 6 - - - - - True - 0 - Vendor: - - - GTK_FILL - - - - - True - 0 - - - 1 - 2 - - - - - True - 0 - Part #: - - - 1 - 2 - GTK_FILL - - - - - True - 0 - - - 1 - 2 - 1 - 2 - - + 0 + Description: + + + 2 + 3 + GTK_FILL + + + + + True + 0 + Page size: + + + 3 + 4 + GTK_FILL + + + + + True + 0 + Label size: + + + 4 + 5 + GTK_FILL + + + + + True + 0 + Layout: + + + 5 + 6 + GTK_FILL + + + + + True + 0 + 0 + Similar products: + + + 6 + 7 + GTK_FILL + + + + + True + 0 + + + 1 + 2 + 2 + 3 + + + + + True + 0 + + + 1 + 2 + 3 + 4 + + + + + True + 0 + + + 1 + 2 + 4 + 5 + + + + + True + 0 + + + 1 + 2 + 5 + 6 + + + + + True + 0 + + + 1 + 2 + + + + + True + 0 + Part #: + + + 1 + 2 + GTK_FILL + + + + + True + 0 + + + 1 + 2 + 1 + 2 + + + + + 77 + True + True + never + automatic + in - - 77 + True - True - never - automatic - in + queue + none - + True - queue - none - - - True - 0 - 0 - 1 + 0 + 0 + 1 2 3 4 - - - - 1 - 2 - 6 - 7 - - + + 1 + 2 + 6 + 7 + + + + + + True + 0 + Vendor: + + + GTK_FILL + - - - - True - <b>Information</b> - True - + + False + False + 0 + - False - False 1 - - - 0 - - - - - True - 0 - none - - + + True - 12 - - - True - vertical - - - - - + Information + + 1 + False + - - - True - <b>Preview</b> - True - + + + + + diff --git a/src/new-label-dialog.c b/src/new-label-dialog.c index 0cb690c2..46621483 100644 --- a/src/new-label-dialog.c +++ b/src/new-label-dialog.c @@ -345,10 +345,13 @@ set_info (glNewLabelDialog *this, if ( vendor && vendor->url ) { + gchar *escaped_url; gchar *markup; - markup = g_strdup_printf ("%s", vendor->url, vendor->name); + escaped_url = g_markup_escape_text (vendor->url, -1); + markup = g_strdup_printf ("%s", escaped_url, vendor->name); gtk_label_set_markup (GTK_LABEL (this->priv->vendor_label), markup); + g_free (escaped_url); g_free (markup); } else @@ -359,10 +362,13 @@ set_info (glNewLabelDialog *this, if ( template->product_url ) { + gchar *escaped_url; gchar *markup; - markup = g_strdup_printf ("%s", template->product_url, template->part); + escaped_url = g_markup_escape_text (template->product_url, -1); + markup = g_strdup_printf ("%s", escaped_url, template->part); gtk_label_set_markup (GTK_LABEL (this->priv->part_label), markup); + g_free (escaped_url); g_free (markup); } else -- 2.39.5