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/cal-client/cal-client.c | 13 ++++++++----- calendar/cal-client/cal-client.h | 3 ++- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'calendar/cal-client') diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c index b46dc3a215..6d9deacde8 100644 --- a/calendar/cal-client/cal-client.c +++ b/calendar/cal-client/cal-client.c @@ -2446,7 +2446,8 @@ cal_client_remove_object (CalClient *client, const char *uid) CalClientResult cal_client_send_object (CalClient *client, icalcomponent *icalcomp, - icalcomponent **new_icalcomp, GList **users) + icalcomponent **new_icalcomp, GList **users, + char error_msg[256]) { CalClientPrivate *priv; CORBA_Environment ev; @@ -2470,13 +2471,15 @@ cal_client_send_object (CalClient *client, icalcomponent *icalcomp, CORBA_exception_init (&ev); obj_string = GNOME_Evolution_Calendar_Cal_sendObject (priv->cal, obj_string, &user_list, &ev); - if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_Cal_InvalidObject)) + if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_Cal_InvalidObject)) { retval = CAL_CLIENT_SEND_INVALID_OBJECT; - else if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_Cal_Busy)) + } else if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_Cal_Busy)) { retval = CAL_CLIENT_SEND_BUSY; - else if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_Cal_PermissionDenied)) + strcpy (error_msg, + ((GNOME_Evolution_Calendar_Cal_Busy *)(CORBA_exception_value (&ev)))->errorMsg); + } else if (BONOBO_USER_EX (&ev, ex_GNOME_Evolution_Calendar_Cal_PermissionDenied)) { retval = CAL_CLIENT_SEND_PERMISSION_DENIED; - else if (BONOBO_EX (&ev)) { + } else if (BONOBO_EX (&ev)) { g_message ("cal_client_update_objects(): could not send the objects"); retval = CAL_CLIENT_SEND_CORBA_ERROR; } else { diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h index de5e19ffdf..ef42cdccd6 100644 --- a/calendar/cal-client/cal-client.h +++ b/calendar/cal-client/cal-client.h @@ -186,7 +186,8 @@ CalClientResult cal_client_update_objects (CalClient *client, icalcomponent *ica CalClientResult cal_client_remove_object (CalClient *client, const char *uid); CalClientSendResult cal_client_send_object (CalClient *client, icalcomponent *icalcomp, - icalcomponent **new_icalcomp, GList **users); + icalcomponent **new_icalcomp, GList **users, + char error_msg[256]); CalQuery *cal_client_get_query (CalClient *client, const char *sexp); -- cgit v1.2.3