diff options
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/e-day-view.c | 25 | ||||
-rw-r--r-- | calendar/gui/e-week-view.c | 26 |
2 files changed, 31 insertions, 20 deletions
diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index ea77600889..e50197b963 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -821,11 +821,6 @@ 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 @@ -840,6 +835,11 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo if (lower != day_view->lower) e_day_view_recalc_day_starts (day_view, lower); + if (!E_CALENDAR_VIEW (day_view)->in_focus) { + e_day_view_free_events (day_view); + return; + } + /* If we don't show the new selection, don't preserve it */ if (day_view->selection_start_day == -1 || day_view->days_shown <= day_view->selection_start_day) e_day_view_set_selected_time_range (E_CALENDAR_VIEW (day_view), start_time, end_time); @@ -3808,6 +3808,9 @@ e_day_view_update_query (EDayView *day_view) { gint rows, r; + if (!E_CALENDAR_VIEW (day_view)->in_focus) + return; + e_day_view_stop_editing_event (day_view); gtk_widget_queue_draw (day_view->top_canvas); @@ -4606,11 +4609,13 @@ e_day_view_add_event (ECalComponent *comp, add_event_data = data; - /* - 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)); */ + /*if (end < start || start >= add_event_data->day_view->upper || end < add_event_data->day_view->lower) { + g_print ("%s: day_view: %p\n", G_STRFUNC, add_event_data->day_view); + g_print ("\tDay view lower: %s", ctime (&add_event_data->day_view->lower)); + g_print ("\tDay view upper: %s", ctime (&add_event_data->day_view->upper)); + g_print ("\tEvent start: %s", ctime (&start)); + g_print ("\tEvent end : %s\n", ctime (&end)); + }*/ /* Check that the event times are valid. */ g_return_val_if_fail (start <= end, TRUE); diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 6012901fcf..69cf5e6ae2 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -617,11 +617,6 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo g_return_if_fail (E_IS_WEEK_VIEW (week_view)); - if (!E_CALENDAR_VIEW (week_view)->in_focus) { - e_week_view_free_events (week_view); - return; - } - time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); /* Calculate the weekday of the given date, 0 = Mon. */ @@ -663,6 +658,11 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo if (update_adjustment_value) gtk_adjustment_set_value (GTK_RANGE (week_view->vscrollbar)->adjustment, 0); + if (!E_CALENDAR_VIEW (week_view)->in_focus) { + e_week_view_free_events (week_view); + return; + } + gtk_widget_queue_draw (week_view->main_canvas); /* FIXME Preserve selection if possible */ @@ -1564,6 +1564,9 @@ e_week_view_update_query (EWeekView *week_view) { gint rows, r; + if (!E_CALENDAR_VIEW (week_view)->in_focus) + return; + gtk_widget_queue_draw (week_view->main_canvas); e_week_view_free_events (week_view); e_week_view_queue_layout (week_view); @@ -2693,11 +2696,14 @@ e_week_view_add_event (ECalComponent *comp, /* Check that the event times are valid. */ num_days = add_event_data->week_view->multi_week_view ? add_event_data->week_view->weeks_shown * 7 : 7; -#if 0 - g_print ("View start:%li end:%li Event start:%li end:%li\n", - add_event_data->week_view->day_starts[0], add_event_data->week_view->day_starts[num_days], - start, end); -#endif + /*if (start > end || start >= add_event_data->week_view->day_starts[num_days] || end <= add_event_data->week_view->day_starts[0]) { + g_print ("%s: week_view:%p\n", G_STRFUNC, add_event_data->week_view); + g_print ("\tstart: %s", ctime (&start)); + g_print ("\tend: %s", ctime (&end)); + g_print ("\tday_starts[0]: %s", ctime (&add_event_data->week_view->day_starts[0])); + g_print ("\tday_starts[%d]: %s\n", num_days, ctime (&add_event_data->week_view->day_starts[num_days])); + }*/ + g_return_val_if_fail (start <= end, TRUE); g_return_val_if_fail (start < add_event_data->week_view->day_starts[num_days], TRUE); g_return_val_if_fail (end > add_event_data->week_view->day_starts[0], TRUE); |