diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-05-30 12:16:04 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-05-30 12:16:04 +0800 |
commit | 740c2caaf80265a070a6660448b29f2a40eb47b2 (patch) | |
tree | c135c47511bcf74a809bb93b83cbcba2a0725172 /calendar | |
parent | f8626b2845d8abb07cbe8be08ec600f8d7cab4ef (diff) | |
download | gsoc2013-evolution-740c2caaf80265a070a6660448b29f2a40eb47b2.tar gsoc2013-evolution-740c2caaf80265a070a6660448b29f2a40eb47b2.tar.gz gsoc2013-evolution-740c2caaf80265a070a6660448b29f2a40eb47b2.tar.bz2 gsoc2013-evolution-740c2caaf80265a070a6660448b29f2a40eb47b2.tar.lz gsoc2013-evolution-740c2caaf80265a070a6660448b29f2a40eb47b2.tar.xz gsoc2013-evolution-740c2caaf80265a070a6660448b29f2a40eb47b2.tar.zst gsoc2013-evolution-740c2caaf80265a070a6660448b29f2a40eb47b2.zip |
Bug 617094 - System timezone label not initialized in preferences
Gert Kulyk gets credit for solving the bug, I just refactored the code a
bit more heavily.
Diffstat (limited to 'calendar')
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.c | 23 | ||||
-rw-r--r-- | calendar/gui/dialogs/cal-prefs-dialog.h | 1 |
2 files changed, 15 insertions, 9 deletions
diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index f2693d5966..410f8cb104 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -397,16 +397,23 @@ update_system_tz_widgets (EShellSettings *shell_settings, GParamSpec *pspec, CalendarPrefsDialog *prefs) { + GtkWidget *widget; icaltimezone *zone; + const gchar *display_name; + gchar *text; + + widget = e_builder_get_widget (prefs->builder, "system-tz-label"); + g_return_if_fail (GTK_IS_LABEL (widget)); zone = e_cal_util_get_system_timezone (); - if (zone) { - gchar *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)"); - } + if (zone != NULL) + display_name = gettext (icaltimezone_get_display_name (zone)); + else + display_name = "UTC"; + + text = g_strdup_printf ("(%s)", display_name); + gtk_label_set_text (GTK_LABEL (widget), text); + g_free (text); } static void @@ -636,6 +643,7 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs, g_signal_connect ( shell_settings, "notify::cal-use-system-timezone", G_CALLBACK (update_system_tz_widgets), prefs); + g_object_notify (G_OBJECT (shell_settings), "cal-use-system-timezone"); widget = e_builder_get_widget (prefs->builder, "timezone"); e_mutual_binding_new ( @@ -646,7 +654,6 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs, widget, "sensitive"); /* General tab */ - prefs->system_tz_label = e_builder_get_widget (prefs->builder, "system-tz-label"); prefs->day_second_zone = e_builder_get_widget (prefs->builder, "day_second_zone"); widget = e_builder_get_widget (prefs->builder, "sun_button"); diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h index 1ae585a0e8..e01399fba0 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.h +++ b/calendar/gui/dialogs/cal-prefs-dialog.h @@ -61,7 +61,6 @@ struct _CalendarPrefsDialog { GConfClient *gconf; /* General tab */ - GtkWidget *system_tz_label; GtkWidget *day_second_zone; GtkWidget *working_days[7]; GtkWidget *week_start_day; |