From f768bddb9325e7784477bcbcef0bce2a466a635a Mon Sep 17 00:00:00 2001 From: JP Rosevear Date: Wed, 4 Sep 2002 16:19:21 +0000 Subject: provide error message param, give a dialog with the message if we get a 2002-09-04 JP Rosevear * gui/itip-utils.c (comp_server_send): provide error message param, give a dialog with the message if we get a busy result; return TRUE if we succeed (itip_send_comp): bail out if we had a problem sending via the server * cal-client/cal-client.c (cal_client_send_object): pass back error message if we get the busy exception in the new param * cal-client/cal-client.h: update proto * pcs/cal.c (impl_Cal_send_object): dump backend error message into Busy exception * pcs/cal-backend.h: update proto * pcs/cal-backend.c (cal_backend_send_object): take/pass new error message parameter * pcs/cal-backend-file.c (cal_backend_file_send_object): take new param * idl/evolution-calendar.idl: add errorMsg to Busy exception svn path=/trunk/; revision=17964 --- calendar/gui/itip-utils.c | 23 ++++++++++++++++------- 1 file changed, 16 insertions(+), 7 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index c6af6989ba..544c9f5e25 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -521,15 +521,17 @@ comp_content_type (CalComponent *comp, CalComponentItipMethod method) } -static GList * -comp_server_send (CalComponentItipMethod method, CalComponent *comp, CalClient *client, icalcomponent *zones) +static gboolean +comp_server_send (CalComponentItipMethod method, CalComponent *comp, CalClient *client, + icalcomponent *zones, GList **users) { - CalClientResult result; + CalClientSendResult result; icalcomponent *top_level, *new_top_level = NULL; - GList *users = NULL; + char error_msg[256]; + gboolean retval = FALSE; top_level = comp_toplevel_with_zones (method, comp, client, zones); - result = cal_client_send_object (client, top_level, &new_top_level, &users); + result = cal_client_send_object (client, top_level, &new_top_level, users, error_msg); if (result == CAL_CLIENT_SEND_SUCCESS) { icalcomponent *ical_comp; @@ -538,11 +540,17 @@ comp_server_send (CalComponentItipMethod method, CalComponent *comp, CalClient * icalcomponent_remove_component (new_top_level, ical_comp); cal_component_set_icalcomponent (comp, ical_comp); icalcomponent_free (new_top_level); + + retval = TRUE; + } else if (result == CAL_CLIENT_SEND_BUSY) { + e_notice (NULL, GNOME_MESSAGE_BOX_ERROR, error_msg); + + retval = FALSE; } icalcomponent_free (top_level); - return users; + return retval; } static gboolean @@ -800,7 +808,8 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp, composer_server = BONOBO_OBJREF (bonobo_server); /* Give the server a chance to manipulate the comp */ - users = comp_server_send (method, send_comp, client, zones); + if (!comp_server_send (method, send_comp, client, zones, &users)) + goto cleanup; /* Tidy up the comp */ comp = comp_compliant (method, send_comp); -- cgit