From 84dc93b8de0c5944982f66559bfc1cc74edb19db Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Tue, 19 Jun 2001 05:23:16 +0000 Subject: added timezone fields. Also moved the 'All Day' flag into an alignment so 2001-06-19 Damon Chaplin * 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 --- calendar/gui/dialogs/event-page.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 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 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 (); +} -- cgit v1.2.3