aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-day-view.c
diff options
context:
space:
mode:
authorJP Rosevear <jpr@ximian.com>2004-05-03 21:12:33 +0800
committerJP Rosevear <jpr@src.gnome.org>2004-05-03 21:12:33 +0800
commiteef4d5c1a0c00b6d3d336de05d6e4aa33afaf53a (patch)
tree9d3787a73c884da7be46553d64816b5074835a40 /calendar/gui/e-day-view.c
parent6aec39ddd634e28d61401295f0e5ec0a115ad62d (diff)
downloadgsoc2013-evolution-eef4d5c1a0c00b6d3d336de05d6e4aa33afaf53a.tar.gz
gsoc2013-evolution-eef4d5c1a0c00b6d3d336de05d6e4aa33afaf53a.tar.zst
gsoc2013-evolution-eef4d5c1a0c00b6d3d336de05d6e4aa33afaf53a.zip
Fixes #57899
2004-05-03 JP Rosevear <jpr@ximian.com> Fixes #57899 * gui/e-day-view.c (e_day_view_do_key_press): bail if the client is read only (or we get an error trying to find out) * gui/e-week-view.c (e_week_view_do_key_press): ditto svn path=/trunk/; revision=25749
Diffstat (limited to 'calendar/gui/e-day-view.c')
-rw-r--r--calendar/gui/e-day-view.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c
index b3f65de4b3..6a74ef4c28 100644
--- a/calendar/gui/e-day-view.c
+++ b/calendar/gui/e-day-view.c
@@ -4667,6 +4667,8 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
{
EDayView *day_view;
icalcomponent *icalcomp;
+ ECal *ecal;
+ ECalModel *model;
ECalComponent *comp;
gint day, event_num;
gchar *initial_text;
@@ -4677,7 +4679,8 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
struct icaltimetype start_tt, end_tt;
const char *uid;
AddEventData add_event_data;
-
+ gboolean read_only = TRUE;
+
g_return_val_if_fail (widget != NULL, FALSE);
g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE);
g_return_val_if_fail (event != NULL, FALSE);
@@ -4800,6 +4803,12 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
return FALSE;
}
+ /* Check if the client is read only */
+ model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view));
+ ecal = e_cal_model_get_default_client (model);
+ if (!e_cal_is_read_only (ecal, &read_only, NULL) || read_only)
+ return FALSE;
+
/* We only want to start an edit with a return key or a simple
character. */
if (keyval == GDK_Return) {
@@ -4812,9 +4821,8 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event)
} else
initial_text = e_utf8_from_gtk_event_key (widget, event->keyval, event->string);
- /* Add a new event covering the selected range */
-
- icalcomp = e_cal_model_create_component_with_defaults (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)));
+ /* Add a new event covering the selected range */
+ icalcomp = e_cal_model_create_component_with_defaults (model);
if (!icalcomp)
return FALSE;
uid = icalcomponent_get_uid (icalcomp);