diff options
Diffstat (limited to 'calendar/gui/gnome-cal.c')
-rw-r--r-- | calendar/gui/gnome-cal.c | 20 |
1 files changed, 19 insertions, 1 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 8fe302293f..25b0336d16 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1178,6 +1178,7 @@ static gboolean update_marcus_bains_line_cb (GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; + time_t now, day_begin; priv = gcal->priv; @@ -1186,6 +1187,23 @@ update_marcus_bains_line_cb (GnomeCalendar *gcal) e_day_view_update_marcus_bains (E_DAY_VIEW (gnome_calendar_get_current_view_widget (gcal))); } + time (&now); + day_begin = time_day_begin (now); + + /* check in the first two minutes */ + if (now >= day_begin && now <= day_begin + 120) { + ECalendarView *view = priv->views[priv->current_view_type]; + time_t start_time = 0, end_time = 0; + + g_return_val_if_fail (view != NULL, TRUE); + + e_calendar_view_get_selected_time_range (view, &start_time, &end_time); + + if (end_time >= time_add_day (day_begin, -1) && start_time <= day_begin) { + gnome_calendar_goto (gcal, now); + } + } + return TRUE; } @@ -2744,7 +2762,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) flags |= COMP_EDITOR_NEW_ITEM; editor = task_editor_new (ecal, flags); - icalcomp = e_cal_model_create_component_with_defaults (model); + icalcomp = e_cal_model_create_component_with_defaults (model, FALSE); comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomp); |