]> git.sur5r.net Git - glabels/commitdiff
2007-11-20 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Wed, 21 Nov 2007 03:41:38 +0000 (03:41 +0000)
committerJim Evins <evins@snaught.com>
Wed, 21 Nov 2007 03:41:38 +0000 (03:41 +0000)
* 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
glabels2/data/glade/template-designer.glade
glabels2/src/template-designer.c

index 6c4498cc6af55e8befd47e452f02e0e3cd85b7f1..73aaece3c76626ebbd5e49b1cd87af8762d1f980 100644 (file)
@@ -1,3 +1,9 @@
+2007-11-20  Jim Evins  <evins@snaught.com>
+
+       * 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  <evins@snaught.com>
 
        * libglabels/Makefile.am:
index f148a74206dadf91b08fce114cb5d6006fb487c3..d21d3898996ce553d0ea06c9f742e9bee5e84d9b 100644 (file)
@@ -375,22 +375,50 @@ This dialog will assist you in the creation of a custom gLabels template.</prope
              </child>
 
              <child>
-               <widget class="GtkLabel" id="name_warning_label">
+               <widget class="GtkHBox" id="hbox39">
                  <property name="visible">True</property>
-                 <property name="label" translatable="yes"></property>
-                 <property name="use_underline">False</property>
-                 <property name="use_markup">True</property>
-                 <property name="justify">GTK_JUSTIFY_LEFT</property>
-                 <property name="wrap">False</property>
-                 <property name="selectable">False</property>
-                 <property name="xalign">0</property>
-                 <property name="yalign">0.5</property>
-                 <property name="xpad">0</property>
-                 <property name="ypad">0</property>
-                 <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-                 <property name="width_chars">-1</property>
-                 <property name="single_line_mode">False</property>
-                 <property name="angle">0</property>
+                 <property name="homogeneous">False</property>
+                 <property name="spacing">6</property>
+
+                 <child>
+                   <widget class="GtkImage" id="name_warning_image">
+                     <property name="visible">True</property>
+                     <property name="xalign">0.5</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xpad">0</property>
+                     <property name="ypad">0</property>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">False</property>
+                     <property name="fill">False</property>
+                   </packing>
+                 </child>
+
+                 <child>
+                   <widget class="GtkLabel" id="name_warning_label">
+                     <property name="visible">True</property>
+                     <property name="label" translatable="yes"></property>
+                     <property name="use_underline">False</property>
+                     <property name="use_markup">True</property>
+                     <property name="justify">GTK_JUSTIFY_LEFT</property>
+                     <property name="wrap">False</property>
+                     <property name="selectable">False</property>
+                     <property name="xalign">0</property>
+                     <property name="yalign">0.5</property>
+                     <property name="xpad">0</property>
+                     <property name="ypad">0</property>
+                     <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+                     <property name="width_chars">-1</property>
+                     <property name="single_line_mode">False</property>
+                     <property name="angle">0</property>
+                   </widget>
+                   <packing>
+                     <property name="padding">0</property>
+                     <property name="expand">False</property>
+                     <property name="fill">True</property>
+                   </packing>
+                 </child>
                </widget>
                <packing>
                  <property name="left_attach">1</property>
index 1cc8cc5c080e19c245dd3516f3dff8a7c5e76c4d..60ffe576f71fd8322b64e36c7eb45c2981d1f031 100644 (file)
@@ -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),
                                     _("<span foreground='red' weight='bold'>Brand and part# match an existing template!</span>"));
         }
         else
         {
+                gtk_image_clear (GTK_IMAGE (dialog->priv->name_warning_image));
                 gtk_label_set_text (GTK_LABEL (dialog->priv->name_warning_label), "");
         }