aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/itip-formatter/itip-view.c
diff options
context:
space:
mode:
Diffstat (limited to 'plugins/itip-formatter/itip-view.c')
-rw-r--r--plugins/itip-formatter/itip-view.c126
1 files changed, 67 insertions, 59 deletions
diff --git a/plugins/itip-formatter/itip-view.c b/plugins/itip-formatter/itip-view.c
index f4368dde3f..6ade3cabe3 100644
--- a/plugins/itip-formatter/itip-view.c
+++ b/plugins/itip-formatter/itip-view.c
@@ -27,10 +27,6 @@
#include <string.h>
#include <glib/gi18n.h>
#include <gconf/gconf-client.h>
-#include <camel/camel-stream.h>
-#include <camel/camel-stream-mem.h>
-#include <camel/camel-medium.h>
-#include <camel/camel-mime-message.h>
#include <libedataserver/e-time-utils.h>
#include <libedataserver/e-data-server-util.h>
#include <libedataserverui/e-source-combo-box.h>
@@ -337,6 +333,22 @@ format_date_and_time_x (struct tm *date_tm,
buffer[0] = '\0';
}
+static gchar *
+dupe_first_bold (const gchar *format, const gchar *first, const gchar *second)
+{
+ gchar *f, *s, *res;
+
+ f = g_markup_printf_escaped ("<b>%s</b>", first ? first : "");
+ s = g_markup_escape_text (second ? second : "", -1);
+
+ res = g_strdup_printf (format, f, s);
+
+ g_free (f);
+ g_free (s);
+
+ return res;
+}
+
static void
set_calendar_sender_text (ItipView *view)
{
@@ -352,64 +364,64 @@ set_calendar_sender_text (ItipView *view)
/* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */
if (priv->organizer && priv->proxy)
- on_behalf_of = g_markup_printf_escaped (_("Please respond on behalf of <b>%s</b>"), priv->proxy);
+ on_behalf_of = dupe_first_bold (_("Please respond on behalf of %s"), priv->proxy, NULL);
else if (priv->attendee && priv->proxy)
- on_behalf_of = g_markup_printf_escaped (_("Received on behalf of <b>%s</b>"), priv->proxy);
+ on_behalf_of = dupe_first_bold (_("Received on behalf of %s"), priv->proxy, NULL);
switch (priv->mode) {
case ITIP_VIEW_MODE_PUBLISH:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has published the following meeting information:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has published the following meeting information:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has published the following meeting information:"), organizer);
+ sender = dupe_first_bold (_("%s has published the following meeting information:"), organizer, NULL);
break;
case ITIP_VIEW_MODE_REQUEST:
/* FIXME is the delegator stuff handled correctly here? */
if (priv->delegator) {
- sender = g_markup_printf_escaped (_("<b>%s</b> has delegated the following meeting to you:"), priv->delegator);
+ sender = dupe_first_bold (_("%s has delegated the following meeting to you:"), priv->delegator, NULL);
} else {
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s requests your presence at the following meeting:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s requests your presence at the following meeting:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> requests your presence at the following meeting:"), organizer);
+ sender = dupe_first_bold (_("%s requests your presence at the following meeting:"), organizer, NULL);
}
break;
case ITIP_VIEW_MODE_ADD:
/* FIXME What text for this? */
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s wishes to add to an existing meeting:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s wishes to add to an existing meeting:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> wishes to add to an existing meeting:"), organizer);
+ sender = dupe_first_bold (_("%s wishes to add to an existing meeting:"), organizer, NULL);
break;
case ITIP_VIEW_MODE_REFRESH:
if (priv->attendee_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s wishes to receive the latest information for the following meeting:"), attendee, priv->attendee_sentby);
+ sender = dupe_first_bold (_("%s through %s wishes to receive the latest information for the following meeting:"), attendee, priv->attendee_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> wishes to receive the latest information for the following meeting:"), attendee);
+ sender = dupe_first_bold (_("%s wishes to receive the latest information for the following meeting:"), attendee, NULL);
break;
case ITIP_VIEW_MODE_REPLY:
if (priv->attendee_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has sent back the following meeting response:"), attendee, priv->attendee_sentby);
+ sender = dupe_first_bold (_("%s through %s has sent back the following meeting response:"), attendee, priv->attendee_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has sent back the following meeting response:"), attendee);
+ sender = dupe_first_bold (_("%s has sent back the following meeting response:"), attendee, NULL);
break;
case ITIP_VIEW_MODE_CANCEL:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has canceled the following meeting:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has canceled the following meeting:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has canceled the following meeting."), organizer);
+ sender = dupe_first_bold (_("%s has canceled the following meeting."), organizer, NULL);
break;
case ITIP_VIEW_MODE_COUNTER:
if (priv->attendee_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has proposed the following meeting changes."), attendee, priv->attendee_sentby);
+ sender = dupe_first_bold (_("%s through %s has proposed the following meeting changes."), attendee, priv->attendee_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has proposed the following meeting changes."), attendee);
+ sender = dupe_first_bold (_("%s has proposed the following meeting changes."), attendee, NULL);
break;
case ITIP_VIEW_MODE_DECLINECOUNTER:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has declined the following meeting changes:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has declined the following meeting changes:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has declined the following meeting changes."), organizer);
+ sender = dupe_first_bold (_("%s has declined the following meeting changes."), organizer, NULL);
break;
default:
break;
@@ -440,64 +452,64 @@ set_tasklist_sender_text (ItipView *view)
/* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */
if (priv->organizer && priv->proxy)
- on_behalf_of = g_markup_printf_escaped (_("Please respond on behalf of <b>%s</b>"), priv->proxy);
+ on_behalf_of = dupe_first_bold (_("Please respond on behalf of %s"), priv->proxy, NULL);
else if (priv->attendee && priv->proxy)
- on_behalf_of = g_markup_printf_escaped (_("Received on behalf of <b>%s</b>"), priv->proxy);
+ on_behalf_of = dupe_first_bold (_("Received on behalf of %s"), priv->proxy, NULL);
switch (priv->mode) {
case ITIP_VIEW_MODE_PUBLISH:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has published the following task:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has published the following task:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has published the following task:"), organizer);
+ sender = dupe_first_bold (_("%s has published the following task:"), organizer, NULL);
break;
case ITIP_VIEW_MODE_REQUEST:
/* FIXME is the delegator stuff handled correctly here? */
if (priv->delegator) {
- sender = g_markup_printf_escaped (_("<b>%s</b> requests the assignment of %s to the following task:"), organizer, priv->delegator);
+ sender = dupe_first_bold (_("%s requests the assignment of %s to the following task:"), organizer, priv->delegator);
} else {
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has assigned you a task:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has assigned you a task:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has assigned you a task:"), organizer);
+ sender = dupe_first_bold (_("%s has assigned you a task:"), organizer, NULL);
}
break;
case ITIP_VIEW_MODE_ADD:
/* FIXME What text for this? */
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s wishes to add to an existing task:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s wishes to add to an existing task:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> wishes to add to an existing task:"), organizer);
+ sender = dupe_first_bold (_("%s wishes to add to an existing task:"), organizer, NULL);
break;
case ITIP_VIEW_MODE_REFRESH:
if (priv->attendee_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s wishes to receive the latest information for the following assigned task:"), attendee, priv->attendee_sentby);
+ sender = dupe_first_bold (_("%s through %s wishes to receive the latest information for the following assigned task:"), attendee, priv->attendee_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> wishes to receive the latest information for the following assigned task:"), attendee);
+ sender = dupe_first_bold (_("%s wishes to receive the latest information for the following assigned task:"), attendee, NULL);
break;
case ITIP_VIEW_MODE_REPLY:
if (priv->attendee_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has sent back the following assigned task response:"), attendee, priv->attendee_sentby);
+ sender = dupe_first_bold (_("%s through %s has sent back the following assigned task response:"), attendee, priv->attendee_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has sent back the following assigned task response:"), attendee);
+ sender = dupe_first_bold (_("%s has sent back the following assigned task response:"), attendee, NULL);
break;
case ITIP_VIEW_MODE_CANCEL:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has canceled the following assigned task:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has canceled the following assigned task:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has canceled the following assigned task:"), organizer);
+ sender = dupe_first_bold (_("%s has canceled the following assigned task:"), organizer, NULL);
break;
case ITIP_VIEW_MODE_COUNTER:
if (priv->attendee_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has proposed the following task assignment changes:"), attendee, priv->attendee_sentby);
+ sender = dupe_first_bold (_("%s through %s has proposed the following task assignment changes:"), attendee, priv->attendee_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has proposed the following task assignment changes:"), attendee);
+ sender = dupe_first_bold (_("%s has proposed the following task assignment changes:"), attendee, NULL);
break;
case ITIP_VIEW_MODE_DECLINECOUNTER:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has declined the following assigned task:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has declined the following assigned task:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has declined the following assigned task:"), organizer);
+ sender = dupe_first_bold (_("%s has declined the following assigned task:"), organizer, NULL);
break;
default:
break;
@@ -527,29 +539,29 @@ set_journal_sender_text (ItipView *view)
/* The current account ID (i.e. the delegatee) is receiving a copy of the request/response. Here we ask the delegatee to respond/accept on behalf of the delegator. */
if (priv->organizer && priv->proxy)
- on_behalf_of = g_markup_printf_escaped (_("Please respond on behalf of <b>%s</b>"), priv->proxy);
+ on_behalf_of = dupe_first_bold (_("Please respond on behalf of %s"), priv->proxy, NULL);
else if (priv->attendee && priv->proxy)
- on_behalf_of = g_markup_printf_escaped (_("Received on behalf of <b>%s</b>"), priv->proxy);
+ on_behalf_of = dupe_first_bold (_("Received on behalf of %s"), priv->proxy, NULL);
switch (priv->mode) {
case ITIP_VIEW_MODE_PUBLISH:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has published the following memo:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has published the following memo:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has published the following memo:"), organizer);
+ sender = dupe_first_bold (_("%s has published the following memo:"), organizer, NULL);
break;
case ITIP_VIEW_MODE_ADD:
/* FIXME What text for this? */
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s wishes to add to an existing memo:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s wishes to add to an existing memo:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> wishes to add to an existing memo:"), organizer);
+ sender = dupe_first_bold (_("%s wishes to add to an existing memo:"), organizer, NULL);
break;
case ITIP_VIEW_MODE_CANCEL:
if (priv->organizer_sentby)
- sender = g_markup_printf_escaped (_("<b>%s</b> through %s has canceled the following shared memo:"), organizer, priv->organizer_sentby);
+ sender = dupe_first_bold (_("%s through %s has canceled the following shared memo:"), organizer, priv->organizer_sentby);
else
- sender = g_markup_printf_escaped (_("<b>%s</b> has canceled the following shared memo:"), organizer);
+ sender = dupe_first_bold (_("%s has canceled the following shared memo:"), organizer, NULL);
break;
default:
break;
@@ -835,19 +847,19 @@ set_buttons (ItipView *view)
/* FIXME Is this really the right button? */
if (priv->needs_decline)
set_one_button (view, _("_Decline"), GTK_STOCK_CANCEL, ITIP_VIEW_RESPONSE_DECLINE);
- set_one_button (view, _("_Accept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
+ set_one_button (view, _("A_ccept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
break;
case ITIP_VIEW_MODE_REQUEST:
set_one_button (view, is_recur_set ? _("_Decline all") : _("_Decline"), GTK_STOCK_CANCEL, ITIP_VIEW_RESPONSE_DECLINE);
set_one_button (view, is_recur_set ? _("_Tentative all") : _("_Tentative"), GTK_STOCK_DIALOG_QUESTION, ITIP_VIEW_RESPONSE_TENTATIVE);
- set_one_button (view, is_recur_set ? _("_Accept all") : _("_Accept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
+ set_one_button (view, is_recur_set ? _("A_ccept all") : _("A_ccept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
break;
case ITIP_VIEW_MODE_ADD:
if (priv->type != E_CAL_SOURCE_TYPE_JOURNAL) {
set_one_button (view, _("_Decline"), GTK_STOCK_CANCEL, ITIP_VIEW_RESPONSE_DECLINE);
set_one_button (view, _("_Tentative"), GTK_STOCK_DIALOG_QUESTION, ITIP_VIEW_RESPONSE_TENTATIVE);
}
- set_one_button (view, _("_Accept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
+ set_one_button (view, _("A_ccept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
break;
case ITIP_VIEW_MODE_REFRESH:
/* FIXME Is this really the right button? */
@@ -863,12 +875,12 @@ set_buttons (ItipView *view)
case ITIP_VIEW_MODE_COUNTER:
set_one_button (view, _("_Decline"), GTK_STOCK_CANCEL, ITIP_VIEW_RESPONSE_DECLINE);
set_one_button (view, _("_Tentative"), GTK_STOCK_DIALOG_QUESTION, ITIP_VIEW_RESPONSE_TENTATIVE);
- set_one_button (view, _("_Accept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
+ set_one_button (view, _("A_ccept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
break;
case ITIP_VIEW_MODE_DECLINECOUNTER:
set_one_button (view, _("_Decline"), GTK_STOCK_CANCEL, ITIP_VIEW_RESPONSE_DECLINE);
set_one_button (view, _("_Tentative"), GTK_STOCK_DIALOG_QUESTION, ITIP_VIEW_RESPONSE_TENTATIVE);
- set_one_button (view, _("_Accept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
+ set_one_button (view, _("A_ccept"), GTK_STOCK_APPLY, ITIP_VIEW_RESPONSE_ACCEPT);
break;
default:
break;
@@ -970,11 +982,7 @@ alarm_check_toggled_cb (GtkWidget *check1, GtkWidget *check2)
g_return_if_fail (check1 != NULL);
g_return_if_fail (check2 != NULL);
-#if GTK_CHECK_VERSION(2,19,7)
gtk_widget_set_sensitive (check2, !(gtk_widget_get_visible (check1) && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check1))));
-#else
- gtk_widget_set_sensitive (check2, !(GTK_WIDGET_VISIBLE (check1) && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check1))));
-#endif
}
static void