aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/itip-formatter/itip-formatter.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@novell.com>2005-01-08 06:17:49 +0800
committerJP Rosevear <jpr@src.gnome.org>2005-01-08 06:17:49 +0800
commita4e1cd2c0d5c28812be48fa8394d36c9c7003ced (patch)
tree4c5404832b4ac8e6214b52ce2f29ec81c5822cde /plugins/itip-formatter/itip-formatter.c
parentb12dec1c48fba6202e9e854f23f1975f8329c0ec (diff)
downloadgsoc2013-evolution-a4e1cd2c0d5c28812be48fa8394d36c9c7003ced.tar.gz
gsoc2013-evolution-a4e1cd2c0d5c28812be48fa8394d36c9c7003ced.tar.zst
gsoc2013-evolution-a4e1cd2c0d5c28812be48fa8394d36c9c7003ced.zip
new protos
2005-01-07 JP Rosevear <jpr@novell.com> * itip-view.h: new protos * itip-view.c (set_tasklist_sender_text): task sender messages (set_calendar_sender_text): calendar sender messages (set_sender_text): select above as appropriate (itip_view_set_item_type): accessor (itip_view_get_item_type): ditto * itip-formatter.c (find_cal_opened_cb): messages for meetings/tasks/journals (send_item): ditto (format_itip_object): ditto (itip_formatter_page_factory): change page title svn path=/trunk/; revision=28280
Diffstat (limited to 'plugins/itip-formatter/itip-formatter.c')
-rw-r--r--plugins/itip-formatter/itip-formatter.c71
1 files changed, 64 insertions, 7 deletions
diff --git a/plugins/itip-formatter/itip-formatter.c b/plugins/itip-formatter/itip-formatter.c
index 03c9b9689a..96c2f9ce00 100644
--- a/plugins/itip-formatter/itip-formatter.c
+++ b/plugins/itip-formatter/itip-formatter.c
@@ -382,7 +382,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
/* If the query fails, we'll just ignore it */
/* FIXME Limit the calendars checked for conflicts? */
/* FIXME What happens for recurring conflicts? */
- if (e_cal_get_object_list (ecal, fd->sexp, &objects, NULL) && g_list_length (objects) > 0) {
+ if (pitip->type == E_CAL_SOURCE_TYPE_EVENT && e_cal_get_object_list (ecal, fd->sexp, &objects, NULL) && g_list_length (objects) > 0) {
itip_view_add_upper_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING,
"An appointment in the calendar '%s' conflicts with this meeting", e_source_peek_name (source));
@@ -465,8 +465,23 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data)
itip_view_set_buttons_sensitive (ITIP_VIEW (pitip->view), FALSE);
}
} else if (!pitip->current_ecal) {
- itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING,
- "Unable to find this meeting in any calendar");
+ switch (pitip->type) {
+ case E_CAL_SOURCE_TYPE_EVENT:
+ itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING,
+ "Unable to find this meeting in any calendar");
+ break;
+ case E_CAL_SOURCE_TYPE_TODO:
+ itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING,
+ "Unable to find this task in any task list");
+ break;
+ case E_CAL_SOURCE_TYPE_JOURNAL:
+ itip_view_add_lower_info_item_printf (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_WARNING,
+ "Unable to find this journal entry in any journal");
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
}
g_free (fd->uid);
@@ -763,9 +778,35 @@ send_item (FormatItipPObject *pitip)
itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, pitip->current_ecal, NULL);
g_object_unref (comp);
- itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "Meeting information sent");
+ switch (pitip->type) {
+ case E_CAL_SOURCE_TYPE_EVENT:
+ itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "Meeting information sent");
+ break;
+ case E_CAL_SOURCE_TYPE_TODO:
+ itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "Task information sent");
+ break;
+ case E_CAL_SOURCE_TYPE_JOURNAL:
+ itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "Journal entry information sent");
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
} else {
- itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, "Unable to send meeting information, the meeting does not exist");
+ switch (pitip->type) {
+ case E_CAL_SOURCE_TYPE_EVENT:
+ itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, "Unable to send meeting information, the meeting does not exist");
+ break;
+ case E_CAL_SOURCE_TYPE_TODO:
+ itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, "Unable to send task information, the task does not exist");
+ break;
+ case E_CAL_SOURCE_TYPE_JOURNAL:
+ itip_view_add_lower_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_ERROR, "Unable to send journal entry information, the journal entry does not exist");
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
}
}
@@ -1060,6 +1101,8 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject
itip_view_set_mode (ITIP_VIEW (pitip->view), ITIP_VIEW_MODE_ERROR);
}
+ itip_view_set_item_type (ITIP_VIEW (pitip->view), pitip->type);
+
switch (pitip->method) {
case ICAL_METHOD_PUBLISH:
case ICAL_METHOD_REQUEST:
@@ -1202,7 +1245,21 @@ format_itip_object (EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject
/* Recurrence info */
/* FIXME Better recurring description */
if (e_cal_component_has_recurrences (pitip->comp)) {
- itip_view_add_upper_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "This meeting recurs");
+ /* FIXME Tell the user we don't support recurring tasks */
+ switch (pitip->type) {
+ case E_CAL_SOURCE_TYPE_EVENT:
+ itip_view_add_upper_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "This meeting recurs");
+ break;
+ case E_CAL_SOURCE_TYPE_TODO:
+ itip_view_add_upper_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "This task recurs");
+ break;
+ case E_CAL_SOURCE_TYPE_JOURNAL:
+ itip_view_add_upper_info_item (ITIP_VIEW (pitip->view), ITIP_VIEW_INFO_ITEM_TYPE_INFO, "This journal recurs");
+ break;
+ default:
+ g_assert_not_reached ();
+ break;
+ }
}
gtk_container_add (GTK_CONTAINER (eb), pitip->view);
@@ -1298,7 +1355,7 @@ itip_formatter_page_factory (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
/* Create a new notebook page */
page = gtk_vbox_new (FALSE, 0);
GTK_CONTAINER (page)->border_width = 12;
- tab_label = gtk_label_new (_("Meetings"));
+ tab_label = gtk_label_new (_("Meetings and Tasks"));
gtk_notebook_append_page (GTK_NOTEBOOK (hook_data->parent), page, tab_label);
/* Frame */