aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/gui/dialogs/e-timezone-dialog.c
diff options
context:
space:
mode:
authorDamon Chaplin <damon@ximian.com>2001-07-03 12:21:37 +0800
committerDamon Chaplin <damon@src.gnome.org>2001-07-03 12:21:37 +0800
commit642d32d63f226cd1ba049a9d979132e1a1cef94d (patch)
treebe4ef8fb72ca41391007554a6cbe97af41533555 /calendar/gui/dialogs/e-timezone-dialog.c
parentbacd3a85a434032316b3e63b95282175ce2b0659 (diff)
downloadgsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.gz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.bz2
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.lz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.xz
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.tar.zst
gsoc2013-evolution-642d32d63f226cd1ba049a9d979132e1a1cef94d.zip
cal-client/cal-client.[hc] cal-util/cal-component.c
2001-07-03 Damon Chaplin <damon@ximian.com> * cal-client/cal-client.[hc] * cal-util/cal-component.c * cal-util/cal-recur.[hc] * cal-util/test-recur.c * cal-util/timeutil.c * gui/calendar-config.c * gui/calendar-model.[hc] * gui/comp-util.[hc] * gui/e-calendar-table.c * gui/e-day-view-main-item.c * gui/e-day-view-top-item.c * gui/e-day-view.[hc] * gui/e-itip-control.c * gui/e-timezone-entry.[hc] * gui/e-week-view.[hc] * gui/gnome-cal.[hc] * gui/goto.c * gui/tag-calendar.[hc] * gui/dialogs/cal-prefs-dialog.c * gui/dialogs/comp-editor-page.[hc] * gui/dialogs/comp-editor-util.[hc] * gui/dialogs/comp-editor.c * gui/dialogs/e-timezone-dialog.[hc] * gui/dialogs/event-page.c * gui/dialogs/meeting-page.c * gui/dialogs/recurrence-page.c * gui/dialogs/task-details-page.c * gui/dialogs/task-details-page.glade * gui/dialogs/task-page.c * idl/evolution-calendar.idl * pcs/cal-backend-file.c * pcs/cal-backend.c * pcs/cal-backend.h * pcs/cal.c * pcs/query.c: timezone changes everywhere. There's still quite a few things to update, and its not working well at present. svn path=/trunk/; revision=10729
Diffstat (limited to 'calendar/gui/dialogs/e-timezone-dialog.c')
-rw-r--r--calendar/gui/dialogs/e-timezone-dialog.c45
1 files changed, 41 insertions, 4 deletions
diff --git a/calendar/gui/dialogs/e-timezone-dialog.c b/calendar/gui/dialogs/e-timezone-dialog.c
index ad9acfb528..70061addd6 100644
--- a/calendar/gui/dialogs/e-timezone-dialog.c
+++ b/calendar/gui/dialogs/e-timezone-dialog.c
@@ -37,6 +37,11 @@
#define E_TIMEZONE_DIALOG_MAP_POINT_SELECTED_2_RGBA 0x000000ff
struct _ETimezoneDialogPrivate {
+ /* The TZID of the timezone. May be NULL for a 'local time' (i.e. when
+ the displayed name is "") or for builtin timezones which we haven't
+ loaded yet. */
+ char *tzid;
+
/* Glade XML data */
GladeXML *xml;
@@ -131,6 +136,7 @@ e_timezone_dialog_init (ETimezoneDialog *etd)
priv = g_new0 (ETimezoneDialogPrivate, 1);
etd->priv = priv;
+ priv->tzid = NULL;
priv->point_selected = NULL;
priv->point_hover = NULL;
priv->timeout_id = 0;
@@ -149,6 +155,9 @@ e_timezone_dialog_destroy (GtkObject *object)
etd = E_TIMEZONE_DIALOG (object);
priv = etd->priv;
+ g_free (priv->tzid);
+ priv->tzid = NULL;
+
if (priv->timeout_id) {
g_source_remove (priv->timeout_id);
priv->timeout_id = 0;
@@ -460,6 +469,9 @@ on_map_button_pressed (GtkWidget *w, GdkEventButton *event, gpointer data)
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry),
get_zone_from_point (etd, priv->point_selected));
+
+ g_free (priv->tzid);
+ priv->tzid = NULL;
}
return TRUE;
@@ -508,8 +520,13 @@ get_zone_from_point (ETimezoneDialog *etd,
}
+/* Returns the TZID of the timezone set, and optionally its displayed name.
+ The TZID may be NULL, in which case the builtin timezone with the city name
+ of display_name should be used. If display_name is also NULL or "", then it
+ is assumed to be a 'local time'. */
char*
-e_timezone_dialog_get_timezone (ETimezoneDialog *etd)
+e_timezone_dialog_get_timezone (ETimezoneDialog *etd,
+ char **display_name)
{
ETimezoneDialogPrivate *priv;
@@ -518,13 +535,21 @@ e_timezone_dialog_get_timezone (ETimezoneDialog *etd)
priv = etd->priv;
- return gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry));
+ if (display_name)
+ *display_name = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry));
+
+ return priv->tzid;
}
+/* Sets the TZID and displayed name of the timezone. The TZID may be NULL for
+ a 'local time' (i.e. display_name is NULL or "") or if it is a builtin
+ timezone which hasn't been loaded yet. (This is done so we don't load
+ timezones until we really need them.) */
void
e_timezone_dialog_set_timezone (ETimezoneDialog *etd,
- char *timezone)
+ char *tzid,
+ char *display_name)
{
ETimezoneDialogPrivate *priv;
@@ -533,8 +558,13 @@ e_timezone_dialog_set_timezone (ETimezoneDialog *etd,
priv = etd->priv;
+ if (priv->tzid)
+ g_free (priv->tzid);
+
+ priv->tzid = g_strdup (tzid);
+
gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry),
- timezone);
+ display_name ? display_name : "");
find_selected_point (etd);
}
@@ -605,5 +635,12 @@ find_selected_point (ETimezoneDialog *etd)
static void
on_combo_changed (GtkEditable *entry, ETimezoneDialog *etd)
{
+ ETimezoneDialogPrivate *priv;
+
+ priv = etd->priv;
+
find_selected_point (etd);
+
+ g_free (priv->tzid);
+ priv->tzid = NULL;
}