]> git.sur5r.net Git - glabels/commitdiff
2005-12-08 Jim Evins <evins@snaught.com>
authorJim Evins <evins@snaught.com>
Fri, 9 Dec 2005 04:55:49 +0000 (04:55 +0000)
committerJim Evins <evins@snaught.com>
Fri, 9 Dec 2005 04:55:49 +0000 (04:55 +0000)
* libglabels/paper.c: (read_paper_files_from_dir):
* libglabels/template.c: (gl_template_register),
(read_template_files_from_dir):
* libglabels/xml-paper.c: (gl_xml_paper_read_papers_from_file),
(gl_xml_paper_parse_papers_doc):
* libglabels/xml-template.c:
(gl_xml_template_read_templates_from_file),
(gl_xml_template_parse_templates_doc),
(gl_xml_template_parse_template_node),
(xml_parse_label_rectangle_node), (xml_parse_label_round_node),
(xml_parse_label_cd_node), (xml_parse_layout_node),
(xml_parse_markup_margin_node), (xml_parse_markup_line_node),
(xml_parse_markup_circle_node),
(gl_xml_template_write_templates_to_file), (xml_create_label_node):
* libglabels/xml.c: (gl_xml_get_prop_length):
Re-classified g_warnings to g_messages.
* src/Makefile.am:
* src/glabels.c: (main):
* src/warning-handler.c: (gl_warning_handler_init),
(warning_handler):
* src/warning-handler.h:
Added warning message handler to make sure the user is
presented with appropriate non-fatal errors.
* src/critical-error-handler.c: (critical_error_handler):
Changed exit to abort.
* src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new), (render_pass1):
* src/bc-postnet.c: (postnet_code):
* src/bc.c: (id_to_index), (name_to_index):
* src/merge.c: (gl_merge_register_backend), (gl_merge_new):
* src/object-editor.c: (gl_object_notebook_construct_valist):
* src/prefs-dialog.c: (update_locale_page_from_prefs):
* src/prefs.c: (gl_prefs_get_units_per_point),
(gl_prefs_get_units_precision), (gl_prefs_get_units_step_size),
(gl_prefs_get_units_string):
* src/print.c: (draw_outline), (clip_to_outline), (clip_punchouts):
* src/splash.c: (gl_splash):
* src/ui-commands.c: (gl_ui_cmd_help_contents):
* src/view-highlight.c: (gl_view_highlight_new),
(highlight_resizable_box_construct), (object_changed_cb),
(view_scale_changed_cb):
* src/view.c: (draw_label_layer), (draw_bg_fg_layers),
(draw_markup_layer), (draw_markup_margin),
(gl_view_object_create_mode), (canvas_event),
(selection_received_cb):
* src/wdgt-mini-preview.c: (mini_outline_list_new):
* src/wdgt-rotate-label.c: (mini_preview_canvas_update):
* src/xml-label-04.c: (gl_xml_label_04_parse),
(xml04_parse_media_description), (xml04_parse_text_props),
(xml04_parse_barcode_props):
* src/xml-label-191.c: (gl_xml_label_191_parse),
(xml191_parse_objects), (xml191_parse_object),
(xml191_parse_text_props), (xml191_parse_image_props),
(xml191_parse_barcode_props), (xml191_parse_data),
(xml191_parse_sheet), (xml191_parse_label), (xml191_parse_layout),
(xml191_parse_markup):
* src/xml-label.c: (gl_xml_label_open), (gl_xml_label_open_buffer),
(xml_doc_to_label), (xml_parse_label), (xml_parse_objects),
(xml_parse_object_text), (xml_parse_object_image),
(xml_parse_object_barcode), (xml_parse_data),
(xml_parse_toplevel_span), (gl_xml_label_save),
(xml_create_objects):
Re-classified g_warnings to g_messages.
* src/merge-evolution.c: (gl_merge_evolution_open),
(gl_merge_evolution_close), (gl_merge_evolution_get_record):
Use g_warning to output errors encountered while
communicating with the evolution data server
instead of embedding them in the data.

git-svn-id: https://glabels.svn.sourceforge.net/svnroot/glabels/trunk@564 f5e0f49d-192f-0410-a22d-a8d8700d0965

29 files changed:
glabels2/ChangeLog
glabels2/libglabels/paper.c
glabels2/libglabels/template.c
glabels2/libglabels/xml-paper.c
glabels2/libglabels/xml-template.c
glabels2/libglabels/xml.c
glabels2/src/Makefile.am
glabels2/src/bc-gnubarcode.c
glabels2/src/bc-postnet.c
glabels2/src/bc.c
glabels2/src/critical-error-handler.c
glabels2/src/glabels.c
glabels2/src/merge-evolution.c
glabels2/src/merge.c
glabels2/src/object-editor.c
glabels2/src/prefs-dialog.c
glabels2/src/prefs.c
glabels2/src/print.c
glabels2/src/splash.c
glabels2/src/ui-commands.c
glabels2/src/view-highlight.c
glabels2/src/view.c
glabels2/src/warning-handler.c [new file with mode: 0644]
glabels2/src/warning-handler.h [new file with mode: 0644]
glabels2/src/wdgt-mini-preview.c
glabels2/src/wdgt-rotate-label.c
glabels2/src/xml-label-04.c
glabels2/src/xml-label-191.c
glabels2/src/xml-label.c

index 8b3df3331e774a95a13c623ea29a4fa1d9822a0d..9d1b5ddda90b405e90244bd57ef4d2751e19919e 100644 (file)
@@ -1,3 +1,73 @@
+2005-12-08  Jim Evins  <evins@snaught.com>
+
+       * libglabels/paper.c: (read_paper_files_from_dir):
+       * libglabels/template.c: (gl_template_register),
+       (read_template_files_from_dir):
+       * libglabels/xml-paper.c: (gl_xml_paper_read_papers_from_file),
+       (gl_xml_paper_parse_papers_doc):
+       * libglabels/xml-template.c:
+       (gl_xml_template_read_templates_from_file),
+       (gl_xml_template_parse_templates_doc),
+       (gl_xml_template_parse_template_node),
+       (xml_parse_label_rectangle_node), (xml_parse_label_round_node),
+       (xml_parse_label_cd_node), (xml_parse_layout_node),
+       (xml_parse_markup_margin_node), (xml_parse_markup_line_node),
+       (xml_parse_markup_circle_node),
+       (gl_xml_template_write_templates_to_file), (xml_create_label_node):
+       * libglabels/xml.c: (gl_xml_get_prop_length):
+               Re-classified g_warnings to g_messages.
+       * src/Makefile.am:
+       * src/glabels.c: (main):
+       * src/warning-handler.c: (gl_warning_handler_init),
+       (warning_handler):
+       * src/warning-handler.h:
+               Added warning message handler to make sure the user is
+               presented with appropriate non-fatal errors.
+       * src/critical-error-handler.c: (critical_error_handler):
+               Changed exit to abort.
+       * src/bc-gnubarcode.c: (gl_barcode_gnubarcode_new), (render_pass1):
+       * src/bc-postnet.c: (postnet_code):
+       * src/bc.c: (id_to_index), (name_to_index):
+       * src/merge.c: (gl_merge_register_backend), (gl_merge_new):
+       * src/object-editor.c: (gl_object_notebook_construct_valist):
+       * src/prefs-dialog.c: (update_locale_page_from_prefs):
+       * src/prefs.c: (gl_prefs_get_units_per_point),
+       (gl_prefs_get_units_precision), (gl_prefs_get_units_step_size),
+       (gl_prefs_get_units_string):
+       * src/print.c: (draw_outline), (clip_to_outline), (clip_punchouts):
+       * src/splash.c: (gl_splash):
+       * src/ui-commands.c: (gl_ui_cmd_help_contents):
+       * src/view-highlight.c: (gl_view_highlight_new),
+       (highlight_resizable_box_construct), (object_changed_cb),
+       (view_scale_changed_cb):
+       * src/view.c: (draw_label_layer), (draw_bg_fg_layers),
+       (draw_markup_layer), (draw_markup_margin),
+       (gl_view_object_create_mode), (canvas_event),
+       (selection_received_cb):
+       * src/wdgt-mini-preview.c: (mini_outline_list_new):
+       * src/wdgt-rotate-label.c: (mini_preview_canvas_update):
+       * src/xml-label-04.c: (gl_xml_label_04_parse),
+       (xml04_parse_media_description), (xml04_parse_text_props),
+       (xml04_parse_barcode_props):
+       * src/xml-label-191.c: (gl_xml_label_191_parse),
+       (xml191_parse_objects), (xml191_parse_object),
+       (xml191_parse_text_props), (xml191_parse_image_props),
+       (xml191_parse_barcode_props), (xml191_parse_data),
+       (xml191_parse_sheet), (xml191_parse_label), (xml191_parse_layout),
+       (xml191_parse_markup):
+       * src/xml-label.c: (gl_xml_label_open), (gl_xml_label_open_buffer),
+       (xml_doc_to_label), (xml_parse_label), (xml_parse_objects),
+       (xml_parse_object_text), (xml_parse_object_image),
+       (xml_parse_object_barcode), (xml_parse_data),
+       (xml_parse_toplevel_span), (gl_xml_label_save),
+       (xml_create_objects):
+               Re-classified g_warnings to g_messages.
+       * src/merge-evolution.c: (gl_merge_evolution_open),
+       (gl_merge_evolution_close), (gl_merge_evolution_get_record):
+               Use g_warning to output errors encountered while
+               communicating with the evolution data server
+               instead of embedding them in the data.
+       
 2005-12-08  Jim Evins  <evins@snaught.com>
 
        * libglabels/libglabels-private.h:
index 88e4b3742bfd1b83a3f554646993e16d172011b1..e81432ac0d3cffe3374baa1886a0bfd6aa013960 100644 (file)
@@ -483,7 +483,7 @@ read_paper_files_from_dir (GList       *papers,
 
        dp = g_dir_open (dirname, 0, &gerror);
        if (gerror != NULL) {
-               g_warning ("cannot open data directory: %s", gerror->message );
+               g_message ("cannot open data directory: %s", gerror->message );
                return papers;
        }
 
index abadc48057fd386faf18e317e04c7118fa5a1b3b..7d584f09723452b8640868fb3951b2b3e5af962d 100644 (file)
@@ -134,7 +134,7 @@ gl_template_register (const glTemplate  *template)
                g_free (abs_filename);
 
        } else {
-               g_warning ("Cannot register new template with unknown page size.");
+               g_message ("Cannot register new template with unknown page size.");
        }
 
 }
@@ -928,7 +928,7 @@ read_template_files_from_dir (GList       *templates,
 
        dp = g_dir_open (dirname, 0, &gerror);
        if (gerror != NULL) {
-               g_warning ("cannot open data directory: %s", gerror->message );
+               g_message ("cannot open data directory: %s", gerror->message );
                return templates;
        }
 
index c30cb4dfc4b9ad327dbff2b9893f5cb8d2cebb59..b0727ef2b255b8dc7d5397653e722f2a9b1a783f 100644 (file)
@@ -68,13 +68,13 @@ gl_xml_paper_read_papers_from_file (gchar *utf8_filename)
 
        filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
        if (!filename) {
-               g_warning ("Utf8 filename conversion error");
+               g_message ("Utf8 filename conversion error");
                return NULL;
        }
 
        papers_doc = xmlParseFile (filename);
        if (!papers_doc) {
-               g_warning ("\"%s\" is not a glabels paper file (not XML)",
+               g_message ("\"%s\" is not a glabels paper file (not XML)",
                           filename);
                return NULL;
        }
@@ -108,13 +108,13 @@ gl_xml_paper_parse_papers_doc (xmlDocPtr  papers_doc)
 
        root = xmlDocGetRootElement (papers_doc);
        if (!root || !root->name) {
-               g_warning ("\"%s\" is not a glabels paper file (no root node)",
+               g_message ("\"%s\" is not a glabels paper file (no root node)",
                           papers_doc->name);
                xmlFreeDoc (papers_doc);
                return papers;
        }
        if (!gl_xml_is_node (root, "Glabels-paper-sizes")) {
-               g_warning ("\"%s\" is not a glabels paper file (wrong root node)",
+               g_message ("\"%s\" is not a glabels paper file (wrong root node)",
                           papers_doc->name);
                xmlFreeDoc (papers_doc);
                return papers;
@@ -128,7 +128,7 @@ gl_xml_paper_parse_papers_doc (xmlDocPtr  papers_doc)
                } else {
                        if ( !xmlNodeIsText(node) ) {
                                if (!gl_xml_is_node (node, "comment")) {
-                                       g_warning ("bad node =  \"%s\"",node->name);
+                                       g_message ("bad node =  \"%s\"",node->name);
                                }
                        }
                }
index 339a61b07344eda30481e35ab9b0b8b69a4a7b08..64fc2da5c0d14c07acd091b3b5ab419e7c4b9ade 100644 (file)
@@ -104,13 +104,13 @@ gl_xml_template_read_templates_from_file (const gchar *utf8_filename)
 
        filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
        if (!filename) {
-               g_warning ("Utf8 filename conversion error");
+               g_message ("Utf8 filename conversion error");
                return NULL;
        }
 
        templates_doc = xmlParseFile (filename);
        if (!templates_doc) {
-               g_warning ("\"%s\" is not a glabels template file (not XML)",
+               g_message ("\"%s\" is not a glabels template file (not XML)",
                      filename);
                return templates;
        }
@@ -145,12 +145,12 @@ gl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc)
 
        root = xmlDocGetRootElement (templates_doc);
        if (!root || !root->name) {
-               g_warning ("\"%s\" is not a glabels template file (no root node)",
+               g_message ("\"%s\" is not a glabels template file (no root node)",
                           templates_doc->URL);
                return templates;
        }
        if (!gl_xml_is_node (root, "Glabels-templates")) {
-               g_warning ("\"%s\" is not a glabels template file (wrong root node)",
+               g_message ("\"%s\" is not a glabels template file (wrong root node)",
                      templates_doc->URL);
                return templates;
        }
@@ -163,7 +163,7 @@ gl_xml_template_parse_templates_doc (const xmlDocPtr templates_doc)
                } else {
                        if ( !xmlNodeIsText(node) ) {
                                if (!gl_xml_is_node (node,"comment")) {
-                                       g_warning ("bad node =  \"%s\"",node->name);
+                                       g_message ("bad node =  \"%s\"",node->name);
                                }
                        }
                }
@@ -207,7 +207,7 @@ gl_xml_template_parse_template_node (const xmlNodePtr template_node)
                if (paper == NULL) {
                        /* This should always be an id, but just in case a name
                           slips by! */
-                       g_warning (_("Unknown page size id \"%s\", trying as name"),
+                       g_message (_("Unknown page size id \"%s\", trying as name"),
                                   page_size);
                        paper = gl_paper_from_name (page_size);
                        g_free (page_size);
@@ -217,7 +217,7 @@ gl_xml_template_parse_template_node (const xmlNodePtr template_node)
                        page_width  = paper->width;
                        page_height = paper->height;
                } else {
-                       g_warning (_("Unknown page size id or name \"%s\""),
+                       g_message (_("Unknown page size id or name \"%s\""),
                                   page_size);
                }
                gl_paper_free (paper);
@@ -242,7 +242,7 @@ gl_xml_template_parse_template_node (const xmlNodePtr template_node)
                } else {
                        if (!xmlNodeIsText (node)) {
                                if (!gl_xml_is_node (node,"comment")) {
-                                       g_warning ("bad node =  \"%s\"",node->name);
+                                       g_message ("bad node =  \"%s\"",node->name);
                                }
                        }
                }
@@ -299,7 +299,7 @@ xml_parse_label_rectangle_node (xmlNodePtr  label_node,
                        xml_parse_markup_circle_node (node, label_type);
                } else if (!xmlNodeIsText (node)) {
                        if (!gl_xml_is_node (node, "comment")) {
-                               g_warning ("bad node =  \"%s\"",node->name);
+                               g_message ("bad node =  \"%s\"",node->name);
                        }
                }
        }
@@ -339,7 +339,7 @@ xml_parse_label_round_node (xmlNodePtr  label_node,
                        xml_parse_markup_circle_node (node, label_type);
                } else if (!xmlNodeIsText (node)) {
                        if (!gl_xml_is_node (node, "comment")) {
-                               g_warning ("bad node =  \"%s\"",node->name);
+                               g_message ("bad node =  \"%s\"",node->name);
                        }
                }
        }
@@ -382,7 +382,7 @@ xml_parse_label_cd_node (xmlNodePtr  label_node,
                        xml_parse_markup_circle_node (node, label_type);
                } else if (!xmlNodeIsText (node)) {
                        if (!gl_xml_is_node (node, "comment")) {
-                               g_warning ("bad node =  \"%s\"",node->name);
+                               g_message ("bad node =  \"%s\"",node->name);
                        }
                }
        }
@@ -417,7 +417,7 @@ xml_parse_layout_node (xmlNodePtr              layout_node,
             node = node->next) {
                if (!xmlNodeIsText (node)) {
                        if (!gl_xml_is_node (node, "comment")) {
-                               g_warning ("bad node =  \"%s\"",node->name);
+                               g_message ("bad node =  \"%s\"",node->name);
                        }
                }
        }
@@ -443,7 +443,7 @@ xml_parse_markup_margin_node (xmlNodePtr              markup_node,
             node = node->next) {
                if (!xmlNodeIsText (node)) {
                        if (!gl_xml_is_node (node, "comment")) {
-                               g_warning ("bad node =  \"%s\"",node->name);
+                               g_message ("bad node =  \"%s\"",node->name);
                        }
                }
        }
@@ -472,7 +472,7 @@ xml_parse_markup_line_node (xmlNodePtr              markup_node,
             node = node->next) {
                if (!xmlNodeIsText (node)) {
                        if (!gl_xml_is_node (node, "comment")) {
-                               g_warning ("bad node =  \"%s\"",node->name);
+                               g_message ("bad node =  \"%s\"",node->name);
                        }
                }
        }
@@ -500,7 +500,7 @@ xml_parse_markup_circle_node (xmlNodePtr              markup_node,
             node = node->next) {
                if (!xmlNodeIsText (node)) {
                        if (!gl_xml_is_node (node, "comment")) {
-                               g_warning ("bad node =  \"%s\"",node->name);
+                               g_message ("bad node =  \"%s\"",node->name);
                        }
                }
        }
@@ -555,14 +555,14 @@ gl_xml_template_write_templates_to_file (GList       *templates,
 
        filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
        if (!filename)
-               g_warning (_("Utf8 conversion error."));
+               g_message (_("Utf8 conversion error."));
        else {
                xmlSetDocCompressMode (doc, 0);
                xml_ret = xmlSaveFormatFile (filename, doc, TRUE);
                xmlFreeDoc (doc);
                if (xml_ret == -1) {
 
-                       g_warning (_("Problem saving xml file."));
+                       g_message (_("Problem saving xml file."));
 
                }
                g_free (filename);
@@ -685,7 +685,7 @@ xml_create_label_node (const glTemplateLabelType  *label_type,
                break;
 
        default:
-               g_warning ("Unknown label style");
+               g_message ("Unknown label style");
                return;
                break;
 
@@ -704,7 +704,7 @@ xml_create_label_node (const glTemplateLabelType  *label_type,
                        xml_create_markup_circle_node (markup, node, ns);
                        break;
                default:
-                       g_warning ("Unknown markup type");
+                       g_message ("Unknown markup type");
                        break;
                }
        }
index eccd26bc1e44490426c2238947d1cc6c1dd8bfa9..19fab3f9eaa9b06e00a8f10f4141627371ca44c8 100644 (file)
@@ -322,7 +322,7 @@ gl_xml_get_prop_length (xmlNodePtr   node,
                                        }
                                }
                                if (i>GL_UNITS_LAST) {
-                                       g_warning ("Line %d, Node \"%s\", Property \"%s\": Unknown unit \"%s\", assuming points",
+                                       g_message ("Line %d, Node \"%s\", Property \"%s\": Unknown unit \"%s\", assuming points",
                                                   xmlGetLineNo (node), node->name, property,
                                                   unit);
                                }
index 51f87a62a384ed0056012733fe4c3ca3fcd6ae8e..7b2ee4f9bae3b5b7f4274a612c3719b8c2c11902 100644 (file)
@@ -41,6 +41,8 @@ glabels_SOURCES =                     \
        glabels.c                       \
        splash.c                        \
        splash.h                        \
+       warning-handler.c               \
+       warning-handler.h               \
        critical-error-handler.c        \
        critical-error-handler.h        \
        window.c                        \
index b2da4231e5a3cb6ee91b200964c8335274c4ee46..40a51fe96d97bc8a4e60e32c458fb855653681b7 100644 (file)
@@ -172,7 +172,7 @@ gl_barcode_gnubarcode_new (const gchar    *id,
        } else if (g_strcasecmp (id, "PLS") == 0) {
                flags = BARCODE_PLS;
        } else {
-               g_warning( "Illegal barcode id %s", id );
+               g_message( "Illegal barcode id %s", id );
                flags = BARCODE_ANY;
        }
 
@@ -193,7 +193,7 @@ gl_barcode_gnubarcode_new (const gchar    *id,
 
        Barcode_Encode (bci, flags);
        if (!bci->partial || !bci->textinfo) {
-               g_warning ("Barcode Data Invalid");
+               g_message ("Barcode Data Invalid");
                Barcode_Delete (bci);
                return NULL;
        }
@@ -352,7 +352,7 @@ render_pass1 (struct Barcode_Item *bci,
                                continue;
                        }
                        if (sscanf (p, "%lf:%lf:%c", &f1, &f2, &c) != 3) {
-                               g_warning ("impossible data: %s", p);
+                               g_message ("impossible data: %s", p);
                                continue;
                        }
                        bchar = g_new0 (glBarcodeChar, 1);
index fec0daab3550644e3c2608c1fbec9951f7cefd7d..694069eb390f9c5ccdf448901d60c2ec16856cdf 100644 (file)
@@ -177,7 +177,7 @@ postnet_code (const gchar *digits)
                }
        }
        if ((len != 5) && (len != 9) && (len != 11)) {
-               g_warning ("Invalid POSTNET length %d, should be 5(ZIP), 9(ZIP+4), or 11(DPBC)", len);
+               g_message ("Invalid POSTNET length %d, should be 5(ZIP), 9(ZIP+4), or 11(DPBC)", len);
        }
 
        /* Create correction character */
index cd3f36353ec24711bc361d55211f95e4aca357bf..eeb6f964beed67cc910d6fbadd38a43ce03c8d9f 100644 (file)
@@ -172,7 +172,7 @@ id_to_index (const gchar *id)
                }
        }
 
-       g_warning( "Unknown barcode id \"%s\"", id );
+       g_message( "Unknown barcode id \"%s\"", id );
        return 0;
 }
 
@@ -192,7 +192,7 @@ name_to_index (const gchar *name)
                }
        }
 
-       g_warning( "Unknown barcode name \"%s\"", name );
+       g_message( "Unknown barcode name \"%s\"", name );
        return 0;
 }
 
index be2c2ed0e3832b28d2a852f8b85800bcf31d8891..21b2c50978dd387524f4cfa0b63b510ccfafbcc3 100644 (file)
@@ -78,6 +78,6 @@ critical_error_handler (const gchar    *log_domain,
 
         gtk_dialog_run (GTK_DIALOG (dialog));
 
-        exit (-1);
+        abort ();
 }
 
index b1354b0e2c69c301712db909138a93613fe486b0..b8583f3626e4d4615f20ccf751628bb857e22c01 100644 (file)
@@ -91,8 +91,9 @@ main (int argc, char **argv)
                                      GNOME_PROGRAM_STANDARD_PROPERTIES,
                                      NULL);
 
-       /* Install graphical handler for critical errors. */
+       /* Install GUI handlers for critical error and warning messages */
        gl_critical_error_handler_init();
+       gl_warning_handler_init();
 
        /* Splash screen */
        gl_splash ();
@@ -102,7 +103,7 @@ main (int argc, char **argv)
                                               ICON_PIXMAP_FILE,  FALSE, NULL);
        if (!g_file_test (icon_file, G_FILE_TEST_EXISTS))
        {
-               g_warning ("Could not find %s", ICON_PIXMAP_FILE);
+               g_message ("Could not find %s", ICON_PIXMAP_FILE);
        }
        else
        {
index 9fc36582fb3eb570b0dcfe59a9adbcf0852d17c9..af48eee8fbe7d2ac5d178ccfdf1f509f08b8a237 100644 (file)
@@ -28,8 +28,9 @@
 
 
 #include "merge-evolution.h"
-#include <libebook/e-book.h>
 
+#include <libebook/e-book.h>
+#include <glib/gi18n.h>
 #include <stdio.h>
 #include <string.h>
 
@@ -46,7 +47,6 @@ struct _glMergeEvolutionPrivate {
        EBook            *book;
        GList            *contacts;
        GList            *fields; /* the fields supported by the addressbook */
-       GList            *error_list; /* list of error strings */
 };
 
 enum {
@@ -295,41 +295,31 @@ gl_merge_evolution_open (glMerge *merge)
        GList *fields, *iter;
        EContactField *field_id;
        GError *error;
-       GList **error_list;
 
        gl_debug (DEBUG_MERGE, "BEGIN");
 
        merge_evolution = GL_MERGE_EVOLUTION (merge);
-       error_list = &merge_evolution->private->error_list; 
 
        query = e_book_query_from_string(merge_evolution->private->query);
        if (!query) {
-               merge_evolution->private->error_list = 
-                       g_list_append(merge_evolution->private->error_list,
-                                                 g_strdup("Couldn't construct query"));
-               g_error_free (error);
+               g_warning (_("Couldn't construct query"));
                return;
        }
 
        merge_evolution->private->book = e_book_new_system_addressbook(&error);
        if (!merge_evolution->private->book) {
-               *error_list = g_list_append(*error_list,
-                                               g_strdup_printf("Couldn't open addressbook: %s", 
-                                                       error->message));
+               g_warning (_("Couldn't open addressbook: %s"), error->message);
                e_book_query_unref(query);
                g_error_free (error);
                return;
        }
 
        if (!e_book_open(merge_evolution->private->book, TRUE, &error)) {
-               *error_list = g_list_append(*error_list,
-                                               g_strdup_printf("Couldn't open addressbook: %s", 
-                                                       error->message));
+               g_warning (_("Couldn't open addressbook: %s"), error->message);
                g_error_free (error);
                e_book_query_unref(query);
                g_object_unref(merge_evolution->private->book);
                merge_evolution->private->book = NULL;
-
                return;
        }
 
@@ -337,14 +327,11 @@ gl_merge_evolution_open (glMerge *merge)
        status = e_book_get_supported_fields(merge_evolution->private->book,
                                                                                 &fields, &error);
        if (status == FALSE) {
-               *error_list = g_list_append(*error_list,
-                                               g_strdup_printf("Couldn't list available fields: %s", 
-                                                       error->message));
+               g_warning (_("Couldn't list available fields: %s"), error->message);
                g_error_free (error);
                e_book_query_unref(query);
                g_object_unref(merge_evolution->private->book);
                merge_evolution->private->book = NULL;
-
                return;
        }
 
@@ -372,9 +359,7 @@ gl_merge_evolution_open (glMerge *merge)
                                                                  &merge_evolution->private->contacts,
                                                                  &error);
        if (status == FALSE) {
-               *error_list = g_list_append(*error_list,
-                                               g_strdup_printf("Couldn't get contacts: %s", 
-                                                       error->message));
+               g_warning (_("Couldn't get contacts: %s"), error->message);
                g_error_free (error);
                e_book_query_unref(query);
                free_field_list(merge_evolution->private->fields);
@@ -417,14 +402,6 @@ gl_merge_evolution_close (glMerge *merge)
        }
        g_list_free(merge_evolution->private->contacts);
        merge_evolution->private->contacts = NULL;
-
-       for (iter = merge_evolution->private->error_list; 
-                iter != NULL; 
-                iter = g_list_next(iter))
-       {
-               g_free(iter->data);
-       }
-       merge_evolution->private->error_list = NULL;
 }
 
 /*--------------------------------------------------------------------------*/
@@ -443,30 +420,6 @@ gl_merge_evolution_get_record (glMerge *merge)
 
        merge_evolution = GL_MERGE_EVOLUTION (merge);
 
-       /* we're in an error state */
-       if (merge_evolution->private->error_list) {
-               head = merge_evolution->private->error_list;
-               char *error_str = head->data;
-
-               /* a yucky hack to make the errors show up in the record list */
-               record = g_new0 (glMergeRecord, 1);
-               record->select_flag = TRUE;
-
-               field = g_new0 (glMergeField, 1);
-               field->key = g_strdup ("full_name");
-               field->value = g_strdup (error_str);
-
-               record->field_list = g_list_append (record->field_list, field);
-
-               /* do a destructive read */
-               g_free (error_str);
-               merge_evolution->private->error_list = 
-                       g_list_remove_link (merge_evolution->private->error_list, head);
-               g_list_free_1 (head);
-
-               return record;
-       }
-
        head = merge_evolution->private->contacts;
        if (head == NULL) {
                return NULL; /* past the last record */
index 744ca257279af1b668353c846f693bc3ee2b96b9..d902b31bc57c2abdf006ea254464501afae265c3 100644 (file)
@@ -124,13 +124,13 @@ gl_merge_register_backend (GType              type,
 
                class = g_type_class_ref (type);
                if (class == NULL) {
-                       g_warning ("%s: unknown object type %d",
+                       g_message ("%s: unknown object type %d",
                                   G_STRLOC, type);
                        break;
                }
                pspec = g_object_class_find_property (class, pname);
                if (pspec == NULL) {
-                       g_warning ("%s: object class `%s' has no property named `%s'",
+                       g_message ("%s: object class `%s' has no property named `%s'",
                                   G_STRLOC, g_type_name (type), pname);
                        break;
                }
@@ -143,7 +143,7 @@ gl_merge_register_backend (GType              type,
                g_value_init (&params[n_params].value, pspec->value_type);
                G_VALUE_COLLECT (&params[n_params].value, args, 0, &error);
                if (error) {
-                       g_warning ("%s: %s", G_STRLOC, error);
+                       g_message ("%s: %s", G_STRLOC, error);
                        g_free (error);
                        break;
                }
@@ -325,7 +325,7 @@ gl_merge_new (gchar *name)
        }
 
        if ( (merge == NULL) && (g_strcasecmp (name, "None") != 0)) {
-               g_warning ("Unknown merge backend \"%s\"", name);
+               g_message ("Unknown merge backend \"%s\"", name);
        }
 
        gl_debug (DEBUG_MERGE, "END");
index a7e817d3d983d7d1986d3d8ef581780f0b4d5412..2290d764bb750a97bbbe7ea02e94a380587b470e 100644 (file)
@@ -326,7 +326,7 @@ gl_object_notebook_construct_valist (glObjectEditor       *editor,
                        break;
 
                default:
-                       g_warning ("option = %d", option);
+                       g_message ("option = %d", option);
                        g_assert_not_reached ();
                }
                
index 1ff63d0a4867b3e5ef15c428ef7e71cb12ef4f1d..69fe674cdbecc08ca1f352443049c15ca70cd047 100644 (file)
@@ -503,7 +503,7 @@ update_locale_page_from_prefs (glPrefsDialog *dlg)
                        TRUE);
                break;
        default:
-               g_warning ("Illegal units");    /* Should not happen */
+               g_message ("Illegal units");    /* Should not happen */
                break;
        }
 
@@ -516,7 +516,7 @@ update_locale_page_from_prefs (glPrefsDialog *dlg)
                        GTK_TOGGLE_BUTTON(dlg->priv->page_size_a4_radio),
                        TRUE);
        } else {
-               g_warning ("Unknown default page size"); /* Shouldn't happen */
+               g_message ("Unknown default page size"); /* Shouldn't happen */
        }
 
        g_signal_handlers_unblock_by_func (
index b5648156d0ad6cb3fc79fd8e81a1e7a7f53020b9..d8141843c5a8277482cec24d268403fc6f42f9eb 100644 (file)
@@ -99,7 +99,7 @@ gl_prefs_get_units_per_point (void)
        case GL_UNITS_MM:
                return 0.35277778;      /* mm */
        default:
-               g_warning ("Illegal units");    /* Should not happen */
+               g_message ("Illegal units");    /* Should not happen */
                return 1.0;
        }
 }
@@ -119,7 +119,7 @@ gl_prefs_get_units_precision (void)
        case GL_UNITS_MM:
                return 1;       /* mm */
        default:
-               g_warning ("Illegal units");    /* Should not happen */
+               g_message ("Illegal units");    /* Should not happen */
                return 1.0;
        }
 }
@@ -139,7 +139,7 @@ gl_prefs_get_units_step_size (void)
        case GL_UNITS_MM:
                return 0.1;     /* mm */
        default:
-               g_warning ("Illegal units");    /* Should not happen */
+               g_message ("Illegal units");    /* Should not happen */
                return 1.0;
        }
 }
@@ -159,7 +159,7 @@ gl_prefs_get_units_string (void)
        case GL_UNITS_MM:
                return _("mm");
        default:
-               g_warning ("Illegal units");    /* Should not happen */
+               g_message ("Illegal units");    /* Should not happen */
                return _("points");
        }
 }
index 0ef01675e2992283ee3087ec70352fc0c3d08933..5f22ba41621a7b4dfca842f7320269f0af161062 100644 (file)
@@ -1248,7 +1248,7 @@ draw_outline (PrintInfo *pi,
                break;
 
        default:
-               g_warning ("Unknown template label style");
+               g_message ("Unknown template label style");
                break;
        }
 
@@ -1318,7 +1318,7 @@ clip_to_outline (PrintInfo *pi,
                break;
 
        default:
-               g_warning ("Unknown template label style");
+               g_message ("Unknown template label style");
                break;
        }
 
@@ -1361,7 +1361,7 @@ clip_punchouts (PrintInfo *pi,
                break;
 
        default:
-               g_warning ("Unknown template label style");
+               g_message ("Unknown template label style");
                break;
        }
 
index 3c46e4457e2799c704003c9050d9bbc0c208d267..a47fbfc5dc0c42a8a12a14ad65c858acf3a1d0d1 100644 (file)
@@ -71,11 +71,11 @@ gl_splash (void)
                                                        FALSE, NULL);
 
        if (!g_file_test (splash_pixmap_file, G_FILE_TEST_EXISTS)) {
-               g_warning ("Could not find %s", SPLASH_PIXMAP_FILE);
+               g_message ("Could not find %s", SPLASH_PIXMAP_FILE);
        }
        pixbuf = gdk_pixbuf_new_from_file (splash_pixmap_file, &gerror);
        if (gerror != NULL) {
-               g_warning ("cannot open splash pixbuf: %s", gerror->message );
+               g_message ("cannot open splash pixbuf: %s", gerror->message );
                gtk_widget_destroy (splash);
                return;
        }
index ac93d95c5dec04b73c377515c6948e4b4c38a4d5..b2f416ef817ae5843db329a7742c0adab7b18e9d 100644 (file)
@@ -1054,7 +1054,7 @@ gl_ui_cmd_help_contents (GtkAction *action,
        
        if (error != NULL)
        {
-               g_warning (error->message);
+               g_message (error->message);
 
                g_error_free (error);
        }
index 0149f208cebfa449387adb1d2b13308c052c9700..64e859aa8b0e587d7ba83ce9ea1e4a11082d1cca 100644 (file)
@@ -277,7 +277,7 @@ gl_view_highlight_new (glViewObject         *view_object,
                break;
 
        default:
-               g_warning ("Invalid resizable highlight style");
+               g_message ("Invalid resizable highlight style");
 
        }
 
@@ -369,7 +369,7 @@ highlight_resizable_box_construct (glViewHighlight        *view_highlight,
                break;
        default:
                view_highlight->private->outline = NULL;
-               g_warning ("Invalid resizable highlight style");
+               g_message ("Invalid resizable highlight style");
        }
 #endif
 
@@ -740,7 +740,7 @@ object_changed_cb (glLabelObject   *object,
                break;
 
        default:
-               g_warning ("Invalid resizable highlight style");
+               g_message ("Invalid resizable highlight style");
 
        }
 
@@ -776,7 +776,7 @@ view_scale_changed_cb (glView          *view,
                break;
 
        default:
-               g_warning ("Invalid resizable highlight style");
+               g_message ("Invalid resizable highlight style");
 
        }
 
index 29f7fc0d67e25c1bfcc8bb533c6035f12462ad78..9c0eb9a4c20073764fddda76e21ac496ea0f52ce 100644 (file)
@@ -655,7 +655,7 @@ draw_label_layer (glView *view)
                } else {
                        /* Should not happen! */
                        view_object = NULL;
-                       g_warning ("Invalid label object type.");
+                       g_message ("Invalid label object type.");
                }
        }
 }
@@ -736,7 +736,7 @@ draw_bg_fg_layers (glView *view)
                break;
 
        default:
-               g_warning ("Unknown template label style");
+               g_message ("Unknown template label style");
                break;
        }
 
@@ -1237,7 +1237,7 @@ draw_markup_layer (glView *view)
                        draw_markup_circle (view, markup);
                        break;
                default:
-                       g_warning ("Unknown template markup type");
+                       g_message ("Unknown template markup type");
                        break;
                }
        }
@@ -1294,7 +1294,7 @@ draw_markup_margin (glView           *view,
                break;
 
        default:
-               g_warning ("Unknown template label style");
+               g_message ("Unknown template label style");
                break;
        }
 
@@ -1803,7 +1803,7 @@ gl_view_object_create_mode (glView            *view,
                cursor = gl_view_barcode_get_create_cursor ();
                break;
        default:
-               g_warning ("Invalid label object type.");/*Should not happen!*/
+               g_message ("Invalid label object type.");/*Should not happen!*/
                break;
        }
 
@@ -3445,12 +3445,12 @@ canvas_event (GnomeCanvas *canvas,
                        break;
                default:
                         /*Should not happen!*/
-                       g_warning ("Invalid label object type.");
+                       g_message ("Invalid label object type.");
                        return FALSE;
        }
 
        default:
-               g_warning ("Invalid view state.");      /*Should not happen!*/
+               g_message ("Invalid view state.");      /*Should not happen!*/
                return FALSE;
 
        }
@@ -3727,7 +3727,7 @@ selection_received_cb (GtkWidget        *widget,
                } else {
                        /* Should not happen! */
                        view_object = NULL;
-                       g_warning ("Invalid label object type.");
+                       g_message ("Invalid label object type.");
                }
                gl_view_select_object (view, view_object);
        }
diff --git a/glabels2/src/warning-handler.c b/glabels2/src/warning-handler.c
new file mode 100644 (file)
index 0000000..6a9e9ee
--- /dev/null
@@ -0,0 +1,79 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
+/*
+ *  (GLABELS) Label and Business Card Creation program for GNOME
+ *
+ *  warning-handler.c:  non-critical error handler
+ *
+ *  Copyright (C) 2005  Jim Evins <evins@snaught.com>.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#include <config.h>
+
+#include "warning-handler.h"
+
+#include <glib/gmessages.h>
+#include <glib/gi18n.h>
+#include <gtk/gtkmessagedialog.h>
+#include <gtk/gtkstock.h>
+#include <stdlib.h>
+
+static void warning_handler (const gchar    *log_domain,
+                             GLogLevelFlags  log_level,
+                             const gchar    *message,
+                             gpointer        user_data);
+
+\f
+/***************************************************************************/
+/* Initialize error handler.                                               */
+/***************************************************************************/
+void
+gl_warning_handler_init (void)
+{
+        g_log_set_handler ("LibGlabels",
+                           G_LOG_LEVEL_WARNING,
+                           warning_handler,
+                           "libglabels");
+
+        g_log_set_handler (NULL,
+                           G_LOG_LEVEL_WARNING,
+                           warning_handler,
+                           "glabels");
+}
+
+/*-------------------------------------------------------------------------*/
+/* PRIVATE.  Actual error handler.                                         */
+/*-------------------------------------------------------------------------*/
+static void
+warning_handler (const gchar    *log_domain,
+                 GLogLevelFlags  log_level,
+                 const gchar    *message,
+                 gpointer        user_data)
+{
+        GtkWidget *dialog;
+
+        dialog = gtk_message_dialog_new (NULL,
+                                         GTK_DIALOG_MODAL,
+                                         GTK_MESSAGE_ERROR,
+                                         GTK_BUTTONS_CLOSE,
+                                         _("gLabels Error!"));
+        gtk_message_dialog_format_secondary_text (GTK_MESSAGE_DIALOG (dialog),
+                                                  message);
+
+        gtk_dialog_run (GTK_DIALOG (dialog));
+}
+
diff --git a/glabels2/src/warning-handler.h b/glabels2/src/warning-handler.h
new file mode 100644 (file)
index 0000000..911cc16
--- /dev/null
@@ -0,0 +1,36 @@
+/* -*- Mode: C; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 8 -*- */
+
+/*
+ *  (GLABELS) Label and Business Card Creation program for GNOME
+ *
+ *  warning-handler.h:  non-critical error handler header file
+ *
+ *  Copyright (C) 2005  Jim Evins <evins@snaught.com>.
+ *
+ *  This program is free software; you can redistribute it and/or modify
+ *  it under the terms of the GNU General Public License as published by
+ *  the Free Software Foundation; either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software Foundation,
+ * Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
+ */
+
+#ifndef __WARNING_HANDLER_H__
+#define __WARNING_HANDLER_H__
+
+#include <glib/gmacros.h>
+
+G_BEGIN_DECLS
+
+void gl_warning_handler_init (void);
+
+G_END_DECLS
+
+#endif
index c05d6d3fed8689161b2979edd76f5416371e3837..f9a97e9fcbb8cabd2c5cf3b0238c741bc766a726 100644 (file)
@@ -425,7 +425,7 @@ mini_outline_list_new (GnomeCanvas       *canvas,
                        }
                        break;
                default:
-                       g_warning ("Unknown label style");
+                       g_message ("Unknown label style");
                        return list;
                        break;
                }
index 71e1bb3be2bcb019822beb2c3845cc598b3436f3..58a663b5a93b1237c39cb051fca83fa892522bbb 100644 (file)
@@ -350,7 +350,7 @@ mini_preview_canvas_update (GnomeCanvas *canvas,
                }
                break;
        default:
-               g_warning ("Unknown label style");
+               g_message ("Unknown label style");
                break;
        }
 
index 88b0c26ebe6d0da4cf72f162a8178dde917f0e0d..c5eb9a76c93721b58099c278ed150c51fc274583 100644 (file)
@@ -73,7 +73,7 @@ glLabel      *gl_xml_label_04_parse      (xmlNodePtr       root,
        *status = XML_LABEL_OK;
 
        if (!xmlStrEqual (root->name, (xmlChar *)"Label")) {
-               g_warning (_("Bad root node = \"%s\""), root->name);
+               g_message (_("Bad root node = \"%s\""), root->name);
                *status = XML_LABEL_ERROR_OPEN_PARSE;
                return NULL;
        }
@@ -121,7 +121,7 @@ glLabel      *gl_xml_label_04_parse      (xmlNodePtr       root,
                        } else if (xmlStrEqual (node->name, (xmlChar *)"Merge_Properties")) {
                                xml04_parse_merge_properties (node, label);
                        } else {
-                               g_warning (_("bad node =  \"%s\""), node->name);
+                               g_message (_("bad node =  \"%s\""), node->name);
                        }
                }
        }
@@ -148,7 +148,7 @@ xml04_parse_media_description (xmlNodePtr node,
 
        template = gl_template_from_name ((gchar *)template_name);
        if (template == NULL) {
-               g_warning ("Undefined template \"%s\"", template_name);
+               g_message ("Undefined template \"%s\"", template_name);
                /* Get a default */
                template = gl_template_from_name (NULL);
                ret = FALSE;
@@ -260,7 +260,7 @@ xml04_parse_text_props (xmlNodePtr    object_node,
                                        nodes =
                                            g_list_append (nodes, node_text);
                                } else {
-                                       g_warning ("Unexpected Text Line child: \"%s\"",
+                                       g_message ("Unexpected Text Line child: \"%s\"",
                                                   text_node->name);
                                }
 
@@ -268,7 +268,7 @@ xml04_parse_text_props (xmlNodePtr    object_node,
                        lines = g_list_append (lines, nodes);
 
                } else if (!xmlNodeIsText (line_node)) {
-                       g_warning ("Unexpected Text child: \"%s\"",
+                       g_message ("Unexpected Text child: \"%s\"",
                                   line_node->name);
                }
 
@@ -462,7 +462,7 @@ xml04_parse_barcode_props (xmlNodePtr    node,
                text_node->field_flag = FALSE;
                text_node->data       = (gchar *)xmlNodeGetContent (child);
        } else {
-               g_warning ("Unexpected Barcode child: \"%s\"", child->name);
+               g_message ("Unexpected Barcode child: \"%s\"", child->name);
        }
        gl_label_barcode_set_data (object, text_node);
 
index 5f174c24d872c04f2c3a8d0d687d088d259d90c6..0b580b7cad02657b6c8d28e8f7b949e93222b06a 100644 (file)
@@ -128,7 +128,7 @@ gl_xml_label_191_parse (xmlNodePtr        root,
        *status = XML_LABEL_OK;
 
        if (!xmlStrEqual (root->name, (xmlChar *)"Document")) {
-               g_warning (_("Bad root node = \"%s\""), root->name);
+               g_message (_("Bad root node = \"%s\""), root->name);
                *status = XML_LABEL_ERROR_OPEN_PARSE;
                return NULL;
        }
@@ -162,7 +162,7 @@ gl_xml_label_191_parse (xmlNodePtr        root,
                        /* Handled in pass 1. */
                } else {
                        if (!xmlNodeIsText (node)) {
-                               g_warning (_("bad node in Document node =  \"%s\""),
+                               g_message (_("bad node in Document node =  \"%s\""),
                                           node->name);
                        }
                }
@@ -194,7 +194,7 @@ xml191_parse_objects (xmlNodePtr  objects_node,
                        xml191_parse_object (node, label);
                } else {
                        if (!xmlNodeIsText (node)) {
-                               g_warning (_("bad node =  \"%s\""), node->name);
+                               g_message (_("bad node =  \"%s\""), node->name);
                        }
                }
        }
@@ -231,7 +231,7 @@ xml191_parse_object (xmlNodePtr  object_node,
        } else if ( xmlStrEqual (string, (xmlChar *)"Barcode") ) {
                object = xml191_parse_barcode_props (object_node, label);
        } else {
-               g_warning ("Unknown label object type \"%s\"", string);
+               g_message ("Unknown label object type \"%s\"", string);
                xmlFree (string);
                return;
        }
@@ -326,7 +326,7 @@ xml191_parse_text_props (xmlNodePtr  object_node,
                                        nodes =
                                                g_list_append (nodes, node_text);
                                } else if (!xmlNodeIsText (text_node)) {
-                                       g_warning ("Unexpected Text Line child: \"%s\"",
+                                       g_message ("Unexpected Text Line child: \"%s\"",
                                                   text_node->name);
                                }
 
@@ -334,7 +334,7 @@ xml191_parse_text_props (xmlNodePtr  object_node,
                        lines = g_list_append (lines, nodes);
 
                } else if (!xmlNodeIsText (line_node)) {
-                       g_warning ("Unexpected Text child: \"%s\"",
+                       g_message ("Unexpected Text child: \"%s\"",
                                   line_node->name);
                }
 
@@ -501,7 +501,7 @@ xml191_parse_image_props (xmlNodePtr  node,
                        filename->field_flag = FALSE;
                        filename->data = (gchar *)xmlGetProp (child, (xmlChar *)"src");
                } else if (!xmlNodeIsText (child)) {
-                       g_warning ("Unexpected Image child: \"%s\"", child->name);
+                       g_message ("Unexpected Image child: \"%s\"", child->name);
                }
        }
 
@@ -555,7 +555,7 @@ xml191_parse_barcode_props (xmlNodePtr  node,
                        text_node->field_flag = FALSE;
                        text_node->data = (gchar *)xmlNodeGetContent (child);
                } else if (!xmlNodeIsText (child)) {
-                       g_warning ("Unexpected Barcode child: \"%s\"", child->name);
+                       g_message ("Unexpected Barcode child: \"%s\"", child->name);
                }
        }
 
@@ -620,7 +620,7 @@ xml191_parse_data (xmlNodePtr  node,
                        xml191_parse_pixdata (child, label);
                } else {
                        if (!xmlNodeIsText (child)) {
-                               g_warning (_("bad node in Data node =  \"%s\""),
+                               g_message (_("bad node in Data node =  \"%s\""),
                                           child->name);
                        }
                }
@@ -696,7 +696,7 @@ xml191_parse_sheet (xmlNodePtr sheet_node)
                if (paper == NULL) {
                        /* This should always be an id, but just in case a name
                           slips by! */
-                       g_warning (_("Unknown page size id \"%s\", trying as name"),
+                       g_message (_("Unknown page size id \"%s\", trying as name"),
                                   template->page_size);
                        paper = gl_paper_from_name (template->page_size);
                        g_free (template->page_size);
@@ -706,7 +706,7 @@ xml191_parse_sheet (xmlNodePtr sheet_node)
                        page_width  = paper->width;
                        page_height = paper->height;
                } else {
-                       g_warning (_("Unknown page size id or name \"%s\""),
+                       g_message (_("Unknown page size id or name \"%s\""),
                                   page_size);
                }
                gl_paper_free (paper);
@@ -739,7 +739,7 @@ xml191_parse_sheet (xmlNodePtr sheet_node)
                        xml191_parse_alias (node, template);
                } else {
                        if (!xmlNodeIsText (node)) {
-                               g_warning ("bad node =  \"%s\"", node->name);
+                               g_message ("bad node =  \"%s\"", node->name);
                        }
                }
        }
@@ -777,7 +777,7 @@ xml191_parse_label (xmlNodePtr  label_node,
                shape = GL_TEMPLATE_SHAPE_CD;
        } else {
                shape = GL_TEMPLATE_SHAPE_RECT;
-               g_warning ("Unknown label style in template");
+               g_message ("Unknown label style in template");
        }
        xmlFree (style);
 
@@ -820,7 +820,7 @@ xml191_parse_label (xmlNodePtr  label_node,
                } else if (xmlStrEqual (node->name, (xmlChar *)"Markup")) {
                        xml191_parse_markup (node, label_type);
                } else if (!xmlNodeIsText (node)) {
-                       g_warning ("bad node =  \"%s\"", node->name);
+                       g_message ("bad node =  \"%s\"", node->name);
                }
        }
 
@@ -852,7 +852,7 @@ xml191_parse_layout (xmlNodePtr           layout_node,
        for (node = layout_node->xmlChildrenNode; node != NULL;
             node = node->next) {
                if (!xmlNodeIsText (node)) {
-                       g_warning ("bad node =  \"%s\"", node->name);
+                       g_message ("bad node =  \"%s\"", node->name);
                }
        }
 
@@ -899,7 +899,7 @@ xml191_parse_markup (xmlNodePtr  markup_node,
        for (node = markup_node->xmlChildrenNode; node != NULL;
             node = node->next) {
                if (!xmlNodeIsText (node)) {
-                       g_warning ("bad node =  \"%s\"", node->name);
+                       g_message ("bad node =  \"%s\"", node->name);
                }
        }
 
index 380120a274cf48b8f5dbaca9828516346edb1baf..3176df4081b23af3ca0af5fdd116b9530319d41c 100644 (file)
@@ -173,7 +173,7 @@ gl_xml_label_open (const gchar      *utf8_filename,
 
        doc = xmlParseFile (filename);
        if (!doc) {
-               g_warning (_("xmlParseFile error"));
+               g_message (_("xmlParseFile error"));
                *status = XML_LABEL_ERROR_OPEN_PARSE;
                return NULL;
        }
@@ -210,7 +210,7 @@ gl_xml_label_open_buffer (const gchar      *buffer,
 
        doc = xmlParseDoc ((xmlChar *) buffer);
        if (!doc) {
-               g_warning (_("xmlParseFile error"));
+               g_message (_("xmlParseFile error"));
                *status = XML_LABEL_ERROR_OPEN_PARSE;
                return NULL;
        }
@@ -247,7 +247,7 @@ xml_doc_to_label (xmlDocPtr         doc,
 
        root = xmlDocGetRootElement (doc);
        if (!root || !root->name) {
-               g_warning (_("No document root"));
+               g_message (_("No document root"));
                *status = XML_LABEL_ERROR_OPEN_PARSE;
                return NULL;
        }
@@ -261,25 +261,25 @@ xml_doc_to_label (xmlDocPtr         doc,
                /* Try compatability mode 0.1 */
                ns = xmlSearchNsByHref (doc, root, (xmlChar *)COMPAT01_NAME_SPACE);
                if (ns != NULL) {
-                       g_warning (_("Importing from glabels 0.1 format"));
-                       g_warning ("TODO");
+                       g_message (_("Importing from glabels 0.1 format"));
+                       g_message ("TODO");
                        label = NULL; /* TODO */
                } else {
                        /* Try compatability mode 0.4 */
                        ns = xmlSearchNsByHref (doc, root,
                                                (xmlChar *)COMPAT04_NAME_SPACE);
                        if (ns != NULL) {
-                               g_warning (_("Importing from glabels 0.4 format"));
+                               g_message (_("Importing from glabels 0.4 format"));
                                label = gl_xml_label_04_parse (root, status);
                        } else {
                                /* Try compatability mode 1.91 */
                                ns = xmlSearchNsByHref (doc, root,
                                                        (xmlChar *)COMPAT191_NAME_SPACE);
                                if (ns != NULL) {
-                                       g_warning (_("Importing from glabels 1.91 format"));
+                                       g_message (_("Importing from glabels 1.91 format"));
                                        label = gl_xml_label_191_parse (root, status);
                                } else {
-                                       g_warning (_("bad document, unknown glabels Namespace"));
+                                       g_message (_("bad document, unknown glabels Namespace"));
                                        *status = XML_LABEL_ERROR_OPEN_PARSE;
                                        return NULL;
                                }
@@ -308,7 +308,7 @@ xml_parse_label (xmlNodePtr        root,
        *status = XML_LABEL_OK;
 
        if (!gl_xml_is_node (root, "Glabels-document")) {
-               g_warning (_("Bad root node = \"%s\""), root->name);
+               g_message (_("Bad root node = \"%s\""), root->name);
                *status = XML_LABEL_ERROR_OPEN_PARSE;
                return NULL;
        }
@@ -345,7 +345,7 @@ xml_parse_label (xmlNodePtr        root,
                        /* Handled in pass 1. */
                } else {
                        if (!xmlNodeIsText (child_node)) {
-                               g_warning (_("bad node in Document node =  \"%s\""),
+                               g_message (_("bad node in Document node =  \"%s\""),
                                           child_node->name);
                                g_object_unref (label);
                                *status = XML_LABEL_ERROR_OPEN_PARSE;
@@ -390,7 +390,7 @@ xml_parse_objects (xmlNodePtr  node,
                        xml_parse_object_barcode (child, label);
                } else {
                        if (!xmlNodeIsText (child)) {
-                               g_warning (_("bad node =  \"%s\""), child->name);
+                               g_message (_("bad node =  \"%s\""), child->name);
                                break;
                        }
                }
@@ -455,7 +455,7 @@ xml_parse_object_text (xmlNodePtr  node,
                        break;
                } else {
                        if (!xmlNodeIsText (child)) {
-                               g_warning ("Unexpected Object-text child: \"%s\"",
+                               g_message ("Unexpected Object-text child: \"%s\"",
                                           child->name);
                        }
                }
@@ -702,7 +702,7 @@ xml_parse_object_image (xmlNodePtr  node,
                        gl_text_node_free (&filename);
                        xmlFree (string);
                } else {
-                       g_warning ("Missing Object-image src or field attr");
+                       g_message ("Missing Object-image src or field attr");
                }
        }
 
@@ -793,7 +793,7 @@ xml_parse_object_barcode (xmlNodePtr  node,
                        gl_label_barcode_set_data (GL_LABEL_BARCODE(object), text_node);
                        gl_text_node_free (&text_node);
                } else {
-                       g_warning ("Missing Object-barcode data or field attr");
+                       g_message ("Missing Object-barcode data or field attr");
                }
        }
 
@@ -854,7 +854,7 @@ xml_parse_data (xmlNodePtr  node,
                        xml_parse_pixdata (child, label);
                } else {
                        if (!xmlNodeIsText (child)) {
-                               g_warning (_("bad node in Data node =  \"%s\""),
+                               g_message (_("bad node in Data node =  \"%s\""),
                                           child->name);
                        }
                }
@@ -979,7 +979,7 @@ xml_parse_toplevel_span  (xmlNodePtr        node,
 
                } else if (gl_xml_is_node (child, "Span")) {
 
-                       g_warning ("Unexpected rich text (not supported, yet!)");
+                       g_message ("Unexpected rich text (not supported, yet!)");
 
                } else if (gl_xml_is_node (child, "Field")) {
 
@@ -997,7 +997,7 @@ xml_parse_toplevel_span  (xmlNodePtr        node,
                        text_nodes = NULL;
 
                } else {
-                       g_warning ("Unexpected Span child: \"%s\"", child->name);
+                       g_message ("Unexpected Span child: \"%s\"", child->name);
                }
 
        }
@@ -1030,14 +1030,14 @@ gl_xml_label_save (glLabel          *label,
 
        filename = g_filename_from_utf8 (utf8_filename, -1, NULL, NULL, NULL);
        if (!filename)
-               g_warning (_("Utf8 conversion error."));
+               g_message (_("Utf8 conversion error."));
        else {
                xmlSetDocCompressMode (doc, gl_label_get_compression (label));
                xml_ret = xmlSaveFormatFile (filename, doc, TRUE);
                xmlFreeDoc (doc);
                if (xml_ret == -1) {
 
-                       g_warning (_("Problem saving xml file."));
+                       g_message (_("Problem saving xml file."));
                        *status = XML_LABEL_ERROR_SAVE_FILE;
 
                } else {
@@ -1157,7 +1157,7 @@ xml_create_objects (xmlNodePtr  root,
                } else if ( GL_IS_LABEL_BARCODE(object) ) {
                        xml_create_object_barcode (node, ns, object);
                } else {
-                       g_warning ("Unknown label object");
+                       g_message ("Unknown label object");
                }
 
        }