aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/e-week-view-config.c
diff options
context:
space:
mode:
Diffstat (limited to 'calendar/gui/e-week-view-config.c')
-rw-r--r--calendar/gui/e-week-view-config.c35
1 files changed, 34 insertions, 1 deletions
diff --git a/calendar/gui/e-week-view-config.c b/calendar/gui/e-week-view-config.c
index 8c9e2cfb70..8b1cdec6d4 100644
--- a/calendar/gui/e-week-view-config.c
+++ b/calendar/gui/e-week-view-config.c
@@ -105,7 +105,7 @@ e_week_view_config_finalize (GObject *object)
}
static void
-e_week_view_config_class_init (ECalViewClass *klass)
+e_week_view_config_class_init (EWeekViewConfigClass *klass)
{
GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
GParamSpec *spec;
@@ -157,6 +157,33 @@ e_week_view_config_get_view (EWeekViewConfig *view_config)
}
static void
+set_timezone (EWeekView *week_view)
+{
+ char *location;
+ icaltimezone *zone;
+
+ location = calendar_config_get_timezone ();
+ zone = icaltimezone_get_builtin_timezone (location);
+ if (!zone)
+ zone = icaltimezone_get_utc_timezone ();
+
+ e_cal_view_set_timezone (E_CAL_VIEW (week_view), zone);
+
+ g_free (location);
+}
+
+static void
+timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data)
+{
+ EWeekViewConfig *view_config = data;
+ EWeekViewConfigPrivate *priv;
+
+ priv = view_config->priv;
+
+ set_timezone (priv->view);
+}
+
+static void
set_week_start (EWeekView *week_view)
{
int week_start_week;
@@ -271,6 +298,12 @@ e_week_view_config_set_view (EWeekViewConfig *view_config, EWeekView *week_view)
return;
priv->view = g_object_ref (week_view);
+
+ /* Time zone */
+ set_timezone (week_view);
+
+ not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config);
+ priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not));
/* Week start */
set_week_start (week_view);