From 4909b5ff6de4c14cc399aa9a94030fb0170e8a19 Mon Sep 17 00:00:00 2001 From: Rodrigo Moya Date: Mon, 5 Apr 2004 11:17:43 +0000 Subject: Fixes #56316 2004-04-05 Rodrigo Moya Fixes #56316 * gui/dialogs/comp-editor-page.[ch]: added "fill_timezones" virtual method to CompEditorPage class. (comp_editor_page_fill_timezones): new function. (comp_editor_page_class_init): initialize new virtual method. * gui/dialogs/event-page.c (event_page_fill_timezones, event_page_class_init): * gui/dialogs/task-page.c (task_page_fill_timezones, task_page_class_init): * gui/dialogs/task-details-page.c (task_details_page_fill_timezones, task_details_page_class_init): implemented new virtual method for pages dealing with timezones. * gui/dialogs/comp-editor.c (save_comp): call the "fill_timezones" method on all pages, and call... (send_timezone): ...this function for each hash table item. svn path=/trunk/; revision=25314 --- calendar/gui/dialogs/event-page.c | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) (limited to 'calendar/gui/dialogs/event-page.c') diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index c56e477fe2..a367396b93 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -97,6 +97,7 @@ static GtkWidget *event_page_get_widget (CompEditorPage *page); static void event_page_focus_main_widget (CompEditorPage *page); static gboolean event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp); static gboolean event_page_fill_component (CompEditorPage *page, ECalComponent *comp); +static gboolean event_page_fill_timezones (CompEditorPage *page, GHashTable *timezones); static void event_page_set_summary (CompEditorPage *page, const char *summary); static void event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); @@ -132,6 +133,7 @@ event_page_class_init (EventPageClass *class) editor_page_class->focus_main_widget = event_page_focus_main_widget; editor_page_class->fill_widgets = event_page_fill_widgets; editor_page_class->fill_component = event_page_fill_component; + editor_page_class->fill_timezones = event_page_fill_timezones; editor_page_class->set_summary = event_page_set_summary; editor_page_class->set_dates = event_page_set_dates; @@ -695,6 +697,34 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) return TRUE; } +/* fill_timezones handler for the event page */ +static gboolean +event_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) +{ + EventPage *epage; + EventPagePrivate *priv; + icaltimezone *zone; + + epage = EVENT_PAGE (page); + priv = epage->priv; + + /* add start date timezone */ + zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone)); + if (zone) { + if (!g_hash_table_lookup (timezones, icaltimezone_get_tzid (zone))) + g_hash_table_insert (timezones, icaltimezone_get_tzid (zone), zone); + } + + /* add end date timezone */ + zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->end_timezone)); + if (zone) { + if (!g_hash_table_lookup (timezones, icaltimezone_get_tzid (zone))) + g_hash_table_insert (timezones, icaltimezone_get_tzid (zone), zone); + } + + return TRUE; +} + /* set_summary handler for the event page */ static void event_page_set_summary (CompEditorPage *page, const char *summary) -- cgit v1.2.3