diff options
Diffstat (limited to 'calendar/gui/e-itip-control.c')
-rw-r--r-- | calendar/gui/e-itip-control.c | 475 |
1 files changed, 350 insertions, 125 deletions
diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index 938fb3a504..c0414c8cf5 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -30,14 +30,15 @@ #include <fcntl.h> #include <glib.h> #include <gtk/gtkmisc.h> +#include <libgnome/gnome-defs.h> #include <libgnome/gnome-i18n.h> #include <libgnome/gnome-util.h> -#include <libgnomeui/gnome-stock-icons.h> +#include <libgnomeui/gnome-stock.h> #include <libgnomeui/gnome-uidefs.h> #include <libgnomeui/gnome-dialog.h> #include <libgnomeui/gnome-dialog-util.h> -#include <bonobo/bonobo-object.h> #include <bonobo/bonobo-exception.h> +#include <gal/util/e-unicode-i18n.h> #include <gal/widgets/e-unicode.h> #include <gtkhtml/gtkhtml.h> #include <gtkhtml/gtkhtml-stream.h> @@ -46,10 +47,10 @@ #include <cal-util/timeutil.h> #include <cal-client/cal-client.h> #include <e-util/e-time-utils.h> +#include <e-util/e-html-utils.h> #include <e-util/e-dialog-widgets.h> #include <evolution-shell-client.h> #include <evolution-folder-selector-button.h> -#include <camel/camel-mime-filter-tohtml.h> #include "calendar-config.h" #include "itip-utils.h" #include "e-itip-control.h" @@ -90,7 +91,7 @@ struct _EItipControlPrivate { extern EvolutionShellClient *global_shell_client; -/* We intentionally use "calendar" instead of "calendar/*" here. We +/* We intentionally use "calendar" instead of "calendar / *" here. We * don't want public calendars. */ static const char *calendar_types[] = { "calendar", NULL }; @@ -106,8 +107,30 @@ static void ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, static GtkVBoxClass *parent_class = NULL; -E_MAKE_TYPE (e_itip_control, "EItipControl", EItipControl, class_init, init, - GTK_TYPE_VBOX); + +GtkType +e_itip_control_get_type (void) +{ + static GtkType type = 0; + + if (type == 0) { + static const GtkTypeInfo info = + { + "EItipControl", + sizeof (EItipControl), + sizeof (EItipControlClass), + (GtkClassInitFunc) class_init, + (GtkObjectInitFunc) init, + /* reserved_1 */ NULL, + /* reserved_2 */ NULL, + (GtkClassInitFunc) NULL, + }; + + type = gtk_type_unique (gtk_vbox_get_type (), &info); + } + + return type; +} static void class_init (EItipControlClass *klass) @@ -116,7 +139,7 @@ class_init (EItipControlClass *klass) object_class = GTK_OBJECT_CLASS (klass); - parent_class = g_type_class_peek_parent (klass); + parent_class = gtk_type_class (gtk_vbox_get_type ()); object_class->destroy = destroy; } @@ -146,7 +169,8 @@ start_calendar_server (char *uri) client = cal_client_new (); - g_signal_connect (client, "cal_opened", G_CALLBACK (start_calendar_server_cb), &success); + gtk_signal_connect (GTK_OBJECT (client), "cal_opened", + start_calendar_server_cb, &success); cal_client_open_calendar (client, uri, TRUE); @@ -157,7 +181,7 @@ start_calendar_server (char *uri) if (success) return client; - g_object_unref (client); + gtk_object_unref (GTK_OBJECT (client)); return NULL; } @@ -170,7 +194,8 @@ start_default_server (gboolean tasks) client = cal_client_new (); - g_signal_connect (client, "cal_opened", G_CALLBACK (start_calendar_server_cb), &success); + gtk_signal_connect (GTK_OBJECT (client), "cal_opened", + start_calendar_server_cb, &success); if (tasks) { if (!cal_client_open_default_tasks (client, FALSE)) @@ -188,7 +213,7 @@ start_default_server (gboolean tasks) return client; error: - g_object_unref (client); + gtk_object_unref (GTK_OBJECT (client)); return NULL; } @@ -245,7 +270,7 @@ get_servers (EvolutionShellClient *shell_client, const char *possible_types[], g CORBA_free (folder_list); } - g_object_unref (shell_client); + bonobo_object_unref (BONOBO_OBJECT (shell_client)); return servers; } @@ -265,8 +290,8 @@ find_server (GPtrArray *servers, CalComponent *comp) client = g_ptr_array_index (servers, i); status = cal_client_get_object (client, uid, &found_comp); if (status == CAL_CLIENT_GET_SUCCESS) { - g_object_unref (found_comp); - g_object_ref (client); + gtk_object_unref (GTK_OBJECT (found_comp)); + gtk_object_ref (GTK_OBJECT (client)); return client; } @@ -317,9 +342,14 @@ init (EItipControl *itip) gtk_widget_set_usize (scrolled_window, 600, 400); gtk_box_pack_start (GTK_BOX (itip), scrolled_window, FALSE, FALSE, 4); - g_signal_connect (priv->html, "url_requested", G_CALLBACK (url_requested_cb), itip); - g_signal_connect (priv->html, "object_requested", G_CALLBACK (object_requested_cb), itip); - g_signal_connect (priv->html, "submit", G_CALLBACK (ok_clicked_cb), itip); + gtk_signal_connect (GTK_OBJECT (priv->html), "url_requested", + url_requested_cb, itip); + gtk_signal_connect (GTK_OBJECT (priv->html), "object_requested", + GTK_SIGNAL_FUNC (object_requested_cb), + itip); + gtk_signal_connect (GTK_OBJECT (priv->html), "submit", + ok_clicked_cb, itip); + } static void @@ -333,7 +363,7 @@ clean_up (EItipControl *itip) priv->vcalendar = NULL; if (priv->comp) - g_object_unref (priv->comp); + gtk_object_unref (GTK_OBJECT (priv->comp)); priv->comp = NULL; icalcomponent_free (priv->top_level); @@ -374,12 +404,12 @@ destroy (GtkObject *obj) if (priv->event_clients) { for (i = 0; i < priv->event_clients->len; i++) - g_object_unref (g_ptr_array_index (priv->event_clients, i)); + gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->event_clients, i))); g_ptr_array_free (priv->event_clients, TRUE); } if (priv->task_clients) { for (i = 0; i < priv->task_clients->len; i++) - g_object_unref (g_ptr_array_index (priv->task_clients, i)); + gtk_object_unref (GTK_OBJECT (g_ptr_array_index (priv->task_clients, i))); g_ptr_array_free (priv->task_clients, TRUE); } @@ -392,7 +422,7 @@ destroy (GtkObject *obj) GtkWidget * e_itip_control_new (void) { - return g_object_new (E_TYPE_ITIP_CONTROL, NULL); + return gtk_type_new (E_TYPE_ITIP_CONTROL); } static void @@ -502,7 +532,8 @@ find_attendee (icalcomponent *ical_comp, const char *address) static void write_label_piece (EItipControl *itip, CalComponentDateTime *dt, char *buffer, int size, - const char *stext, const char *etext) + const char *stext, const char *etext, + gboolean just_date) { EItipControlPrivate *priv; struct tm tmp_tm; @@ -522,6 +553,8 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt, } tmp_tm = icaltimetype_to_tm (dt->value); + if (just_date) + tmp_tm.tm_hour = tmp_tm.tm_min = tmp_tm.tm_sec = 0; if (stext != NULL) strcat (buffer, stext); @@ -540,12 +573,12 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt, } /* Output timezone after time, e.g. " America/New_York". */ - if (zone) { + if (zone && !just_date) { /* Note that this returns UTF-8, since all iCalendar data is UTF-8. But it probably is not translated. */ display_name = icaltimezone_get_display_name (zone); if (display_name && *display_name) { - strcat (buffer, " "); + strcat (buffer, " <font size=-1>["); /* We check if it is one of our builtin timezone names, in which case we call gettext to translate it, and @@ -553,10 +586,11 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt, timezone name, we use it as-is, as it is already UTF-8. */ if (icaltimezone_get_builtin_timezone (display_name)) { - strcat (buffer, _(display_name)); + strcat (buffer, U_(display_name)); } else { strcat (buffer, display_name); } + strcat (buffer, "]</font>"); } } @@ -564,6 +598,188 @@ write_label_piece (EItipControl *itip, CalComponentDateTime *dt, strcat (buffer, etext); } +/* copied from recurrence-page.c, so it should be pre-translated */ +static const char *date_suffix[] = { + N_("st"), + N_("nd"), + N_("rd"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("st"), + N_("nd"), + N_("rd"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("th"), + N_("st") +}; + +static const char * +nth (int n) +{ + static char buffer[10]; + + if (n == -1) + return "last"; + if (n < 1 || n >= (sizeof (date_suffix) / sizeof (const char *))) + return "?"; + sprintf (buffer, "%d%s", n, date_suffix[n - 1]); + return buffer; +} + +static const char *dayname[] = { + N_("Sunday"), + N_("Monday"), + N_("Tuesday"), + N_("Wednesday"), + N_("Thursday"), + N_("Friday"), + N_("Saturday") +}; + +static inline char * +get_dayname (struct icalrecurrencetype *r, int i) +{ + enum icalrecurrencetype_weekday day; + + day = icalrecurrencetype_day_day_of_week (r->by_day[i]); + g_return_val_if_fail (day > 0 && day < 8, "?"); + + return _(dayname[day - 1]); +} + +static void +write_recurrence_piece (EItipControl *itip, CalComponent *comp, + char *buffer, int size) +{ + GSList *rrules; + struct icalrecurrencetype *r; + int len, i; + + strcpy (buffer, "<b>Recurring:</b> "); + len = strlen (buffer); + buffer += len; + size -= len; + + if (!cal_component_has_simple_recurrence (comp)) { + strcpy (buffer, _("Yes. (Complex Recurrence)")); + return; + } + + cal_component_get_rrule_list (comp, &rrules); + g_return_if_fail (rrules && !rrules->next); + + r = rrules->data; + + switch (r->freq) { + case ICAL_DAILY_RECURRENCE: + if (r->interval == 1) + strcpy (buffer, _("Every day")); + else + sprintf (buffer, _("Every %d days"), r->interval); + break; + + case ICAL_WEEKLY_RECURRENCE: + if (r->by_day[0] == ICAL_RECURRENCE_ARRAY_MAX) { + if (r->interval == 1) + strcpy (buffer, _("Every week")); + else + sprintf (buffer, _("Every %d weeks"), r->interval); + } else { + if (r->interval == 1) + strcpy (buffer, _("Every week on ")); + else + sprintf (buffer, _("Every %d weeks on "), r->interval); + + for (i = 1; i < 8 && r->by_day[i] != ICAL_RECURRENCE_ARRAY_MAX; i++) { + if (i > 1) + strcat (buffer, ", "); + strcat (buffer, get_dayname (r, i - 1)); + } + if (i > 1) + strcat (buffer, _(" and ")); + strcat (buffer, get_dayname (r, i - 1)); + } + break; + + case ICAL_MONTHLY_RECURRENCE: + if (r->by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { + sprintf (buffer, _("The %s day of "), + nth (r->by_month_day[0])); + } else { + int pos; + + /* Outlook 2000 uses BYDAY=TU;BYSETPOS=2, and will not + accept BYDAY=2TU. So we now use the same as Outlook + by default. */ + + pos = icalrecurrencetype_day_position (r->by_day[0]); + if (pos == 0) + pos = r->by_set_pos[0]; + + sprintf (buffer, _("The %s %s of "), + nth (pos), get_dayname (r, 0)); + } + + if (r->interval == 1) + strcat (buffer, _("every month")); + else { + len = strlen (buffer); + buffer += len; + size -= len; + sprintf (buffer, _("every %d months"), r->interval); + } + break; + + case ICAL_YEARLY_RECURRENCE: + if (r->interval == 1) + strcpy (buffer, _("Every year")); + else { + sprintf (buffer, _("Every %d years"), r->interval); + } + break; + + default: + g_assert_not_reached (); + } + + len = strlen (buffer); + buffer += len; + size -= len; + if (r->count) { + sprintf (buffer, _(" a total of %d times"), r->count); + } else if (!icaltime_is_null_time (r->until)) { + CalComponentDateTime dt; + + dt.value = &r->until; + dt.tzid = r->until.zone; + + write_label_piece (itip, &dt, buffer, size, + _(", ending on "), NULL, TRUE); + } + + strcat (buffer, "<br>"); +} + static void set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, CalComponent *comp) @@ -582,8 +798,8 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, cal_component_get_dtstart (comp, &datetime); if (datetime.value) { write_label_piece (itip, &datetime, buffer, 1024, - _("<b>Starts:</b> "), - "<br>"); + U_("<b>Starts:</b> "), + "<br>", FALSE); gtk_html_write (html, html_stream, buffer, strlen(buffer)); wrote = TRUE; } @@ -592,20 +808,27 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, buffer[0] = '\0'; cal_component_get_dtend (comp, &datetime); if (datetime.value){ - write_label_piece (itip, &datetime, buffer, 1024, _("<b>Ends:</b> "), "<br>"); + write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Ends:</b> "), "<br>", FALSE); gtk_html_write (html, html_stream, buffer, strlen (buffer)); wrote = TRUE; } cal_component_free_datetime (&datetime); buffer[0] = '\0'; + if (cal_component_has_recurrences (comp)) { + write_recurrence_piece (itip, comp, buffer, 1024); + gtk_html_write (html, html_stream, buffer, strlen (buffer)); + wrote = TRUE; + } + + buffer[0] = '\0'; datetime.tzid = NULL; cal_component_get_completed (comp, &datetime.value); if (type == CAL_COMPONENT_TODO && datetime.value) { /* Pass TRUE as is_utc, so it gets converted to the current timezone. */ datetime.value->is_utc = TRUE; - write_label_piece (itip, &datetime, buffer, 1024, _("<b>Completed:</b> "), "<br>"); + write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Completed:</b> "), "<br>", FALSE); gtk_html_write (html, html_stream, buffer, strlen (buffer)); wrote = TRUE; task_completed = TRUE; @@ -615,7 +838,7 @@ set_date_label (EItipControl *itip, GtkHTML *html, GtkHTMLStream *html_stream, buffer[0] = '\0'; cal_component_get_due (comp, &datetime); if (type == CAL_COMPONENT_TODO && !task_completed && datetime.value) { - write_label_piece (itip, &datetime, buffer, 1024, _("<b>Due:</b> "), "<br>"); + write_label_piece (itip, &datetime, buffer, 1024, U_("<b>Due:</b> "), "<br>", FALSE); gtk_html_write (html, html_stream, buffer, strlen (buffer)); wrote = TRUE; } @@ -652,7 +875,7 @@ write_error_html (EItipControl *itip, const gchar *itip_err) html_stream = gtk_html_begin (GTK_HTML (priv->html)); gtk_html_stream_printf (html_stream, "<html><head><title>%s</title></head>", - _("iCalendar Information")); + U_("iCalendar Information")); gtk_html_write (GTK_HTML (priv->html), html_stream, HTML_BODY_START, strlen(HTML_BODY_START)); @@ -667,7 +890,7 @@ write_error_html (EItipControl *itip, const gchar *itip_err) gtk_html_stream_printf (html_stream, "<td align=\"left\" valign=\"top\">"); /* Title */ - set_message (GTK_HTML (priv->html), html_stream, _("iCalendar Error"), TRUE); + set_message (GTK_HTML (priv->html), html_stream, U_("iCalendar Error"), TRUE); /* Error */ gtk_html_write (GTK_HTML (priv->html), html_stream, itip_err, strlen(itip_err)); @@ -702,7 +925,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, html_stream = gtk_html_begin (GTK_HTML (priv->html)); gtk_html_stream_printf (html_stream, "<html><head><title>%s</title></head>", - _("iCalendar Information")); + U_("iCalendar Information")); gtk_html_write (GTK_HTML (priv->html), html_stream, HTML_BODY_START, strlen(HTML_BODY_START)); @@ -733,7 +956,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, attendee->cn : itip_strip_mailto (attendee->value)); } else { - html = g_strdup_printf (itip_desc, _("An unknown person")); + html = g_strdup_printf (itip_desc, U_("An unknown person")); } break; case ICAL_METHOD_REQUEST: @@ -749,7 +972,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, priv->delegator_name : priv->delegator_address); else - html = g_strdup_printf (itip_desc, _("An unknown person"), + html = g_strdup_printf (itip_desc, U_("An unknown person"), priv->delegator_name ? priv->delegator_name : priv->delegator_address); @@ -760,7 +983,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, organizer.cn : itip_strip_mailto (organizer.value)); else - html = g_strdup_printf (itip_desc, _("An unknown person")); + html = g_strdup_printf (itip_desc, U_("An unknown person")); } break; @@ -777,14 +1000,14 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, organizer.cn : itip_strip_mailto (organizer.value)); else - html = g_strdup_printf (itip_desc, _("An unknown person")); + html = g_strdup_printf (itip_desc, U_("An unknown person")); break; } gtk_html_write (GTK_HTML (priv->html), html_stream, html, strlen(html)); g_free (html); /* Describe what the user can do */ - const_html = _("<br> Please review the following information, " + const_html = U_("<br> Please review the following information, " "and then select an action from the menu below."); gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html)); @@ -799,17 +1022,17 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, /* Summary */ cal_component_get_summary (priv->comp, &text); - html = text.value ? camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0) : _("<i>None</i>"); + html = e_text_to_html (text.value ? text.value : U_("<i>None</i>"), E_TEXT_TO_HTML_CONVERT_NL); gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>", - _("Summary:"), html); + U_("Summary:"), html); g_free (html); /* Location */ cal_component_get_location (priv->comp, &string); if (string != NULL) { - html = camel_text_to_html (string, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0); + html = e_text_to_html (string, E_TEXT_TO_HTML_CONVERT_NL); gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>", - _("Location:"), html); + U_("Location:"), html); g_free (html); } @@ -823,24 +1046,24 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, CalComponentAttendee *a = alist->data; gtk_html_stream_printf (html_stream, "<b>%s</b><br>", - _("Status:")); + U_("Status:")); switch (a->status) { case ICAL_PARTSTAT_ACCEPTED: gtk_html_stream_printf (html_stream, "%s<br><br>", - _("Accepted")); + U_("Accepted")); break; case ICAL_PARTSTAT_TENTATIVE: gtk_html_stream_printf (html_stream, "%s<br><br>", - _("Tentatively Accepted")); + U_("Tentatively Accepted")); break; case ICAL_PARTSTAT_DECLINED: gtk_html_stream_printf (html_stream, "%s<br><br>", - _("Declined")); + U_("Declined")); break; default: gtk_html_stream_printf (html_stream, "%s<br><br>", - _("Unknown")); + U_("Unknown")); } } @@ -853,9 +1076,9 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, text = *((CalComponentText *)l->data); if (l && text.value) { - html = camel_text_to_html (text.value, CAMEL_MIME_FILTER_TOHTML_CONVERT_NL, 0); + html = e_text_to_html (text.value, E_TEXT_TO_HTML_CONVERT_NL); gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s", - _("Description:"), html); + U_("Description:"), html); g_free (html); } cal_component_free_text_list (l); @@ -893,9 +1116,9 @@ get_publish_options (gboolean selector) "</select>    " "<input TYPE=Submit name=\"ok\" value=\"%s\">" "</form>", - _("Choose an action:"), - _("Update"), - _("OK")); + U_("Choose an action:"), + U_("Update"), + U_("OK")); if (selector) { char *sel; @@ -921,12 +1144,12 @@ get_request_options (gboolean selector) "<input TYPE=\"checkbox\" name=\"rsvp\" value=\"1\" checked>%s  " "<input TYPE=\"submit\" name=\"ok\" value=\"%s\"><br> " "</form>", - _("Choose an action:"), - _("Accept"), - _("Tentatively accept"), - _("Decline"), - _("RSVP"), - _("OK")); + U_("Choose an action:"), + U_("Accept"), + U_("Tentatively accept"), + U_("Decline"), + U_("RSVP"), + U_("OK")); if (selector) { char *sel; @@ -947,9 +1170,9 @@ get_request_fb_options () "<option VALUE=\"F\">%s</option></select>    " "<input TYPE=Submit name=\"ok\" value=\"%s\">" "</form>", - _("Choose an action:"), - _("Send Free/Busy Information"), - _("OK")); + U_("Choose an action:"), + U_("Send Free/Busy Information"), + U_("OK")); } static char* @@ -960,9 +1183,9 @@ get_reply_options () "<option VALUE=\"R\">%s</option></select>    " "<input TYPE=Submit name=\"ok\" value=\"%s\">" "</form>", - _("Choose an action:"), - _("Update respondent status"), - _("OK")); + U_("Choose an action:"), + U_("Update respondent status"), + U_("OK")); } static char* @@ -973,9 +1196,9 @@ get_refresh_options () "<option VALUE=\"S\">%s</option></select>    " "<input TYPE=Submit name=\"ok\" value=\"%s\">" "</form>", - _("Choose an action:"), - _("Send Latest Information"), - _("OK")); + U_("Choose an action:"), + U_("Send Latest Information"), + U_("OK")); } static char* @@ -986,9 +1209,9 @@ get_cancel_options () "<option VALUE=\"C\">%s</option></select>    " "<input TYPE=Submit name=\"ok\" value=\"%s\">" "</form>", - _("Choose an action:"), - _("Cancel"), - _("OK")); + U_("Choose an action:"), + U_("Cancel"), + U_("OK")); } @@ -1044,7 +1267,7 @@ adjust_item (EItipControl *itip, CalComponent *comp) cal_component_set_description_list (comp, l); cal_component_free_text_list (l); - g_object_unref (real_comp); + gtk_object_unref (GTK_OBJECT (real_comp)); } else { CalComponentText text = {_("Unknown"), NULL}; @@ -1068,50 +1291,50 @@ show_current_event (EItipControl *itip) switch (priv->method) { case ICAL_METHOD_PUBLISH: - itip_desc = _("<b>%s</b> has published meeting information."); - itip_title = _("Meeting Information"); + itip_desc = U_("<b>%s</b> has published meeting information."); + itip_title = U_("Meeting Information"); options = get_publish_options (priv->event_client ? FALSE : TRUE); break; case ICAL_METHOD_REQUEST: if (priv->delegator_address != NULL) - itip_desc = _("<b>%s</b> requests the presence of %s at a meeting."); + itip_desc = U_("<b>%s</b> requests the presence of %s at a meeting."); else - itip_desc = _("<b>%s</b> requests your presence at a meeting."); - itip_title = _("Meeting Proposal"); + itip_desc = U_("<b>%s</b> requests your presence at a meeting."); + itip_title = U_("Meeting Proposal"); options = get_request_options (priv->event_client ? FALSE : TRUE); break; case ICAL_METHOD_ADD: - itip_desc = _("<b>%s</b> wishes to add to an existing meeting."); - itip_title = _("Meeting Update"); + itip_desc = U_("<b>%s</b> wishes to add to an existing meeting."); + itip_title = U_("Meeting Update"); options = get_publish_options (priv->event_client ? FALSE : TRUE); break; case ICAL_METHOD_REFRESH: - itip_desc = _("<b>%s</b> wishes to receive the latest meeting information."); - itip_title = _("Meeting Update Request"); + itip_desc = U_("<b>%s</b> wishes to receive the latest meeting information."); + itip_title = U_("Meeting Update Request"); options = get_refresh_options (); /* Provide extra info, since its not in the component */ adjust_item (itip, priv->comp); break; case ICAL_METHOD_REPLY: - itip_desc = _("<b>%s</b> has replied to a meeting request."); - itip_title = _("Meeting Reply"); + itip_desc = U_("<b>%s</b> has replied to a meeting request."); + itip_title = U_("Meeting Reply"); options = get_reply_options (); /* Provide extra info, since might not be in the component */ adjust_item (itip, priv->comp); break; case ICAL_METHOD_CANCEL: - itip_desc = _("<b>%s</b> has cancelled a meeting."); - itip_title = _("Meeting Cancellation"); + itip_desc = U_("<b>%s</b> has cancelled a meeting."); + itip_title = U_("Meeting Cancellation"); options = get_cancel_options (); /* Provide extra info, since might not be in the component */ adjust_item (itip, priv->comp); break; default: - itip_desc = _("<b>%s</b> has sent an unintelligible message."); - itip_title = _("Bad Meeting Message"); + itip_desc = U_("<b>%s</b> has sent an unintelligible message."); + itip_title = U_("Bad Meeting Message"); options = NULL; } @@ -1135,50 +1358,50 @@ show_current_todo (EItipControl *itip) switch (priv->method) { case ICAL_METHOD_PUBLISH: - itip_desc = _("<b>%s</b> has published task information."); - itip_title = _("Task Information"); + itip_desc = U_("<b>%s</b> has published task information."); + itip_title = U_("Task Information"); options = get_publish_options (priv->task_client ? FALSE : TRUE); break; case ICAL_METHOD_REQUEST: if (priv->delegator_address != NULL) - itip_desc = _("<b>%s</b> requests %s to perform a task."); + itip_desc = U_("<b>%s</b> requests %s to perform a task."); else - itip_desc = _("<b>%s</b> requests you perform a task."); - itip_title = _("Task Proposal"); + itip_desc = U_("<b>%s</b> requests you perform a task."); + itip_title = U_("Task Proposal"); options = get_request_options (priv->task_client ? FALSE : TRUE); break; case ICAL_METHOD_ADD: - itip_desc = _("<b>%s</b> wishes to add to an existing task."); - itip_title = _("Task Update"); + itip_desc = U_("<b>%s</b> wishes to add to an existing task."); + itip_title = U_("Task Update"); options = get_publish_options (priv->task_client ? FALSE : TRUE); break; case ICAL_METHOD_REFRESH: - itip_desc = _("<b>%s</b> wishes to receive the latest task information."); - itip_title = _("Task Update Request"); + itip_desc = U_("<b>%s</b> wishes to receive the latest task information."); + itip_title = U_("Task Update Request"); options = get_refresh_options (); /* Provide extra info, since its not in the component */ adjust_item (itip, priv->comp); break; case ICAL_METHOD_REPLY: - itip_desc = _("<b>%s</b> has replied to a task assignment."); - itip_title = _("Task Reply"); + itip_desc = U_("<b>%s</b> has replied to a task assignment."); + itip_title = U_("Task Reply"); options = get_reply_options (); /* Provide extra info, since might not be in the component */ adjust_item (itip, priv->comp); break; case ICAL_METHOD_CANCEL: - itip_desc = _("<b>%s</b> has cancelled a task."); - itip_title = _("Task Cancellation"); + itip_desc = U_("<b>%s</b> has cancelled a task."); + itip_title = U_("Task Cancellation"); options = get_cancel_options (); /* Provide extra info, since might not be in the component */ adjust_item (itip, priv->comp); break; default: - itip_desc = _("<b>%s</b> has sent an unintelligible message."); - itip_title = _("Bad Task Message"); + itip_desc = U_("<b>%s</b> has sent an unintelligible message."); + itip_title = U_("Bad Task Message"); options = NULL; } @@ -1197,23 +1420,23 @@ show_current_freebusy (EItipControl *itip) switch (priv->method) { case ICAL_METHOD_PUBLISH: - itip_desc = _("<b>%s</b> has published free/busy information."); - itip_title = _("Free/Busy Information"); + itip_desc = U_("<b>%s</b> has published free/busy information."); + itip_title = U_("Free/Busy Information"); options = NULL; break; case ICAL_METHOD_REQUEST: - itip_desc = _("<b>%s</b> requests your free/busy information."); - itip_title = _("Free/Busy Request"); + itip_desc = U_("<b>%s</b> requests your free/busy information."); + itip_title = U_("Free/Busy Request"); options = get_request_fb_options (); break; case ICAL_METHOD_REPLY: - itip_desc = _("<b>%s</b> has replied to a free/busy request."); - itip_title = _("Free/Busy Reply"); + itip_desc = U_("<b>%s</b> has replied to a free/busy request."); + itip_title = U_("Free/Busy Reply"); options = NULL; break; default: - itip_desc = _("<b>%s</b> has sent an unintelligible message."); - itip_title = _("Bad Free/Busy Message"); + itip_desc = U_("<b>%s</b> has sent an unintelligible message."); + itip_title = U_("Bad Free/Busy Message"); options = NULL; } @@ -1251,12 +1474,12 @@ show_current (EItipControl *itip) priv = itip->priv; if (priv->comp) - g_object_unref (priv->comp); + gtk_object_unref (GTK_OBJECT (priv->comp)); if (priv->event_client != NULL) - g_object_unref (priv->event_client); + gtk_object_unref (GTK_OBJECT (priv->event_client)); priv->event_client = NULL; if (priv->task_client != NULL) - g_object_unref (priv->task_client); + gtk_object_unref (GTK_OBJECT (priv->task_client)); priv->task_client = NULL; /* Determine any delegate sections */ @@ -1287,8 +1510,8 @@ show_current (EItipControl *itip) priv->comp = cal_component_new (); if (!cal_component_set_icalcomponent (priv->comp, priv->ical_comp)) { - write_error_html (itip, _("The message does not appear to be properly formed")); - g_object_unref (priv->comp); + write_error_html (itip, U_("The message does not appear to be properly formed")); + gtk_object_unref (GTK_OBJECT (priv->comp)); priv->comp = NULL; return; }; @@ -1349,7 +1572,7 @@ show_current (EItipControl *itip) show_current_freebusy (itip); break; default: - write_error_html (itip, _("The message contains only unsupported requests.")); + write_error_html (itip, U_("The message contains only unsupported requests.")); } find_my_address (itip, priv->ical_comp); @@ -1377,13 +1600,13 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text) priv->main_comp = icalparser_parse_string (priv->vcalendar); if (priv->main_comp == NULL) { - write_error_html (itip, _("The attachment does not contain a valid calendar message")); + write_error_html (itip, U_("The attachment does not contain a valid calendar message")); return; } prop = icalcomponent_get_first_property (priv->main_comp, ICAL_METHOD_PROPERTY); if (prop == NULL) { - write_error_html (itip, _("The attachment does not contain a valid calendar message")); + write_error_html (itip, U_("The attachment does not contain a valid calendar message")); return; } @@ -1408,7 +1631,7 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text) priv->ical_comp = get_next (&priv->iter); if (priv->ical_comp == NULL) { - write_error_html (itip, _("The attachment has no viewable calendar items")); + write_error_html (itip, U_("The attachment has no viewable calendar items")); return; } @@ -1625,6 +1848,7 @@ update_item (EItipControl *itip) clone = icalcomponent_new_clone (priv->ical_comp); icalcomponent_add_component (priv->top_level, clone); + icalcomponent_set_method (priv->top_level, priv->method); result = cal_client_update_objects (client, priv->top_level); switch (result) { @@ -1745,7 +1969,7 @@ update_attendee_status (EItipControl *itip) cleanup: if (comp != NULL) - g_object_unref (comp); + gtk_object_unref (GTK_OBJECT (comp)); gnome_dialog_run_and_close (GNOME_DIALOG (dialog)); } @@ -1800,7 +2024,7 @@ send_item (EItipControl *itip) default: itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp, NULL, NULL); } - g_object_unref (comp); + gtk_object_unref (GTK_OBJECT (comp)); dialog = gnome_ok_dialog (_("Item sent!\n")); } else { dialog = gnome_warning_dialog (_("The item could not be sent!\n")); @@ -1849,7 +2073,7 @@ send_freebusy (EItipControl *itip) CalComponent *comp = CAL_COMPONENT (l->data); itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp, priv->event_client, NULL); - g_object_unref (comp); + gtk_object_unref (GTK_OBJECT (comp)); } dialog = gnome_ok_dialog (_("Item sent!\n")); @@ -1876,7 +2100,7 @@ button_selected_cb (EvolutionFolderSelectorButton *button, GNOME_Evolution_Folde else uri = cal_util_expand_uri (folder->physicalUri, FALSE); - g_object_unref (priv->event_client); + gtk_object_unref (GTK_OBJECT (priv->event_client)); priv->event_client = start_calendar_server (uri); g_free (uri); @@ -1944,7 +2168,8 @@ object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data) button = NULL; } - g_signal_connect (button, "selected", G_CALLBACK (button_selected_cb), itip); + gtk_signal_connect (GTK_OBJECT (button), "selected", + button_selected_cb, itip); gtk_container_add (GTK_CONTAINER (eb), button); gtk_widget_show (button); @@ -2011,7 +2236,7 @@ ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar send_item (itip); break; case 'C': - remove_item (itip); + update_item (itip); break; } } @@ -2084,6 +2309,6 @@ ok_clicked_cb (GtkHTML *html, const gchar *method, const gchar *url, const gchar default: itip_send_comp (CAL_COMPONENT_METHOD_REPLY, comp, NULL, NULL); } - g_object_unref (comp); + gtk_object_unref (GTK_OBJECT (comp)); } } |