[Xfce4-commits] <orage:master> 4.8.1.9 Fixed Bug 7848 Alarm Procedure command run error by "Execute" button.

Juha Kautto noreply at xfce.org
Fri Jul 29 10:38:01 CEST 2011


Updating branch refs/heads/master
         to 33fabe1c9f54bc4e181185eae0b6ed51421c064e (commit)
       from 44c855931730fa582c857ee606613d2fa0f578fa (commit)

commit 33fabe1c9f54bc4e181185eae0b6ed51421c064e
Author: Juha Kautto <juha at xfce.org>
Date:   Fri Jul 29 11:31:24 2011 +0300

    4.8.1.9 Fixed Bug 7848 Alarm Procedure command run error by "Execute" button.
    
    Fixed bug 7848 by adding forgotten parameter part.
    Also added failback to use stock icon (GTK_STOCK_ABOUT) if everything else
    fails as Orage really needs tray icon in gnome environment, where the panel
    plugin is not available.
    Also removed non working bold setting from libical alarm message.
    And changed main calendar event box to show also date when several days are
    selected to be shown.

 configure.in.in   |    2 +-
 src/appointment.c |    3 +-
 src/mainbox.c     |   10 ++++--
 src/reminder.c    |   11 +++---
 src/tray_icon.c   |   93 +++++++++++++++++++++++++++++------------------------
 5 files changed, 66 insertions(+), 53 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 6695216..9a95057 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -9,7 +9,7 @@ dnl Written for Xfce by Juha Kautto <juha at xfce.org>
 dnl
 
 dnl Version information
-m4_define([orage_version], [4.8.1.8-git])
+m4_define([orage_version], [4.8.1.9-git])
 
 m4_define([gtk_minimum_version], [2.10.0])
 m4_define([xfce_minimum_version], [4.6.0])
diff --git a/src/appointment.c b/src/appointment.c
index 936c68e..d956e12 100644
--- a/src/appointment.c
+++ b/src/appointment.c
@@ -2491,7 +2491,8 @@ static void on_test_button_clicked_cb(GtkButton *button
     cur_alarm.repeat_delay = appt->soundrepeat_len;
     cur_alarm.procedure = appt->procedure_alarm;
     if (appt->procedure_alarm)
-        cur_alarm.cmd = g_strdup(appt->procedure_cmd);
+        cur_alarm.cmd = g_strconcat(appt->procedure_cmd, " "
+                , appt->procedure_params, NULL);
     else
         cur_alarm.cmd = NULL;
     create_reminders(&cur_alarm);
diff --git a/src/mainbox.c b/src/mainbox.c
index 3bd44b7..f445789 100644
--- a/src/mainbox.c
+++ b/src/mainbox.c
@@ -390,6 +390,7 @@ static void add_info_row(xfical_appt *appt, GtkBox *parentBox, gboolean todo)
     /***** add data into the vbox *****/
     ev = gtk_event_box_new();
     tmp_title = orage_process_text_commands(appt->title);
+    s_time = g_strdup(orage_icaltime_to_i18_time(appt->starttimecur));
     if (appt->allDay || todo) {
         tmp = g_strdup_printf("  %s", tmp_title);
     }
@@ -399,8 +400,12 @@ static void add_info_row(xfical_appt *appt, GtkBox *parentBox, gboolean todo)
         today = orage_tm_time_to_icaltime(orage_localtime());
         if (!strncmp(today, appt->starttimecur, 8)) /* today */
             tmp = g_strdup_printf(" %s* %s", s_timeonly, appt->title);
-        else
-            tmp = g_strdup_printf(" %s  %s", s_timeonly, appt->title);
+        else {
+            if (g_par.show_event_days > 1)
+                tmp = g_strdup_printf(" %s  %s", s_time, appt->title);
+            else
+                tmp = g_strdup_printf(" %s  %s", s_timeonly, appt->title);
+        }
         g_free(s_timeonly);
     }
     label = gtk_label_new(tmp);
@@ -436,7 +441,6 @@ static void add_info_row(xfical_appt *appt, GtkBox *parentBox, gboolean todo)
 
     /***** set hint *****/
     tmp_note = orage_process_text_commands(appt->note);
-    s_time = g_strdup(orage_icaltime_to_i18_time(appt->starttimecur));
     if (todo) {
         na = _("Never");
         e_time = g_strdup(appt->use_due_time
diff --git a/src/reminder.c b/src/reminder.c
index dcca425..3486772 100644
--- a/src/reminder.c
+++ b/src/reminder.c
@@ -555,13 +555,12 @@ static void create_notify_reminder(alarm_struct *l_alarm)
         return;
     }
 
-    strncpy(heading,  _("Reminder "), 99);
+    strncpy(heading,  _("Reminder "), 100);
     if (l_alarm->title)
-        g_strlcat(heading, l_alarm->title, 50);
+        g_strlcat(heading, l_alarm->title, 150);
     if (l_alarm->action_time) {
-        g_strlcat(heading, "\n<b>", 10);
-        g_strlcat(heading, l_alarm->action_time, 90);
-        g_strlcat(heading, "<\b>", 10);
+        g_strlcat(heading, "\n", 160);
+        g_strlcat(heading, l_alarm->action_time, 250);
     }
     /* since version 0.7.0, libnotify does not have the widget parameter in 
        notify_notification_new and it does not have function
@@ -834,7 +833,7 @@ static void create_procedure_reminder(alarm_struct *l_alarm)
 #endif
     /*
     status = orage_exec(l_alarm->cmd, &active, &error);
-        */
+    */
     cmd = g_strconcat(l_alarm->cmd, " &", NULL);
     status = system(cmd);
     if (status)
diff --git a/src/tray_icon.c b/src/tray_icon.c
index 08e12cf..01cda8e 100644
--- a/src/tray_icon.c
+++ b/src/tray_icon.c
@@ -385,62 +385,67 @@ GdkPixbuf *orage_create_icon(gboolean static_icon, gint size)
     GdkVisual *pic_vis;
     struct tm *t;
     gint width = 160, height = 160, depth = 16; /* size of icon */
-    gint real_width = 0, real_height = 0; /* usable size of icon */
+    gint r_width = 0, r_height = 0; /* usable size of icon */
 
     icon_theme = gtk_icon_theme_get_default();
-    if (static_icon || !g_par.use_dynamic_icon) {
+    if (static_icon || !g_par.use_dynamic_icon) { /* load static icon */
         pixbuf = gtk_icon_theme_load_icon(icon_theme, "xfcalendar", size
                 , GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
-        return(pixbuf);
     }
+    else { /***** dynamic icon build starts now *****/
+        t = orage_localtime();
+        pic_cmap = gdk_colormap_get_system();
+        pic_vis = gdk_colormap_get_visual(pic_cmap);
+        depth = pic_vis->depth;
+
+        if (g_par.use_own_dynamic_icon) {
+            pic = create_own_icon_pixmap(pic_cmap, width, height, depth);
+            pic_gc = gdk_gc_new(pic);
+            create_own_icon_pango_layout(1, pic, pic_gc, t, width, height);
+            create_own_icon_pango_layout(2, pic, pic_gc, t, width, height);
+            create_own_icon_pango_layout(3, pic, pic_gc, t, width, height);
+        }
+        else { /* standard dynamic icon */
+            pic = create_icon_pixmap(pic_cmap, width, height, depth);
+            pic_gc = gdk_gc_new(pic);
+            /* We draw borders so we can't use the whole space */
+            r_width = width - 6; 
+            r_height = height - 6;
 
-    /***** dynamic icon build starts now *****/
-    t = orage_localtime();
-    pic_cmap = gdk_colormap_get_system();
-    pic_vis = gdk_colormap_get_visual(pic_cmap);
-    depth = pic_vis->depth;
-
-    if (g_par.use_own_dynamic_icon) {
-        pic = create_own_icon_pixmap(pic_cmap, width, height, depth);
-        pic_gc = gdk_gc_new(pic);
-        create_own_icon_pango_layout(1, pic, pic_gc, t, width, height);
-        create_own_icon_pango_layout(2, pic, pic_gc, t, width, height);
-        create_own_icon_pango_layout(3, pic, pic_gc, t, width, height);
-    }
-    else { /* standard dynamic icon */
-        pic = create_icon_pixmap(pic_cmap, width, height, depth);
-        pic_gc = gdk_gc_new(pic);
-        /* We draw borders so we can't use the whole space */
-        real_width = width - 6; 
-        real_height = height - 6;
+            /* weekday */
+            create_icon_pango_layout(1, pic, pic_gc, t, r_width, r_height);
 
-        /* weekday */
-        create_icon_pango_layout(1, pic, pic_gc, t, real_width, real_height);
+            /* day */
+            create_icon_pango_layout(2, pic, pic_gc, t, r_width, r_height);
 
-        /* day */
-        create_icon_pango_layout(2, pic, pic_gc, t, real_width, real_height);
+            /* month */
+            create_icon_pango_layout(3, pic, pic_gc, t, r_width, r_height);
+        }
 
-        /* month */
-        create_icon_pango_layout(3, pic, pic_gc, t, real_width, real_height);
-    }
+        pixbuf = gdk_pixbuf_get_from_drawable(NULL, pic, pic_cmap
+                , 0, 0, 0, 0, width, height);
+        if (size) {
+            pixbuf2 = gdk_pixbuf_scale_simple(pixbuf, size, size
+                    , GDK_INTERP_BILINEAR);
+            g_object_unref(pixbuf);
+            pixbuf = pixbuf2;
+        }
 
-    pixbuf = gdk_pixbuf_get_from_drawable(NULL, pic, pic_cmap
-            , 0, 0, 0, 0, width, height);
-    if (size) {
-        pixbuf2 = gdk_pixbuf_scale_simple(pixbuf, size, size
-                , GDK_INTERP_BILINEAR);
-        g_object_unref(pixbuf);
-        pixbuf = pixbuf2;
+        if (pixbuf == NULL) {
+            g_warning("orage_create_icon: dynamic icon creation failed\n");
+            pixbuf = gtk_icon_theme_load_icon(icon_theme, "xfcalendar", size
+                    , GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
+        }
+        g_object_unref(pic_gc);
+        g_object_unref(pic);
     }
-
+  
     if (pixbuf == NULL) {
-        g_warning("orage_create_icon: dynamic icon creation failed\n");
-        pixbuf = gtk_icon_theme_load_icon(icon_theme, "xfcalendar", size
+        g_warning("orage_create_icon: static icon creation failed, using stock ABOUT icon\n");
+        /* dynamic icon also tries static before giving up */
+        pixbuf = gtk_icon_theme_load_icon(icon_theme, GTK_STOCK_ABOUT, size
                 , GTK_ICON_LOOKUP_USE_BUILTIN, NULL);
     }
-    g_object_unref(pic_gc);
-    g_object_unref(pic);
-  
     return(pixbuf);
 }
 
@@ -538,6 +543,10 @@ void refresh_TrayIcon(void)
     GdkPixbuf *orage_logo;
 
     orage_logo = orage_create_icon(FALSE, 0);
+    if (!orage_logo) {
+        g_warning("refresh_TrayIcon: failed to load icon.");
+        return;
+    }
     if (g_par.show_systray) { /* refresh tray icon */
         if (ORAGE_TRAYICON && gtk_status_icon_is_embedded(ORAGE_TRAYICON)) {
             gtk_status_icon_set_visible(ORAGE_TRAYICON, FALSE);


More information about the Xfce4-commits mailing list