From f86754c329d9411893abd98bfe98b45d5ccfc943 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Wed, 13 Aug 2008 09:09:33 +0000 Subject: Fixes #347287 2008-08-15 Chenthill Palanisamy Fixes #347287 * gui/e-cal-list-view-config.c: * (e_cal_list_view_config_set_view): * gui/e-cal-list-view.c: (e_cal_list_view_new): * gui/e-cal-list-view.h: * gui/e-cal-model.c: (e_cal_model_set_timezone), * (add_instance_cb), (e_cal_view_objects_added_cb), (e_cal_view_done_cb), (update_e_cal_view_for_client), (cal_opened_cb), (add_new_client), (e_cal_model_component_class_init), (e_cal_model_component_finalize), (e_cal_model_component_init), (e_cal_model_component_get_type), (e_cal_model_copy_component_data), (e_cal_model_free_component_data): * gui/e-cal-model.h: * gui/e-calendar-view.c: (e_calendar_view_init), (e_calendar_view_set_model): * gui/e-calendar-view.h: * gui/e-day-view-config.c: (e_day_view_config_set_view): * gui/e-day-view.c: (time_range_changed_cb), (model_row_changed_cb), (model_cell_changed_cb), (model_rows_inserted_cb), (model_rows_deleted_cb), (timezone_changed_cb), (e_day_view_init), (init_model), (e_day_view_new), (e_day_view_set_mins_per_row), (e_day_view_add_event), (e_day_view_check_layout): * gui/e-day-view.h: * gui/e-week-view-config.c: (e_week_view_config_set_view): * gui/e-week-view.c: (time_range_changed_cb), (model_row_changed_cb), (model_cell_changed_cb), (model_rows_inserted_cb), (model_rows_deleted_cb), (timezone_changed_cb), (e_week_view_init), (init_model), (e_week_view_new), (e_week_view_add_event), (e_week_view_check_layout): * gui/e-week-view.h: * gui/gnome-cal.c: (message_proxy), (create_thread_pool), (message_push), (update_query_async), (update_query), (set_search_query), (set_timezone), (setup_widgets), (update_view_times), (display_view), (display_view_cb), (add_mclient_async), (add_mclient), (client_cal_opened_cb), (default_client_cal_opened_cb), (gnome_calendar_remove_source_by_uid), (gnome_calendar_on_date_navigator_selection_changed): Use a single model for all the views. svn path=/trunk/; revision=35977 --- calendar/gui/e-day-view.c | 57 ++++++++++++++++++++++++++++++++++------------- 1 file changed, 42 insertions(+), 15 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index fc1912969d..ebf17eff78 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -486,6 +486,11 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo g_return_if_fail (E_IS_DAY_VIEW (day_view)); + if (!E_CALENDAR_VIEW (day_view)->in_focus) { + e_day_view_free_events (day_view); + return; + } + /* Calculate the first day that should be shown, based on start_time and the days_shown setting. If we are showing 1 day it is just the start of the day given by start_time, otherwise it is the previous @@ -568,6 +573,10 @@ model_row_changed_cb (ETableModel *etm, int row, gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); + if (!E_CALENDAR_VIEW (day_view)->in_focus) { + return; + } + update_row (day_view, row); } @@ -576,6 +585,10 @@ model_cell_changed_cb (ETableModel *etm, int col, int row, gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); + if (!E_CALENDAR_VIEW (day_view)->in_focus) { + return; + } + update_row (day_view, row); } @@ -586,6 +599,10 @@ model_rows_inserted_cb (ETableModel *etm, int row, int count, gpointer user_data ECalModel *model; int i; + if (!E_CALENDAR_VIEW (day_view)->in_focus) { + return; + } + e_day_view_stop_editing_event (day_view); model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)); @@ -612,6 +629,10 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data) EDayView *day_view = E_DAY_VIEW (user_data); int i; + if (!E_CALENDAR_VIEW (day_view)->in_focus) { + return; + } + e_day_view_stop_editing_event (day_view); for (i = row + count; i > row; i--) { @@ -653,6 +674,10 @@ timezone_changed_cb (ECalendarView *cal_view, icaltimezone *old_zone, g_return_if_fail (E_IS_DAY_VIEW (day_view)); + + if (!cal_view->in_focus) + return; + /* If our time hasn't been set yet, just return. */ if (day_view->lower == 0 && day_view->upper == 0) return; @@ -673,7 +698,6 @@ e_day_view_init (EDayView *day_view) { gint day; GnomeCanvasGroup *canvas_group; - ECalModel *model; GtkWidget *w; GTK_WIDGET_SET_FLAGS (day_view, GTK_CAN_FOCUS); @@ -981,9 +1005,16 @@ e_day_view_init (EDayView *day_view) target_table, n_targets, GDK_ACTION_COPY | GDK_ACTION_MOVE | GDK_ACTION_ASK); - /* Get the model */ - model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)); + /* connect to ECalendarView's signals */ + g_signal_connect (G_OBJECT (day_view), "timezone_changed", + G_CALLBACK (timezone_changed_cb), NULL); +} + + +static void +init_model (EDayView *day_view, ECalModel *model) +{ /* connect to ECalModel's signals */ g_signal_connect (G_OBJECT (model), "time_range_changed", G_CALLBACK (time_range_changed_cb), day_view); @@ -995,10 +1026,6 @@ e_day_view_init (EDayView *day_view) G_CALLBACK (model_rows_inserted_cb), day_view); g_signal_connect (G_OBJECT (model), "model_rows_deleted", G_CALLBACK (model_rows_deleted_cb), day_view); - - /* connect to ECalendarView's signals */ - g_signal_connect (G_OBJECT (day_view), "timezone_changed", - G_CALLBACK (timezone_changed_cb), NULL); } /* Turn off the background of the canvas windows. This reduces flicker @@ -1019,12 +1046,13 @@ e_day_view_on_canvas_realized (GtkWidget *widget, * Creates a new #EDayView. **/ GtkWidget * -e_day_view_new (void) +e_day_view_new (ECalModel *model) { GObject *day_view; day_view = g_object_new (e_day_view_get_type (), NULL); - e_cal_model_set_flags (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES); + e_calendar_view_set_model ((ECalendarView *)day_view, model); + init_model ((EDayView *) day_view, model); return GTK_WIDGET (day_view); } @@ -2346,7 +2374,7 @@ e_day_view_set_mins_per_row (EDayView *day_view, e_day_view_recalc_num_rows (day_view); /* If we aren't visible, we'll sort it out later. */ - if (!GTK_WIDGET_VISIBLE (day_view)) + if (!E_CALENDAR_VIEW (day_view)->in_focus) return; for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) @@ -4147,12 +4175,11 @@ e_day_view_add_event (ECalComponent *comp, add_event_data = data; -#if 0 + /* g_print ("Day view lower: %s", ctime (&add_event_data->day_view->lower)); g_print ("Day view upper: %s", ctime (&add_event_data->day_view->upper)); g_print ("Event start: %s", ctime (&start)); - g_print ("Event end : %s\n", ctime (&end)); -#endif + g_print ("Event end : %s\n", ctime (&end)); */ /* Check that the event times are valid. */ g_return_val_if_fail (start <= end, TRUE); @@ -4167,7 +4194,7 @@ e_day_view_add_event (ECalComponent *comp, if (add_event_data->comp_data) { event.comp_data = e_cal_model_copy_component_data (add_event_data->comp_data); } else { - event.comp_data = g_new0 (ECalModelComponent, 1); + event.comp_data = g_object_new (E_TYPE_CAL_MODEL_COMPONENT, NULL); event.comp_data->client = g_object_ref (e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (add_event_data->day_view)))); e_cal_component_abort_sequence (comp); @@ -4241,7 +4268,7 @@ e_day_view_check_layout (EDayView *day_view) gint day, rows_in_top_display; /* Don't bother if we aren't visible. */ - if (!GTK_WIDGET_VISIBLE (day_view)) + if (!E_CALENDAR_VIEW (day_view)->in_focus) return; /* Make sure the events are sorted (by start and size). */ -- cgit From d620820eab5d5f3814debb1b5f0dc7c5a7138973 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 8 Sep 2008 09:31:56 +0000 Subject: Fixes #544187. svn path=/trunk/; revision=36276 --- calendar/gui/e-day-view.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index ebf17eff78..f1fb84cd3c 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -624,10 +624,10 @@ model_rows_inserted_cb (ETableModel *etm, int row, int count, gpointer user_data } static void -model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data) +model_comps_deleted_cb (ETableModel *etm, gpointer data, gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); - int i; + GSList *l, *list = data; if (!E_CALENDAR_VIEW (day_view)->in_focus) { return; @@ -635,15 +635,12 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data) e_day_view_stop_editing_event (day_view); - for (i = row + count; i > row; i--) { + for (l = list; l != NULL; l = g_slist_next (l)) { + ECalModelComponent *comp_data = l->data; gint day, event_num; const char *uid = NULL; char *rid = NULL; - ECalModelComponent *comp_data; - comp_data = e_cal_model_get_component_at (E_CAL_MODEL (etm), i - 1); - if (!comp_data) - continue; uid = icalcomponent_get_uid (comp_data->icalcomp); if (e_cal_util_component_is_instance (comp_data->icalcomp)) { @@ -656,6 +653,7 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data) if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num)) e_day_view_remove_event_cb (day_view, day, event_num, NULL); + g_free (rid); } @@ -1024,8 +1022,8 @@ init_model (EDayView *day_view, ECalModel *model) G_CALLBACK (model_cell_changed_cb), day_view); g_signal_connect (G_OBJECT (model), "model_rows_inserted", G_CALLBACK (model_rows_inserted_cb), day_view); - g_signal_connect (G_OBJECT (model), "model_rows_deleted", - G_CALLBACK (model_rows_deleted_cb), day_view); + g_signal_connect (G_OBJECT (model), "comps_deleted", + G_CALLBACK (model_comps_deleted_cb), day_view); } /* Turn off the background of the canvas windows. This reduces flicker -- cgit From 0418253eff2bc00c1b9ae9f4daa7af82a71b4899 Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Sun, 14 Sep 2008 08:17:20 +0000 Subject: Chenthill Palanisamy ** Fix for bug #551628 (Remove old events from the view when objects are modified). svn path=/trunk/; revision=36322 --- calendar/gui/e-day-view.c | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index f1fb84cd3c..a5df99a0b7 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -555,12 +555,30 @@ update_row (EDayView *day_view, int row) { ECalModelComponent *comp_data; ECalModel *model; + gint day, event_num; + const char *uid = NULL; + char *rid = NULL; e_day_view_stop_editing_event (day_view); model = e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)); comp_data = e_cal_model_get_component_at (model, row); g_return_if_fail (comp_data != NULL); + + uid = icalcomponent_get_uid (comp_data->icalcomp); + if (e_cal_util_component_is_instance (comp_data->icalcomp)) { + icalproperty *prop; + + prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_RECURRENCEID_PROPERTY); + if (prop) + rid = icaltime_as_ical_string (icalcomponent_get_recurrenceid (comp_data->icalcomp)); + } + + if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num)) + e_day_view_remove_event_cb (day_view, day, event_num, NULL); + + g_free (rid); + process_component (day_view, comp_data); gtk_widget_queue_draw (day_view->top_canvas); @@ -641,7 +659,6 @@ model_comps_deleted_cb (ETableModel *etm, gpointer data, gpointer user_data) const char *uid = NULL; char *rid = NULL; - uid = icalcomponent_get_uid (comp_data->icalcomp); if (e_cal_util_component_is_instance (comp_data->icalcomp)) { icalproperty *prop; -- cgit From 7798c79718cec2b8360b25dd11de72be1b1df2df Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 26 Sep 2008 09:12:41 +0000 Subject: ** Fix for bug #553297 2008-09-26 Milan Crha ** Fix for bug #553297 * gui/e-day-view.c: (e_day_view_on_editing_stopped): Do not try to access uninitialized variables. svn path=/trunk/; revision=36460 --- calendar/gui/e-day-view.c | 3 +++ 1 file changed, 3 insertions(+) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index a5df99a0b7..2561b6016d 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -6321,6 +6321,9 @@ e_day_view_on_editing_stopped (EDayView *day_view, if (mod == CALOBJ_MOD_THIS) { ECalComponentDateTime olddt, dt; + icaltimetype itt; + + dt.value = &itt; e_cal_component_get_dtstart (comp, &olddt); if (olddt.value->zone) { -- cgit From fe5198584ee9f4823cc7bf13bc91ba83b7fad524 Mon Sep 17 00:00:00 2001 From: Sankarasivasubramanian Pasupathilingam Date: Fri, 3 Oct 2008 11:36:31 +0000 Subject: Change license from GPL to LGPL. svn path=/trunk/; revision=36545 --- calendar/gui/e-day-view.c | 50 +++++++++++++++++++---------------------------- 1 file changed, 20 insertions(+), 30 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 2561b6016d..0b27c94569 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1,30 +1,26 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ /* - * Authors : - * Damon Chaplin - * Rodrigo Moya - * - * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) + * EDayView - displays the Day & Work-Week views of the calendar. * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public - * License as published by the Free Software Foundation. + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) version 3. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 - * USA - */ - -/* - * EDayView - displays the Day & Work-Week views of the calendar. + * You should have received a copy of the GNU Lesser General Public + * License along with the program; if not, see + * + * Authors: + * Damon Chaplin + * Rodrigo Moya + * + * Copyright (C) 1999-2008 Novell, Inc. (www.novell.com) */ - #ifdef HAVE_CONFIG_H #include #endif @@ -215,11 +211,9 @@ static gboolean e_day_view_on_top_canvas_scroll (GtkWidget *widget, static gboolean e_day_view_on_main_canvas_scroll (GtkWidget *widget, GdkEventScroll *scroll, EDayView *day_view); - static gboolean e_day_view_on_time_canvas_scroll (GtkWidget *widget, GdkEventScroll *scroll, EDayView *day_view); - static gboolean e_day_view_on_main_canvas_motion (GtkWidget *widget, GdkEventMotion *event, EDayView *day_view); @@ -2999,10 +2993,8 @@ e_day_view_on_top_canvas_scroll (GtkWidget *widget, e_day_view_top_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE); return TRUE; default: - break; + return FALSE; } - - return FALSE; } static gboolean @@ -3025,13 +3017,11 @@ e_day_view_on_time_canvas_scroll (GtkWidget *widget, e_day_view_scroll (day_view, -E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE); return TRUE; default: - break; - } - - return FALSE; -} - -static gboolean + return FALSE; + } +} + +static gboolean e_day_view_on_long_event_button_press (EDayView *day_view, gint event_num, GdkEventButton *event, -- cgit From 37e500a1c1c25eaeb0e253564cdd7d8817f05ceb Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Tue, 11 Nov 2008 08:14:34 +0000 Subject: Fix for bug #490503 - Show summary of unaccepted meetings as bold in calendar views. svn path=/trunk/; revision=36770 --- calendar/gui/e-day-view.c | 35 ++++++++++++++++------------------- 1 file changed, 16 insertions(+), 19 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 0b27c94569..2943b6dcd5 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1775,41 +1775,38 @@ e_day_view_remove_event_cb (EDayView *day_view, return TRUE; } -#if 0 -/* Checks if the users participation status is Needs action and shows the summary as bold text*/ +/* Checks if the users participation status is NEEDS-ACTION and shows the summary as bold text */ static void set_text_as_bold (EDayViewEvent *event) { ECalComponent *comp; - char *address; - GSList *attendees, *l; + GSList *attendees = NULL, *l; + gchar *address; ECalComponentAttendee *at = NULL; comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); address = itip_get_comp_attendee (comp, event->comp_data->client); e_cal_component_get_attendee_list (comp, &attendees); - for (l = attendees; l; l = l->next) { ECalComponentAttendee *attendee = l->data; - if (g_str_equal (itip_strip_mailto (attendee->value), address)) { + if ((g_str_equal (itip_strip_mailto (attendee->value), address)) + || (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address))) { at = attendee; break; } } - - /* The attendee has not yet accepted the meeting, display the summary as bolded . - If the attendee is not present, it might have come through a mailing list*/ - if (!at || (at->status == ICAL_PARTSTAT_NEEDSACTION)) { - gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL); - } - e_cal_component_free_attendee_list (attendees); - g_object_unref (comp); g_free (address); + g_object_unref (comp); + + /* The attendee has not yet accepted the meeting, display the summary as bolded. + If the attendee is not present, it might have come through a mailing list. + In that case, we never show the meeting as bold even if it is unaccepted. */ + if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) + gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL); } -#endif /* This updates the text shown for an event. If the event start or end do not lie on a row boundary, the time is displayed before the summary. */ @@ -1859,9 +1856,9 @@ e_day_view_update_event_label (EDayView *day_view, "text", text, NULL); -/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) + if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) - set_text_as_bold (event); */ + set_text_as_bold (event); if (free_text) g_free (text); @@ -1891,9 +1888,9 @@ e_day_view_update_long_event_label (EDayView *day_view, if (free_text) g_free ((gchar*)summary); -/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) + if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) - set_text_as_bold (event); */ + set_text_as_bold (event); } -- cgit From 1eba7c5d8d740185a48b007e51acc16e4eebaf47 Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Mon, 8 Dec 2008 06:40:17 +0000 Subject: Patch from Hiroyuki Ikezoe ** Fix for bug #350725 (Copy/Paste support in day/week views). svn path=/trunk/; revision=36841 --- calendar/gui/e-day-view.c | 177 ++++++++++++++++++++++++++++------------------ 1 file changed, 109 insertions(+), 68 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 2943b6dcd5..7d54f83cbf 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -153,6 +153,7 @@ static GList *e_day_view_get_selected_events (ECalendarView *cal_view); static gboolean e_day_view_get_selected_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time); static void e_day_view_set_selected_time_range (ECalendarView *cal_view, time_t start_time, time_t end_time); static gboolean e_day_view_get_visible_time_range (ECalendarView *cal_view, time_t *start_time, time_t *end_time); +static void e_day_view_paste_text (ECalendarView *day_view); static void e_day_view_update_query (EDayView *day_view); static void e_day_view_goto_start_of_work_day (EDayView *day_view); static void e_day_view_goto_end_of_work_day (EDayView *day_view); @@ -467,6 +468,7 @@ e_day_view_class_init (EDayViewClass *class) view_class->get_selected_time_range = e_day_view_get_selected_time_range; view_class->set_selected_time_range = e_day_view_set_selected_time_range; view_class->get_visible_time_range = e_day_view_get_visible_time_range; + view_class->paste_text = e_day_view_paste_text; /* init the accessibility support for e_day_view */ e_day_view_a11y_init (); @@ -4722,16 +4724,13 @@ e_day_view_event_sort_func (const void *arg1, } static gboolean -e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) +e_day_view_add_new_event_in_selected_range (EDayView *day_view, GdkEventKey *key_event) { - EDayView *day_view; icalcomponent *icalcomp; ECal *ecal; ECalModel *model; ECalComponent *comp; gint day, event_num; - guint keyval; - gboolean stop_emission; time_t dtstart, dtend; ECalComponentDateTime start_dt, end_dt; struct icaltimetype start_tt, end_tt; @@ -4739,6 +4738,80 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) AddEventData add_event_data; gboolean read_only = TRUE; + /* 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; + + icalcomp = e_cal_model_create_component_with_defaults (model); + if (!icalcomp) + return FALSE; + + uid = icalcomponent_get_uid (icalcomp); + + comp = e_cal_component_new (); + e_cal_component_set_icalcomponent (comp, icalcomp); + + e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend); + + start_tt = icaltime_from_timet_with_zone (dtstart, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + + end_tt = icaltime_from_timet_with_zone (dtend, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + + if (day_view->selection_in_top_canvas) { + start_dt.tzid = NULL; + start_tt.is_date = 1; + end_tt.is_date = 1; + + /* Editor default in day/work-week view - top canvas */ + e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT); + } else { + start_dt.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + + /* Editor default in day/work-week view - main canvas */ + e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE); + } + + start_dt.value = &start_tt; + end_dt.value = &end_tt; + end_dt.tzid = start_dt.tzid; + e_cal_component_set_dtstart (comp, &start_dt); + e_cal_component_set_dtend (comp, &end_dt); + + e_cal_component_set_categories ( + comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (day_view))); + + /* We add the event locally and start editing it. We don't send it + to the server until the user finishes editing it. */ + add_event_data.day_view = day_view; + add_event_data.comp_data = NULL; + e_day_view_add_event (comp, dtstart, dtend, &add_event_data); + e_day_view_check_layout (day_view); + gtk_widget_queue_draw (day_view->top_canvas); + gtk_widget_queue_draw (day_view->main_canvas); + + if (!e_day_view_find_event_from_uid (day_view, ecal, uid, NULL, &day, &event_num)) { + g_warning ("Couldn't find event to start editing.\n"); + g_object_unref (comp); + return FALSE; + } + + e_day_view_start_editing_event (day_view, day, event_num, key_event); + + g_object_unref (comp); + return TRUE; +} + +static gboolean +e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) +{ + EDayView *day_view; + guint keyval; + gboolean stop_emission; + 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); @@ -4862,12 +4935,6 @@ 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) && @@ -4878,64 +4945,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return FALSE; } - /* 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); - - comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomp); - - e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend); - - start_tt = icaltime_from_timet_with_zone (dtstart, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - - end_tt = icaltime_from_timet_with_zone (dtend, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - - if (day_view->selection_in_top_canvas) { - start_dt.tzid = NULL; - start_tt.is_date = 1; - end_tt.is_date = 1; - - /* Editor default in day/work-week view - top canvas */ - e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT); - } else { - start_dt.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - - /* Editor default in day/work-week view - main canvas */ - e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE); - } - - start_dt.value = &start_tt; - end_dt.value = &end_tt; - end_dt.tzid = start_dt.tzid; - e_cal_component_set_dtstart (comp, &start_dt); - e_cal_component_set_dtend (comp, &end_dt); - - e_cal_component_set_categories ( - comp, e_calendar_view_get_default_category (E_CALENDAR_VIEW (day_view))); - - /* We add the event locally and start editing it. We don't send it - to the server until the user finishes editing it. */ - add_event_data.day_view = day_view; - add_event_data.comp_data = NULL; - e_day_view_add_event (comp, dtstart, dtend, &add_event_data); - e_day_view_check_layout (day_view); - gtk_widget_queue_draw (day_view->top_canvas); - gtk_widget_queue_draw (day_view->main_canvas); - - if (e_day_view_find_event_from_uid (day_view, ecal, uid, NULL, &day, &event_num)) { - e_day_view_start_editing_event (day_view, day, event_num, event); - } else { - g_warning ("Couldn't find event to start editing.\n"); - } - - g_object_unref (comp); - - return TRUE; + return e_day_view_add_new_event_in_selected_range (day_view, event); } static gboolean @@ -7839,3 +7849,34 @@ e_day_view_get_num_events_selected (EDayView *day_view) return (day_view->editing_event_day != -1) ? 1 : 0; } + +static void +e_day_view_paste_text (ECalendarView *cal_view) +{ + EDayView *day_view; + EDayViewEvent *event; + + g_return_if_fail (E_IS_DAY_VIEW (cal_view)); + + day_view = E_DAY_VIEW (cal_view); + + if (day_view->editing_event_num == -1 && + !e_day_view_add_new_event_in_selected_range (day_view, NULL)) + return; + + if (day_view->editing_event_day == E_DAY_VIEW_LONG_EVENT) { + event = &g_array_index (day_view->long_events, + EDayViewEvent, + day_view->editing_event_num); + } else { + event = &g_array_index (day_view->events[day_view->editing_event_day], + EDayViewEvent, + day_view->editing_event_num); + } + + if (event->canvas_item && + E_IS_TEXT (event->canvas_item) && + E_TEXT (event->canvas_item)->editing) { + e_text_paste_clipboard (E_TEXT (event->canvas_item)); + } +} -- cgit From 4d269fdc404863e16f62de4f301d7aca29f69f06 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 9 Dec 2008 18:20:21 +0000 Subject: ** Fix for bug #333224 2008-12-09 Milan Crha ** Fix for bug #333224 * gui/e-day-view.c: (e_day_view_on_text_item_event): Sanitize returned values from 'e_day_view_convert_position_in_main_canvas', because it can let the 'event_num' or 'day' set to -1, which means invalid value. svn path=/trunk/; revision=36858 --- calendar/gui/e-day-view.c | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 7d54f83cbf..331b3a4132 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -5864,6 +5864,15 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, ECalendarViewPosition pos; gboolean main_canvas = TRUE; + if (day_view->editing_event_num != -1) + break; + + if (day_view->resize_event_num != -1) + break; + + if (day_view->drag_event_num != -1) + break; + /* Convert the coords to the main canvas window, or return if the window is not found. */ if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) event, @@ -5892,15 +5901,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, } if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) - return FALSE; - - if (day_view->editing_event_num != -1) break; - if (day_view->resize_event_num != -1) - break; - - if (day_view->drag_event_num != -1) + /* even when returns position inside, or other, then the day and/or event_num + can be unknown, thus check for this here, otherwise it will crash later */ + if (day == -1 || event_num == -1) break; pevent = tooltip_get_view_event (day_view, day, event_num); -- cgit From 577f9fdffbbb9e57b44b0290f1aea8088c6f0976 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sun, 11 Jan 2009 04:52:38 +0000 Subject: Remove unneeded #include . 2009-01-10 Matthew Barnes * addressbook/gui/contact-editor/e-contact-editor-address.c: * addressbook/gui/contact-editor/e-contact-editor-fullname.c: * addressbook/gui/contact-editor/e-contact-editor-im.c: * addressbook/gui/widgets/e-addressbook-view.c: * addressbook/printing/e-contact-print.c: * calendar/gui/calendar-commands.c: * calendar/gui/e-cal-list-view.c: * calendar/gui/e-day-view.c: * calendar/gui/e-itip-control.c: * calendar/gui/e-meeting-list-view.c: * calendar/gui/e-meeting-store.c: * calendar/gui/e-week-view.c: * calendar/gui/gnome-cal.c: * calendar/gui/memos-control.c: * calendar/gui/tasks-control.c: * e-util/e-dialog-utils.c: * mail/em-folder-view.c: * mail/importers/mail-importer.c: * shell/e-shell.c: * shell/evolution-shell-component-utils.c: * shell/importer/intelligent.c: * shell/main.c: * widgets/menus/gal-view-collection.c: * widgets/menus/gal-view-instance.c: Remove unneeded #include . svn path=/trunk/; revision=37036 --- calendar/gui/e-day-view.c | 1 - 1 file changed, 1 deletion(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 331b3a4132..05f4d1ca64 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -39,7 +39,6 @@ #include #include #include -#include #include #include -- cgit From da073416c7611f821410cd18bdc5751b43b64d91 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 15 Jan 2009 11:19:25 +0000 Subject: ** Fix for bug #246313 2009-01-15 Milan Crha ** Fix for bug #246313 * gui/e-day-view.c: (e_day_view_check_if_new_event_fits): Removed. * gui/e-day-view.h: (struct _EDayView): * gui/e-day-view.c: (e_day_view_init), (e_day_view_size_allocate), (e_day_view_recalc_main_canvas_size), (e_day_view_recalc_cell_sizes), (e_day_view_update_scroll_regions), (e_day_view_check_layout): * gui/e-day-view-layout.h: (e_day_view_layout_day_events): * gui/e-day-view-layout.c: (e_day_view_layout_day_events), (e_day_view_layout_day_event), (e_day_view_expand_day_event): Added ability to show all event in one-day view, but show only up to 6 columns in a multi-day view. * gui/print.c: (print_day_details): Always print all events. svn path=/trunk/; revision=37077 --- calendar/gui/e-day-view.c | 97 +++++++++++++++++++++-------------------------- 1 file changed, 44 insertions(+), 53 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 05f4d1ca64..141d4d33c0 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -182,8 +182,6 @@ static void e_day_view_top_scroll (EDayView *day_view, static void e_day_view_update_top_scroll (EDayView *day_view, gboolean scroll_to_top); -static gboolean e_day_view_check_if_new_event_fits (EDayView *day_view); - static void e_day_view_on_canvas_realized (GtkWidget *widget, EDayView *day_view); @@ -987,6 +985,10 @@ e_day_view_init (EDayView *day_view) /* * Scrollbar. */ + day_view->mc_hscrollbar = gtk_hscrollbar_new (GTK_LAYOUT (day_view->main_canvas)->hadjustment); + gtk_table_attach (GTK_TABLE (day_view), day_view->mc_hscrollbar, 1, 2, 2, 3, GTK_FILL, 0, 0, 0); + gtk_widget_show (day_view->mc_hscrollbar); + day_view->tc_vscrollbar = gtk_vscrollbar_new (GTK_LAYOUT (day_view->top_canvas)->vadjustment); gtk_table_attach (GTK_TABLE (day_view), day_view->tc_vscrollbar, 2, 3, 0, 1, 0, GTK_FILL, 0, 0); @@ -1461,28 +1463,19 @@ e_day_view_style_set (GtkWidget *widget, pango_font_metrics_unref (font_metrics); } -/* This recalculates the sizes of each column. */ static void -e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_day_view_recalc_main_canvas_size (EDayView *day_view) { - EDayView *day_view; gint day, scroll_y; gboolean need_reshape; -#if 0 - g_print ("In e_day_view_size_allocate\n"); -#endif - day_view = E_DAY_VIEW (widget); - - (*GTK_WIDGET_CLASS (e_day_view_parent_class)->size_allocate) (widget, allocation); - - e_day_view_recalc_cell_sizes (day_view); - /* Set the scroll region of the top canvas */ e_day_view_update_top_scroll (day_view, TRUE); need_reshape = e_day_view_update_scroll_regions (day_view); + e_day_view_recalc_cell_sizes (day_view); + /* Scroll to the start of the working day, if this is the initial allocation. */ if (day_view->scroll_to_work_day) { @@ -1503,6 +1496,17 @@ e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) } } +/* This recalculates the sizes of each column. */ +static void +e_day_view_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +{ +#if 0 + g_print ("In e_day_view_size_allocate\n"); +#endif + (*GTK_WIDGET_CLASS (e_day_view_parent_class)->size_allocate) (widget, allocation); + + e_day_view_recalc_main_canvas_size (E_DAY_VIEW (widget)); +} static void e_day_view_recalc_cell_sizes (EDayView *day_view) @@ -1529,6 +1533,8 @@ e_day_view_recalc_cell_sizes (EDayView *day_view) get divided evenly. Note that we use one more element than the number of columns, to make it easy to get the column widths. */ width = day_view->main_canvas->allocation.width; + if (day_view->days_shown == 1) + width = MAX (width, day_view->max_cols * (E_DAY_VIEW_MIN_DAY_COL_WIDTH + E_DAY_VIEW_GAP_WIDTH) - E_DAY_VIEW_MIN_DAY_COL_WIDTH - 1); width /= day_view->days_shown; offset = 0; for (day = 0; day <= day_view->days_shown; day++) { @@ -2673,12 +2679,21 @@ e_day_view_update_scroll_regions (EDayView *day_view) gnome_canvas_get_scroll_region (GNOME_CANVAS (day_view->main_canvas), NULL, NULL, &old_x2, &old_y2); new_x2 = day_view->main_canvas->allocation.width - 1; + + if (day_view->days_shown == 1) + new_x2 = MAX (new_x2, day_view->max_cols * (E_DAY_VIEW_MIN_DAY_COL_WIDTH + E_DAY_VIEW_GAP_WIDTH) - E_DAY_VIEW_MIN_DAY_COL_WIDTH - 1); + if (old_x2 != new_x2 || old_y2 != new_y2) { need_reshape = TRUE; gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->main_canvas), 0, 0, new_x2, new_y2); } + if (new_x2 <= day_view->main_canvas->allocation.width - 1) + gtk_widget_hide (day_view->mc_hscrollbar); + else + gtk_widget_show (day_view->mc_hscrollbar); + return need_reshape; } @@ -4262,13 +4277,13 @@ e_day_view_add_event (ECalComponent *comp, return TRUE; } - /* This lays out the short (less than 1 day) events in the columns. Any long events are simply skipped. */ void e_day_view_check_layout (EDayView *day_view) { gint day, rows_in_top_display; + gint max_cols = -1; /* Don't bother if we aren't visible. */ if (!E_CALENDAR_VIEW (day_view)->in_focus) @@ -4278,11 +4293,17 @@ e_day_view_check_layout (EDayView *day_view) e_day_view_ensure_events_sorted (day_view); for (day = 0; day < day_view->days_shown; day++) { - if (day_view->need_layout[day]) - e_day_view_layout_day_events (day_view->events[day], + if (day_view->need_layout[day]) { + gint cols; + + cols = e_day_view_layout_day_events (day_view->events[day], day_view->rows, day_view->mins_per_row, - day_view->cols_per_row[day]); + day_view->cols_per_row[day], + day_view->days_shown == 1 ? -1 : E_DAY_VIEW_MULTI_DAY_MAX_COLUMNS); + + max_cols = MAX (cols, max_cols); + } if (day_view->need_layout[day] || day_view->need_reshape[day]) { @@ -4308,13 +4329,17 @@ e_day_view_check_layout (EDayView *day_view) } } - if (day_view->long_events_need_layout || day_view->long_events_need_reshape) e_day_view_reshape_long_events (day_view); day_view->long_events_need_layout = FALSE; day_view->long_events_need_reshape = FALSE; + + if (max_cols != -1 && max_cols != day_view->max_cols) { + day_view->max_cols = max_cols; + e_day_view_recalc_main_canvas_size (day_view); + } } @@ -4927,13 +4952,6 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) if (day_view->selection_start_day == -1) return FALSE; - /* Check if there is room for a new event to be typed in. If there - isn't we don't want to add an event as we will then add a new - event for every key press. */ - if (!e_day_view_check_if_new_event_fits (day_view)) { - return FALSE; - } - /* We only want to start an edit with a return key or a simple character. */ if ((keyval != GDK_Return) && @@ -5581,33 +5599,6 @@ e_day_view_top_scroll (EDayView *day_view, gtk_adjustment_set_value (adj, new_value); } -static gboolean -e_day_view_check_if_new_event_fits (EDayView *day_view) -{ - gint day, start_row, end_row, row; - - day = day_view->selection_start_day; - start_row = day_view->selection_start_row; - end_row = day_view->selection_end_row; - - /* Long events always fit, since we keep adding rows to the top - canvas. */ - if (day != day_view->selection_end_day) - return TRUE; - if (start_row == 0 && end_row == day_view->rows) - return TRUE; - - /* If any of the rows already have E_DAY_VIEW_MAX_COLUMNS columns, - return FALSE. */ - for (row = start_row; row <= end_row; row++) { - if (day_view->cols_per_row[day][row] >= E_DAY_VIEW_MAX_COLUMNS) - return FALSE; - } - - return TRUE; -} - - void e_day_view_ensure_rows_visible (EDayView *day_view, gint start_row, -- cgit From 9a69a192221d827f263e6972b9f07031b62676ef Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Thu, 15 Jan 2009 14:48:21 +0000 Subject: ** Fix for bug #245156 2009-01-15 Milan Crha ** Fix for bug #245156 * gui/e-day-view.c: (e_day_view_finish_long_event_resize), (e_day_view_finish_resize), (e_day_view_change_event_time), (e_day_view_on_top_canvas_drag_data_received), (e_day_view_on_main_canvas_drag_data_received): * gui/e-week-view.c: (e_week_view_change_event_time): * gui/e-calendar-view.c: (on_unrecur_appointment): Keep old timezone for dtstart/dtend when changing it. * gui/comp-util.h: (cal_comp_set_dtstart_with_oldzone), (cal_comp_set_dtend_with_oldzone): * gui/comp-util.c: (cal_comp_set_dtstart_with_oldzone), (cal_comp_set_dtend_with_oldzone), (datetime_to_zone): Helper functions to make it easier. svn path=/trunk/; revision=37079 --- calendar/gui/e-day-view.c | 30 ++++++++++++++---------------- 1 file changed, 14 insertions(+), 16 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 141d4d33c0..04c258d7fc 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -3941,7 +3941,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) dt = day_view->day_starts[day_view->resize_start_row]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtstart (comp, &date); + cal_comp_set_dtstart_with_oldzone (client, comp, &date); e_cal_component_free_datetime (&ecdt); date.tzid = NULL; /* do not reuse it later */ } else { @@ -3954,7 +3954,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) dt = day_view->day_starts[day_view->resize_end_row + 1]; *date.value = icaltime_from_timet_with_zone (dt, is_date, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtend (comp, &date); + cal_comp_set_dtend_with_oldzone (client, comp, &date); e_cal_component_free_datetime (&ecdt); date.tzid = NULL; /* do not reuse it later */ } @@ -3972,12 +3972,12 @@ e_day_view_finish_long_event_resize (EDayView *day_view) *date.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtend (comp, &date); + cal_comp_set_dtend_with_oldzone (client, comp, &date); } else { *date.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtstart (comp, &date); + cal_comp_set_dtstart_with_oldzone (client, comp, &date); } e_cal_component_set_rdate_list (comp, NULL); @@ -4037,20 +4037,18 @@ e_day_view_finish_resize (EDayView *day_view) } date.value = &itt; - /* FIXME: Should probably keep the timezone of the original start - and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) { dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_start_row); *date.value = icaltime_from_timet_with_zone (dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtstart (comp, &date); + cal_comp_set_dtstart_with_oldzone (client, comp, &date); } else { dt = e_day_view_convert_grid_position_to_time (day_view, day, day_view->resize_end_row + 1); *date.value = icaltime_from_timet_with_zone (dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtend (comp, &date); + cal_comp_set_dtend_with_oldzone (client, comp, &date); } e_cal_component_commit_sequence (comp); @@ -4081,12 +4079,12 @@ e_day_view_finish_resize (EDayView *day_view) *date.value = icaltime_from_timet_with_zone ( event->comp_data->instance_end, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtend (comp, &date); + cal_comp_set_dtend_with_oldzone (client, comp, &date); } else { *date.value = icaltime_from_timet_with_zone ( event->comp_data->instance_start, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtstart (comp, &date); + cal_comp_set_dtstart_with_oldzone (client, comp, &date); } e_cal_component_set_rdate_list (comp, NULL); @@ -6057,10 +6055,10 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt *date.value = icaltime_from_timet_with_zone (start_dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtstart (comp, &date); + cal_comp_set_dtstart_with_oldzone (client, comp, &date); *date.value = icaltime_from_timet_with_zone (end_dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtend (comp, &date); + cal_comp_set_dtend_with_oldzone (client, comp, &date); e_cal_component_commit_sequence (comp); @@ -7431,7 +7429,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } - e_cal_component_set_dtstart (comp, &date); + cal_comp_set_dtstart_with_oldzone (client, comp, &date); if (end_offset == 0) dt = day_view->day_starts[day + num_days]; @@ -7447,7 +7445,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); } - e_cal_component_set_dtend (comp, &date); + cal_comp_set_dtend_with_oldzone (client, comp, &date); gtk_drag_finish (context, TRUE, TRUE, time); @@ -7644,11 +7642,11 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, dt = e_day_view_convert_grid_position_to_time (day_view, day, row) + start_offset * 60; *date.value = icaltime_from_timet_with_zone (dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtstart (comp, &date); + cal_comp_set_dtstart_with_oldzone (client, comp, &date); dt = e_day_view_convert_grid_position_to_time (day_view, day, row + num_rows) - end_offset * 60; *date.value = icaltime_from_timet_with_zone (dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - e_cal_component_set_dtend (comp, &date); + cal_comp_set_dtend_with_oldzone (client, comp, &date); e_cal_component_abort_sequence (comp); gtk_drag_finish (context, TRUE, TRUE, time); -- cgit From ae26a9a5fb34beb48e4161c8f145b0fb2d3cb3a9 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 19 Jan 2009 13:10:36 +0000 Subject: ** Fix for bug #200254 2009-01-19 Milan Crha ** Fix for bug #200254 * gui/apps_evolution_calendar.schemas.in: * gui/dialogs/cal-prefs-dialog.glade: * gui/dialogs/cal-prefs-dialog.h: (struct _CalendarPrefsDialog): * gui/dialogs/cal-prefs-dialog.c: (dview_show_week_no_toggled), (setup_changes), (show_config), (calendar_prefs_dialog_construct): * gui/calendar-config-keys.h: * gui/calendar-config.h: * gui/calendar-config.c: (calendar_config_get_dview_show_week_no), (calendar_config_set_dview_show_week_no), (calendar_config_add_notification_dview_show_week_no): New option whether to show week number in Day and Work Week view. * gui/e-day-view.h: (struct _EDayView), (e_day_view_get_show_week_number), (e_day_view_set_show_week_number): * gui/e-day-view.c: (dview_show_week_no_changed_cb), (e_day_view_init), (e_day_view_destroy), (e_day_view_recalc_day_starts), (e_day_view_get_show_week_number), (e_day_view_set_show_week_number): New widget showing week number of the first day in a view. svn path=/trunk/; revision=37096 --- calendar/gui/e-day-view.c | 48 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 04c258d7fc..d60fd1e5c2 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -701,6 +701,12 @@ timezone_changed_cb (ECalendarView *cal_view, icaltimezone *old_zone, e_day_view_update_query (day_view); } +static void +dview_show_week_no_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) +{ + e_day_view_set_show_week_number (data, calendar_config_get_dview_show_week_no ()); +} + static void e_day_view_init (EDayView *day_view) { @@ -805,6 +811,12 @@ e_day_view_init (EDayView *day_view) day_view->before_click_dtstart = 0; day_view->before_click_dtend = 0; + day_view->week_number_label = gtk_label_new (""); + gtk_table_attach (GTK_TABLE (day_view), day_view->week_number_label, 0, 1, 0, 1, GTK_FILL, GTK_FILL, 0, 0); + day_view->wn_notif_id = calendar_config_add_notification_dview_show_week_no (dview_show_week_no_changed_cb, day_view); + if (calendar_config_get_dview_show_week_no ()) + gtk_widget_show (day_view->week_number_label); + /* * Top Canvas */ @@ -1081,6 +1093,11 @@ e_day_view_destroy (GtkObject *object) e_day_view_stop_auto_scroll (day_view); + if (day_view->wn_notif_id) { + calendar_config_remove_notification (day_view->wn_notif_id); + day_view->wn_notif_id = 0; + } + if (day_view->large_font_desc) { pango_font_description_free (day_view->large_font_desc); day_view->large_font_desc = NULL; @@ -2281,6 +2298,9 @@ e_day_view_recalc_day_starts (EDayView *day_view, time_t start_time) { gint day; + char *str; + struct icaltimetype tt; + GDate dt; day_view->day_starts[0] = start_time; for (day = 1; day <= day_view->days_shown; day++) { @@ -2294,8 +2314,36 @@ e_day_view_recalc_day_starts (EDayView *day_view, day_view->lower = start_time; day_view->upper = day_view->day_starts[day_view->days_shown]; + + tt = icaltime_from_timet_with_zone (day_view->day_starts[0], FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + g_date_clear (&dt, 1); + g_date_set_dmy (&dt, tt.day, tt.month, tt.year); + /* To Translators: the %d stands for a week number, it's value between 1 and 52/53 */ + str = g_strdup_printf (_("Week %d"), g_date_get_iso8601_week_of_year (&dt)); + gtk_label_set_text (GTK_LABEL (day_view->week_number_label), str); + g_free (str); } +gboolean +e_day_view_get_show_week_number (EDayView *day_view) +{ + g_return_val_if_fail (day_view != NULL, FALSE); + + return GTK_WIDGET_VISIBLE (day_view->week_number_label); +} + +void +e_day_view_set_show_week_number (EDayView *day_view, gboolean show) +{ + g_return_if_fail (day_view != NULL); + + if (e_day_view_get_show_week_number (day_view) != show) { + if (show) + gtk_widget_show (day_view->week_number_label); + else + gtk_widget_hide (day_view->week_number_label); + } +} /* Whether we are displaying a work-week, in which case the display always starts on the first day of the working week. */ -- cgit From 708696127f3702bdf1bdb424dce490d679420842 Mon Sep 17 00:00:00 2001 From: Suman Manjunath Date: Wed, 21 Jan 2009 06:42:45 +0000 Subject: ** Fix for bug #541209 2009-01-21 Suman Manjunath ** Fix for bug #541209 ** Adapt to the new APIs from upstream libical. Changes made include using the "_r" counterpart for the following APIs: + icalproperty_as_ical_string () + icalvalue_as_ical_string () + icalcomponent_as_ical_string () + icalparameter_as_ical_string () + icaldurationtype_as_ical_string () + icalenum_reqstat_code () + icallangbind_property_eval_string () + icallangbind_quote_as_ical () + icalmime_text_end_part () + icalperiodtype_as_ical_string () + icalproperty_enum_to_string () + icalproperty_get_parameter_as_string () + icalproperty_get_value_as_string () + icalproperty_get_property_name () + icalrecurrencetype_as_string () + icaltime_as_ical_string () + icalreqstattype_as_string () + icalvalue_binary_as_ical_string () + icalvalue_int_as_ical_string () + icalvalue_utcoffset_as_ical_string () + icalvalue_string_as_ical_string () + icalvalue_recur_as_ical_string () + icalvalue_text_as_ical_string () + icalvalue_attach_as_ical_string () + icalvalue_duration_as_ical_string () + icalvalue_date_as_ical_string () + icalvalue_datetime_as_ical_string () + icalvalue_float_as_ical_string () + icalvalue_geo_as_ical_string () + icalvalue_datetimeperiod_as_ical_string () + icalvalue_period_as_ical_string () + icalvalue_trigger_as_ical_string () + icalvalue_as_ical_string () svn path=/trunk/; revision=37113 --- calendar/gui/e-day-view.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index d60fd1e5c2..523cf45afd 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -564,7 +564,7 @@ update_row (EDayView *day_view, int row) prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_RECURRENCEID_PROPERTY); if (prop) - rid = icaltime_as_ical_string (icalcomponent_get_recurrenceid (comp_data->icalcomp)); + rid = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid (comp_data->icalcomp)); } if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num)) @@ -658,7 +658,7 @@ model_comps_deleted_cb (ETableModel *etm, gpointer data, gpointer user_data) prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_RECURRENCEID_PROPERTY); if (prop) - rid = icaltime_as_ical_string (icalcomponent_get_recurrenceid (comp_data->icalcomp)); + rid = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid (comp_data->icalcomp)); } if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num)) @@ -1993,7 +1993,7 @@ e_day_view_find_event_from_uid (EDayView *day_view, u = icalcomponent_get_uid (event->comp_data->icalcomp); if (u && !strcmp (uid, u)) { if (rid && *rid) { - r = icaltime_as_ical_string (icalcomponent_get_recurrenceid (event->comp_data->icalcomp)); + r = icaltime_as_ical_string_r (icalcomponent_get_recurrenceid (event->comp_data->icalcomp)); if (!r || !*r) continue; if (strcmp (rid, r) != 0) { @@ -4586,7 +4586,7 @@ e_day_view_reshape_day_events (EDayView *day_view, e_day_view_reshape_day_event (day_view, day, event_num); event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); - current_comp_string = icalcomponent_as_ical_string (event->comp_data->icalcomp); + current_comp_string = icalcomponent_as_ical_string_r (event->comp_data->icalcomp); if (day_view->last_edited_comp_string == NULL) { g_free (current_comp_string); continue; @@ -7364,7 +7364,7 @@ e_day_view_on_drag_data_get (GtkWidget *widget, e_cal_util_add_timezones_from_component (vcal, event->comp_data->icalcomp); icalcomponent_add_component (vcal, icalcomponent_new_clone (event->comp_data->icalcomp)); - comp_str = icalcomponent_as_ical_string (vcal); + comp_str = icalcomponent_as_ical_string_r (vcal); if (comp_str) { gtk_selection_data_set (selection_data, selection_data->target, 8, (unsigned char *)comp_str, strlen (comp_str)); -- cgit From 2e94db8a65126ffcb456bd2823cf45e5b1510b0b Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Tue, 27 Jan 2009 12:32:09 +0000 Subject: ** Fix for bug #318003 2009-01-27 Milan Crha ** Fix for bug #318003 * gui/memos-component.c: (selector_tree_data_dropped): * gui/tasks-component.c: (selector_tree_data_dropped): * gui/calendar-component.c: (selector_tree_data_dropped), (create_component_view): * gui/comp-util.h: (cal_comp_process_source_list_drop): * gui/comp-util.c: (update_single_object), (update_objects), (cal_comp_process_source_list_drop): Support move of the event in day view when dropped over the source list. Use the same function for events/tasks/memos. * gui/e-day-view.c: (e_day_view_on_drag_data_get): Encode string data same as memos and tasks do, with a source UID. * gui/e-calendar-table.c: (e_calendar_table_copy_clipboard): * gui/e-memo-table.c: (e_memo_table_copy_clipboard): Removed inappropriate comments. svn path=/trunk/; revision=37140 --- calendar/gui/e-day-view.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 523cf45afd..263b72d7ad 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -7366,8 +7366,18 @@ e_day_view_on_drag_data_get (GtkWidget *widget, comp_str = icalcomponent_as_ical_string_r (vcal); if (comp_str) { + ESource *source = e_cal_get_source (event->comp_data->client); + const char *source_uid = e_source_peek_uid (source); + char *tmp; + + if (!source_uid) + source_uid = ""; + + tmp = g_strconcat (source_uid, "\n", comp_str, NULL); gtk_selection_data_set (selection_data, selection_data->target, - 8, (unsigned char *)comp_str, strlen (comp_str)); + 8, (unsigned char *)tmp, strlen (tmp)); + + g_free (tmp); } icalcomponent_free (vcal); -- cgit From 7660d20a357ccda2e29bdfc3a1898e36200d5db5 Mon Sep 17 00:00:00 2001 From: Chow Loong Jin Date: Fri, 13 Feb 2009 16:44:13 +0000 Subject: ** Fixes bug #571625 2009-02-13 Chow Loong Jin ** Fixes bug #571625 * calendar/gui/e-day-view.c * calendar/gui/e-week-view.c: Use black/white for foreground instead of active/inactive text color svn path=/trunk/; revision=37262 --- calendar/gui/e-day-view.c | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 263b72d7ad..efdc1cd958 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1237,7 +1237,7 @@ e_day_view_unrealize (GtkWidget *widget) static GdkColor e_day_view_get_text_color (EDayView *day_view, EDayViewEvent *event, GtkWidget *widget) { - GdkColor color, bg_color; + GdkColor bg_color; guint16 red, green, blue; gdouble cc = 65535.0; @@ -1257,11 +1257,9 @@ e_day_view_get_text_color (EDayView *day_view, EDayViewEvent *event, GtkWidget * } if ((red/cc > 0.7) || (green/cc > 0.7) || (blue/cc > 0.7 )) - color = widget->style->text[GTK_STATE_NORMAL]; + return widget->style->black; else - color = widget->style->text[GTK_STATE_ACTIVE]; - - return color; + return widget->style->white; } static void -- cgit From 53e4d84f5202b6ab964ec4f0527a12e0f6c3f836 Mon Sep 17 00:00:00 2001 From: Andre Klapper Date: Wed, 18 Feb 2009 23:55:13 +0000 Subject: Remove useless and deprecated gtk_layout_freeze and gtk_layout_thaw calls. 2009-02-19 Andre Klapper * /gui/e-day-view.c: Remove useless and deprecated gtk_layout_freeze and gtk_layout_thaw calls. svn path=/trunk/; revision=37289 --- calendar/gui/e-day-view.c | 11 ----------- 1 file changed, 11 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index efdc1cd958..e86d862414 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -6577,19 +6577,8 @@ e_day_view_auto_scroll_handler (gpointer data) if (new_scroll_y != scroll_y) { /* NOTE: This reduces flicker, but only works if we don't use canvas items which have X windows. */ - - /* FIXME: Since GNOME 2.0 we can't do this, since the canvas - * won't update when its's thawed. Is this a bug or should we - * really be doing something else? Investigate. */ -#if 0 - gtk_layout_freeze (GTK_LAYOUT (day_view->main_canvas)); -#endif - gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), scroll_x, new_scroll_y); -#if 0 - gtk_layout_thaw (GTK_LAYOUT (day_view->main_canvas)); -#endif } canvas_x = day_view->last_mouse_x + scroll_x; -- cgit From 0842ee913edc381b2220023f768d64474c19b5a5 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Fri, 20 Feb 2009 10:46:50 +0000 Subject: ** Fix for bug #567949 2009-02-20 Milan Crha ** Fix for bug #567949 * gui/e-day-view.c: (set_text_as_bold): * gui/e-week-view.c: (set_text_as_bold): Do not free memory before done with it. svn path=/trunk/; revision=37298 --- calendar/gui/e-day-view.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index e86d862414..9060fa2999 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -1819,15 +1819,16 @@ set_text_as_bold (EDayViewEvent *event) break; } } - e_cal_component_free_attendee_list (attendees); - g_free (address); - g_object_unref (comp); /* The attendee has not yet accepted the meeting, display the summary as bolded. If the attendee is not present, it might have come through a mailing list. In that case, we never show the meeting as bold even if it is unaccepted. */ if (at && (at->status == ICAL_PARTSTAT_NEEDSACTION)) gnome_canvas_item_set (event->canvas_item, "bold", TRUE, NULL); + + e_cal_component_free_attendee_list (attendees); + g_free (address); + g_object_unref (comp); } /* This updates the text shown for an event. If the event start or end do not -- cgit From f04e4e06d22dc1ab0dd25501d9199d7e5014dbf9 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Thu, 5 Mar 2009 10:29:43 +0000 Subject: Fixes #435455 (bnc) svn path=/trunk/; revision=37375 --- calendar/gui/e-day-view.c | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 9060fa2999..91da668000 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -3250,6 +3250,13 @@ e_day_view_on_event_click (EDayView *day_view, !e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) && (pos == E_CALENDAR_VIEW_POS_TOP_EDGE || pos == E_CALENDAR_VIEW_POS_BOTTOM_EDGE)) { + gboolean read_only = FALSE; + + if (event && (!event->is_editable || (e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && read_only))) { + return; + } + + /* Grab the keyboard focus, so the event being edited is saved and we can use the Escape key to abort the resize. */ if (!GTK_WIDGET_HAS_FOCUS (day_view)) @@ -3722,9 +3729,12 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, gtk_target_list_unref (target_list); } } else { + gboolean read_only = FALSE; cursor = day_view->normal_cursor; - if (event) { + /* Check if the event is editable and client is not readonly while changing the cursor */ + if (event && event->is_editable && e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && !read_only) { + switch (pos) { case E_CALENDAR_VIEW_POS_LEFT_EDGE: cursor = day_view->move_cursor; @@ -3903,6 +3913,7 @@ e_day_view_update_resize (EDayView *day_view, EDayViewEvent *event; gint day, event_num; gboolean need_reshape = FALSE; + gboolean read_only = FALSE; #if 0 g_print ("Updating resize Row:%i\n", row); @@ -3916,6 +3927,10 @@ e_day_view_update_resize (EDayView *day_view, event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); + if (event && (!event->is_editable || (e_cal_is_read_only (event->comp_data->client, &read_only, NULL) && read_only))) { + return; + } + if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) { row = MIN (row, day_view->resize_end_row); if (row != day_view->resize_start_row) { @@ -4289,6 +4304,11 @@ e_day_view_add_event (ECalComponent *comp, e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view)))) event.different_timezone = TRUE; + if (!e_cal_component_has_attendees (comp) || itip_organizer_is_user (comp, event.comp_data->client) || itip_sentby_is_user (comp, event.comp_data->client)) + event.is_editable = TRUE; + else + event.is_editable = FALSE; + /* Find out which array to add the event to. */ for (day = 0; day < add_event_data->day_view->days_shown; day++) { if (start >= add_event_data->day_view->day_starts[day] -- cgit From 9896e4f7db7817087b7c18793682a4ab5f7c63e2 Mon Sep 17 00:00:00 2001 From: Chenthill Palanisamy Date: Mon, 13 Apr 2009 09:03:38 +0000 Subject: Fixes #561312 2009-04-13 Chenthill Palanisamy Fixes #561312 * calendar/gui/comp-util.c: * calendar/gui/comp-util.h: Added a new function to sanitize master recurrence event before modifying all instances. * calendar/gui/dialogs/comp-editor.c: * calendar/gui/e-day-view.c: * calendar/gui/e-week-view.c: Used the new util api. Do not invoke recurrence dialog while modifying detached instances. svn path=/trunk/; revision=37518 --- calendar/gui/e-day-view.c | 48 +++++++++++++++++++++++++++++++++++------------ 1 file changed, 36 insertions(+), 12 deletions(-) (limited to 'calendar/gui/e-day-view.c') diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 91da668000..af812edb31 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4022,12 +4022,15 @@ e_day_view_finish_long_event_resize (EDayView *day_view) } e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { /* set the correct DTSTART/DTEND on the individual recurrence */ if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) { @@ -4049,7 +4052,8 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_cal_component_commit_sequence (comp); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); @@ -4129,11 +4133,14 @@ e_day_view_finish_resize (EDayView *day_view) day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); if (mod == CALOBJ_MOD_THIS) { /* set the correct DTSTART/DTEND on the individual recurrence */ @@ -4154,7 +4161,8 @@ e_day_view_finish_resize (EDayView *day_view) e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -6138,19 +6146,23 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { gtk_widget_queue_draw (day_view->top_canvas); goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -6371,11 +6383,14 @@ e_day_view_on_editing_stopped (EDayView *day_view, } else { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { goto out; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { ECalComponentDateTime olddt, dt; icaltimetype itt; @@ -6423,7 +6438,8 @@ e_day_view_on_editing_stopped (EDayView *day_view, e_cal_component_commit_sequence (comp); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; /* FIXME When sending here, what exactly should we send? */ toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); @@ -7524,11 +7540,14 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } + + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); @@ -7536,7 +7555,8 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); @@ -7726,19 +7746,23 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); e_cal_component_commit_sequence (comp); - if (e_cal_component_is_instance (comp)) { + if (e_cal_component_has_recurrences (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { g_object_unref (comp); return; } + if (mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master (comp, client); + if (mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (comp, NULL); e_cal_component_set_rrule_list (comp, NULL); e_cal_component_set_exdate_list (comp, NULL); e_cal_component_set_exrule_list (comp, NULL); } - } + } else if (e_cal_component_is_instance (comp)) + mod = CALOBJ_MOD_THIS; toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); -- cgit