Index: plugins/startup-wizard/startup-wizard.c
===================================================================
--- plugins/startup-wizard/startup-wizard.c	(revision 37524)
+++ plugins/startup-wizard/startup-wizard.c	(working copy)
@@ -24,7 +24,6 @@
 #include <glib/gi18n.h>
 #include <gtk/gtk.h>
 #include <libgnomeui/libgnomeui.h>
-#include "widgets/e-timezone-dialog/e-timezone-dialog.h"
 #include "e-util/e-error.h"
 #include "e-util/e-import.h"
 #include "shell/es-event.h"
@@ -32,10 +31,7 @@
 #include "mail/em-account-editor.h"
 #include "calendar/gui/calendar-config.h"
 
-#define IMPORT_TIMEZONE_DIALOG "StartupWizard::TimezoneDialog"
-
 void startup_wizard (EPlugin *ep, ESEventTargetUpgrade *target);
-GtkWidget *startup_wizard_timezone_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data);
 GtkWidget *startup_wizard_importer_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data);
 gboolean startup_wizard_check (EPlugin *ep, EConfigHookPageCheckData *check_data);
 void startup_wizard_commit (EPlugin *ep, EMConfigTargetAccount *target);
@@ -98,25 +94,6 @@ startup_wizard (EPlugin *ep, ESEventTarg
 }
 
 GtkWidget *
-startup_wizard_timezone_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
-{
-	ETimezoneDialog *etd;
-	GtkWidget *page;
-
-	etd = e_timezone_dialog_new ();
-	g_object_set_data (G_OBJECT (hook_data->config), IMPORT_TIMEZONE_DIALOG, etd);
-
-	page = gnome_druid_page_standard_new_with_vals (_("Timezone"), NULL, NULL);
-	e_timezone_dialog_reparent (etd, GNOME_DRUID_PAGE_STANDARD (page)->vbox);
-
-	e_timezone_dialog_set_timezone (etd, NULL);
-
-	gnome_druid_append_page (GNOME_DRUID (hook_data->parent), GNOME_DRUID_PAGE (page));
-
-	return GTK_WIDGET (page);
-}
-
-GtkWidget *
 startup_wizard_importer_page (EPlugin *ep, EConfigHookItemFactoryData *hook_data)
 {
 	GtkWidget *page, *label, *sep, *table;
@@ -208,22 +185,13 @@ import_done(EImport *ei, void *d)
 void
 startup_wizard_commit (EPlugin *ep, EMConfigTargetAccount *target)
 {
-	EConfig *ec = ((EConfigTarget *)target)->config;
-	ETimezoneDialog *etd;
-	icaltimezone *zone;
-
-	/* Set Timezone */
-	etd = g_object_get_data (G_OBJECT (ec), IMPORT_TIMEZONE_DIALOG);
-	if (etd) {
-		zone = e_timezone_dialog_get_timezone (E_TIMEZONE_DIALOG (etd));
-		if (zone)
-			calendar_config_set_timezone (icaltimezone_get_display_name (zone));
-
-		/* Need to do this otherwise the timezone widget gets destroyed but the
-		   timezone object isn't, and we can get a crash like #22047.  */
-		g_object_unref (etd);
-		g_object_set_data (G_OBJECT (ec), IMPORT_TIMEZONE_DIALOG, NULL);
-	}
+	char *location;
+
+	/* Use System Timezone by default */
+	calendar_config_set_use_system_timezone (TRUE);
+	location = e_cal_util_get_system_timezone_location ();
+	calendar_config_set_timezone (location);
+	g_free (location);
 
 	if (import_importers) {
 		import_iterator = import_importers;
@@ -246,20 +214,6 @@ startup_wizard_commit (EPlugin *ep, EMCo
 void
 startup_wizard_abort (EPlugin *ep, EMConfigTargetAccount *target)
 {
-	EConfig *ec = ((EConfigTarget *)target)->config;
-	ETimezoneDialog *etd;
-
-	/* We're doing an _exit(), so i dont see why we're bothering to do
-	   any cleanup whatsoever here ... */
-
-	etd = g_object_get_data (G_OBJECT (ec), IMPORT_TIMEZONE_DIALOG);
-	if (etd) {
-		/* Need to do this otherwise the timezone widget gets destroyed but the
-		   timezone object isn't, and we can get a crash like #22047.  */
-		g_object_unref (etd);
-		g_object_set_data (G_OBJECT (ec), IMPORT_TIMEZONE_DIALOG, NULL);
-	}
-
 	gtk_main_quit ();
 	_exit (0);
 }
Index: plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml
===================================================================
--- plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml	(revision 37524)
+++ plugins/startup-wizard/org-gnome-evolution-startup-wizard.eplug.xml	(working copy)
@@ -17,7 +17,6 @@
 
 	    <hook class="org.gnome.evolution.mail.config:1.0">
 		      <group target="account" id="org.gnome.evolution.mail.config.accountWizard" commit="startup_wizard_commit" abort="startup_wizard_abort">
-			<item type="page" path="50.timezone" factory="startup_wizard_timezone_page"/>
 			<item type="page" path="60.importers" factory="startup_wizard_importer_page"/>
 		      </group>
 	    </hook>
Index: plugins/startup-wizard/ChangeLog
===================================================================
--- plugins/startup-wizard/ChangeLog	(revision 37524)
+++ plugins/startup-wizard/ChangeLog	(working copy)
@@ -1,3 +1,12 @@
+2009-04-15  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #381132
+
+	* org-gnome-evolution-startup-wizard.eplug.xml:
+	* startup-wizard.c: (startup_wizard_timezone_page),
+	(startup_wizard_commit), (startup_wizard_abort):
+	Do not setup timezone, set a system timezone instead.
+
 2009-01-21  Milan Crha  <mcrha@redhat.com>
 
 	* Makefile.am: Use also EVOLUTION_CALENDAR_CFLAGS.
Index: calendar/gui/dialogs/cal-prefs-dialog.c
===================================================================
--- calendar/gui/dialogs/cal-prefs-dialog.c	(revision 37524)
+++ calendar/gui/dialogs/cal-prefs-dialog.c	(working copy)
@@ -495,6 +495,30 @@ template_url_changed (GtkEntry *entry, C
 }
 
 static void
+update_system_tz_widgets (CalendarPrefsDialog *prefs)
+{
+	icaltimezone *zone;
+
+	zone = e_cal_util_get_system_timezone ();
+	if (zone) {
+		char *tmp = g_strdup_printf ("(%s)", icaltimezone_get_display_name (zone));
+		gtk_label_set_text (GTK_LABEL (prefs->system_tz_label), tmp);
+		g_free (tmp);
+	} else {
+		gtk_label_set_text (GTK_LABEL (prefs->system_tz_label), "(UTC)");
+	}
+
+	gtk_widget_set_sensitive (prefs->timezone, !gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (prefs->use_system_tz_check)));
+}
+
+static void
+use_system_tz_changed (GtkWidget *check, CalendarPrefsDialog *prefs)
+{
+	calendar_config_set_use_system_timezone (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (check)));
+	update_system_tz_widgets (prefs);
+}
+
+static void
 setup_changes (CalendarPrefsDialog *prefs)
 {
 	int i;
@@ -502,6 +526,7 @@ setup_changes (CalendarPrefsDialog *pref
 	for (i = 0; i < 7; i ++)
 		g_signal_connect (G_OBJECT (prefs->working_days[i]), "toggled", G_CALLBACK (working_days_changed), prefs);
 
+	g_signal_connect (G_OBJECT (prefs->use_system_tz_check), "toggled", G_CALLBACK (use_system_tz_changed), prefs);
 	g_signal_connect (G_OBJECT (prefs->timezone), "changed", G_CALLBACK (timezone_changed), prefs);
 	g_signal_connect (G_OBJECT (prefs->day_second_zone), "clicked", G_CALLBACK (day_second_zone_clicked), prefs);
 	g_signal_connect (G_OBJECT (prefs->daylight_saving), "toggled", G_CALLBACK (daylight_saving_changed), prefs);
@@ -637,8 +662,13 @@ show_config (CalendarPrefsDialog *prefs)
 	CalUnits units;
 	int interval;
 
+	/* Use system timezone */
+	gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (prefs->use_system_tz_check), calendar_config_get_use_system_timezone ());
+	gtk_widget_set_sensitive (prefs->system_tz_label, FALSE);
+	update_system_tz_widgets (prefs);
+
 	/* Timezone. */
-	location = calendar_config_get_timezone ();
+	location = calendar_config_get_timezone_stored ();
 	zone = icaltimezone_get_builtin_timezone (location);
 	e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (prefs->timezone), zone);
 	g_free (location);
@@ -788,6 +818,8 @@ calendar_prefs_dialog_construct (Calenda
 	e_config_add_items ((EConfig *) ec, l, NULL, NULL, eccp_free, prefs);
 
 	/* General tab */
+	prefs->use_system_tz_check = glade_xml_get_widget (gui, "use-system-tz-check");
+	prefs->system_tz_label = glade_xml_get_widget (gui, "system-tz-label");
 	prefs->timezone = glade_xml_get_widget (gui, "timezone");
 	prefs->day_second_zone = glade_xml_get_widget (gui, "day_second_zone");
 	prefs->daylight_saving = glade_xml_get_widget (gui, "daylight_cb");
Index: calendar/gui/dialogs/cal-prefs-dialog.h
===================================================================
--- calendar/gui/dialogs/cal-prefs-dialog.h	(revision 37524)
+++ calendar/gui/dialogs/cal-prefs-dialog.h	(working copy)
@@ -43,6 +43,8 @@ struct _CalendarPrefsDialog {
 	GConfClient *gconf;
 
 	/* General tab */
+	GtkWidget *use_system_tz_check;
+	GtkWidget *system_tz_label;
 	GtkWidget *timezone;
 	GtkWidget *day_second_zone;
 	GtkWidget *daylight_saving;
Index: calendar/gui/dialogs/cal-prefs-dialog.glade
===================================================================
--- calendar/gui/dialogs/cal-prefs-dialog.glade	(revision 37524)
+++ calendar/gui/dialogs/cal-prefs-dialog.glade	(working copy)
@@ -96,36 +96,16 @@
 	      <child>
 		<widget class="GtkTable" id="time">
 		  <property name="visible">True</property>
-		  <property name="n_rows">4</property>
+		  <property name="n_rows">5</property>
 		  <property name="n_columns">2</property>
 		  <property name="homogeneous">False</property>
 		  <property name="row_spacing">6</property>
 		  <property name="column_spacing">6</property>
 
 		  <child>
-		    <widget class="Custom" id="timezone">
-		      <property name="visible">True</property>
-		      <property name="creation_function">make_timezone_entry</property>
-		      <property name="int1">0</property>
-		      <property name="int2">0</property>
-		      <property name="last_modification_time">Thu, 13 Jan 2005 04:18:03 GMT</property>
-		      <accessibility>
-			<atkrelation target="timezone_label" type="labelled-by"/>
-		      </accessibility>
-		    </widget>
-		    <packing>
-		      <property name="left_attach">1</property>
-		      <property name="right_attach">2</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
-		      <property name="y_options">fill</property>
-		    </packing>
-		  </child>
-
-		  <child>
-		    <widget class="GtkLabel" id="timezone_label">
+		    <widget class="GtkLabel" id="label63">
 		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Time _zone:</property>
+		      <property name="label" translatable="yes">Se_cond zone:</property>
 		      <property name="use_underline">True</property>
 		      <property name="use_markup">False</property>
 		      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -135,7 +115,7 @@
 		      <property name="yalign">0.5</property>
 		      <property name="xpad">0</property>
 		      <property name="ypad">0</property>
-		      <property name="mnemonic_widget">timezone</property>
+		      <property name="mnemonic_widget">day_second_zone</property>
 		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 		      <property name="width_chars">-1</property>
 		      <property name="single_line_mode">False</property>
@@ -144,30 +124,93 @@
 		    <packing>
 		      <property name="left_attach">0</property>
 		      <property name="right_attach">1</property>
-		      <property name="top_attach">0</property>
-		      <property name="bottom_attach">1</property>
+		      <property name="top_attach">4</property>
+		      <property name="bottom_attach">5</property>
 		      <property name="x_options">fill</property>
 		      <property name="y_options"></property>
 		    </packing>
 		  </child>
 
 		  <child>
-		    <widget class="GtkCheckButton" id="daylight_cb">
+		    <widget class="GtkHBox" id="hbox25">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="label" translatable="yes">Adjust for daylight sa_ving time</property>
-		      <property name="use_underline">True</property>
-		      <property name="relief">GTK_RELIEF_NORMAL</property>
-		      <property name="focus_on_click">True</property>
-		      <property name="active">False</property>
-		      <property name="inconsistent">False</property>
-		      <property name="draw_indicator">True</property>
+		      <property name="homogeneous">False</property>
+		      <property name="spacing">0</property>
+
+		      <child>
+			<widget class="GtkButton" id="day_second_zone">
+			  <property name="visible">True</property>
+			  <property name="can_focus">True</property>
+			  <property name="label" translatable="yes">None</property>
+			  <property name="use_underline">True</property>
+			  <property name="relief">GTK_RELIEF_NORMAL</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkLabel" id="label64">
+			  <property name="visible">True</property>
+			  <property name="label" translatable="yes">(Shown in a Day View)</property>
+			  <property name="use_underline">False</property>
+			  <property name="use_markup">False</property>
+			  <property name="justify">GTK_JUSTIFY_LEFT</property>
+			  <property name="wrap">False</property>
+			  <property name="selectable">False</property>
+			  <property name="xalign">0.5</property>
+			  <property name="yalign">0.5</property>
+			  <property name="xpad">6</property>
+			  <property name="ypad">0</property>
+			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+			  <property name="width_chars">-1</property>
+			  <property name="single_line_mode">False</property>
+			  <property name="angle">0</property>
+			</widget>
+			<packing>
+			  <property name="padding">0</property>
+			  <property name="expand">False</property>
+			  <property name="fill">False</property>
+			</packing>
+		      </child>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">1</property>
 		      <property name="right_attach">2</property>
-		      <property name="top_attach">1</property>
-		      <property name="bottom_attach">2</property>
+		      <property name="top_attach">4</property>
+		      <property name="bottom_attach">5</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="label11">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Time format:</property>
+		      <property name="use_underline">False</property>
+		      <property name="use_markup">False</property>
+		      <property name="justify">GTK_JUSTIFY_LEFT</property>
+		      <property name="wrap">False</property>
+		      <property name="selectable">False</property>
+		      <property name="xalign">0</property>
+		      <property name="yalign">0.5</property>
+		      <property name="xpad">0</property>
+		      <property name="ypad">0</property>
+		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
+		      <property name="width_chars">-1</property>
+		      <property name="single_line_mode">False</property>
+		      <property name="angle">0</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">0</property>
+		      <property name="right_attach">1</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
 		      <property name="x_options">fill</property>
 		      <property name="y_options"></property>
 		    </packing>
@@ -221,34 +264,28 @@
 		    <packing>
 		      <property name="left_attach">1</property>
 		      <property name="right_attach">2</property>
-		      <property name="top_attach">2</property>
-		      <property name="bottom_attach">3</property>
+		      <property name="top_attach">3</property>
+		      <property name="bottom_attach">4</property>
 		      <property name="x_options">fill</property>
 		      <property name="y_options">fill</property>
 		    </packing>
 		  </child>
 
 		  <child>
-		    <widget class="GtkLabel" id="label11">
+		    <widget class="GtkCheckButton" id="daylight_cb">
 		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Time format:</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_LEFT</property>
-		      <property name="wrap">False</property>
-		      <property name="selectable">False</property>
-		      <property name="xalign">0</property>
-		      <property name="yalign">0.5</property>
-		      <property name="xpad">0</property>
-		      <property name="ypad">0</property>
-		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
-		      <property name="width_chars">-1</property>
-		      <property name="single_line_mode">False</property>
-		      <property name="angle">0</property>
+		      <property name="can_focus">True</property>
+		      <property name="label" translatable="yes">Adjust for daylight sa_ving time</property>
+		      <property name="use_underline">True</property>
+		      <property name="relief">GTK_RELIEF_NORMAL</property>
+		      <property name="focus_on_click">True</property>
+		      <property name="active">False</property>
+		      <property name="inconsistent">False</property>
+		      <property name="draw_indicator">True</property>
 		    </widget>
 		    <packing>
-		      <property name="left_attach">0</property>
-		      <property name="right_attach">1</property>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
 		      <property name="top_attach">2</property>
 		      <property name="bottom_attach">3</property>
 		      <property name="x_options">fill</property>
@@ -257,9 +294,29 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkLabel" id="label63">
+		    <widget class="Custom" id="timezone">
 		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Se_cond zone:</property>
+		      <property name="creation_function">make_timezone_entry</property>
+		      <property name="int1">0</property>
+		      <property name="int2">0</property>
+		      <property name="last_modification_time">Thu, 13 Jan 2005 04:18:03 GMT</property>
+		      <accessibility>
+			<atkrelation target="timezone_label" type="labelled-by"/>
+		      </accessibility>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">1</property>
+		      <property name="right_attach">2</property>
+		      <property name="top_attach">1</property>
+		      <property name="bottom_attach">2</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
+
+		  <child>
+		    <widget class="GtkLabel" id="timezone_label">
+		      <property name="visible">True</property>
+		      <property name="label" translatable="yes">Time _zone:</property>
 		      <property name="use_underline">True</property>
 		      <property name="use_markup">False</property>
 		      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -269,7 +326,7 @@
 		      <property name="yalign">0.5</property>
 		      <property name="xpad">0</property>
 		      <property name="ypad">0</property>
-		      <property name="mnemonic_widget">day_second_zone</property>
+		      <property name="mnemonic_widget">timezone</property>
 		      <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 		      <property name="width_chars">-1</property>
 		      <property name="single_line_mode">False</property>
@@ -278,39 +335,42 @@
 		    <packing>
 		      <property name="left_attach">0</property>
 		      <property name="right_attach">1</property>
-		      <property name="top_attach">3</property>
-		      <property name="bottom_attach">4</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
 		      <property name="x_options">fill</property>
 		      <property name="y_options"></property>
 		    </packing>
 		  </child>
 
 		  <child>
-		    <widget class="GtkHBox" id="hbox25">
+		    <widget class="GtkHBox" id="hbox26">
 		      <property name="visible">True</property>
 		      <property name="homogeneous">False</property>
 		      <property name="spacing">0</property>
 
 		      <child>
-			<widget class="GtkButton" id="day_second_zone">
+			<widget class="GtkCheckButton" id="use-system-tz-check">
 			  <property name="visible">True</property>
 			  <property name="can_focus">True</property>
-			  <property name="label" translatable="yes">None</property>
+			  <property name="label" translatable="yes">Use s_ystem time zone</property>
 			  <property name="use_underline">True</property>
 			  <property name="relief">GTK_RELIEF_NORMAL</property>
 			  <property name="focus_on_click">True</property>
+			  <property name="active">False</property>
+			  <property name="inconsistent">False</property>
+			  <property name="draw_indicator">True</property>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
-			  <property name="expand">True</property>
+			  <property name="expand">False</property>
 			  <property name="fill">True</property>
 			</packing>
 		      </child>
 
 		      <child>
-			<widget class="GtkLabel" id="label64">
+			<widget class="GtkLabel" id="system-tz-label">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="yes">(Shown in a Day View)</property>
+			  <property name="label">(system/tz)</property>
 			  <property name="use_underline">False</property>
 			  <property name="use_markup">False</property>
 			  <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -318,7 +378,7 @@
 			  <property name="selectable">False</property>
 			  <property name="xalign">0.5</property>
 			  <property name="yalign">0.5</property>
-			  <property name="xpad">6</property>
+			  <property name="xpad">5</property>
 			  <property name="ypad">0</property>
 			  <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
 			  <property name="width_chars">-1</property>
@@ -335,10 +395,9 @@
 		    <packing>
 		      <property name="left_attach">1</property>
 		      <property name="right_attach">2</property>
-		      <property name="top_attach">3</property>
-		      <property name="bottom_attach">4</property>
+		      <property name="top_attach">0</property>
+		      <property name="bottom_attach">1</property>
 		      <property name="x_options">fill</property>
-		      <property name="y_options">fill</property>
 		    </packing>
 		  </child>
 		</widget>
@@ -1268,6 +1327,7 @@ Days</property>
 		      <property name="fill">False</property>
 		    </packing>
 		  </child>
+
 		  <child>
 		    <widget class="GtkCheckButton" id="dview_show_week_no">
 		      <property name="visible">True</property>
Index: calendar/gui/apps_evolution_calendar.schemas.in
===================================================================
--- calendar/gui/apps_evolution_calendar.schemas.in	(revision 37524)
+++ calendar/gui/apps_evolution_calendar.schemas.in	(working copy)
@@ -16,6 +16,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/evolution/calendar/display/use_system_timezone</key>
+      <applyto>/apps/evolution/calendar/display/use_system_timezone</applyto>
+      <owner>evolution-calendar</owner>
+      <type>bool</type>
+      <default>true</default>
+      <locale name="C">
+        <short>Use system timezone</short>
+        <long>Check this to use system timezone in Evolution.</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/evolution/calendar/display/day_second_zone</key>
       <applyto>/apps/evolution/calendar/display/day_second_zone</applyto>
       <owner>evolution-calendar</owner>
Index: calendar/gui/calendar-config-keys.h
===================================================================
--- calendar/gui/calendar-config-keys.h	(revision 37524)
+++ calendar/gui/calendar-config-keys.h	(working copy)
@@ -28,6 +28,7 @@ G_BEGIN_DECLS
 #define CALENDAR_CONFIG_PREFIX "/apps/evolution/calendar"
 
 /* Display settings */
+#define CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/use_system_timezone"
 #define CALENDAR_CONFIG_TIMEZONE CALENDAR_CONFIG_PREFIX "/display/timezone"
 #define CALENDAR_CONFIG_DAYLIGHT_SAVING CALENDAR_CONFIG_PREFIX "/display/use_daylight_saving"
 #define CALENDAR_CONFIG_SELECTED_CALENDARS CALENDAR_CONFIG_PREFIX "/display/selected_calendars"
Index: calendar/gui/calendar-config.c
===================================================================
--- calendar/gui/calendar-config.c	(revision 37524)
+++ calendar/gui/calendar-config.c	(working copy)
@@ -39,8 +39,6 @@
 #include "calendar-config-keys.h"
 #include "calendar-config.h"
 
-
-
 static GConfClient *config = NULL;
 
 /* Store the zones here, this is not destroyed as the ical timezones */
@@ -185,6 +183,35 @@ calendar_config_add_notification_primary
 	return id;
 }
 
+gboolean
+calendar_config_get_use_system_timezone (void)
+{
+	calendar_config_init ();
+
+	return gconf_client_get_bool (config, CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE, NULL);
+}
+
+void
+calendar_config_set_use_system_timezone (gboolean use)
+{
+	calendar_config_init ();
+
+	if (calendar_config_get_use_system_timezone () != use) {
+		gconf_client_set_bool (config, CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE, use, NULL);
+		gconf_client_notify (config, CALENDAR_CONFIG_TIMEZONE);
+
+		/* FIXME: notify CALENDAR_CONFIG_TIMEZONE change on system timezone change
+		   itself too, when using system timezone. How to receive such change? */
+	}
+}
+
+guint
+calendar_config_add_notification_use_system_timezone (GConfClientNotifyFunc func, gpointer data)
+{
+	calendar_config_init ();
+
+	return gconf_client_notify_add (config, CALENDAR_CONFIG_USE_SYSTEM_TIMEZONE, func, data, NULL, NULL);
+}
 
 /* The current timezone, e.g. "Europe/London". It may be NULL, in which case
    you should assume UTC (though Evolution will show the timezone-setting
@@ -192,6 +219,15 @@ calendar_config_add_notification_primary
 gchar *
 calendar_config_get_timezone (void)
 {
+	if (calendar_config_get_use_system_timezone ())
+		return e_cal_util_get_system_timezone_location ();
+
+	return calendar_config_get_timezone_stored ();
+}
+
+gchar *
+calendar_config_get_timezone_stored (void)
+{
 	calendar_config_init ();
 
 	return gconf_client_get_string (config, CALENDAR_CONFIG_TIMEZONE, NULL);
Index: calendar/gui/calendar-config.h
===================================================================
--- calendar/gui/calendar-config.h	(revision 37524)
+++ calendar/gui/calendar-config.h	(working copy)
@@ -73,8 +73,14 @@ char     *calendar_config_get_primary_ca
 void	  calendar_config_set_primary_calendar (const char *primary_uid);
 guint	  calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, gpointer data);
 
+/* Use system timezone; if TRUE, then influences also the current timezone functions. */
+gboolean calendar_config_get_use_system_timezone (void);
+void     calendar_config_set_use_system_timezone (gboolean use);
+guint    calendar_config_add_notification_use_system_timezone (GConfClientNotifyFunc func, gpointer data);
+
 /* The current timezone, e.g. "Europe/London". */
 gchar*	  calendar_config_get_timezone		(void);
+gchar*	  calendar_config_get_timezone_stored	(void);
 icaltimezone *calendar_config_get_icaltimezone (void);
 void	  calendar_config_set_timezone		(const gchar	     *timezone);
 guint calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer data);
Index: calendar/ChangeLog
===================================================================
--- calendar/ChangeLog	(revision 37524)
+++ calendar/ChangeLog	(working copy)
@@ -1,3 +1,21 @@
+2009-04-15  Milan Crha  <mcrha@redhat.com>
+
+	** Part of fix for bug #381132
+
+	* gui/apps_evolution_calendar.schemas.in:
+	* gui/dialogs/cal-prefs-dialog.glade:
+	* gui/dialogs/cal-prefs-dialog.h: (struct _CalendarPrefsDialog):
+	* gui/dialogs/cal-prefs-dialog.c: (update_system_tz_widgets),
+	(use_system_tz_changed), (setup_changes), (show_config),
+	(calendar_prefs_dialog_construct):
+	* gui/calendar-config-keys.h:
+	* gui/calendar-config.h:
+	* gui/calendar-config.c: (calendar_config_get_use_system_timezone),
+	(calendar_config_set_use_system_timezone),
+	(calendar_config_add_notification_use_system_timezone),
+	(calendar_config_get_timezone), (calendar_config_get_timezone_stored):
+	Be able to set system timezone as calendar's time zone.
+
 2009-04-13  Chenthill Palanisamy  <pchenthill@novell.com>
 
 	Fixes #561312
