diff options
-rw-r--r-- | calendar/ChangeLog | 19 | ||||
-rw-r--r-- | calendar/cal-client/cal-client.c | 4 | ||||
-rw-r--r-- | calendar/cal-client/cal-client.h | 1 | ||||
-rw-r--r-- | calendar/gui/e-tasks.c | 15 | ||||
-rw-r--r-- | calendar/gui/gnome-cal.c | 15 | ||||
-rw-r--r-- | calendar/idl/evolution-calendar.idl | 3 | ||||
-rw-r--r-- | calendar/pcs/cal-factory.c | 16 |
7 files changed, 72 insertions, 1 deletions
diff --git a/calendar/ChangeLog b/calendar/ChangeLog index a575a07eef..2a454061db 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,5 +1,24 @@ 2002-05-16 Rodrigo Moya <rodrigo@ximian.com> + * gui/gnome-cal.c (client_cal_opened_cb): added support for + CAL_CLIENT_OPEN_PERMISSION_DENIED error code. + (permission_error): new function to display 'Permission Denied' + error message when opening the calendar. + + * gui/e-tasks.c: likewise. + + * idl/evolution-calendar.idl: added PERMISSION_DENIED to Listener's + OpenStatus enumeration. + + * cal-client/cal-client.c (cal_opened_cb): added code for retrieving + 'Permission Denied' errors, and convert it to CalClientOpenStatus + values. + + * pcs/cal-factory.c (open_backend): added code for informing of + 'Permission Denied' errors. + +2002-05-16 Rodrigo Moya <rodrigo@ximian.com> + * idl/evolution-calendar.idl: added PermissionDenied exception and make it be raised in open, updateObjects and removeObject. diff --git a/calendar/cal-client/cal-client.c b/calendar/cal-client/cal-client.c index 612da541f5..17f1d2a4fb 100644 --- a/calendar/cal-client/cal-client.c +++ b/calendar/cal-client/cal-client.c @@ -408,6 +408,10 @@ cal_opened_cb (CalListener *listener, client_status = CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED; goto error; + case GNOME_Evolution_Calendar_Listener_PERMISSION_DENIED : + client_status = CAL_CLIENT_OPEN_PERMISSION_DENIED; + goto error; + default: g_assert_not_reached (); } diff --git a/calendar/cal-client/cal-client.h b/calendar/cal-client/cal-client.h index 4a977e5a56..578edd4ee9 100644 --- a/calendar/cal-client/cal-client.h +++ b/calendar/cal-client/cal-client.h @@ -47,6 +47,7 @@ typedef enum { CAL_CLIENT_OPEN_SUCCESS, CAL_CLIENT_OPEN_ERROR, CAL_CLIENT_OPEN_NOT_FOUND, + CAL_CLIENT_OPEN_PERMISSION_DENIED, CAL_CLIENT_OPEN_METHOD_NOT_SUPPORTED } CalClientOpenStatus; diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index 23bd46f34f..db00d2f8f3 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -406,6 +406,17 @@ method_error (ETasks *tasks, g_free (msg); } +/* Displays an error to indicate permission problems */ +static void +permission_error (ETasks *tasks, const char *uri) +{ + char *msg; + + msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), uri); + gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks)))); + g_free (msg); +} + /* Callback from the calendar client when a calendar is opened */ static void cal_opened_cb (CalClient *client, @@ -446,6 +457,10 @@ cal_opened_cb (CalClient *client, method_error (tasks, cal_client_get_uri (client)); break; + case CAL_CLIENT_OPEN_PERMISSION_DENIED: + permission_error (tasks, cal_client_get_uri (client)); + break; + default: g_assert_not_reached (); } diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index ad6b485a6c..0b83d18392 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1551,6 +1551,17 @@ method_error (GnomeCalendar *gcal, const char *uri) g_free (msg); } +/* Displays an error to indicate permission problems */ +static void +permission_error (GnomeCalendar *gcal, const char *uri) +{ + char *msg; + + msg = g_strdup_printf (_("You don't have permission to open the folder in `%s'"), uri); + gnome_error_dialog_parented (msg, GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal)))); + g_free (msg); +} + /* Callback from the calendar client when a calendar is loaded */ static void client_cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer data) @@ -1589,6 +1600,10 @@ client_cal_opened_cb (CalClient *client, CalClientOpenStatus status, gpointer da method_error (gcal, cal_client_get_uri (client)); break; + case CAL_CLIENT_OPEN_PERMISSION_DENIED : + permission_error (gcal, cal_client_get_uri (client)); + break; + default: g_assert_not_reached (); return; diff --git a/calendar/idl/evolution-calendar.idl b/calendar/idl/evolution-calendar.idl index 08ad056c3b..9a7b0929dd 100644 --- a/calendar/idl/evolution-calendar.idl +++ b/calendar/idl/evolution-calendar.idl @@ -223,7 +223,8 @@ module Calendar { NOT_FOUND, /* Requested opening in only_if_exists mode * when the URI did not exist. */ - METHOD_NOT_SUPPORTED /* A method handler is not registered */ + METHOD_NOT_SUPPORTED, /* A method handler is not registered */ + PERMISSION_DENIED }; /* Return status when setting calendar mode */ diff --git a/calendar/pcs/cal-factory.c b/calendar/pcs/cal-factory.c index 1df133ea90..767e6ec93c 100644 --- a/calendar/pcs/cal-factory.c +++ b/calendar/pcs/cal-factory.c @@ -300,6 +300,22 @@ open_backend (CalFactory *factory, const char *uristr, gboolean only_if_exists, CORBA_exception_free (&ev); return NULL; + case CAL_BACKEND_OPEN_PERMISSION_DENIED : + gtk_object_unref (GTK_OBJECT (backend)); + + CORBA_exception_init (&ev); + GNOME_Evolution_Calendar_Listener_notifyCalOpened ( + listener, + GNOME_Evolution_Calendar_Listener_PERMISSION_DENIED, + CORBA_OBJECT_NIL, + &ev); + + if (ev._major != CORBA_NO_EXCEPTION) + g_message ("open_backend(): could not notify the listener"); + + CORBA_exception_free (&ev); + return NULL; + default: g_assert_not_reached (); return NULL; |