aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/pcs/cal.c
diff options
context:
space:
mode:
authorRodrigo Moya <rodrigo@ximian.com>2002-10-07 17:20:44 +0800
committerRodrigo Moya <rodrigo@src.gnome.org>2002-10-07 17:20:44 +0800
commitc098c90ebb80d4072ac1ebabc26204fd0067a4b1 (patch)
tree62d86773b852cd4d9d0ebeb49df3c80ad0226ca2 /calendar/pcs/cal.c
parentfa5928750cff1b72d67102cd8a64e557b87479bf (diff)
downloadgsoc2013-evolution-c098c90ebb80d4072ac1ebabc26204fd0067a4b1.tar
gsoc2013-evolution-c098c90ebb80d4072ac1ebabc26204fd0067a4b1.tar.gz
gsoc2013-evolution-c098c90ebb80d4072ac1ebabc26204fd0067a4b1.tar.bz2
gsoc2013-evolution-c098c90ebb80d4072ac1ebabc26204fd0067a4b1.tar.lz
gsoc2013-evolution-c098c90ebb80d4072ac1ebabc26204fd0067a4b1.tar.xz
gsoc2013-evolution-c098c90ebb80d4072ac1ebabc26204fd0067a4b1.tar.zst
gsoc2013-evolution-c098c90ebb80d4072ac1ebabc26204fd0067a4b1.zip
Fixes #15892
2002-10-04 Rodrigo Moya <rodrigo@ximian.com> Fixes #15892 * idl/evolution-calendar.idl: added notifyErrorOccurred method to the Listener interface, so that backends can notify clients of errors that can't be reported otherwise. * pcs/cal.[ch] (cal_notify_error): new function. * pcs/cal-backend-file.c (save): made to save to temporary file and then moved to the correct file, so that we don't lose any data if there's a problem while saving. (notify_error): new function for notifying error messages to clients. * cal-client/cal-listener.[ch]: added new callback function for getting error messages from backends. (impl_notifyErrorOccurred): new method implementation. (cal_listener_class_init): initialize new epv member. (cal_listener_init, cal_listener_destroy, cal_listener_construct, cal_listener_new): initialize new function pointer. * cal-client/cal-client.[ch]: adapted to changes in CalListener class. (cal_client_class_init): added "backend_error" signal to CalClient class. (backend_error_cb): callback for "error_occurred" signal on the CalListener, which just emits the "backend_error" signal of CalClient. * gui/gnome-cal.c (gnome_calendar_construct): connect to "backend_error" signal on the CalClient's we create. (backend_error_cb): display error message on error from backend. * gui/e-tasks.c: likewise. svn path=/trunk/; revision=18329
Diffstat (limited to 'calendar/pcs/cal.c')
-rw-r--r--calendar/pcs/cal.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/calendar/pcs/cal.c b/calendar/pcs/cal.c
index 60fcdc59ad..861cc47c89 100644
--- a/calendar/pcs/cal.c
+++ b/calendar/pcs/cal.c
@@ -874,6 +874,36 @@ cal_notify_remove (Cal *cal, const char *uid)
}
/**
+ * cal_notify_error
+ * @cal: A calendar client interface.
+ * @message: Error message.
+ *
+ * Notify a calendar client of an error occurred in the backend.
+ */
+void
+cal_notify_error (Cal *cal, const char *message)
+{
+ CalPrivate *priv;
+ CORBA_Environment ev;
+
+ g_return_if_fail (cal != NULL);
+ g_return_if_fail (IS_CAL (cal));
+ g_return_if_fail (message != NULL);
+
+ priv = cal->priv;
+ g_return_if_fail (priv->listener != CORBA_OBJECT_NIL);
+
+ CORBA_exception_init (&ev);
+ GNOME_Evolution_Calendar_Listener_notifyErrorOccurred (priv->listener, (char *) message, &ev);
+
+ if (BONOBO_EX (&ev))
+ g_message ("cal_notify_remove(): could not notify the listener "
+ "about a removed object");
+
+ CORBA_exception_free (&ev);
+}
+
+/**
* cal_notify_categories_changed:
* @cal: A calendar client interface.
* @categories: List of categories.