Author: juha
Date: 2007-02-21 16:51:14 +0000 (Wed, 21 Feb 2007)
New Revision: 25006

Modified:
   xfcalendar/trunk/TODO
   xfcalendar/trunk/src/appointment.c
   xfcalendar/trunk/src/event-list.c
   xfcalendar/trunk/src/functions.c
   xfcalendar/trunk/src/functions.h
   xfcalendar/trunk/src/ical-code.c
   xfcalendar/trunk/src/interface.c
   xfcalendar/trunk/src/main.c
   xfcalendar/trunk/src/mainbox.c
   xfcalendar/trunk/src/orage-dbus-object.c
   xfcalendar/trunk/src/tray_icon.c
Log:
 orage_message wrapper for g_message


Modified: xfcalendar/trunk/TODO
===================================================================
--- xfcalendar/trunk/TODO       2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/TODO       2007-02-21 16:51:14 UTC (rev 25006)
@@ -52,3 +52,4 @@
     Needed for TODOs
 
 15) Internal: build own message/warning system
+*** DONE 4.5 ***

Modified: xfcalendar/trunk/src/appointment.c
===================================================================
--- xfcalendar/trunk/src/appointment.c  2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/appointment.c  2007-02-21 16:51:14 UTC (rev 25006)
@@ -864,7 +864,7 @@
                 apptw->appointment_add = FALSE;
                 gtk_widget_set_sensitive(apptw->Duplicate, TRUE);
                 gtk_widget_set_sensitive(apptw->File_menu_duplicate, TRUE);
-                g_message("Orage **: Added: %s", apptw->xf_uid);
+                orage_message("Added: %s", apptw->xf_uid);
             }
             else
                 g_warning("Addition failed: %s", apptw->xf_uid);
@@ -872,7 +872,7 @@
         else {
             ok = xfical_appt_mod(apptw->xf_uid, appt);
             if (ok)
-                g_message("Orage **: Modified: %s", apptw->xf_uid);
+                orage_message("Modified: %s", apptw->xf_uid);
             else
                 g_warning("Modification failed: %s", apptw->xf_uid);
         }
@@ -937,7 +937,7 @@
                     return;
             result = xfical_appt_del(apptw->xf_uid);
             if (result)
-                g_message("Orage **: Removed: %s", apptw->xf_uid);
+                orage_message("Removed: %s", apptw->xf_uid);
             else
                 g_warning("Removal failed: %s", apptw->xf_uid);
             xfical_file_close();
@@ -1260,7 +1260,7 @@
         if (!xfical_file_open())
             return(NULL);
         if ((appt = xfical_appt_get(par)) == NULL) {
-            g_message("Orage **: appointment not found");
+            orage_message("appointment not found");
             xfical_file_close();
             return(NULL);
         }
@@ -1282,7 +1282,7 @@
     char *untildate_to_display;
     int i;
 
-    g_message("Orage **: %s appointment: %s", action, par);
+    orage_message("%s appointment: %s", action, par);
     if ((appt = fill_appt_window_get_appt(action, par)) == NULL) {
         apptw->appt = NULL;
         return;

Modified: xfcalendar/trunk/src/event-list.c
===================================================================
--- xfcalendar/trunk/src/event-list.c   2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/event-list.c   2007-02-21 16:51:14 UTC (rev 25006)
@@ -803,7 +803,7 @@
                 gtk_tree_model_get(model, &iter, COL_UID, &uid, -1);
                 result = xfical_appt_del(uid);
                 if (result)
-                    g_message("Orage **: Removed: %s", uid);
+                    orage_message("Removed: %s", uid);
                 else
                     g_warning("Removal failed: %s", uid);
                 g_free(uid);

Modified: xfcalendar/trunk/src/functions.c
===================================================================
--- xfcalendar/trunk/src/functions.c    2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/functions.c    2007-02-21 16:51:14 UTC (rev 25006)
@@ -86,6 +86,19 @@
 }
 */
 
+void orage_message(const char *format, ...)
+{
+    va_list args;
+    char *formatted, *str;
+
+    va_start(args, format);
+    formatted = g_strdup_vprintf(format, args);
+    va_end(args);
+
+    g_message("Orage **: %s", formatted);
+    g_free(formatted);
+}
+
 GtkWidget *orage_toolbar_append_button(GtkWidget *toolbar
     , const gchar *stock_id, GtkTooltips *tooltips, const char *tooltip_text
     , gint pos)

Modified: xfcalendar/trunk/src/functions.h
===================================================================
--- xfcalendar/trunk/src/functions.h    2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/functions.h    2007-02-21 16:51:14 UTC (rev 25006)
@@ -26,6 +26,8 @@
 
 #define ORAGE_STR_EXISTS(str) ((str != NULL) && (str[0] != 0))
 
+void orage_message(const char *format, ...);
+
 GtkWidget *orage_toolbar_append_button(GtkWidget *toolbar
         , const gchar *stock_id, GtkTooltips *tooltips
         , const char *tooltip_text, gint pos);

Modified: xfcalendar/trunk/src/ical-code.c
===================================================================
--- xfcalendar/trunk/src/ical-code.c    2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/ical-code.c    2007-02-21 16:51:14 UTC (rev 25006)
@@ -543,7 +543,7 @@
         return;
     }
     else
-        g_message("Orage **: Adding timezone %s", loc);
+        orage_message("Adding timezone %s", loc);
 
     if (strcmp(loc,"UTC") == 0 
     ||  strcmp(loc,"floating") == 0) {
@@ -1181,9 +1181,9 @@
     }  /* EVENTS */
     g_par.alarm_list = g_list_sort(g_par.alarm_list, alarm_order);
     if (first_list_today) {
-        g_message("Orage **: Build alarm list: Processed %d events."
+        orage_message("Build alarm list: Processed %d events."
                 , cnt_event);
-        g_message("Orage **: \tFound %d alarms of which %d are active. 
(Searched %d recurring alarms.)"
+        orage_message("\tFound %d alarms of which %d are active. (Searched %d 
recurring alarms.)"
                 , cnt_alarm, cnt_act_alarm, cnt_repeat);
         }
 }
@@ -2386,7 +2386,7 @@
     char *uid;
 
     if (g_par.archive_limit == 0) {
-        g_message(_("Orage **: Archiving not enabled. Exiting"));
+        orage_message(_("Archiving not enabled. Exiting"));
         return(TRUE);
     }
     if (!xfical_file_open() || !xfical_archive_open()) {
@@ -2405,9 +2405,9 @@
     }
     threshold->tm_mon += 1;
 
-    g_message(_("Orage **: Archiving threshold: %d month(s)")
+    orage_message(_("Archiving threshold: %d month(s)")
             , g_par.archive_limit);
-    g_message(_("Orage **: \tArchiving events, which are older than: 
%04d-%02d-%02d")
+    orage_message(_("\tArchiving events, which are older than: %04d-%02d-%02d")
             , threshold->tm_year, threshold->tm_mon, threshold->tm_mday);
 
     /* Check appointment file for items older than the threshold */
@@ -2433,9 +2433,9 @@
         if ((edate.year*12 + edate.month) 
             < (threshold->tm_year*12 + threshold->tm_mon)) {
             p = icalcomponent_get_first_property(c, ICAL_RRULE_PROPERTY);
-            g_message(_("Orage **: Archiving uid: %s (%s)")
+            orage_message(_("Archiving uid: %s (%s)")
                     , uid, (p) ? _("recur") : _("normal"));
-            g_message(_("Orage **: \tEnd year: %04d, month: %02d, day: %02d")
+            orage_message(_("\tEnd year: %04d, month: %02d, day: %02d")
                     , edate.year, edate.month, edate.day);
             if (p)  /*  it is recurrent event */
                 xfical_icalcomponent_archive_recurrent(c, threshold, uid);
@@ -2450,7 +2450,7 @@
     icalset_mark(fical);
     icalset_commit(fical);
     xfical_file_close();
-    g_message(_("Orage **: Archiving done\n"));
+    orage_message(_("Archiving done\n"));
     return(TRUE);
 }
 
@@ -2483,7 +2483,7 @@
     const char *text;
 
     /* PHASE 1: go through base orage file and remove "repeat" shortcuts */
-    g_message(_("Orage **: Starting archive removal: PHASE 1: reset recurring 
appointments"));
+    orage_message(_("Starting archive removal: PHASE 1: reset recurring 
appointments"));
     if (!xfical_file_open()) {
         g_warning("xfical_unarchive: file open error");
         return(FALSE);
@@ -2527,7 +2527,7 @@
     icalset_mark(fical);
     icalset_commit(fical);
     xfical_file_close();
-    g_message(_("Orage **: Archive removal done\n"));
+    orage_message(_("Archive removal done\n"));
     return(TRUE);
 }
 
@@ -2577,7 +2577,7 @@
     if ((uid = (char *)icalcomponent_get_uid(ca)) == NULL) {
         uid = generate_uid();
         icalcomponent_add_property(ca,  icalproperty_new_uid(uid));
-        g_message("Orage **: Generated UID %s\n", uid);
+        orage_message("Generated UID %s\n", uid);
 
     }
     if (!xfical_file_open()) {
@@ -2622,7 +2622,7 @@
      * support so that we can do better conversion 
      */
 
-    g_message("Orage **: Starting import file preprocessing");
+    orage_message("Starting import file preprocessing");
     if (!g_file_get_contents(file_name_in, &text, &text_len, &error)) {
         g_warning("pre_format: Could not open ical file (%s) error:%s"
                 , file_name_in, error->message);
@@ -2669,7 +2669,7 @@
             }
         }
         tmp3 = g_strndup(tmp2+1, tmp-tmp2);
-        g_message("Orage **: ... Removed CHARSET from %s", tmp3);
+        orage_message("... Removed CHARSET from %s", tmp3);
         g_free(tmp3);
     }
     /* 2: change DCREATED to CREATED */
@@ -2689,7 +2689,7 @@
             *(tmp3-1) = 'Z'; /* this is 'bad'...but who cares...it is fast */
         }
         tmp3 = g_strndup(tmp, tmp2-tmp);
-        g_message("Orage **: ... Patched DCREATED to be CREATED (%s)", tmp3);
+        orage_message("... Patched DCREATED to be CREATED (%s)", tmp3);
         g_free(tmp3);
     }
     /* write file */
@@ -2698,7 +2698,7 @@
         return(FALSE);
     }
     g_free(text);
-    g_message("Orage **: Import file preprocessing done");
+    orage_message("Import file preprocessing done");
     return(TRUE);
 }
 

Modified: xfcalendar/trunk/src/interface.c
===================================================================
--- xfcalendar/trunk/src/interface.c    2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/interface.c    2007-02-21 16:51:14 UTC (rev 25006)
@@ -137,7 +137,7 @@
             ok = copy_file(g_par.orage_file, s);
             if (ok) { /* this is move. so let's remove the orig */
                if (g_remove(g_par.orage_file))
-                   g_message("file remove failed %s", g_par.orage_file);
+                   g_warning("file remove failed %s", g_par.orage_file);
             }
         }
     }
@@ -202,7 +202,7 @@
             ok = copy_file(g_par.archive_file, s);
             if (ok) { /* this is move. so let's remove the orig */
                if (g_remove(g_par.archive_file))
-                   g_message("file remove failed %s", g_par.archive_file);
+                   g_warning("file remove failed %s", g_par.archive_file);
             }
         }
     }
@@ -444,7 +444,7 @@
                 *filename_end = 0; /* filename ends here */
             /* FIXME: proper messages to screen */
             if (orage_import_file(filename))
-                g_message("Orage **: Import done %s", filename);
+                orage_message("Import done %s", filename);
             else
                 g_warning("import failed file=%s\n", filename);
             if (filename_end != NULL) { /* we have more files */
@@ -485,7 +485,7 @@
         }
 
         if (orage_export_file(entry_filename, app_count, entry_uids))
-            g_message("Orage **: Export done %s", entry_filename);
+            orage_message("Export done %s", entry_filename);
         else
             g_warning("export failed file=%s\n", entry_filename);
     }

Modified: xfcalendar/trunk/src/main.c
===================================================================
--- xfcalendar/trunk/src/main.c 2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/main.c 2007-02-21 16:51:14 UTC (rev 25006)
@@ -299,7 +299,7 @@
         /* let's use dbus since server is running there already */
 #ifdef HAVE_DBUS
         if (orage_dbus_import_file(file_name))
-            g_message("import done file=%s", file_name);
+            orage_message("import done file=%s", file_name);
         else
             g_warning("import failed file=%s\n", file_name);
 #else
@@ -307,7 +307,7 @@
 #endif
     else if (!running && initialized) /* do it self directly */
         if (xfical_import_file(file_name))
-            g_message("import done file=%s", file_name);
+            orage_message("import done file=%s", file_name);
         else
             g_warning("import failed file=%s\n", file_name);
 }

Modified: xfcalendar/trunk/src/mainbox.c
===================================================================
--- xfcalendar/trunk/src/mainbox.c      2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/mainbox.c      2007-02-21 16:51:14 UTC (rev 25006)
@@ -176,7 +176,7 @@
             gtk_calendar_select_month(GTK_CALENDAR(calendar), month, year);
             break;
         default:
-            g_message("Orage **: Got unknown scroll event!!!");
+            g_warning("Got unknown scroll event!!!");
     }
 }
 

Modified: xfcalendar/trunk/src/orage-dbus-object.c
===================================================================
--- xfcalendar/trunk/src/orage-dbus-object.c    2007-02-21 16:14:15 UTC (rev 
25005)
+++ xfcalendar/trunk/src/orage-dbus-object.c    2007-02-21 16:51:14 UTC (rev 
25006)
@@ -64,7 +64,7 @@
     orage_dbus->connection = dbus_g_bus_get(DBUS_BUS_SESSION, &error);
     if (orage_dbus->connection == NULL) {
       /* notify the user that D-BUS service won't be available */
-        g_message("Orage: Failed to connect to the D-BUS session bus: %s"
+        g_warning("Failed to connect to the D-BUS session bus: %s"
                 , error->message);
         g_error_free(error);
     }

Modified: xfcalendar/trunk/src/tray_icon.c
===================================================================
--- xfcalendar/trunk/src/tray_icon.c    2007-02-21 16:14:15 UTC (rev 25005)
+++ xfcalendar/trunk/src/tray_icon.c    2007-02-21 16:51:14 UTC (rev 25006)
@@ -119,13 +119,13 @@
                       , "small", "x-small", "xx-small", "END"};
 
   if (x <= 12 || y <= 12) {
-      g_message("Orage **: Too small icon size, using static icon\n");
+      orage_message("Too small icon size, using static icon\n");
       pixbuf = xfce_themed_icon_load("xfcalendar", 16);
       return(pixbuf);
   }
   if (g_par.icon_size_x == 0 
   ||  g_par.icon_size_y == 0) { /* signal to use static icon */
-      g_message("Orage **: Icon size set to zero, using static icon\n");
+      orage_message("Icon size set to zero, using static icon\n");
       pixbuf = xfce_themed_icon_load("xfcalendar", x);
       return(pixbuf);
   }
@@ -177,7 +177,7 @@
       y_used_head = PANGO_PIXELS(real_rect.height);
   }
   else
-      g_message("Orage **: trayicon: heading does not fit in dynamic icon");
+      orage_message("trayicon: heading does not fit in dynamic icon");
 
   /* month */
   if (strftime(month, 19, "%^b", t) == 0) {
@@ -201,7 +201,7 @@
       y_used_month = PANGO_PIXELS(real_rect.height);
   }
   else
-      g_message("Orage **: trayicon: month does not fit in dynamic icon");
+      orage_message("trayicon: month does not fit in dynamic icon");
 
   do { /* main loop where we try our best to fit header+day+month into icon */
       y_used = 0;

_______________________________________________
Xfce4-commits mailing list
[email protected]
http://foo-projects.org/mailman/listinfo/xfce4-commits

Reply via email to