From f16056b8177404142111d3355fa5a3b94839b1d8 Mon Sep 17 00:00:00 2001 From: Jim Evins Date: Wed, 21 Nov 2007 03:41:38 +0000 Subject: [PATCH] 2007-11-20 Jim Evins * data/glade/template-designer.glade: * src/template-designer.c: Added warning icon when match brand and part match an existing template. git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@693 f5e0f49d-192f-0410-a22d-a8d8700d0965 --- glabels2/ChangeLog | 6 +++ glabels2/data/glade/template-designer.glade | 58 +++++++++++++++------ glabels2/src/template-designer.c | 5 ++ 3 files changed, 54 insertions(+), 15 deletions(-) diff --git a/glabels2/ChangeLog b/glabels2/ChangeLog index 6c4498cc..73aaece3 100644 --- a/glabels2/ChangeLog +++ b/glabels2/ChangeLog @@ -1,3 +1,9 @@ +2007-11-20 Jim Evins + + * data/glade/template-designer.glade: + * src/template-designer.c: + Added warning icon when match brand and part match an existing template. + 2007-11-18 Jim Evins * libglabels/Makefile.am: diff --git a/glabels2/data/glade/template-designer.glade b/glabels2/data/glade/template-designer.glade index f148a742..d21d3898 100644 --- a/glabels2/data/glade/template-designer.glade +++ b/glabels2/data/glade/template-designer.glade @@ -375,22 +375,50 @@ This dialog will assist you in the creation of a custom gLabels template. - + True - - False - True - GTK_JUSTIFY_LEFT - False - False - 0 - 0.5 - 0 - 0 - PANGO_ELLIPSIZE_NONE - -1 - False - 0 + False + 6 + + + + True + 0.5 + 0.5 + 0 + 0 + + + 0 + False + False + + + + + + True + + False + True + GTK_JUSTIFY_LEFT + False + False + 0 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + True + + 1 diff --git a/glabels2/src/template-designer.c b/glabels2/src/template-designer.c index 1cc8cc5c..60ffe576 100644 --- a/glabels2/src/template-designer.c +++ b/glabels2/src/template-designer.c @@ -92,6 +92,7 @@ struct _glTemplateDesignerPrivate /* Name page controls */ GtkWidget *brand_entry; GtkWidget *part_num_entry; + GtkWidget *name_warning_image; GtkWidget *name_warning_label; GtkWidget *description_entry; @@ -447,6 +448,7 @@ construct_name_page (glTemplateDesigner *dialog, dialog->priv->name_page = glade_xml_get_widget (gui, "name_page"); dialog->priv->brand_entry = glade_xml_get_widget (gui, "brand_entry"); dialog->priv->part_num_entry = glade_xml_get_widget (gui, "part_num_entry"); + dialog->priv->name_warning_image = glade_xml_get_widget (gui, "name_warning_image"); dialog->priv->name_warning_label = glade_xml_get_widget (gui, "name_warning_label"); dialog->priv->description_entry = glade_xml_get_widget (gui, "description_entry"); @@ -1245,11 +1247,14 @@ name_page_changed_cb (glTemplateDesigner *dialog) if (brand && brand[0] && part_num && part_num[0] && lgl_db_does_template_exist (brand, part_num)) { + gtk_image_set_from_stock (GTK_IMAGE (dialog->priv->name_warning_image), + GTK_STOCK_DIALOG_WARNING, GTK_ICON_SIZE_BUTTON); gtk_label_set_markup (GTK_LABEL (dialog->priv->name_warning_label), _("Brand and part# match an existing template!")); } else { + gtk_image_clear (GTK_IMAGE (dialog->priv->name_warning_image)); gtk_label_set_text (GTK_LABEL (dialog->priv->name_warning_label), ""); } -- 2.39.5