diff options
author | Damon Chaplin <damon@ximian.com> | 2001-06-19 13:23:16 +0800 |
---|---|---|
committer | Damon Chaplin <damon@src.gnome.org> | 2001-06-19 13:23:16 +0800 |
commit | 84dc93b8de0c5944982f66559bfc1cc74edb19db (patch) | |
tree | 92a9e795070ea5eec32eed0bae87020c98f85245 /calendar/gui | |
parent | 15d3afd9d6efcc62264d8de14f2272b41c1f6891 (diff) | |
download | gsoc2013-evolution-84dc93b8de0c5944982f66559bfc1cc74edb19db.tar.gz gsoc2013-evolution-84dc93b8de0c5944982f66559bfc1cc74edb19db.tar.zst gsoc2013-evolution-84dc93b8de0c5944982f66559bfc1cc74edb19db.zip |
added timezone fields. Also moved the 'All Day' flag into an alignment so
2001-06-19 Damon Chaplin <damon@ximian.com>
* gui/dialogs/task-details-page.glade:
* gui/dialogs/task-page.glade:
* gui/dialogs/event-page.glade: added timezone fields. Also moved the
'All Day' flag into an alignment so it doesn't mess up the height of
the other widgets.
* gui/dialogs/task-details-page.c:
* gui/dialogs/task-page.c:
* gui/dialogs/event-page.c: added code to handle the timezone fields.
This still needs to be hooked up when the libical code is finished.
* gui/dialogs/e-timezone-dialog.c (on_map_leave): new function to
clear the preview label and turn off the highlighted point on the
map when you move the mouse outside it.
(find_selected_point): new function to try to find the point
corresponding to the text in the combo.
(on_combo_changed): call the above function to update the selected
point.
(on_map_leave): turn off the preview point & label when the mouse
leaves the map.
(e_timezone_dialog_set_cal_client): changed it so that selecting "None"
clears the entry.
* gui/dialogs/comp-editor-page.[hc]: added set_cal_client() virtual
method since some pages need to access the CalClient to get timezone
information. Also added comp_editor_page_set_cal_client() to call
the virtual method.
* gui/dialogs/comp-editor.c (comp_editor_set_cal_client): called
comp_editor_page_set_cal_client() on each page.
* gui/calendar-config.c: added functions to get & set the timezone.
svn path=/trunk/; revision=10285
Diffstat (limited to 'calendar/gui')
-rw-r--r-- | calendar/gui/calendar-config.c | 27 | ||||
-rw-r--r-- | calendar/gui/calendar-config.h | 4 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-page.c | 18 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor-page.h | 5 | ||||
-rw-r--r-- | calendar/gui/dialogs/comp-editor.c | 5 | ||||
-rw-r--r-- | calendar/gui/dialogs/e-timezone-dialog.c | 118 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.c | 36 | ||||
-rw-r--r-- | calendar/gui/dialogs/event-page.glade | 105 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.c | 24 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-details-page.glade | 42 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.c | 29 | ||||
-rw-r--r-- | calendar/gui/dialogs/task-page.glade | 50 |
12 files changed, 418 insertions, 45 deletions
diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 1446783c3c..a11e0d32b7 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -36,6 +36,7 @@ typedef struct { + gchar *timezone; CalWeekdays working_days; gboolean use_24_hour_format; gint week_start_day; @@ -84,6 +85,7 @@ config_read (void) gnome_config_push_prefix (prefix); g_free (prefix); + config->timezone = gnome_config_get_string ("Timezone"); config->working_days = gnome_config_get_int_with_default ("WorkingDays", &is_default); if (is_default) { config->working_days = CAL_MONDAY | CAL_TUESDAY @@ -133,6 +135,8 @@ calendar_config_write (void) gnome_config_push_prefix (prefix); g_free (prefix); + if (config->timezone) + gnome_config_set_string ("Timezone", config->timezone); gnome_config_set_int ("WorkingDays", config->working_days); gnome_config_set_bool ("Use24HourFormat", config->use_24_hour_format); gnome_config_set_int ("WeekStartDay", config->week_start_day); @@ -190,6 +194,29 @@ calendar_config_write_on_exit (void) * Calendar Settings. */ +/* 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 + dialog the next time a calendar or task folder is selected). */ +gchar* +calendar_config_get_timezone (void) +{ + return config->timezone; +} + + +/* Sets the timezone. You shouldn't really set it to the empty string or NULL, + as this means that Evolution will show the timezone-setting dialog to ask + the user for the timezone. */ +void +calendar_config_set_timezone (gchar *timezone) +{ + if (timezone && timezone[0]) + config->timezone = timezone; + else + config->timezone = NULL; +} + + /* Whether we use 24-hour format or 12-hour format (AM/PM). */ gboolean calendar_config_get_24_hour_format (void) diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index fb19ba2cc5..1dcfcbf17c 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -61,6 +61,10 @@ void calendar_config_write_on_exit (void); * Calendar Settings. */ +/* The current timezone, e.g. "Europe/London". */ +gchar* calendar_config_get_timezone (void); +void calendar_config_set_timezone (gchar *timezone); + /* The working days of the week, a bit-wise combination of flags. */ CalWeekdays calendar_config_get_working_days (void); void calendar_config_set_working_days (CalWeekdays days); diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index f390e86dd8..eab0a50566 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -126,6 +126,7 @@ comp_editor_page_class_init (CompEditorPageClass *class) class->fill_component = NULL; class->set_summary = NULL; class->set_dates = NULL; + class->set_cal_client = NULL; } @@ -222,6 +223,23 @@ comp_editor_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) } /** + * comp_editor_page_set_cal_client: + * @page: An editor page + * @client: A #CalClient object + * + * Sets the #CalClient for the dialog page to use. + **/ +void +comp_editor_page_set_cal_client (CompEditorPage *page, CalClient *client) +{ + g_return_if_fail (page != NULL); + g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); + + if (CLASS (page)->set_cal_client != NULL) + (* CLASS (page)->set_cal_client) (page, client); +} + +/** * comp_editor_page_notify_changed: * @page: An editor page. * diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index ac088e7759..931aa32d62 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -26,6 +26,7 @@ #include <libgnome/gnome-defs.h> #include <gtk/gtkwidget.h> #include <cal-util/cal-component.h> +#include "cal-client.h" BEGIN_GNOME_DECLS @@ -66,6 +67,8 @@ typedef struct { void (* set_summary) (CompEditorPage *page, const char *summary); void (* set_dates) (CompEditorPage *page, CompEditorPageDates *dates); + + void (* set_cal_client) (CompEditorPage *page, CalClient *client); } CompEditorPageClass; @@ -79,6 +82,8 @@ void comp_editor_page_set_summary (CompEditorPage *page, const char *summary); void comp_editor_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); +void comp_editor_page_set_cal_client (CompEditorPage *page, + CalClient *client); void comp_editor_page_notify_changed (CompEditorPage *page); void comp_editor_page_notify_summary_changed (CompEditorPage *page, const char *summary); diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index ddf9f9a9ae..6ab62671f5 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -252,6 +252,7 @@ void comp_editor_set_cal_client (CompEditor *editor, CalClient *client) { CompEditorPrivate *priv; + GList *elem; g_return_if_fail (editor != NULL); g_return_if_fail (IS_COMP_EDITOR (editor)); @@ -275,6 +276,10 @@ comp_editor_set_cal_client (CompEditor *editor, CalClient *client) } priv->client = client; + + /* Pass the client to any pages that need it. */ + for (elem = priv->pages; elem; elem = elem->next) + comp_editor_page_set_cal_client (elem->data, client); } /** diff --git a/calendar/gui/dialogs/e-timezone-dialog.c b/calendar/gui/dialogs/e-timezone-dialog.c index 7e9fce6cb8..d515ede197 100644 --- a/calendar/gui/dialogs/e-timezone-dialog.c +++ b/calendar/gui/dialogs/e-timezone-dialog.c @@ -69,6 +69,9 @@ static gboolean on_map_timeout (gpointer data); static gboolean on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data); +static gboolean on_map_leave (GtkWidget *widget, + GdkEventCrossing *event, + gpointer data); static gboolean on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, gpointer data); @@ -78,6 +81,10 @@ static gboolean on_map_button_pressed (GtkWidget *w, static char* get_zone_from_point (ETimezoneDialog *etd, EMapPoint *point); +static void find_selected_point (ETimezoneDialog *etd); +static void on_combo_changed (GtkEditable *entry, + ETimezoneDialog *etd); + static GtkObjectClass *parent_class; @@ -198,6 +205,7 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) map = GTK_WIDGET (e_map_new ()); priv->map = E_MAP (map); gtk_widget_set_events (map, gtk_widget_get_events (map) + | GDK_LEAVE_NOTIFY_MASK | GDK_VISIBILITY_NOTIFY_MASK); gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry), FALSE); @@ -207,11 +215,16 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) gtk_signal_connect (GTK_OBJECT (map), "motion-notify-event", GTK_SIGNAL_FUNC (on_map_motion), etd); + gtk_signal_connect (GTK_OBJECT (map), "leave-notify-event", + GTK_SIGNAL_FUNC (on_map_leave), etd); gtk_signal_connect (GTK_OBJECT (map), "visibility-notify-event", GTK_SIGNAL_FUNC (on_map_visibility_changed), etd); gtk_signal_connect (GTK_OBJECT (map), "button-press-event", GTK_SIGNAL_FUNC (on_map_button_pressed), etd); + gtk_signal_connect (GTK_OBJECT (GTK_COMBO (priv->timezone_combo)->entry), "changed", + GTK_SIGNAL_FUNC (on_combo_changed), etd); + return etd; error: @@ -325,6 +338,31 @@ on_map_motion (GtkWidget *widget, GdkEventMotion *event, gpointer data) static gboolean +on_map_leave (GtkWidget *widget, GdkEventCrossing *event, gpointer data) +{ + ETimezoneDialog *etd; + ETimezoneDialogPrivate *priv; + char *old_zone; + + etd = E_TIMEZONE_DIALOG (data); + priv = etd->priv; + + if (priv->point_hover && priv->point_hover != priv->point_selected) + e_map_point_set_color_rgba (priv->map, priv->point_hover, + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + + priv->point_hover = NULL; + + /* Clear the timezone preview label, if it isn't already empty. */ + gtk_label_get (GTK_LABEL (priv->timezone_preview), &old_zone); + if (strcmp (old_zone, "")) + gtk_label_set_text (GTK_LABEL (priv->timezone_preview), ""); + + return FALSE; +} + + +static gboolean on_map_visibility_changed (GtkWidget *w, GdkEventVisibility *event, gpointer data) { @@ -433,7 +471,8 @@ e_timezone_dialog_set_cal_client (ETimezoneDialog *etd, { ETimezoneDialogPrivate *priv; CalTimezoneInfo *zone; - GList *tzlist = NULL; + GtkWidget *listitem; + GtkCombo *combo; char *current_zone; int i; @@ -443,6 +482,11 @@ e_timezone_dialog_set_cal_client (ETimezoneDialog *etd, priv = etd->priv; + combo = GTK_COMBO (priv->timezone_combo); + + /* Clear any existing items */ + gtk_list_clear_items (GTK_LIST (combo->list), 0, -1); + priv->zones = cal_client_get_builtin_timezone_info (client); if (!priv->zones) { @@ -450,9 +494,17 @@ e_timezone_dialog_set_cal_client (ETimezoneDialog *etd, return; } - /* Put the "None" and "UTC" entries at the top of the combo's list. */ - tzlist = g_list_prepend (tzlist, _("None")); - tzlist = g_list_prepend (tzlist, _("UTC")); + /* Put the "None" and "UTC" entries at the top of the combo's list. + When "None" is selected we want the field to be cleared. */ + listitem = gtk_list_item_new_with_label (_("None")); + gtk_widget_show (listitem); + gtk_container_add (GTK_CONTAINER (combo->list), listitem); + gtk_combo_set_item_string (combo, GTK_ITEM (listitem), ""); + + /* Note: We don't translate timezone names at the moment. */ + listitem = gtk_list_item_new_with_label ("UTC"); + gtk_widget_show (listitem); + gtk_container_add (GTK_CONTAINER (combo->list), listitem); current_zone = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry)); @@ -469,14 +521,11 @@ e_timezone_dialog_set_cal_client (ETimezoneDialog *etd, zone->longitude, zone->latitude, E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); } - tzlist = g_list_prepend (tzlist, zone->location); - } - - tzlist = g_list_reverse (tzlist); - gtk_combo_set_popdown_strings (GTK_COMBO (priv->timezone_combo), - tzlist); - g_list_free (tzlist); + listitem = gtk_list_item_new_with_label (zone->location); + gtk_widget_show (listitem); + gtk_container_add (GTK_CONTAINER (combo->list), listitem); + } } @@ -506,8 +555,9 @@ e_timezone_dialog_set_timezone (ETimezoneDialog *etd, priv = etd->priv; gtk_entry_set_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry), - get_zone_from_point (etd, priv->point_selected)); + timezone); + find_selected_point (etd); } @@ -524,3 +574,47 @@ e_timezone_dialog_get_toplevel (ETimezoneDialog *etd) return priv->app; } + +/* This tries to find the timezone corresponding to the text in the combo, + and selects the point so that it flashes. */ +static void +find_selected_point (ETimezoneDialog *etd) +{ + ETimezoneDialogPrivate *priv; + CalTimezoneInfo *zone; + char *current_zone; + EMapPoint *point = NULL; + int i; + + priv = etd->priv; + + if (priv->zones == NULL) + return; + + current_zone = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry)); + + for (i = 0; i < priv->zones->len; i++) { + zone = &g_array_index (priv->zones, CalTimezoneInfo, i); + if (!strcmp (current_zone, zone->location)) { + point = e_map_get_closest_point (priv->map, + zone->longitude, + zone->latitude, + FALSE); + + break; + } + } + + if (priv->point_selected) + e_map_point_set_color_rgba (priv->map, priv->point_selected, + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + + priv->point_selected = point; +} + + +static void +on_combo_changed (GtkEditable *entry, ETimezoneDialog *etd) +{ + find_selected_point (etd); +} diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 07ace90bec..8087294012 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -35,6 +35,7 @@ #include "widgets/misc/e-dateedit.h" #include "cal-util/timeutil.h" #include "../calendar-config.h" +#include "../e-timezone-entry.h" #include "comp-editor-util.h" #include "event-page.h" @@ -53,6 +54,8 @@ struct _EventPagePrivate { GtkWidget *start_time; GtkWidget *end_time; + GtkWidget *start_timezone; + GtkWidget *end_timezone; GtkWidget *all_day_event; GtkWidget *description; @@ -81,6 +84,7 @@ static void event_page_fill_widgets (CompEditorPage *page, CalComponent *comp); static void event_page_fill_component (CompEditorPage *page, CalComponent *comp); static void event_page_set_summary (CompEditorPage *page, const char *summary); static void event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); +static void event_page_set_cal_client (CompEditorPage *page, CalClient *client); static CompEditorPageClass *parent_class = NULL; @@ -135,6 +139,7 @@ event_page_class_init (EventPageClass *class) editor_page_class->fill_component = event_page_fill_component; editor_page_class->set_summary = event_page_set_summary; editor_page_class->set_dates = event_page_set_dates; + editor_page_class->set_cal_client = event_page_set_cal_client; object_class->destroy = event_page_destroy; } @@ -154,6 +159,8 @@ event_page_init (EventPage *epage) priv->summary = NULL; priv->start_time = NULL; priv->end_time = NULL; + priv->start_timezone = NULL; + priv->end_timezone = NULL; priv->all_day_event = NULL; priv->description = NULL; priv->classification_public = NULL; @@ -505,6 +512,19 @@ event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) /* nothing */ } +static void +event_page_set_cal_client (CompEditorPage *page, CalClient *client) +{ + EventPage *epage; + EventPagePrivate *priv; + + epage = EVENT_PAGE (page); + priv = epage->priv; + + e_timezone_entry_set_cal_client (E_TIMEZONE_ENTRY (priv->start_timezone), client); + e_timezone_entry_set_cal_client (E_TIMEZONE_ENTRY (priv->end_timezone),client); +} + /* Gets the widgets from the XML file and returns if they are all available. */ @@ -526,6 +546,8 @@ get_widgets (EventPage *epage) priv->start_time = GW ("start-time"); priv->end_time = GW ("end-time"); + priv->start_timezone = GW ("start-timezone"); + priv->end_timezone = GW ("end-timezone"); priv->all_day_event = GW ("all-day-event"); priv->description = GW ("description"); @@ -545,6 +567,8 @@ get_widgets (EventPage *epage) return (priv->summary && priv->start_time && priv->end_time + && priv->start_timezone + && priv->end_timezone && priv->all_day_event && priv->description && priv->classification_public @@ -850,6 +874,10 @@ init_widgets (EventPage *epage) GTK_SIGNAL_FUNC (field_changed_cb), epage); gtk_signal_connect (GTK_OBJECT (priv->end_time), "changed", GTK_SIGNAL_FUNC (field_changed_cb), epage); + gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed", + GTK_SIGNAL_FUNC (field_changed_cb), epage); + gtk_signal_connect (GTK_OBJECT (priv->end_timezone), "changed", + GTK_SIGNAL_FUNC (field_changed_cb), epage); gtk_signal_connect (GTK_OBJECT (priv->all_day_event), "toggled", GTK_SIGNAL_FUNC (field_changed_cb), epage); gtk_signal_connect (GTK_OBJECT (priv->description), "changed", @@ -938,3 +966,11 @@ make_date_edit (void) { return comp_editor_new_date_edit (TRUE, TRUE); } + +GtkWidget *make_timezone_entry (void); + +GtkWidget * +make_timezone_entry (void) +{ + return e_timezone_entry_new (); +} diff --git a/calendar/gui/dialogs/event-page.glade b/calendar/gui/dialogs/event-page.glade index e9b774fe41..bd1c094357 100644 --- a/calendar/gui/dialogs/event-page.glade +++ b/calendar/gui/dialogs/event-page.glade @@ -117,7 +117,7 @@ <name>table12</name> <border_width>4</border_width> <rows>2</rows> - <columns>3</columns> + <columns>4</columns> <homogeneous>False</homogeneous> <row_spacing>4</row_spacing> <column_spacing>4</column_spacing> @@ -175,29 +175,6 @@ </widget> <widget> - <class>GtkCheckButton</class> - <name>all-day-event</name> - <can_focus>True</can_focus> - <label>A_ll day event</label> - <active>False</active> - <draw_indicator>True</draw_indicator> - <child> - <left_attach>2</left_attach> - <right_attach>3</right_attach> - <top_attach>0</top_attach> - <bottom_attach>1</bottom_attach> - <xpad>0</xpad> - <ypad>0</ypad> - <xexpand>False</xexpand> - <yexpand>False</yexpand> - <xshrink>False</xshrink> - <yshrink>False</yshrink> - <xfill>True</xfill> - <yfill>False</yfill> - </child> - </widget> - - <widget> <class>Custom</class> <name>start-time</name> <creation_function>make_date_edit</creation_function> @@ -244,6 +221,84 @@ <yfill>True</yfill> </child> </widget> + + <widget> + <class>Custom</class> + <name>end-timezone</name> + <creation_function>make_timezone_entry</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Mon, 18 Jun 2001 23:51:40 GMT</last_modification_time> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>False</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>Custom</class> + <name>start-timezone</name> + <creation_function>make_timezone_entry</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Mon, 18 Jun 2001 23:51:34 GMT</last_modification_time> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>GtkAlignment</class> + <name>alignment1</name> + <xalign>0.5</xalign> + <yalign>7.45058e-09</yalign> + <xscale>1</xscale> + <yscale>0</yscale> + <child> + <left_attach>3</left_attach> + <right_attach>4</right_attach> + <top_attach>0</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + + <widget> + <class>GtkCheckButton</class> + <name>all-day-event</name> + <can_focus>True</can_focus> + <label>A_ll day event</label> + <active>False</active> + <draw_indicator>True</draw_indicator> + </widget> + </widget> </widget> </widget> @@ -350,6 +405,7 @@ <class>GtkButton</class> <name>contacts-button</name> <can_focus>True</can_focus> + <relief>GTK_RELIEF_NORMAL</relief> <child> <padding>0</padding> <expand>False</expand> @@ -388,6 +444,7 @@ <class>GtkButton</class> <name>categories-button</name> <can_focus>True</can_focus> + <relief>GTK_RELIEF_NORMAL</relief> <child> <padding>0</padding> <expand>False</expand> diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 7fb3bd1672..bde17af2fe 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -32,6 +32,7 @@ #include <gal/widgets/e-unicode.h> #include <widgets/misc/e-dateedit.h> #include "e-util/e-dialog-widgets.h" +#include "../e-timezone-entry.h" #include "comp-editor-util.h" #include "task-details-page.h" @@ -49,6 +50,8 @@ struct _TaskDetailsPagePrivate { GtkWidget *date_time; GtkWidget *completed_date; + GtkWidget *completed_timezone; + GtkWidget *url; gboolean updating; @@ -65,6 +68,7 @@ static void task_details_page_fill_widgets (CompEditorPage *page, CalComponent * static void task_details_page_fill_component (CompEditorPage *page, CalComponent *comp); static void task_details_page_set_summary (CompEditorPage *page, const char *summary); static void task_details_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); +static void task_details_page_set_cal_client (CompEditorPage *page, CalClient *client); static CompEditorPageClass *parent_class = NULL; @@ -120,6 +124,7 @@ task_details_page_class_init (TaskDetailsPageClass *class) editor_page_class->fill_component = task_details_page_fill_component; editor_page_class->set_summary = task_details_page_set_summary; editor_page_class->set_dates = task_details_page_set_dates; + editor_page_class->set_cal_client = task_details_page_set_cal_client; object_class->destroy = task_details_page_destroy; } @@ -139,6 +144,7 @@ task_details_page_init (TaskDetailsPage *tdpage) priv->summary = NULL; priv->date_time = NULL; priv->completed_date = NULL; + priv->completed_timezone = NULL; priv->url = NULL; priv->updating = FALSE; @@ -303,6 +309,18 @@ task_details_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) dates->complete); } +static void +task_details_page_set_cal_client (CompEditorPage *page, CalClient *client) +{ + TaskDetailsPage *tdpage; + TaskDetailsPagePrivate *priv; + + tdpage = TASK_DETAILS_PAGE (page); + priv = tdpage->priv; + + e_timezone_entry_set_cal_client (E_TIMEZONE_ENTRY (priv->completed_timezone), client); +} + /* Gets the widgets from the XML file and returns if they are all available. */ @@ -324,6 +342,8 @@ get_widgets (TaskDetailsPage *tdpage) priv->date_time = GW ("date-time"); priv->completed_date = GW ("completed-date"); + priv->completed_timezone = GW ("completed-timezone"); + priv->url = GW ("url"); #undef GW @@ -331,6 +351,7 @@ get_widgets (TaskDetailsPage *tdpage) return (priv->summary && priv->date_time && priv->completed_date + && priv->completed_timezone && priv->url); } @@ -385,6 +406,9 @@ init_widgets (TaskDetailsPage *tdpage) gtk_signal_connect (GTK_OBJECT (priv->completed_date), "changed", GTK_SIGNAL_FUNC (date_changed_cb), tdpage); + gtk_signal_connect (GTK_OBJECT (priv->completed_timezone), "changed", + GTK_SIGNAL_FUNC (field_changed_cb), tdpage); + /* URL */ gtk_signal_connect (GTK_OBJECT (priv->url), "changed", GTK_SIGNAL_FUNC (field_changed_cb), tdpage); diff --git a/calendar/gui/dialogs/task-details-page.glade b/calendar/gui/dialogs/task-details-page.glade index 9d13387d59..b2438785b5 100644 --- a/calendar/gui/dialogs/task-details-page.glade +++ b/calendar/gui/dialogs/task-details-page.glade @@ -251,12 +251,10 @@ </widget> <widget> - <class>Custom</class> - <name>completed-date</name> - <creation_function>task_details_page_create_date_edit</creation_function> - <int1>0</int1> - <int2>0</int2> - <last_modification_time>Fri, 01 Jun 2001 18:58:51 GMT</last_modification_time> + <class>GtkHBox</class> + <name>hbox1</name> + <homogeneous>False</homogeneous> + <spacing>0</spacing> <child> <left_attach>1</left_attach> <right_attach>2</right_attach> @@ -264,13 +262,41 @@ <bottom_attach>1</bottom_attach> <xpad>0</xpad> <ypad>0</ypad> - <xexpand>True</xexpand> + <xexpand>False</xexpand> <yexpand>False</yexpand> <xshrink>False</xshrink> <yshrink>False</yshrink> <xfill>True</xfill> - <yfill>False</yfill> + <yfill>True</yfill> </child> + + <widget> + <class>Custom</class> + <name>completed-date</name> + <creation_function>task_details_page_create_date_edit</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Fri, 01 Jun 2001 18:58:51 GMT</last_modification_time> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> + + <widget> + <class>Custom</class> + <name>completed-timezone</name> + <creation_function>make_timezone_entry</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Tue, 19 Jun 2001 04:32:42 GMT</last_modification_time> + <child> + <padding>0</padding> + <expand>True</expand> + <fill>True</fill> + </child> + </widget> </widget> </widget> </widget> diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 6b02ab884b..340281dd59 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -36,6 +36,7 @@ #include <gal/widgets/e-categories.h> #include <widgets/misc/e-dateedit.h> #include "e-util/e-dialog-widgets.h" +#include "../e-timezone-entry.h" #include "comp-editor-util.h" #include "task-page.h" @@ -53,6 +54,8 @@ struct _TaskPagePrivate { GtkWidget *due_date; GtkWidget *start_date; + GtkWidget *due_timezone; + GtkWidget *start_timezone; GtkWidget *percent_complete; @@ -116,6 +119,7 @@ static void task_page_fill_widgets (CompEditorPage *page, CalComponent *comp); static void task_page_fill_component (CompEditorPage *page, CalComponent *comp); static void task_page_set_summary (CompEditorPage *page, const char *summary); static void task_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); +static void task_page_set_cal_client (CompEditorPage *page, CalClient *client); static CompEditorPageClass *parent_class = NULL; @@ -170,6 +174,7 @@ task_page_class_init (TaskPageClass *class) editor_page_class->fill_component = task_page_fill_component; editor_page_class->set_summary = task_page_set_summary; editor_page_class->set_dates = task_page_set_dates; + editor_page_class->set_cal_client = task_page_set_cal_client; object_class->destroy = task_page_destroy; } @@ -189,6 +194,8 @@ task_page_init (TaskPage *tpage) priv->summary = NULL; priv->due_date = NULL; priv->start_date = NULL; + priv->due_timezone = NULL; + priv->start_timezone = NULL; priv->percent_complete = NULL; priv->status = NULL; priv->description = NULL; @@ -600,6 +607,19 @@ task_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) priv->updating = FALSE; } +static void +task_page_set_cal_client (CompEditorPage *page, CalClient *client) +{ + TaskPage *tpage; + TaskPagePrivate *priv; + + tpage = TASK_PAGE (page); + priv = tpage->priv; + + e_timezone_entry_set_cal_client (E_TIMEZONE_ENTRY (priv->due_timezone), client); + e_timezone_entry_set_cal_client (E_TIMEZONE_ENTRY (priv->start_timezone),client); +} + /* Gets the widgets from the XML file and returns if they are all available. */ @@ -621,6 +641,8 @@ get_widgets (TaskPage *tpage) priv->due_date = GW ("due-date"); priv->start_date = GW ("start-date"); + priv->due_timezone = GW ("due-timezone"); + priv->start_timezone = GW ("start-timezone"); priv->percent_complete = GW ("percent-complete"); @@ -644,6 +666,8 @@ get_widgets (TaskPage *tpage) return (priv->summary && priv->due_date && priv->start_date + && priv->due_timezone + && priv->start_timezone && priv->percent_complete && priv->status && priv->priority @@ -855,6 +879,11 @@ init_widgets (TaskPage *tpage) gtk_signal_connect (GTK_OBJECT (priv->due_date), "changed", GTK_SIGNAL_FUNC (date_changed_cb), tpage); + gtk_signal_connect (GTK_OBJECT (priv->due_timezone), "changed", + GTK_SIGNAL_FUNC (field_changed_cb), tpage); + gtk_signal_connect (GTK_OBJECT (priv->start_timezone), "changed", + GTK_SIGNAL_FUNC (field_changed_cb), tpage); + /* Connect signals. The Status, Percent Complete & Date Completed properties are closely related so whenever one changes we may need to update the other 2. */ diff --git a/calendar/gui/dialogs/task-page.glade b/calendar/gui/dialogs/task-page.glade index b6182cd860..0c54bb80a9 100644 --- a/calendar/gui/dialogs/task-page.glade +++ b/calendar/gui/dialogs/task-page.glade @@ -120,7 +120,7 @@ <class>GtkTable</class> <name>table1</name> <rows>2</rows> - <columns>2</columns> + <columns>3</columns> <homogeneous>False</homogeneous> <row_spacing>2</row_spacing> <column_spacing>4</column_spacing> @@ -227,6 +227,52 @@ <yfill>False</yfill> </child> </widget> + + <widget> + <class>Custom</class> + <name>due-timezone</name> + <creation_function>make_timezone_entry</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Tue, 19 Jun 2001 04:43:54 GMT</last_modification_time> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>0</top_attach> + <bottom_attach>1</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>True</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> + + <widget> + <class>Custom</class> + <name>start-timezone</name> + <creation_function>make_timezone_entry</creation_function> + <int1>0</int1> + <int2>0</int2> + <last_modification_time>Tue, 19 Jun 2001 04:43:46 GMT</last_modification_time> + <child> + <left_attach>2</left_attach> + <right_attach>3</right_attach> + <top_attach>1</top_attach> + <bottom_attach>2</bottom_attach> + <xpad>0</xpad> + <ypad>0</ypad> + <xexpand>False</xexpand> + <yexpand>False</yexpand> + <xshrink>False</xshrink> + <yshrink>False</yshrink> + <xfill>True</xfill> + <yfill>True</yfill> + </child> + </widget> </widget> </widget> </widget> @@ -468,6 +514,7 @@ Undefined <class>GtkButton</class> <name>contacts-button</name> <can_focus>True</can_focus> + <relief>GTK_RELIEF_NORMAL</relief> <child> <padding>0</padding> <expand>False</expand> @@ -506,6 +553,7 @@ Undefined <class>GtkButton</class> <name>categories-button</name> <can_focus>True</can_focus> + <relief>GTK_RELIEF_NORMAL</relief> <child> <padding>0</padding> <expand>False</expand> |