[evolution/gnome-2-30] Bug 617094 - System timezone label not initialized in preferences
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/gnome-2-30] Bug 617094 - System timezone label not initialized in preferences
- Date: Sun, 30 May 2010 04:19:21 +0000 (UTC)
commit 5715627af7feff4f47d4d05469fe37d5f0b00815
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun May 30 00:16:04 2010 -0400
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.
calendar/gui/dialogs/cal-prefs-dialog.c | 23 +++++++++++++++--------
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 08f61aa..c1acf81 100644
--- a/calendar/gui/dialogs/cal-prefs-dialog.c
+++ b/calendar/gui/dialogs/cal-prefs-dialog.c
@@ -396,16 +396,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
@@ -635,6 +642,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 (
@@ -645,7 +653,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 14011d8..f5c0585 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]