From c9e9b9a7bd01883daf4ac57e83233aae40bf1439 Mon Sep 17 00:00:00 2001 From: Damon Chaplin Date: Wed, 20 Jun 2001 02:45:03 +0000 Subject: added a 'Time zone' setting. Also rearranged a little, adding a new 2001-06-19 Damon Chaplin * gui/dialogs/cal-prefs-dialog.c: added a 'Time zone' setting. Also rearranged a little, adding a new 'General' page, since we had too many settings on the 'Calendar' page. * gui/e-timezone-entry.[hc]: * gui/dialogs/e-timezone-dialog.[hc]: * gui/dialogs/comp-editor.c: * gui/dialogs/comp-editor-page.[hc]: * gui/dialogs/event-page.c: * gui/dialogs/task-details-page.c: * gui/dialogs/task-page.c: removed CalClient stuff. The timezone dialog now uses the timezone data directly from the client's libical library. svn path=/trunk/; revision=10321 --- calendar/gui/dialogs/cal-prefs-dialog.c | 19 +- calendar/gui/dialogs/cal-prefs-dialog.glade | 334 ++++++++++++++++++---------- calendar/gui/dialogs/cal-prefs-dialog.h | 6 +- calendar/gui/dialogs/comp-editor-page.c | 18 -- calendar/gui/dialogs/comp-editor-page.h | 5 - calendar/gui/dialogs/comp-editor.c | 5 - calendar/gui/dialogs/e-timezone-dialog.c | 193 ++++++++-------- calendar/gui/dialogs/e-timezone-dialog.h | 5 - calendar/gui/dialogs/event-page.c | 15 -- calendar/gui/dialogs/task-details-page.c | 14 -- calendar/gui/dialogs/task-page.c | 15 -- calendar/gui/e-timezone-entry.c | 41 ---- calendar/gui/e-timezone-entry.h | 3 - 13 files changed, 327 insertions(+), 346 deletions(-) (limited to 'calendar') diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index 9839318e8e..df030eddd6 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -33,18 +33,20 @@ #include #include #include +#include "../e-timezone-entry.h" #include "cal-prefs-dialog.h" #include "../calendar-config.h" #include "../calendar-commands.h" #include "../e-tasks.h" -typedef struct { +struct _CalPrefsDialogPrivate { /* Glade XML data */ GladeXML *xml; GtkWidget *dialog; + GtkWidget *timezone; GtkWidget *working_days[7]; GtkWidget *week_start_day; GtkWidget *start_of_day; @@ -55,7 +57,7 @@ typedef struct { GtkWidget *show_end_times; GtkWidget *compress_weekend; GtkWidget *dnav_show_week_no; -} CalPrefsDialogPrivate; +}; static const int week_start_day_map[] = { 1, 2, 3, 4, 5, 6, 0, -1 @@ -196,6 +198,7 @@ get_widgets (CalPrefsDialog *prefs) priv->working_days[5] = GW ("fri_button"); priv->working_days[6] = GW ("sat_button"); + priv->timezone = GW ("timezone"); priv->week_start_day = GW ("first_day_of_week"); priv->start_of_day = GW ("start_of_day"); priv->end_of_day = GW ("end_of_day"); @@ -209,6 +212,7 @@ get_widgets (CalPrefsDialog *prefs) #undef GW return (priv->dialog + && priv->timezone && priv->working_days[0] && priv->working_days[1] && priv->working_days[2] @@ -347,9 +351,15 @@ cal_prefs_dialog_show_config (CalPrefsDialog *prefs) CalPrefsDialogPrivate *priv; CalWeekdays working_days; gint mask, day, week_start_day, time_divisions; + char *zone; priv = prefs->priv; + /* Timezone. */ + zone = calendar_config_get_timezone (); + e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->timezone), + zone ? zone : ""); + /* Working Days. */ working_days = calendar_config_get_working_days (); mask = 1 << 0; @@ -403,9 +413,14 @@ cal_prefs_dialog_update_config (CalPrefsDialog *prefs) CalPrefsDialogPrivate *priv; CalWeekdays working_days; gint mask, day, week_start_day, time_divisions, hour, minute; + char *zone; priv = prefs->priv; + /* Timezone. */ + zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->timezone)); + calendar_config_set_timezone (zone); + /* Working Days. */ working_days = 0; mask = 1 << 0; diff --git a/calendar/gui/dialogs/cal-prefs-dialog.glade b/calendar/gui/dialogs/cal-prefs-dialog.glade index f6eccb163d..bf45b072ce 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.glade +++ b/calendar/gui/dialogs/cal-prefs-dialog.glade @@ -98,11 +98,161 @@ GtkVBox - vbox8 + vbox10 4 False 6 + + GtkFrame + frame12 + + 0 + GTK_SHADOW_ETCHED_IN + + 0 + False + True + + + + GtkTable + table5 + 4 + 2 + 2 + False + 4 + 4 + + + GtkLabel + label22 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 0 + 1 + 0 + 0 + False + False + False + False + True + False + + + + + Custom + timezone + make_timezone_entry + 0 + 0 + Wed, 20 Jun 2001 02:22:46 GMT + + 1 + 2 + 0 + 1 + 0 + 0 + True + False + False + False + True + True + + + + + GtkLabel + label20 + + GTK_JUSTIFY_CENTER + False + 0 + 0.5 + 0 + 0 + + 0 + 1 + 1 + 2 + 0 + 0 + False + False + False + False + True + False + + + + + GtkHBox + hbox10 + True + 4 + + 1 + 2 + 1 + 2 + 0 + 0 + False + False + False + False + True + True + + + + GtkRadioButton + use_12_hour + True + + False + True + time_format_group + + 0 + False + True + + + + + GtkRadioButton + use_24_hour + True + + False + True + time_format_group + + 0 + False + True + + + + + + GtkFrame frame9 @@ -357,6 +507,31 @@ Sunday + + Placeholder + + + + + GtkLabel + Notebook:tab + label21 + + GTK_JUSTIFY_CENTER + False + 0.5 + 0.5 + 0 + 0 + + + + GtkVBox + vbox8 + 4 + False + 6 + GtkFrame frame10 @@ -373,8 +548,8 @@ Sunday GtkTable table4 4 - 4 - 3 + 3 + 7 False 0 4 @@ -392,8 +567,8 @@ Sunday 0 1 - 1 - 2 + 0 + 1 0 0 False @@ -406,46 +581,56 @@ Sunday - GtkLabel - label20 - - GTK_JUSTIFY_CENTER - False - 0 + GtkAlignment + alignment4 + 7.45058e-09 0.5 - 0 - 0 + 0 + 1 - 0 - 1 + 1 + 2 0 1 0 0 - False + True False False False True False + + + GtkOptionMenu + time_divisions + True + 60 minutes +30 minutes +15 minutes +10 minutes +05 minutes + + 0 + GtkCheckButton show_end_times True - + False True 0 - 3 - 2 - 3 + 7 + 1 + 2 0 0 - True + False False False False @@ -458,35 +643,14 @@ Sunday GtkCheckButton compress_weekend True - + False True 0 - 3 - 3 - 4 - 0 - 0 - True - False - False - False - True - False - - - - - GtkHBox - hbox10 - True - 4 - - 1 - 3 - 0 - 1 + 7 + 2 + 3 0 0 False @@ -496,72 +660,6 @@ Sunday True True - - - GtkRadioButton - use_12_hour - True - - False - True - time_format_group - - 0 - False - True - - - - - GtkRadioButton - use_24_hour - True - - False - True - time_format_group - - 0 - False - True - - - - - - GtkAlignment - alignment4 - 7.45058e-09 - 0.5 - 0 - 1 - - 1 - 2 - 1 - 2 - 0 - 0 - False - False - False - False - True - False - - - - GtkOptionMenu - time_divisions - True - 60 minutes -30 minutes -15 minutes -10 minutes -05 minutes - - 0 - @@ -963,18 +1061,18 @@ Sunday GtkVBox vbox6 + 4 False - 0 + 6 GtkFrame frame6 - 4 0 GTK_SHADOW_ETCHED_IN - 4 + 0 False True @@ -1046,12 +1144,11 @@ Sunday GtkFrame frame7 - 4 0 GTK_SHADOW_ETCHED_IN - 4 + 0 False True @@ -1070,12 +1167,11 @@ Sunday GtkFrame frame8 - 4 0 GTK_SHADOW_ETCHED_IN - 4 + 0 False True diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h index 9d744f806d..58d7880e2d 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.h +++ b/calendar/gui/dialogs/cal-prefs-dialog.h @@ -45,12 +45,14 @@ BEGIN_GNOME_DECLS typedef struct _CalPrefsDialog CalPrefsDialog; typedef struct _CalPrefsDialogClass CalPrefsDialogClass; +typedef struct _CalPrefsDialogPrivate CalPrefsDialogPrivate; + struct _CalPrefsDialog { GtkObject object; - /* Private data */ - gpointer priv; + /*< private >*/ + CalPrefsDialogPrivate *priv; }; struct _CalPrefsDialogClass diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 005314d0c0..afa09177f5 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -136,7 +136,6 @@ comp_editor_page_class_init (CompEditorPageClass *class) class->fill_component = NULL; class->set_summary = NULL; class->set_dates = NULL; - class->set_cal_client = NULL; } @@ -198,23 +197,6 @@ comp_editor_page_fill_component (CompEditorPage *page, CalComponent *comp) (* CLASS (page)->fill_component) (page, comp); } -/** - * 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_set_summary: * @page: An editor page diff --git a/calendar/gui/dialogs/comp-editor-page.h b/calendar/gui/dialogs/comp-editor-page.h index c4c31852cf..b544200a76 100644 --- a/calendar/gui/dialogs/comp-editor-page.h +++ b/calendar/gui/dialogs/comp-editor-page.h @@ -26,7 +26,6 @@ #include #include #include -#include "cal-client.h" BEGIN_GNOME_DECLS @@ -69,8 +68,6 @@ 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; @@ -80,8 +77,6 @@ void comp_editor_page_fill_widgets (CompEditorPage *page, CalComponent *comp); void comp_editor_page_fill_component (CompEditorPage *page, CalComponent *comp); -void comp_editor_page_set_cal_client (CompEditorPage *page, - CalClient *client); void comp_editor_page_set_summary (CompEditorPage *page, const char *summary); void comp_editor_page_set_dates (CompEditorPage *page, diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index bdcaefd269..bdf5c39737 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -359,7 +359,6 @@ 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)); @@ -383,10 +382,6 @@ 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 d515ede197..199abbeb3f 100644 --- a/calendar/gui/dialogs/e-timezone-dialog.c +++ b/calendar/gui/dialogs/e-timezone-dialog.c @@ -26,6 +26,7 @@ #include #include #include +#include #include #include #include "e-timezone-dialog.h" @@ -39,11 +40,6 @@ struct _ETimezoneDialogPrivate { /* Glade XML data */ GladeXML *xml; - /* Client to use */ - CalClient *client; - - GArray *zones; - EMapPoint *point_selected; EMapPoint *point_hover; @@ -158,12 +154,6 @@ e_timezone_dialog_destroy (GtkObject *object) priv->timeout_id = 0; } - if (priv->client) { - gtk_signal_disconnect_by_data (GTK_OBJECT (priv->client), etd); - gtk_object_unref (GTK_OBJECT (priv->client)); - priv->client = NULL; - } - if (priv->xml) { gtk_object_unref (GTK_OBJECT (priv->xml)); priv->xml = NULL; @@ -177,6 +167,57 @@ e_timezone_dialog_destroy (GtkObject *object) } +static void +e_timezone_dialog_add_timezones (ETimezoneDialog *etd) +{ + ETimezoneDialogPrivate *priv; + icalarray *zones; + GtkWidget *listitem; + GtkCombo *combo; + int i; + + priv = etd->priv; + + combo = GTK_COMBO (priv->timezone_combo); + + /* Clear any existing items in the combo. */ + gtk_list_clear_items (GTK_LIST (combo->list), 0, -1); + + /* 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); + + /* Get the array of builtin timezones. */ + zones = icaltimezone_get_builtin_timezones (); + + for (i = 0; i < zones->num_elements; i++) { + icaltimezone *zone; + char *location; + + zone = icalarray_element_at (zones, i); + + location = icaltimezone_get_location (zone); + + e_map_add_point (priv->map, location, + icaltimezone_get_longitude (zone), + icaltimezone_get_latitude (zone), + E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); + + listitem = gtk_list_item_new_with_label (location); + gtk_widget_show (listitem); + gtk_container_add (GTK_CONTAINER (combo->list), listitem); + } +} + + ETimezoneDialog * e_timezone_dialog_construct (ETimezoneDialog *etd) { @@ -210,6 +251,8 @@ e_timezone_dialog_construct (ETimezoneDialog *etd) gtk_entry_set_editable (GTK_ENTRY (GTK_COMBO (priv->timezone_combo)->entry), FALSE); + e_timezone_dialog_add_timezones (etd); + gtk_container_add (GTK_CONTAINER (priv->map_window), map); gtk_widget_show (map); @@ -428,26 +471,34 @@ get_zone_from_point (ETimezoneDialog *etd, EMapPoint *point) { ETimezoneDialogPrivate *priv; - CalTimezoneInfo *zone; + icalarray *zones; double longitude, latitude; int i; priv = etd->priv; - if (point == NULL || priv->zones == NULL) + if (point == NULL) return ""; e_map_point_get_location (point, &longitude, &latitude); - for (i = 0; i < priv->zones->len; i++) { - zone = &g_array_index (priv->zones, CalTimezoneInfo, i); + /* Get the array of builtin timezones. */ + zones = icaltimezone_get_builtin_timezones (); + + for (i = 0; i < zones->num_elements; i++) { + icaltimezone *zone; + double zone_longitude, zone_latitude; + + zone = icalarray_element_at (zones, i); + zone_longitude = icaltimezone_get_longitude (zone); + zone_latitude = icaltimezone_get_latitude (zone); - if (zone->longitude - 0.005 <= longitude && - zone->longitude + 0.005 >= longitude && - zone->latitude - 0.005 <= latitude && - zone->latitude + 0.005 >= latitude) + if (zone_longitude - 0.005 <= longitude && + zone_longitude + 0.005 >= longitude && + zone_latitude - 0.005 <= latitude && + zone_latitude + 0.005 >= latitude) { - return zone->location; + return icaltimezone_get_location (zone); } } @@ -457,78 +508,6 @@ get_zone_from_point (ETimezoneDialog *etd, } -CalClient* -e_timezone_dialog_get_cal_client (ETimezoneDialog *etd) -{ - - return etd->priv->client; -} - - -void -e_timezone_dialog_set_cal_client (ETimezoneDialog *etd, - CalClient *client) -{ - ETimezoneDialogPrivate *priv; - CalTimezoneInfo *zone; - GtkWidget *listitem; - GtkCombo *combo; - char *current_zone; - int i; - - g_return_if_fail (etd != NULL); - g_return_if_fail (E_IS_TIMEZONE_DIALOG (etd)); - g_return_if_fail (IS_CAL_CLIENT (client)); - - 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) { - g_warning ("No timezone info found"); - return; - } - - /* 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)); - - for (i = 0; i < priv->zones->len; i++) { - zone = &g_array_index (priv->zones, CalTimezoneInfo, i); - if (!strcmp (current_zone, zone->location)) { - priv->point_selected = e_map_add_point (priv->map, - zone->location, - zone->longitude, - zone->latitude, - E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); - } else { - e_map_add_point (priv->map, zone->location, - zone->longitude, zone->latitude, - E_TIMEZONE_DIALOG_MAP_POINT_NORMAL_RGBA); - } - - listitem = gtk_list_item_new_with_label (zone->location); - gtk_widget_show (listitem); - gtk_container_add (GTK_CONTAINER (combo->list), listitem); - } -} - - char* e_timezone_dialog_get_timezone (ETimezoneDialog *etd) { @@ -581,26 +560,36 @@ static void find_selected_point (ETimezoneDialog *etd) { ETimezoneDialogPrivate *priv; - CalTimezoneInfo *zone; + icalarray *zones; 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)) { + /* Get the array of builtin timezones. */ + zones = icaltimezone_get_builtin_timezones (); + + for (i = 0; i < zones->num_elements; i++) { + icaltimezone *zone; + char *location; + + zone = icalarray_element_at (zones, i); + + location = icaltimezone_get_location (zone); + + if (!strcmp (current_zone, location)) { + double zone_longitude, zone_latitude; + + zone_longitude = icaltimezone_get_longitude (zone); + zone_latitude = icaltimezone_get_latitude (zone); + point = e_map_get_closest_point (priv->map, - zone->longitude, - zone->latitude, + zone_longitude, + zone_latitude, FALSE); - break; } } diff --git a/calendar/gui/dialogs/e-timezone-dialog.h b/calendar/gui/dialogs/e-timezone-dialog.h index bb253934f7..860ced85f8 100644 --- a/calendar/gui/dialogs/e-timezone-dialog.h +++ b/calendar/gui/dialogs/e-timezone-dialog.h @@ -24,7 +24,6 @@ #include #include -#include @@ -57,10 +56,6 @@ ETimezoneDialog* e_timezone_dialog_construct (ETimezoneDialog *etd); ETimezoneDialog* e_timezone_dialog_new (void); -CalClient* e_timezone_dialog_get_cal_client (ETimezoneDialog *etd); -void e_timezone_dialog_set_cal_client (ETimezoneDialog *etd, - CalClient *client); - char* e_timezone_dialog_get_timezone (ETimezoneDialog *etd); void e_timezone_dialog_set_timezone (ETimezoneDialog *etd, char *timezone); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index 8087294012..f653e469ef 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -84,7 +84,6 @@ 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; @@ -139,7 +138,6 @@ 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; } @@ -512,19 +510,6 @@ 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. */ diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index bde17af2fe..76a3cadcd4 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -68,7 +68,6 @@ 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; @@ -124,7 +123,6 @@ 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; } @@ -309,18 +307,6 @@ 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. */ diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 340281dd59..02a1e1bfd3 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -119,7 +119,6 @@ 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; @@ -174,7 +173,6 @@ 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; } @@ -607,19 +605,6 @@ 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. */ diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index 6bf7625c32..ff54a92da4 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -42,8 +42,6 @@ struct _ETimezoneEntryPrivate { GtkWidget *entry; GtkWidget *button; - - CalClient *client; }; @@ -175,11 +173,6 @@ e_timezone_entry_destroy (GtkObject *object) tentry = E_TIMEZONE_ENTRY (object); priv = tentry->priv; - if (priv->client) { - gtk_object_unref (GTK_OBJECT (priv->client)); - priv->client = NULL; - } - g_free (tentry->priv); tentry->priv = NULL; @@ -202,7 +195,6 @@ on_button_clicked (GtkWidget *widget, priv = tentry->priv; timezone_dialog = e_timezone_dialog_new (); - e_timezone_dialog_set_cal_client (timezone_dialog, priv->client); zone = e_timezone_entry_get_timezone (tentry); e_timezone_dialog_set_timezone (timezone_dialog, zone); @@ -217,39 +209,6 @@ on_button_clicked (GtkWidget *widget, } -/** - * e_timezone_entry_set_cal_client: - * @tentry: An #ETimezoneEntry. - * @client: Calendar client. - * - * Sets the calendar client that the timezone entry uses to get the timezone - * information. - **/ -void -e_timezone_entry_set_cal_client (ETimezoneEntry *tentry, CalClient *client) -{ - ETimezoneEntryPrivate *priv; - - g_return_if_fail (tentry != NULL); - g_return_if_fail (E_IS_TIMEZONE_ENTRY (tentry)); - - priv = tentry->priv; - - if (client == priv->client) - return; - - if (client) { - g_return_if_fail (IS_CAL_CLIENT (client)); - gtk_object_ref (GTK_OBJECT (client)); - } - - if (priv->client) - gtk_object_unref (GTK_OBJECT (priv->client)); - - priv->client = client; -} - - static void on_entry_changed (GtkEntry *entry, ETimezoneEntry *tentry) diff --git a/calendar/gui/e-timezone-entry.h b/calendar/gui/e-timezone-entry.h index f5a32915a2..0eadf1bef0 100644 --- a/calendar/gui/e-timezone-entry.h +++ b/calendar/gui/e-timezone-entry.h @@ -67,9 +67,6 @@ struct _ETimezoneEntryClass { guint e_timezone_entry_get_type (void); GtkWidget* e_timezone_entry_new (void); -void e_timezone_entry_set_cal_client (ETimezoneEntry *tentry, - CalClient *client); - char* e_timezone_entry_get_timezone (ETimezoneEntry *tentry); void e_timezone_entry_set_timezone (ETimezoneEntry *tentry, char *timezone); -- cgit v1.2.3