aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2009-07-10 01:54:18 +0800
committerMilan Crha <mcrha@redhat.com>2009-07-10 01:54:18 +0800
commit3facea9518a780f6804a8a22fd3cdbe12cd0f19a (patch)
treec705965632e8ae7319b88df7b76ed4f5e33d8871
parent2cddd404600c93fc9942d809bb25ddfdc7b5df0c (diff)
downloadgsoc2013-evolution-3facea9518a780f6804a8a22fd3cdbe12cd0f19a.tar.gz
gsoc2013-evolution-3facea9518a780f6804a8a22fd3cdbe12cd0f19a.tar.zst
gsoc2013-evolution-3facea9518a780f6804a8a22fd3cdbe12cd0f19a.zip
Bug #240605 - auto-select next day at midnight in selected day view
-rw-r--r--calendar/gui/gnome-cal.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 806f8be698..e2fbd0f476 100644
--- a/calendar/gui/gnome-cal.c
+++ b/calendar/gui/gnome-cal.c
@@ -1437,6 +1437,7 @@ static gboolean
update_marcus_bains_line_cb (GnomeCalendar *gcal)
{
GnomeCalendarPrivate *priv;
+ time_t now, day_begin;
priv = gcal->priv;
@@ -1445,6 +1446,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;
}