[evolution] Bug #240605 - auto-select next day at midnight in selected day view
- From: Milan Crha <mcrha src gnome org>
- To: svn-commits-list gnome org
- Subject: [evolution] Bug #240605 - auto-select next day at midnight in selected day view
- Date: Thu, 9 Jul 2009 17:54:23 +0000 (UTC)
commit 3facea9518a780f6804a8a22fd3cdbe12cd0f19a
Author: Milan Crha <mcrha redhat com>
Date: Thu Jul 9 19:54:18 2009 +0200
Bug #240605 - auto-select next day at midnight in selected day view
calendar/gui/gnome-cal.c | 18 ++++++++++++++++++
1 files changed, 18 insertions(+), 0 deletions(-)
---
diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c
index 806f8be..e2fbd0f 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;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]