From 76bbd700763e4b45614df6ad6174fe831ddb932e Mon Sep 17 00:00:00 2001 From: nobody Date: Thu, 24 Jan 2002 19:01:46 +0000 Subject: This commit was manufactured by cvs2svn to create tag 'EVOLUTION_1_0_2'. svn path=/tags/EVOLUTION_1_0_2/; revision=15455 --- calendar/ChangeLog | 253 ++++------------ .../conduits/calendar/calendar-conduit-config.h | 135 +++++++++ calendar/conduits/calendar/calendar-conduit.c | 328 +++++---------------- calendar/conduits/todo/todo-conduit-config.h | 129 ++++++++ calendar/conduits/todo/todo-conduit.c | 328 +++++---------------- calendar/gui/calendar-config.c | 33 --- calendar/gui/calendar-model.c | 5 +- calendar/gui/e-day-view.c | 10 +- calendar/gui/e-itip-control.c | 1 + calendar/gui/e-meeting-model.c | 10 +- calendar/gui/e-week-view.c | 6 +- calendar/gui/gnome-cal.c | 8 +- calendar/gui/itip-utils.c | 3 +- 13 files changed, 496 insertions(+), 753 deletions(-) create mode 100644 calendar/conduits/calendar/calendar-conduit-config.h create mode 100644 calendar/conduits/todo/todo-conduit-config.h (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 494b6ac008..358f82b920 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,18 +1,3 @@ -2002-01-23 Ettore Perazzoli - - * gui/component-factory.c (create_object): Pass a NULL @icon to - `evolution_shell_component_add_user_creatable_item()'. - -2002-01-21 JP Rosevear - - * conduits/todo/todo-conduit.c (todoconduit_load_configuration): - return a new configuration struct, load default priority setting - (todoconduit_save_configuration): save default priority setting - (e_todo_context_new): dupe configuration - - * conduits/calendar/calendar-conduit.c (e_calendar_context_new): - set ps to NULL - 2002-01-17 Damon Chaplin * gui/dialogs/alarm-page.c (get_alarm_string): save the alarm string @@ -24,39 +9,6 @@ * gui/dialogs/task-page.c (task_page_fill_widgets): default component classification to PUBLIC. Fixes internal bug #1066 -2002-01-14 JP Rosevear - - * conduits/calendar/calendar-conduit.c: move all functions here, - get rid of header files, use e-pilot-settings to display gui - - * conduits/todo/todo-conduit.c: as above - -2002-01-14 JP Rosevear - - * gui/gnome-cal.c (get_current_time): use icaltimetype_to_tm - -2002-01-14 JP Rosevear - - * gui/e-week-view-main-item.c (e_week_view_main_item_draw_day): - figure out when today is and highlight if it is not selected - - * gui/e-week-view.h: enum the "today" color - - * gui/e-week-view.c (e_week_view_realize): init the "today" color - -2002-01-13 JP Rosevear - - * gui/alarm-notify/save.h: add protos - - * gui/alarm-notify/save.c (save_blessed_program): records a - program as blessed - (is_blessed_program): checks to see if a program is blessed - - * gui/alarm-notify/alarm-queue.c (procedure_notification_dialog): - popup a dialog notifying the user that is a program and let them - not see the dialog about this program again - (procedure_notification): use above - 2002-01-11 Damon Chaplin * gui/e-timezone-entry.c: @@ -64,110 +16,7 @@ * gui/calendar-config.c (on_timezone_set): translate timezone names when displayed. Fixes bug #6544. -2002-01-03 JP Rosevear - - * gui/tasks-control.c (tasks_control_complete_cmd): new verb - callback - (sensitize_commands): set sensitivity of mark complete command - - * gui/e-tasks.h: new proto - - * gui/e-tasks.c (e_tasks_complete_selected): mark selected tasks - in the table as complete - - * gui/e-calendar-table.h: new proto - - * gui/e-calendar-table.c (e_calendar_table_complete_selected): - mark selected rows as complete - -2002-01-03 JP Rosevear - - * gui/tasks-control.c (confirm_expunge): only need one warning - message now - - * gui/e-tasks.c (create_sexp): change the logic to expunge all - completed tasks not just hidden ones - -2002-01-03 JP Rosevear - - * gui/tasks-control.c (confirm_expunge): confirm expunging of the - tasks - (tasks_control_expunge_cmd): verb callback - - * gui/calendar-config.c (config_read): read confirm expunge value - (calendar_config_write): write confirm expunge value - (calendar_config_write_on_exit): ditto - (calendar_config_get_confirm_expunge): get value - (calendar_config_set_confirm_expunge): set value - - * gui/calendar-config.h: new proto - - * gui/e-itip-control.c (start_calendar_server): kill warning - - * gui/e-tasks.c (e_tasks_init): init query member to NULL - (set_status_message): util function to set status message - (e_tasks_open): use above - (cal_opened_cb): ditto - (create_sexp): create sexp of items to be deleted - (query_obj_updated_cb): remove any items found - (query_eval_error_cb): bail out on error - (query_query_done_cb): tidy when done - (e_tasks_delete_completed): set up query - - * gui/e-tasks.h: new proto - - * gui/calendar-model.c (query_query_done_cb): use g_warning - instead of printing to stderr - (query_eval_error_cb): ditto - (update_query): clear the status message if we can't create the - query - - * gui/tag-calendar.c (resolve_tzid_cb): make this static - -2001-12-21 JP Rosevear - - * gui/dialogs/comp-editor.c: remove needs send signal related - cruft - (save_comp_with_send): with send_component_dialog, indicate if the - meeting info is newly created or not - (real_edit_comp): remember if the dialog initially needs a send - - * gui/dialogs/send-comp.c (send_component_dialog): take a "new" - parameter indicating whether the dialog should intimate if the - component to be sent is a new meeting or not - - * gui/dialogs/send-comp.h: update proto - - * gui/dialogs/comp-editor.c: remove no longer used needs_send - notification and signal - - * gui/dialogs/comp-editor.h: remove proto - - * gui/e-day-view.c (e_day_view_on_main_canvas_drag_data_received): add new - param to send_component_dialog - (e_day_view_finish_long_event_resize): ditto - (e_day_view_finish_resize): ditto - (e_day_view_on_editing_stopped): ditto - (e_day_view_on_top_canvas_drag_data_received): ditto - - * gui/e-week-view.c (e_week_view_on_editing_stopped): add new - param to send_component_dialog - -2001-12-21 JP Rosevear - - * gui/dialogs/comp-editor.h: inherit from bonobo window - - * gui/dialogs/comp-editor.c: inherit from bonobo window - (comp_editor_key_press_event): Look for an escape key press and - close the window if found - -2001-12-20 Ettore Perazzoli - - [Fixes #17377, Evolution doesn't work on multi-depth displays.] - - * gui/main.c (main): Push GdkRGB visual and colormap. - -2001-12-19 JP Rosevear +2001-12-18 JP Rosevear * conduits/calendar/calendar-conduit.c (check_for_slow_setting): go slow and clear the map if the last uri and the current uri do @@ -202,7 +51,20 @@ (cal_client_open_default_calendar): open the default uri or the fallback if the method is unsupported (cal_client_open_default_tasks): same for tasks - + +2001-12-18 Dan Winship + + * gui/itip-utils.c (itip_send_comp): Unfortunate hack to make this + work with Outlook 2000 in an Exchange environment (at the expense + of making it break with O2k in a POP/IMAP environment, unless you + set EVOLUTION_SEND_IMIP_AS_ATTACHMENT.) Fails to adequately fix + #14705, but it's the best we can do for 1.0.1. + +2001-12-17 JP Rosevear + + * gui/e-meeting-model.c (process_free_busy): indicate the meeting + attendee has calendar info + 2001-12-17 JP Rosevear * gui/e-itip-control.c (send_item): use get_real_item @@ -216,22 +78,28 @@ (send_item): use get_real_item 2001-12-17 JP Rosevear + + * gui/itip-utils.c (comp_limit_attendees): can't remove properties + in an iteration loop, so remove them outside the loop + (comp_minimal): don't set a recurid if there isn't one, add the x + properties to the clone + (comp_compliant): unref the clone for DECLINECOUNTER + + * gui/e-itip-control.c (get_refresh_options): make function + available again + (show_current_event): use it here + (ok_clicked_cb): can't remove properties in an iteration loop, so + remove them outside the loop + + * cal-util/cal-component.c (free_icalcomponent): properly free the + attendee list + (cal_component_rescan): don't destroy the alarm hash - * gui/itip-utils.c (comp_limit_attendees): can't remove properties - in an iteration loop, so remove them outside the loop - (comp_minimal): don't set a recurid if there isn't one, add the x - properties to the clone - (comp_compliant): unref the clone for DECLINECOUNTER +2001-12-14 Ettore Perazzoli - * gui/e-itip-control.c (get_refresh_options): make function - available again - (show_current_event): use it here - (ok_clicked_cb): can't remove properties in an iteration loop, so - remove them outside the loop + [Fixes #17377, Evolution doesn't work on multi-depth displays.] - * cal-util/cal-component.c (free_icalcomponent): properly free the - attendee list - (cal_component_rescan): don't destroy the alarm hash + * gui/main.c (main): Push GdkRGB visual and colormap. 2001-12-13 Damon Chaplin @@ -239,11 +107,11 @@ We won't be using the translations in 1.0.1, but it gives translators time before we do use them in 1.0.2. - * Makefile.am: added zones.h to EXTRA_DIST. + * Makefile.am (CONDUIT_DIR): added zones.h to EXTRA_DIST. 2001-12-12 JP Rosevear - * gui/e-day-view.c (e_day_view_on_top_canvas_button_release): + * gui/e-day-view.c (e_day_view_on_top_canvas_button_release): ungrab the pointer before calling e_day_view_finish_long_event_resize (e_day_view_on_main_canvas_button_release): ditto @@ -253,7 +121,10 @@ (e_day_view_on_editing_stopped): ditto (e_day_view_on_top_canvas_drag_data_received): ditto (e_day_view_on_main_canvas_drag_data_received): ditto - + + * gui/e-week-view.c (e_week_view_on_editing_stopped): ask if the + meeting should be sent if + 2001-12-11 JP Rosevear * gui/e-meeting-model.c (process_free_busy_comp): properly convert @@ -289,22 +160,6 @@ * importers/GNOME_Evolution_Calendar_Importer.oaf.in: fixed executable name. Fixes bug #16880. -2001-12-08 JP Rosevear - - * conduits/calendar/calendar-conduit.c (local_record_from_comp): - if we have an alarm that can be represented on the pilot, set the - appointment fields appropriately, if the duration has values for - minutes and/or hours and/or days, use the lowest common - denominator - (comp_from_remote_record): if the appointment on the pilot has an - alarm, find the first alarm an item currently had that is relative - to the start and with a negative duration and update it (or create - a new one if no valid ones exist) - - * cal-util/cal-component.c (cal_component_get_alarm_uids): build - list in the order they appear in the component so we get - consisting order for the gui and for the pilot - 2001-12-08 Rodrigo Moya * gui/calendar-config.c (calendar_config_get_default_uri): @@ -340,6 +195,22 @@ (start_query_cb): Set the state to QUERY_IN_PROGRESS here instead of in populate_query(). +2001-12-07 JP Rosevear + + * conduits/calendar/calendar-conduit.c (local_record_from_comp): + if we have an alarm that can be represented on the pilot, set the + appointment fields appropriately, if the duration has values for + minutes and/or hours and/or days, use the lowest common + denominator + (comp_from_remote_record): if the appointment on the pilot has an + alarm, find the first alarm an item currently had that is relative + to the start and with a negative duration and update it (or create + a new one if no valid ones exist) + + * cal-util/cal-component.c (cal_component_get_alarm_uids): build + list in the order they appear in the component so we get + consisting order for the gui and for the pilot + 2001-12-07 Rodrigo Moya * gui/calendar-config.c (calendar_config_get_default_uri): @@ -354,18 +225,18 @@ 2001-12-06 Jon Trowbridge - * gui/dialogs/event-editor.c (event_editor_destroy): Explicitly + * gui/dialogs/event-editor.c (event_editor_destroy): Explicitly destroy the EMeetingModel. This is a hack to work around problems with the reference counting; we are still leaking the EMeetingModels. - * gui/e-meeting-time-sel.c - (e_meeting_time_selector_construct): Ref our EMeetingModel. - (e_meeting_time_selector_destroy): Unref the model. + * gui/e-meeting-time-sel.c (e_meeting_time_selector_construct): + Ref our EMeetingModel. + (e_meeting_time_selector_destroy): Unref the model. - * gui/e-meeting-model.c (destroy): Properly destroy + * gui/e-meeting-model.c (destroy): Properly destroy corba_select_names with a call to bonobo_object_release_unref. - (Fixes 14002) + (Fixes 14002) 2001-12-05 Rodrigo Moya diff --git a/calendar/conduits/calendar/calendar-conduit-config.h b/calendar/conduits/calendar/calendar-conduit-config.h new file mode 100644 index 0000000000..4521612034 --- /dev/null +++ b/calendar/conduits/calendar/calendar-conduit-config.h @@ -0,0 +1,135 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* Evolution calendar - Calendar Conduit Configuration + * + * Copyright (C) 1998 Free Software Foundation + * Copyright (C) 2000 Ximian, Inc. + * + * Authors: Eskil Heyn Olsen + * JP Rosevear + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __CAL_CONDUIT_CONFIG_H__ +#define __CAL_CONDUIT_CONFIG_H__ + +#include +#include +#include + +/* Configuration info */ +typedef struct _ECalConduitCfg ECalConduitCfg; +struct _ECalConduitCfg { + guint32 pilot_id; + GnomePilotConduitSyncType sync_type; + + gboolean open_secret; + gchar *last_uri; +}; + +#ifdef CAL_CONFIG_LOAD +/* Loads the configuration data */ +static void +calconduit_load_configuration (ECalConduitCfg **c, guint32 pilot_id) +{ + GnomePilotConduitManagement *management; + GnomePilotConduitConfig *config; + gchar prefix[256]; + g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", + pilot_id); + + *c = g_new0 (ECalConduitCfg,1); + g_assert (*c != NULL); + + (*c)->pilot_id = pilot_id; + + management = gnome_pilot_conduit_management_new ("e_calendar_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); + config = gnome_pilot_conduit_config_new (management, pilot_id); + if (!gnome_pilot_conduit_config_is_enabled (config, &(*c)->sync_type)) + (*c)->sync_type = GnomePilotConduitSyncTypeNotSet; + gtk_object_unref (GTK_OBJECT (config)); + gtk_object_unref (GTK_OBJECT (management)); + + /* Custom settings */ + gnome_config_push_prefix (prefix); + + (*c)->open_secret = gnome_config_get_bool ("open_secret=FALSE"); + (*c)->last_uri = gnome_config_get_string ("last_uri"); + + gnome_config_pop_prefix (); +} +#endif + +#ifdef CAL_CONFIG_SAVE +/* Saves the configuration data. */ +static void +calconduit_save_configuration (ECalConduitCfg *c) +{ + gchar prefix[256]; + + g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", + c->pilot_id); + + gnome_config_push_prefix (prefix); + gnome_config_set_bool ("open_secret", c->open_secret); + gnome_config_set_string ("last_uri", c->last_uri); + gnome_config_pop_prefix (); + + gnome_config_sync (); + gnome_config_drop_all (); +} +#endif + +#ifdef CAL_CONFIG_DUPE +/* Creates a duplicate of the configuration data */ +static ECalConduitCfg* +calconduit_dupe_configuration (ECalConduitCfg *c) +{ + ECalConduitCfg *retval; + + g_return_val_if_fail (c != NULL, NULL); + + retval = g_new0 (ECalConduitCfg, 1); + retval->sync_type = c->sync_type; + retval->pilot_id = c->pilot_id; + + retval->open_secret = c->open_secret; + retval->last_uri = g_strdup (c->last_uri); + + return retval; +} +#endif + +#ifdef CAL_CONFIG_DESTROY +/* Destroy a configuration */ +static void +calconduit_destroy_configuration (ECalConduitCfg **c) +{ + g_return_if_fail (c != NULL); + g_return_if_fail (*c != NULL); + + g_free ((*c)->last_uri); + g_free (*c); + *c = NULL; +} +#endif + +#endif /* __CAL_CONDUIT_CONFIG_H__ */ + + + + + + + diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index f86e753232..a320e9bb8d 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -23,6 +23,7 @@ #include +#include #include #include #include @@ -30,16 +31,22 @@ #include #include #include +#include #include -#include -#include -#include -#include -#include -#include -#include +#include #include +#define CAL_CONFIG_LOAD 1 +#define CAL_CONFIG_SAVE 1 +#define CAL_CONFIG_DESTROY 1 +#include +#undef CAL_CONFIG_LOAD +#undef CAL_CONFIG_SAVE +#undef CAL_CONFIG_DESTROY + +#include + +static void free_local (ECalLocalRecord *local); GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); @@ -63,157 +70,69 @@ void conduit_destroy_gpilot_conduit (GnomePilotConduit*); #define PILOT_MAX_ADVANCE 99 -typedef struct _ECalLocalRecord ECalLocalRecord; -typedef struct _ECalConduitCfg ECalConduitCfg; -typedef struct _ECalConduitContext ECalConduitContext; - -/* Local Record */ -struct _ECalLocalRecord { - /* The stuff from gnome-pilot-conduit-standard-abs.h - Must be first in the structure, or instances of this - structure cannot be used by gnome-pilot-conduit-standard-abs. - */ - GnomePilotDesktopRecord local; - - /* The corresponding Comp object */ - CalComponent *comp; - - /* pilot-link appointment structure */ - struct Appointment *appt; -}; - -static void -calconduit_destroy_record (ECalLocalRecord *local) -{ - gtk_object_unref (GTK_OBJECT (local->comp)); - free_Appointment (local->appt); - g_free (local->appt); - g_free (local); -} - -/* Configuration */ -struct _ECalConduitCfg { - guint32 pilot_id; - GnomePilotConduitSyncType sync_type; - - gboolean secret; - gchar *last_uri; -}; - -static ECalConduitCfg * -calconduit_load_configuration (guint32 pilot_id) +/* Debug routines */ +static char * +print_local (ECalLocalRecord *local) { - ECalConduitCfg *c; - GnomePilotConduitManagement *management; - GnomePilotConduitConfig *config; - gchar prefix[256]; - - c = g_new0 (ECalConduitCfg, 1); - g_assert (c != NULL); - - /* Pilot ID */ - c->pilot_id = pilot_id; - - /* Sync Type */ - management = gnome_pilot_conduit_management_new ("e_calendar_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); - config = gnome_pilot_conduit_config_new (management, pilot_id); - if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type)) - c->sync_type = GnomePilotConduitSyncTypeNotSet; - gtk_object_unref (GTK_OBJECT (config)); - gtk_object_unref (GTK_OBJECT (management)); - - /* Custom settings */ - g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", pilot_id); - gnome_config_push_prefix (prefix); + static char buff[ 4096 ]; - c->secret = gnome_config_get_bool ("secret=FALSE"); - c->last_uri = gnome_config_get_string ("last_uri"); + if (local == NULL) { + sprintf (buff, "[NULL]"); + return buff; + } - gnome_config_pop_prefix (); + if (local->appt && local->appt->description) { + g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']", + mktime (&local->appt->begin), + mktime (&local->appt->end), + local->appt->description ? + local->appt->description : "", + local->appt->note ? + local->appt->note : ""); + return buff; + } - return c; + return ""; } -static void -calconduit_save_configuration (ECalConduitCfg *c) +static char *print_remote (GnomePilotRecord *remote) { - gchar prefix[256]; - - g_snprintf (prefix, 255, "/gnome-pilot.d/e-calendar-conduit/Pilot_%u/", c->pilot_id); - gnome_config_push_prefix (prefix); - - gnome_config_set_bool ("secret", c->secret); - gnome_config_set_string ("last_uri", c->last_uri); - - gnome_config_pop_prefix (); - - gnome_config_sync (); - gnome_config_drop_all (); -} + static char buff[ 4096 ]; + struct Appointment appt; -static ECalConduitCfg* -calconduit_dupe_configuration (ECalConduitCfg *c) -{ - ECalConduitCfg *retval; + if (remote == NULL) { + sprintf (buff, "[NULL]"); + return buff; + } - g_return_val_if_fail (c != NULL, NULL); + memset (&appt, 0, sizeof (struct Appointment)); + unpack_Appointment (&appt, remote->record, remote->length); - retval = g_new0 (ECalConduitCfg, 1); - retval->pilot_id = c->pilot_id; - retval->sync_type = c->sync_type; - retval->secret = c->secret; - retval->last_uri = g_strdup (c->last_uri); - - return retval; -} + g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']", + mktime (&appt.begin), + mktime (&appt.end), + appt.description ? + appt.description : "", + appt.note ? + appt.note : ""); -static void -calconduit_destroy_configuration (ECalConduitCfg *c) -{ - g_return_if_fail (c != NULL); + free_Appointment (&appt); - g_free (c->last_uri); - g_free (c); + return buff; } -/* Context */ -struct _ECalConduitContext { - ECalConduitCfg *cfg; - GnomePilotDBInfo *dbi; - - ECalConduitCfg *new_cfg; - GtkWidget *ps; - - struct AppointmentAppInfo ai; - - CalClient *client; - - icaltimezone *timezone; - GList *uids; - GList *changed; - GHashTable *changed_hash; - GList *locals; - - EPilotMap *map; -}; - +/* Context Routines */ static ECalConduitContext * e_calendar_context_new (guint32 pilot_id) { - ECalConduitContext *ctxt; + ECalConduitContext *ctxt = g_new0 (ECalConduitContext, 1); + + calconduit_load_configuration (&ctxt->cfg, pilot_id); - ctxt = g_new0 (ECalConduitContext, 1); - g_assert (ctxt != NULL); - - ctxt->cfg = calconduit_load_configuration (pilot_id); - ctxt->new_cfg = calconduit_dupe_configuration (ctxt->cfg); - ctxt->ps = NULL; - ctxt->dbi = NULL; ctxt->client = NULL; - ctxt->timezone = NULL; ctxt->uids = NULL; - ctxt->changed = NULL; ctxt->changed_hash = NULL; + ctxt->changed = NULL; ctxt->locals = NULL; ctxt->map = NULL; @@ -236,17 +155,14 @@ e_calendar_context_destroy (ECalConduitContext *ctxt) g_return_if_fail (ctxt != NULL); if (ctxt->cfg != NULL) - calconduit_destroy_configuration (ctxt->cfg); + calconduit_destroy_configuration (&ctxt->cfg); if (ctxt->client != NULL) gtk_object_unref (GTK_OBJECT (ctxt->client)); - + if (ctxt->uids != NULL) cal_obj_uid_list_free (ctxt->uids); - - if (ctxt->changed != NULL) - cal_client_change_list_free (ctxt->changed); - + if (ctxt->changed_hash != NULL) { g_hash_table_foreach_remove (ctxt->changed_hash, e_calendar_context_foreach_change, NULL); g_hash_table_destroy (ctxt->changed_hash); @@ -254,63 +170,17 @@ e_calendar_context_destroy (ECalConduitContext *ctxt) if (ctxt->locals != NULL) { for (l = ctxt->locals; l != NULL; l = l->next) - calconduit_destroy_record (l->data); + free_local (l->data); g_list_free (ctxt->locals); } + + if (ctxt->changed != NULL) + cal_client_change_list_free (ctxt->changed); if (ctxt->map != NULL) e_pilot_map_destroy (ctxt->map); -} - -/* Debug routines */ -static char * -print_local (ECalLocalRecord *local) -{ - static char buff[ 4096 ]; - - if (local == NULL) { - sprintf (buff, "[NULL]"); - return buff; - } - - if (local->appt && local->appt->description) { - g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']", - mktime (&local->appt->begin), - mktime (&local->appt->end), - local->appt->description ? - local->appt->description : "", - local->appt->note ? - local->appt->note : ""); - return buff; - } - - return ""; -} - -static char *print_remote (GnomePilotRecord *remote) -{ - static char buff[ 4096 ]; - struct Appointment appt; - - if (remote == NULL) { - sprintf (buff, "[NULL]"); - return buff; - } - - memset (&appt, 0, sizeof (struct Appointment)); - unpack_Appointment (&appt, remote->record, remote->length); - - g_snprintf (buff, 4096, "[%ld %ld '%s' '%s']", - mktime (&appt.begin), - mktime (&appt.end), - appt.description ? - appt.description : "", - appt.note ? - appt.note : ""); - - free_Appointment (&appt); - return buff; + g_free (ctxt); } /* Calendar Server routines */ @@ -635,6 +505,15 @@ compute_status (ECalConduitContext *ctxt, ECalLocalRecord *local, const char *ui } } +static void +free_local (ECalLocalRecord *local) +{ + gtk_object_unref (GTK_OBJECT (local->comp)); + free_Appointment (local->appt); + g_free (local->appt); + g_free (local); +} + static GnomePilotRecord local_record_to_pilot_record (ECalLocalRecord *local, ECalConduitContext *ctxt) @@ -1626,7 +1505,7 @@ free_match (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (local != NULL, -1); - calconduit_destroy_record (local); + free_local (local); return 0; } @@ -1644,58 +1523,6 @@ prepare (GnomePilotConduitSyncAbs *conduit, return 0; } -/* Pilot Settings Callbacks */ -static void -fill_widgets (ECalConduitContext *ctxt) -{ - e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps), - ctxt->cfg->secret); -} - -static gint -create_settings_window (GnomePilotConduit *conduit, - GtkWidget *parent, - ECalConduitContext *ctxt) -{ - LOG ("create_settings_window"); - - ctxt->ps = e_pilot_settings_new (); - gtk_container_add (GTK_CONTAINER (parent), ctxt->ps); - gtk_widget_show (ctxt->ps); - - fill_widgets (ctxt); - - return 0; -} -static void -display_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt) -{ - LOG ("display_settings"); - - fill_widgets (ctxt); -} - -static void -save_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt) -{ - LOG ("save_settings"); - - ctxt->new_cfg->secret = - e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps)); - - calconduit_save_configuration (ctxt->new_cfg); -} - -static void -revert_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt) -{ - LOG ("revert_settings"); - - calconduit_save_configuration (ctxt->cfg); - calconduit_destroy_configuration (ctxt->new_cfg); - ctxt->new_cfg = calconduit_dupe_configuration (ctxt->cfg); -} - static ORBit_MessageValidationResult accept_all_cookies (CORBA_unsigned_long request_id, CORBA_Principal *principal, @@ -1735,7 +1562,6 @@ conduit_get_gpilot_conduit (guint32 pilot_id) ctxt = e_calendar_context_new (pilot_id); gtk_object_set_data (GTK_OBJECT (retval), "calconduit_context", ctxt); - /* Sync signals */ gtk_signal_connect (retval, "pre_sync", (GtkSignalFunc) pre_sync, ctxt); gtk_signal_connect (retval, "post_sync", (GtkSignalFunc) post_sync, ctxt); @@ -1756,12 +1582,6 @@ conduit_get_gpilot_conduit (guint32 pilot_id) gtk_signal_connect (retval, "prepare", (GtkSignalFunc) prepare, ctxt); - /* Gui Settings */ - gtk_signal_connect (retval, "create_settings_window", (GtkSignalFunc) create_settings_window, ctxt); - gtk_signal_connect (retval, "display_settings", (GtkSignalFunc) display_settings, ctxt); - gtk_signal_connect (retval, "save_settings", (GtkSignalFunc) save_settings, ctxt); - gtk_signal_connect (retval, "revert_settings", (GtkSignalFunc) revert_settings, ctxt); - return GNOME_PILOT_CONDUIT (retval); } diff --git a/calendar/conduits/todo/todo-conduit-config.h b/calendar/conduits/todo/todo-conduit-config.h new file mode 100644 index 0000000000..3296cd47e3 --- /dev/null +++ b/calendar/conduits/todo/todo-conduit-config.h @@ -0,0 +1,129 @@ +/* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ +/* Evolution calendar - ToDo Conduit Configuration + * + * Copyright (C) 1998 Free Software Foundation + * Copyright (C) 2000 Ximian, Inc. + * + * Authors: Eskil Heyn Olsen + * JP Rosevear + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of version 2 of the GNU General Public + * License as published by the Free Software Foundation. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA. + */ + +#ifndef __TODO_CONDUIT_CONFIG_H__ +#define __TODO_CONDUIT_CONFIG_H__ + +#include +#include +#include + +/* Configuration info */ +typedef struct _EToDoConduitCfg EToDoConduitCfg; +struct _EToDoConduitCfg { + guint32 pilot_id; + GnomePilotConduitSyncType sync_type; /* only used by capplet */ + + gboolean open_secret; + gchar *last_uri; +}; + +#ifdef TODO_CONFIG_LOAD +/* Load the configuration data */ +static void +todoconduit_load_configuration (EToDoConduitCfg **c, guint32 pilot_id) +{ + GnomePilotConduitManagement *management; + GnomePilotConduitConfig *config; + gchar prefix[256]; + g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/", + pilot_id); + + *c = g_new0 (EToDoConduitCfg,1); + g_assert (*c != NULL); + + (*c)->pilot_id = pilot_id; + + management = gnome_pilot_conduit_management_new ("e_todo_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); + config = gnome_pilot_conduit_config_new (management, pilot_id); + if (!gnome_pilot_conduit_config_is_enabled (config, &(*c)->sync_type)) + (*c)->sync_type = GnomePilotConduitSyncTypeNotSet; + gtk_object_unref (GTK_OBJECT (config)); + gtk_object_unref (GTK_OBJECT (management)); + + /* Custom settings */ + gnome_config_push_prefix (prefix); + + (*c)->open_secret = gnome_config_get_bool ("open_secret=FALSE"); + (*c)->last_uri = gnome_config_get_string ("last_uri"); + + gnome_config_pop_prefix (); +} +#endif + +#ifdef TODO_CONFIG_SAVE +/* Saves the configuration data. */ +static void +todoconduit_save_configuration (EToDoConduitCfg *c) +{ + gchar prefix[256]; + + g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/", + c->pilot_id); + + gnome_config_push_prefix (prefix); + gnome_config_set_bool ("open_secret", c->open_secret); + gnome_config_set_string ("last_uri", c->last_uri); + gnome_config_pop_prefix (); + + gnome_config_sync (); + gnome_config_drop_all (); +} +#endif + +#ifdef TODO_CONFIG_DUPE +/* Creates a duplicate of the configuration data */ +static EToDoConduitCfg* +todoconduit_dupe_configuration (EToDoConduitCfg *c) +{ + EToDoConduitCfg *retval; + + g_return_val_if_fail (c != NULL, NULL); + + retval = g_new0 (EToDoConduitCfg, 1); + retval->sync_type = c->sync_type; + retval->pilot_id = c->pilot_id; + + retval->open_secret = c->open_secret; + retval->last_uri = g_strdup (c->last_uri); + + return retval; +} +#endif + +#ifdef TODO_CONFIG_DESTROY +/* Destroy a configuration */ +static void +todoconduit_destroy_configuration (EToDoConduitCfg **c) +{ + g_return_if_fail (c != NULL); + g_return_if_fail (*c != NULL); + + g_free ((*c)->last_uri); + g_free (*c); + *c = NULL; +} +#endif + +#endif /* __TODO_CONDUIT_CONFIG_H__ */ + diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c index 0363a4e3ce..8b68110847 100644 --- a/calendar/conduits/todo/todo-conduit.c +++ b/calendar/conduits/todo/todo-conduit.c @@ -31,17 +31,22 @@ #include #include #include +#include #include -#include #include -#include -#include -#include -#include -#include -#include #include +#define TODO_CONFIG_LOAD 1 +#define TODO_CONFIG_SAVE 1 +#define TODO_CONFIG_DESTROY 1 +#include +#undef TODO_CONFIG_LOAD +#undef TODO_CONFIG_SAVE +#undef TODO_CONFIG_DESTROY + +#include + +static void free_local (EToDoLocalRecord *local); GnomePilotConduit * conduit_get_gpilot_conduit (guint32); void conduit_destroy_gpilot_conduit (GnomePilotConduit*); @@ -51,10 +56,10 @@ void conduit_destroy_gpilot_conduit (GnomePilotConduit*); #endif #define G_LOG_DOMAIN "etodoconduit" -#define DEBUG_TODOCONDUIT 1 -/* #undef DEBUG_TODOCONDUIT */ +#define DEBUG_CALCONDUIT 1 +/* #undef DEBUG_CALCONDUIT */ -#ifdef DEBUG_TODOCONDUIT +#ifdef DEBUG_CALCONDUIT #define LOG(e...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, e) #else #define LOG(e...) @@ -63,153 +68,69 @@ void conduit_destroy_gpilot_conduit (GnomePilotConduit*); #define WARN(e...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_WARNING, e) #define INFO(e...) g_log (G_LOG_DOMAIN, G_LOG_LEVEL_MESSAGE, e) -typedef struct _EToDoLocalRecord EToDoLocalRecord; -typedef struct _EToDoConduitCfg EToDoConduitCfg; -typedef struct _EToDoConduitContext EToDoConduitContext; - -/* Local Record */ -struct _EToDoLocalRecord { - /* The stuff from gnome-pilot-conduit-standard-abs.h - Must be first in the structure, or instances of this - structure cannot be used by gnome-pilot-conduit-standard-abs. - */ - GnomePilotDesktopRecord local; - - /* The corresponding Comp object */ - CalComponent *comp; - - /* pilot-link todo structure */ - struct ToDo *todo; -}; - -static void -todoconduit_destroy_record (EToDoLocalRecord *local) -{ - gtk_object_unref (GTK_OBJECT (local->comp)); - free_ToDo (local->todo); - g_free (local->todo); - g_free (local); -} - -/* Configuration */ -struct _EToDoConduitCfg { - guint32 pilot_id; - GnomePilotConduitSyncType sync_type; - - gboolean secret; - gint priority; - - gchar *last_uri; -}; - -static EToDoConduitCfg * -todoconduit_load_configuration (guint32 pilot_id) -{ - EToDoConduitCfg *c; - GnomePilotConduitManagement *management; - GnomePilotConduitConfig *config; - gchar prefix[256]; - g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/", - pilot_id); - - c = g_new0 (EToDoConduitCfg,1); - g_assert (c != NULL); - - c->pilot_id = pilot_id; - - management = gnome_pilot_conduit_management_new ("e_todo_conduit", GNOME_PILOT_CONDUIT_MGMT_ID); - config = gnome_pilot_conduit_config_new (management, pilot_id); - if (!gnome_pilot_conduit_config_is_enabled (config, &c->sync_type)) - c->sync_type = GnomePilotConduitSyncTypeNotSet; - gtk_object_unref (GTK_OBJECT (config)); - gtk_object_unref (GTK_OBJECT (management)); - - /* Custom settings */ - gnome_config_push_prefix (prefix); - - c->secret = gnome_config_get_bool ("secret=FALSE"); - c->priority = gnome_config_get_int ("priority=1"); - c->last_uri = gnome_config_get_string ("last_uri"); - - gnome_config_pop_prefix (); - - return c; -} - -static void -todoconduit_save_configuration (EToDoConduitCfg *c) -{ - gchar prefix[256]; - - g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/", - c->pilot_id); - - gnome_config_push_prefix (prefix); - gnome_config_set_bool ("secret", c->secret); - gnome_config_set_int ("priority", c->priority); - gnome_config_set_string ("last_uri", c->last_uri); - gnome_config_pop_prefix (); - - gnome_config_sync (); - gnome_config_drop_all (); -} - -static EToDoConduitCfg* -todoconduit_dupe_configuration (EToDoConduitCfg *c) +/* Debug routines */ +static char * +print_local (EToDoLocalRecord *local) { - EToDoConduitCfg *retval; - - g_return_val_if_fail (c != NULL, NULL); + static char buff[ 4096 ]; - retval = g_new0 (EToDoConduitCfg, 1); - retval->sync_type = c->sync_type; - retval->pilot_id = c->pilot_id; + if (local == NULL) { + sprintf (buff, "[NULL]"); + return buff; + } - retval->secret = c->secret; - retval->priority = c->priority; - retval->last_uri = g_strdup (c->last_uri); + if (local->todo && local->todo->description) { + g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']", + local->todo->indefinite, + mktime (& local->todo->due), + local->todo->priority, + local->todo->complete, + local->todo->description ? + local->todo->description : "", + local->todo->note ? + local->todo->note : ""); + return buff; + } - return retval; + return ""; } -static void -todoconduit_destroy_configuration (EToDoConduitCfg *c) +static char *print_remote (GnomePilotRecord *remote) { - g_return_if_fail (c != NULL); - - g_free (c->last_uri); - g_free (c); -} + static char buff[ 4096 ]; + struct ToDo todo; -/* Context */ -struct _EToDoConduitContext { - EToDoConduitCfg *cfg; - GnomePilotDBInfo *dbi; + if (remote == NULL) { + sprintf (buff, "[NULL]"); + return buff; + } - EToDoConduitCfg *new_cfg; - GtkWidget *ps; - - struct ToDoAppInfo ai; + memset (&todo, 0, sizeof (struct ToDo)); + unpack_ToDo (&todo, remote->record, remote->length); - CalClient *client; + g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']", + todo.indefinite, + mktime (&todo.due), + todo.priority, + todo.complete, + todo.description ? + todo.description : "", + todo.note ? + todo.note : ""); - icaltimezone *timezone; - GList *uids; - GList *changed; - GHashTable *changed_hash; - GList *locals; + free_ToDo (&todo); - EPilotMap *map; -}; + return buff; +} +/* Context Routines */ static EToDoConduitContext * e_todo_context_new (guint32 pilot_id) { EToDoConduitContext *ctxt = g_new0 (EToDoConduitContext, 1); - ctxt->cfg = todoconduit_load_configuration (pilot_id); - ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg); - ctxt->ps = NULL; + todoconduit_load_configuration (&ctxt->cfg, pilot_id); + ctxt->client = NULL; ctxt->uids = NULL; ctxt->changed_hash = NULL; @@ -236,7 +157,7 @@ e_todo_context_destroy (EToDoConduitContext *ctxt) g_return_if_fail (ctxt != NULL); if (ctxt->cfg != NULL) - todoconduit_destroy_configuration (ctxt->cfg); + todoconduit_destroy_configuration (&ctxt->cfg); if (ctxt->client != NULL) gtk_object_unref (GTK_OBJECT (ctxt->client)); @@ -251,7 +172,7 @@ e_todo_context_destroy (EToDoConduitContext *ctxt) if (ctxt->locals != NULL) { for (l = ctxt->locals; l != NULL; l = l->next) - todoconduit_destroy_record (l->data); + free_local (l->data); g_list_free (ctxt->locals); } @@ -264,62 +185,6 @@ e_todo_context_destroy (EToDoConduitContext *ctxt) g_free (ctxt); } -/* Debug routines */ -static char * -print_local (EToDoLocalRecord *local) -{ - static char buff[ 4096 ]; - - if (local == NULL) { - sprintf (buff, "[NULL]"); - return buff; - } - - if (local->todo && local->todo->description) { - g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']", - local->todo->indefinite, - mktime (& local->todo->due), - local->todo->priority, - local->todo->complete, - local->todo->description ? - local->todo->description : "", - local->todo->note ? - local->todo->note : ""); - return buff; - } - - return ""; -} - -static char *print_remote (GnomePilotRecord *remote) -{ - static char buff[ 4096 ]; - struct ToDo todo; - - if (remote == NULL) { - sprintf (buff, "[NULL]"); - return buff; - } - - memset (&todo, 0, sizeof (struct ToDo)); - unpack_ToDo (&todo, remote->record, remote->length); - - g_snprintf (buff, 4096, "[%d %ld %d %d '%s' '%s']", - todo.indefinite, - mktime (&todo.due), - todo.priority, - todo.complete, - todo.description ? - todo.description : "", - todo.note ? - todo.note : ""); - - free_ToDo (&todo); - - return buff; -} - - /* Calendar Server routines */ static void start_calendar_server_cb (CalClient *cal_client, @@ -477,6 +342,15 @@ compute_status (EToDoConduitContext *ctxt, EToDoLocalRecord *local, const char * } } +static void +free_local (EToDoLocalRecord *local) +{ + gtk_object_unref (GTK_OBJECT (local->comp)); + free_ToDo (local->todo); + g_free (local->todo); + g_free (local); +} + static GnomePilotRecord local_record_to_pilot_record (EToDoLocalRecord *local, EToDoConduitContext *ctxt) @@ -1215,7 +1089,7 @@ free_match (GnomePilotConduitSyncAbs *conduit, g_return_val_if_fail (local != NULL, -1); - todoconduit_destroy_record (local); + free_local (local); return 0; } @@ -1233,58 +1107,6 @@ prepare (GnomePilotConduitSyncAbs *conduit, return 0; } -/* Pilot Settings Callbacks */ -static void -fill_widgets (EToDoConduitContext *ctxt) -{ - e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps), - ctxt->cfg->secret); -} - -static gint -create_settings_window (GnomePilotConduit *conduit, - GtkWidget *parent, - EToDoConduitContext *ctxt) -{ - LOG ("create_settings_window"); - - ctxt->ps = e_pilot_settings_new (); - gtk_container_add (GTK_CONTAINER (parent), ctxt->ps); - gtk_widget_show (ctxt->ps); - - fill_widgets (ctxt); - - return 0; -} -static void -display_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) -{ - LOG ("display_settings"); - - fill_widgets (ctxt); -} - -static void -save_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) -{ - LOG ("save_settings"); - - ctxt->new_cfg->secret = - e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps)); - - todoconduit_save_configuration (ctxt->new_cfg); -} - -static void -revert_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) -{ - LOG ("revert_settings"); - - todoconduit_save_configuration (ctxt->cfg); - todoconduit_destroy_configuration (ctxt->new_cfg); - ctxt->new_cfg = todoconduit_dupe_configuration (ctxt->cfg); -} - static ORBit_MessageValidationResult accept_all_cookies (CORBA_unsigned_long request_id, CORBA_Principal *principal, @@ -1344,12 +1166,6 @@ conduit_get_gpilot_conduit (guint32 pilot_id) gtk_signal_connect (retval, "prepare", (GtkSignalFunc) prepare, ctxt); - /* Gui Settings */ - gtk_signal_connect (retval, "create_settings_window", (GtkSignalFunc) create_settings_window, ctxt); - gtk_signal_connect (retval, "display_settings", (GtkSignalFunc) display_settings, ctxt); - gtk_signal_connect (retval, "save_settings", (GtkSignalFunc) save_settings, ctxt); - gtk_signal_connect (retval, "revert_settings", (GtkSignalFunc) revert_settings, ctxt); - return GNOME_PILOT_CONDUIT (retval); } diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 80f7f856d8..b2b7514b0a 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -70,7 +70,6 @@ typedef struct CalUnits hide_completed_tasks_units; gint hide_completed_tasks_value; gboolean confirm_delete; - gboolean confirm_expunge; gboolean use_default_reminder; int default_reminder_interval; CalUnits default_reminder_units; @@ -247,8 +246,6 @@ config_read (void) /* Confirmation */ config->confirm_delete = bonobo_config_get_boolean_with_default ( db, "/Calendar/Other/ConfirmDelete", TRUE, NULL); - config->confirm_expunge = bonobo_config_get_boolean_with_default ( - db, "/Calendar/Other/ConfirmExpunge", TRUE, NULL); /* Default reminders */ config->use_default_reminder = bonobo_config_get_boolean_with_default ( @@ -361,7 +358,6 @@ calendar_config_write (void) config->hide_completed_tasks_value, NULL); bonobo_config_set_boolean (db, "/Calendar/Other/ConfirmDelete", config->confirm_delete, NULL); - bonobo_config_set_boolean (db, "/Calendar/Other/ConfirmExpunge", config->confirm_expunge, NULL); bonobo_config_set_boolean (db, "/Calendar/Other/UseDefaultReminder", config->use_default_reminder, NULL); @@ -407,9 +403,6 @@ calendar_config_write_on_exit (void) bonobo_config_set_float (db, "/Calendar/Display/MonthVPanePosition", config->month_vpane_pos, NULL); - bonobo_config_set_boolean (db, "/Calendar/Other/ConfirmExpunge", - config->confirm_expunge, NULL); - Bonobo_ConfigDatabase_sync (db, &ev); bonobo_object_release_unref (db, NULL); @@ -805,32 +798,6 @@ calendar_config_set_confirm_delete (gboolean confirm) config->confirm_delete = confirm; } -/** - * calendar_config_get_confirm_expunge: - * - * Queries the configuration value for whether a confirmation dialog is - * presented when expunging calendar/tasks items. - * - * Return value: Whether confirmation is required when expunging items. - **/ -gboolean -calendar_config_get_confirm_expunge (void) -{ - return config->confirm_expunge; -} - -/** - * calendar_config_set_confirm_expunge: - * @confirm: Whether confirmation is required when expunging items. - * - * Sets the configuration value for whether a confirmation dialog is presented - * when expunging calendar/tasks items. - **/ -void -calendar_config_set_confirm_expunge (gboolean confirm) -{ - config->confirm_expunge = confirm; -} /* This sets all the common config settings for an ECalendar widget. These are the week start day, and whether we show week numbers. */ diff --git a/calendar/gui/calendar-model.c b/calendar/gui/calendar-model.c index e8317402ac..f2b9d8b428 100644 --- a/calendar/gui/calendar-model.c +++ b/calendar/gui/calendar-model.c @@ -1891,7 +1891,7 @@ query_query_done_cb (CalQuery *query, CalQueryDoneStatus status, const char *err calendar_model_set_status_message (model, NULL); if (status != CAL_QUERY_DONE_SUCCESS) - g_warning ("query done: %s\n", error_str); + fprintf (stderr, "query done: %s\n", error_str); } /* Callback used when an evaluation error occurs when running a query */ @@ -1906,7 +1906,7 @@ query_eval_error_cb (CalQuery *query, const char *error_str, gpointer data) calendar_model_set_status_message (model, NULL); - g_warning ("eval error: %s\n", error_str); + fprintf (stderr, "eval error: %s\n", error_str); } /* Builds a complete query sexp for the calendar model by adding the predicates @@ -1987,7 +1987,6 @@ update_query (CalendarModel *model) if (!priv->query) { g_message ("update_query(): Could not create the query"); - calendar_model_set_status_message (model, NULL); return; } diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 6b473950f7..dc8441e88a 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4437,7 +4437,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE; if (cal_client_update_object (day_view->client, comp)) { - if (cal_component_has_attendees (comp) && send_component_dialog (comp, FALSE)) + if (cal_component_has_attendees (comp) && send_component_dialog (comp)) itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp); } else { g_message ("e_day_view_finish_long_event_resize(): Could not update the object!"); @@ -4498,7 +4498,7 @@ e_day_view_finish_resize (EDayView *day_view) day_view->resize_drag_pos = E_DAY_VIEW_POS_NONE; if (cal_client_update_object (day_view->client, comp)) { - if (cal_component_has_attendees (comp) && send_component_dialog (comp, FALSE)) + if (cal_component_has_attendees (comp) && send_component_dialog (comp)) itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp); } else { g_message ("e_day_view_finish_resize(): Could not update the object!"); @@ -5841,7 +5841,7 @@ e_day_view_on_editing_stopped (EDayView *day_view, cal_component_set_summary (event->comp, &summary); if (cal_client_update_object (day_view->client, event->comp)) { - if (cal_component_has_attendees (event->comp) && send_component_dialog (event->comp, FALSE)) + if (cal_component_has_attendees (event->comp) && send_component_dialog (event->comp)) itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, event->comp); } else { g_message ("e_day_view_on_editing_stopped(): Could not update the object!"); @@ -6889,7 +6889,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); if (cal_client_update_object (day_view->client, comp)) { - if (cal_component_has_attendees (comp) && send_component_dialog (comp, FALSE)) + if (cal_component_has_attendees (comp) && send_component_dialog (comp)) itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp); } else { g_message ("e_day_view_on_top_canvas_drag_data_received(): Could " @@ -7001,7 +7001,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, gnome_canvas_item_show (event->canvas_item); if (cal_client_update_object (day_view->client, comp)) { - if (cal_component_has_attendees (comp) && send_component_dialog (comp, FALSE)) + if (cal_component_has_attendees (comp) && send_component_dialog (comp)) itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, comp); } else { g_message ("e_day_view_on_main_canvas_drag_data_received(): " diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index 66abdb89be..c7aece807c 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -187,6 +187,7 @@ static CalClient * start_calendar_server (gboolean tasks) { CalClient *client; + char *cal_uri; gboolean success; client = cal_client_new (); diff --git a/calendar/gui/e-meeting-model.c b/calendar/gui/e-meeting-model.c index a3429aaf55..37632d4a2d 100644 --- a/calendar/gui/e-meeting-model.c +++ b/calendar/gui/e-meeting-model.c @@ -687,15 +687,15 @@ destroy (GtkObject *obj) gtk_object_unref (GTK_OBJECT (priv->client)); if (priv->ebook != NULL) - gtk_object_unref (GTK_OBJECT (priv->ebook)); + gtk_object_unref (GTK_OBJECT (priv->ebook)); if (priv->corba_select_names != CORBA_OBJECT_NIL) { - CORBA_Environment ev; + CORBA_Environment ev; CORBA_exception_init (&ev); bonobo_object_release_unref (priv->corba_select_names, &ev); CORBA_exception_free (&ev); - } - + } + g_free (priv); } @@ -1181,6 +1181,8 @@ process_free_busy (EMeetingModel *im, EMeetingAttendee *ia, char *text) if (main_comp == NULL) return; + e_meeting_attendee_set_has_calendar_info (ia, TRUE); + kind = icalcomponent_isa (main_comp); if (kind == ICAL_VCALENDAR_COMPONENT) { icalcompiter iter; diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 7dd9d83cc3..df489ef710 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -593,10 +593,6 @@ e_week_view_realize (GtkWidget *widget) week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].green = 65535; week_view->colors[E_WEEK_VIEW_COLOR_DATES_SELECTED].blue = 65535; - week_view->colors[E_WEEK_VIEW_COLOR_TODAY].red = 65535; - week_view->colors[E_WEEK_VIEW_COLOR_TODAY].green = 0; - week_view->colors[E_WEEK_VIEW_COLOR_TODAY].blue = 0; - nfailed = gdk_colormap_alloc_colors (colormap, week_view->colors, E_WEEK_VIEW_COLOR_LAST, FALSE, TRUE, success); @@ -3192,7 +3188,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, cal_component_set_summary (event->comp, &summary); if (cal_client_update_object (week_view->client, event->comp)) { - if (cal_component_has_attendees (event->comp) && send_component_dialog (event->comp, FALSE)) + if (cal_component_has_attendees (event->comp) && send_component_dialog (event->comp)) itip_send_comp (CAL_COMPONENT_METHOD_REQUEST, event->comp); } else { g_message ("e_week_view_on_editing_stopped(): Could not update the object!"); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 664fac4bc8..bc9e426ef4 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -642,7 +642,13 @@ get_current_time (ECalendarItem *calitem, gpointer data) cal->priv->zone); /* Now copy it to the struct tm and return it. */ - tmp_tm = icaltimetype_to_tm (&tt); + tmp_tm.tm_year = tt.year - 1900; + tmp_tm.tm_mon = tt.month - 1; + tmp_tm.tm_mday = tt.day; + tmp_tm.tm_hour = tt.hour; + tmp_tm.tm_min = tt.minute; + tmp_tm.tm_sec = tt.second; + tmp_tm.tm_isdst = -1; return tmp_tm; } diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 405240e9da..4aecab882a 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -701,7 +701,8 @@ itip_send_comp (CalComponentItipMethod method, CalComponent *send_comp) g_return_if_fail (bonobo_server != NULL); composer_server = BONOBO_OBJREF (bonobo_server); - GNOME_Evolution_Composer_setMultipartType (composer_server, GNOME_Evolution_Composer_MIXED, &ev); + if (!getenv ("EVOLUTION_SEND_IMIP_AS_ATTACHMENT")) + GNOME_Evolution_Composer_setMultipartType (composer_server, GNOME_Evolution_Composer_ALTERNATIVE, &ev); if (BONOBO_EX (&ev)) { g_warning ("Unable to set multipart type while sending iTip message"); goto cleanup; -- cgit v1.2.3