diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-11-15 06:04:21 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-11-15 06:04:21 +0800 |
commit | 9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91 (patch) | |
tree | 2e1e96f33404781354c422a7e9beaf458ebeb655 /calendar | |
parent | 7e8f8bb9e5167b0219b48ab3e8062080d3740b0a (diff) | |
download | gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.gz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.bz2 gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.lz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.xz gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.tar.zst gsoc2013-evolution-9e4fcb29cf7f05c18f7fd34e318f9e795fa32e91.zip |
** Remove trailing whitespace from source code.
2007-11-14 Matthew Barnes <mbarnes@redhat.com>
** Remove trailing whitespace from source code.
svn path=/trunk/; revision=34537
Diffstat (limited to 'calendar')
146 files changed, 4876 insertions, 4876 deletions
diff --git a/calendar/common/authentication.c b/calendar/common/authentication.c index f8bce7c86e..f11a0ed1ff 100644 --- a/calendar/common/authentication.c +++ b/calendar/common/authentication.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors : +/* + * Authors : * Rodrigo Moya <rodrigo@ximian.com> * * Copyright 2003, Novell, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -59,7 +59,7 @@ ECal * auth_new_cal_from_default (ECalSourceType type) { ECal *ecal = NULL; - + if (!e_cal_open_default (&ecal, type, auth_func_cb, NULL, NULL)) return NULL; diff --git a/calendar/common/authentication.h b/calendar/common/authentication.h index 4cc398f522..2b5804c039 100644 --- a/calendar/common/authentication.h +++ b/calendar/common/authentication.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors : +/* + * Authors : * Rodrigo Moya <rodrigo@ximian.com> * * Copyright 2003, Novell, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/conduits/calendar/calendar-conduit.c b/calendar/conduits/calendar/calendar-conduit.c index b37941aafd..2654477e0f 100644 --- a/calendar/conduits/calendar/calendar-conduit.c +++ b/calendar/conduits/calendar/calendar-conduit.c @@ -4,7 +4,7 @@ * Copyright (C) 1998 Free Software Foundation * Copyright (C) 2000 Ximian, Inc. * - * Authors: Eskil Heyn Olsen <deity@eskil.dk> + * Authors: Eskil Heyn Olsen <deity@eskil.dk> * JP Rosevear <jpr@ximian.com> * * This program is free software; you can redistribute it and/or @@ -56,7 +56,7 @@ void conduit_destroy_gpilot_conduit (GnomePilotConduit*); #define LOG(x) x #else #define LOG(x) -#endif +#endif #define WARN g_warning #define INFO g_message @@ -101,18 +101,18 @@ struct _ECalConduitCfg { ESource *source; gboolean secret; gboolean multi_day_split; - + gchar *last_uri; }; static ECalConduitCfg * -calconduit_load_configuration (guint32 pilot_id) +calconduit_load_configuration (guint32 pilot_id) { ECalConduitCfg *c; GnomePilotConduitManagement *management; GnomePilotConduitConfig *config; gchar prefix[256]; - + c = g_new0 (ECalConduitCfg, 1); g_assert (c != NULL); @@ -152,14 +152,14 @@ calconduit_load_configuration (guint32 pilot_id) char *filename = g_filename_from_uri (c->last_uri, NULL, NULL); const char *path = filename; const char *home; - + home = g_get_home_dir (); - + if (!strncmp (path, home, strlen (home))) { path += strlen (home); if (G_IS_DIR_SEPARATOR (*path)) path++; - + if (!strcmp (path, "evolution/local/Calendar/calendar.ics")) { gchar *new_filename = g_build_filename (home, @@ -173,14 +173,14 @@ calconduit_load_configuration (guint32 pilot_id) } g_free (filename); } - - gnome_config_pop_prefix (); + + gnome_config_pop_prefix (); return c; } static void -calconduit_save_configuration (ECalConduitCfg *c) +calconduit_save_configuration (ECalConduitCfg *c) { gchar prefix[256]; @@ -199,7 +199,7 @@ calconduit_save_configuration (ECalConduitCfg *c) } static ECalConduitCfg* -calconduit_dupe_configuration (ECalConduitCfg *c) +calconduit_dupe_configuration (ECalConduitCfg *c) { ECalConduitCfg *retval; @@ -216,12 +216,12 @@ calconduit_dupe_configuration (ECalConduitCfg *c) retval->secret = c->secret; retval->multi_day_split = c->multi_day_split; retval->last_uri = g_strdup (c->last_uri); - + return retval; } -static void -calconduit_destroy_configuration (ECalConduitCfg *c) +static void +calconduit_destroy_configuration (ECalConduitCfg *c) { g_return_if_fail (c != NULL); @@ -237,12 +237,12 @@ struct _ECalConduitGui { }; static ECalConduitGui * -e_cal_gui_new (EPilotSettings *ps) +e_cal_gui_new (EPilotSettings *ps) { ECalConduitGui *gui; GtkWidget *lbl; gint rows; - + g_return_val_if_fail (ps != NULL, NULL); g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL); @@ -257,12 +257,12 @@ e_cal_gui_new (EPilotSettings *ps) gtk_table_attach_defaults (GTK_TABLE (ps), gui->multi_day_split, 1, 2, rows, rows + 1); gtk_widget_show (lbl); gtk_widget_show (gui->multi_day_split); - + return gui; } static void -e_cal_gui_fill_widgets (ECalConduitGui *gui, ECalConduitCfg *cfg) +e_cal_gui_fill_widgets (ECalConduitGui *gui, ECalConduitCfg *cfg) { g_return_if_fail (gui != NULL); g_return_if_fail (cfg != NULL); @@ -272,7 +272,7 @@ e_cal_gui_fill_widgets (ECalConduitGui *gui, ECalConduitCfg *cfg) } static void -e_cal_gui_fill_config (ECalConduitGui *gui, ECalConduitCfg *cfg) +e_cal_gui_fill_config (ECalConduitGui *gui, ECalConduitCfg *cfg) { g_return_if_fail (gui != NULL); g_return_if_fail (cfg != NULL); @@ -281,7 +281,7 @@ e_cal_gui_fill_config (ECalConduitGui *gui, ECalConduitCfg *cfg) } static void -e_cal_gui_destroy (ECalConduitGui *gui) +e_cal_gui_destroy (ECalConduitGui *gui) { g_free (gui); } @@ -294,7 +294,7 @@ struct _ECalConduitContext { ECalConduitCfg *new_cfg; ECalConduitGui *gui; GtkWidget *ps; - + struct AppointmentAppInfo ai; ECal *client; @@ -305,18 +305,18 @@ struct _ECalConduitContext { GList *changed; GHashTable *changed_hash; GList *locals; - + EPilotMap *map; }; static ECalConduitContext * -e_calendar_context_new (guint32 pilot_id) +e_calendar_context_new (guint32 pilot_id) { ECalConduitContext *ctxt; 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; @@ -329,12 +329,12 @@ e_calendar_context_new (guint32 pilot_id) ctxt->changed_hash = NULL; ctxt->locals = NULL; ctxt->map = NULL; - + return ctxt; } static gboolean -e_calendar_context_foreach_change (gpointer key, gpointer value, gpointer data) +e_calendar_context_foreach_change (gpointer key, gpointer value, gpointer data) { g_free (key); @@ -345,7 +345,7 @@ static void e_calendar_context_destroy (ECalConduitContext *ctxt) { GList *l; - + g_return_if_fail (ctxt != NULL); if (ctxt->cfg != NULL) @@ -358,27 +358,27 @@ e_calendar_context_destroy (ECalConduitContext *ctxt) if (ctxt->client != NULL) g_object_unref (ctxt->client); if (ctxt->default_comp != NULL) - g_object_unref (ctxt->default_comp); + g_object_unref (ctxt->default_comp); if (ctxt->comps != NULL) { for (l = ctxt->comps; l; l = l->next) g_object_unref (l->data); g_list_free (ctxt->comps); } - + if (ctxt->changed != NULL) e_cal_free_change_list (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); } - + if (ctxt->locals != NULL) { for (l = ctxt->locals; l != NULL; l = l->next) calconduit_destroy_record (l->data); g_list_free (ctxt->locals); } - + if (ctxt->map != NULL) e_pilot_map_destroy (ctxt->map); } @@ -432,7 +432,7 @@ static char *print_remote (GnomePilotRecord *remote) sprintf (buff, "[NULL]"); return buff; } - + unpack_Appointment (&appt, buffer, datebook_v1); pi_buffer_free(buffer); #else @@ -481,12 +481,12 @@ start_calendar_server (ECalConduitContext *ctxt) As of Evo. 2.5.x, timezone should be set before calling e_cal_open. */ - + if (ctxt->timezone) { if (!e_cal_set_default_timezone (ctxt->client, ctxt->timezone, NULL)) return -1; } - + if (e_source_get_property (ctxt->cfg->source, "auth")) { EUri *e_uri; @@ -510,14 +510,14 @@ start_calendar_server (ECalConduitContext *ctxt) /* Utility routines */ static icaltimezone * -get_timezone (ECal *client, const char *tzid) +get_timezone (ECal *client, const char *tzid) { icaltimezone *timezone = NULL; timezone = icaltimezone_get_builtin_timezone_from_tzid (tzid); - if (timezone == NULL) + if (timezone == NULL) e_cal_get_timezone (client, tzid, &timezone, NULL); - + return timezone; } @@ -536,29 +536,29 @@ get_default_timezone (void) g_free (location); location = g_strdup ("UTC"); } - + timezone = icaltimezone_get_builtin_timezone (location); g_free (location); g_object_unref (listener); - return timezone; + return timezone; } static char * -map_name (ECalConduitContext *ctxt) +map_name (ECalConduitContext *ctxt) { char *filename; - + filename = g_strdup_printf ("%s/.evolution/calendar/local/system/pilot-map-calendar-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); - + return filename; } static icalrecurrencetype_weekday -get_ical_day (int day) +get_ical_day (int day) { switch (day) { case 0: @@ -581,7 +581,7 @@ get_ical_day (int day) } static int -get_pilot_day (icalrecurrencetype_weekday wd) +get_pilot_day (icalrecurrencetype_weekday wd) { switch (wd) { case ICAL_SUNDAY_WEEKDAY: @@ -604,24 +604,24 @@ get_pilot_day (icalrecurrencetype_weekday wd) } static gboolean -is_empty_time (struct tm time) +is_empty_time (struct tm time) { - if (time.tm_sec || time.tm_min || time.tm_hour - || time.tm_mday || time.tm_mon || time.tm_year) + if (time.tm_sec || time.tm_min || time.tm_hour + || time.tm_mday || time.tm_mon || time.tm_year) return FALSE; - + return TRUE; } static gboolean -is_all_day (ECal *client, ECalComponentDateTime *dt_start, ECalComponentDateTime *dt_end) +is_all_day (ECal *client, ECalComponentDateTime *dt_start, ECalComponentDateTime *dt_end) { time_t dt_start_time, dt_end_time; icaltimezone *timezone; if (dt_start->value->is_date && dt_end->value->is_date) return TRUE; - + timezone = get_timezone (client, dt_start->tzid); dt_start_time = icaltime_as_timet_with_zone (*dt_start->value, timezone); dt_end_time = icaltime_as_timet_with_zone (*dt_end->value, get_timezone (client, dt_end->tzid)); @@ -646,7 +646,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp *multi_ccc = NULL; *multi_comp = NULL; - + if (ccc->type == E_CAL_CHANGE_DELETED) return FALSE; @@ -665,7 +665,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp tz_end = get_timezone (ctxt->client, dt_end.tzid); event_end = icaltime_as_timet_with_zone (*dt_end.value, tz_end); - day_end = time_day_end_with_zone (event_start, ctxt->timezone); + day_end = time_day_end_with_zone (event_start, ctxt->timezone); if (day_end >= event_end) { ret = FALSE; goto cleanup; @@ -676,7 +676,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp if (dt_start.value->is_date && dt_end.value->is_date) is_date = TRUE; - + old_start_value = dt_start.value; old_end_value = dt_end.value; while (!last) { @@ -685,7 +685,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp char *new_uid = e_cal_component_gen_uid (); struct icaltimetype start_value, end_value; ECalChange *c = NULL; - + if (day_end >= event_end) { day_end = event_end; last = TRUE; @@ -696,13 +696,13 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp start_value = icaltime_from_timet_with_zone (event_start, is_date, tz_start); dt_start.value = &start_value; e_cal_component_set_dtstart (clone, &dt_start); - + end_value = icaltime_from_timet_with_zone (day_end, is_date, tz_end); dt_end.value = &end_value; e_cal_component_set_dtend (clone, &dt_end); e_cal_component_commit_sequence (clone); - + /* FIXME Error handling */ ical_comp = e_cal_component_get_icalcomponent (clone); if (!ical_comp) { @@ -717,7 +717,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp c = g_new0 (ECalChange, 1); c->comp = clone; c->type = E_CAL_CHANGE_ADDED; - + *multi_ccc = g_list_prepend (*multi_ccc, c); *multi_comp = g_list_prepend (*multi_comp, g_object_ref (c->comp)); @@ -728,7 +728,7 @@ process_multi_day (ECalConduitContext *ctxt, ECalChange *ccc, GList **multi_comp } dt_start.value = old_start_value; dt_end.value = old_end_value; - + e_cal_component_get_uid (ccc->comp, &uid); /* FIXME Error handling */ if (e_cal_component_is_instance (ccc->comp) || e_cal_component_has_recurrences (ccc->comp)) @@ -754,21 +754,21 @@ nth_weekday (int pos, icalrecurrencetype_weekday weekday) } static GList * -next_changed_item (ECalConduitContext *ctxt, GList *changes) +next_changed_item (ECalConduitContext *ctxt, GList *changes) { ECalChange *ccc; GList *l; - + for (l = changes; l != NULL; l = l->next) { const char *uid; ccc = l->data; - + e_cal_component_get_uid (ccc->comp, &uid); if (g_hash_table_lookup (ctxt->changed_hash, uid)) return l; } - + return NULL; } @@ -781,21 +781,21 @@ compute_status (ECalConduitContext *ctxt, ECalLocalRecord *local, const char *ui local->local.secret = FALSE; ccc = g_hash_table_lookup (ctxt->changed_hash, uid); - + if (ccc == NULL) { local->local.attr = GnomePilotRecordNothing; return; } - + switch (ccc->type) { case E_CAL_CHANGE_ADDED: local->local.attr = GnomePilotRecordNew; break; - + case E_CAL_CHANGE_MODIFIED: local->local.attr = GnomePilotRecordModified; break; - + case E_CAL_CHANGE_DELETED: local->local.attr = GnomePilotRecordDeleted; break; @@ -806,16 +806,16 @@ static gboolean rrules_mostly_equal (struct icalrecurrencetype *a, struct icalrecurrencetype *b) { struct icalrecurrencetype acopy, bcopy; - + acopy = *a; bcopy = *b; - + acopy.until = bcopy.until = icaltime_null_time (); acopy.count = bcopy.count = 0; - + if (!memcmp (&acopy, &bcopy, sizeof (struct icalrecurrencetype))) return TRUE; - + return FALSE; } @@ -823,7 +823,7 @@ static gboolean find_last_cb (ECalComponent *comp, time_t start, time_t end, gpointer data) { time_t *last = data; - + *last = start; return TRUE; @@ -858,25 +858,25 @@ local_record_to_pilot_record (ECalLocalRecord *local, pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY); return p; } - + pack_Appointment (local->appt, buffer, datebook_v1); p.record = g_new0(unsigned char, buffer->used); p.length = buffer->used; memcpy(p.record, buffer->data, buffer->used); - - pi_buffer_free(buffer); + + pi_buffer_free(buffer); #else p.record = (unsigned char *)record; p.length = pack_Appointment (local->appt, p.record, 0xffff); #endif - return p; + return p; } /* * converts a ECalComponent object to a ECalLocalRecord */ static void -local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduitContext *ctxt) +local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduitContext *ctxt) { const char *uid; ECalComponentText summary; @@ -886,13 +886,13 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit ECalComponentClassification classif; icaltimezone *default_tz = ctxt->timezone; int i; - + g_return_if_fail (local != NULL); g_return_if_fail (comp != NULL); local->comp = comp; g_object_ref (comp); - + e_cal_component_get_uid (local->comp, &uid); local->local.ID = e_pilot_map_lookup_pid (ctxt->map, uid, TRUE); compute_status (ctxt, local, uid); @@ -900,30 +900,30 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit local->appt = g_new0 (struct Appointment, 1); /* Handle the fields and category we don't sync by making sure - * we don't overwrite them + * we don't overwrite them */ if (local->local.ID != 0) { int cat = 0; #ifdef PILOT_LINK_0_12 struct Appointment appt; pi_buffer_t * record; - + record = pi_buffer_new(DLP_BUF_SIZE); if(record == NULL){ pi_set_error(ctxt->dbi->pilot_socket, PI_ERR_GENERIC_MEMORY); return; } #else - struct Appointment appt; + struct Appointment appt; char record[0xffff]; -#endif - if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, +#endif + if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, ctxt->dbi->db_handle, #ifdef PILOT_LINK_0_12 - local->local.ID, record, + local->local.ID, record, NULL, NULL, &cat) > 0) { #else - local->local.ID, &record, + local->local.ID, &record, NULL, NULL, NULL, &cat) > 0) { #endif local->local.category = cat; @@ -942,14 +942,14 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit pi_buffer_free (record); #endif } - + /*Category support*/ e_pilot_local_category_to_remote(&(local->local.category), comp, &(ctxt->ai.category)); /* STOP: don't replace these with g_strdup, since free_Appointment uses free to deallocate */ e_cal_component_get_summary (comp, &summary); - if (summary.value) + if (summary.value) local->appt->description = e_pilot_utf8_to_pchar (summary.value); e_cal_component_get_description_list (comp, &d_list); @@ -967,17 +967,17 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit e_cal_component_get_dtstart (comp, &dt_start); e_cal_component_get_dtend (comp, &dt_end); if (dt_start.value) { - icaltimezone_convert_time (dt_start.value, + icaltimezone_convert_time (dt_start.value, get_timezone (ctxt->client, dt_start.tzid), default_tz); local->appt->begin = icaltimetype_to_tm (dt_start.value); } - + if (dt_start.value && dt_end.value) { if (is_all_day (ctxt->client, &dt_start, &dt_end)) { local->appt->event = 1; } else { - icaltimezone_convert_time (dt_end.value, + icaltimezone_convert_time (dt_end.value, get_timezone (ctxt->client, dt_end.tzid), default_tz); local->appt->end = icaltimetype_to_tm (dt_end.value); @@ -987,7 +987,7 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit local->appt->event = 1; } e_cal_component_free_datetime (&dt_start); - e_cal_component_free_datetime (&dt_end); + e_cal_component_free_datetime (&dt_end); /* Recurrence Rules */ local->appt->repeatType = repeatNone; @@ -996,10 +996,10 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit if (e_cal_component_has_rrules (comp)) { GSList *list; struct icalrecurrencetype *recur; - + e_cal_component_get_rrule_list (comp, &list); recur = list->data; - + switch (recur->freq) { case ICAL_DAILY_RECURRENCE: local->appt->repeatType = repeatDaily; @@ -1012,18 +1012,18 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit wd = icalrecurrencetype_day_day_of_week (recur->by_day[i]); local->appt->repeatDays[get_pilot_day (wd)] = 1; } - + break; case ICAL_MONTHLY_RECURRENCE: if (recur->by_month_day[0] != ICAL_RECURRENCE_ARRAY_MAX) { local->appt->repeatType = repeatMonthlyByDate; break; } - + /* Not going to work with -ve by_day/by_set_pos other than -1, * pilot doesn't support that anyhow */ local->appt->repeatType = repeatMonthlyByDay; - switch (recur->by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX ? recur->by_set_pos[0] + switch (recur->by_set_pos[0] != ICAL_RECURRENCE_ARRAY_MAX ? recur->by_set_pos[0] : icalrecurrencetype_day_position (recur->by_day[0])) { case 1: local->appt->repeatDay = dom1stSun; @@ -1054,11 +1054,11 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit if (local->appt->repeatType != repeatNone) { local->appt->repeatFrequency = recur->interval; } - + if (!icaltime_is_null_time (recur->until)) { local->appt->repeatForever = 0; - local->appt->repeatEnd = icaltimetype_to_tm_with_zone (&recur->until, - icaltimezone_get_utc_timezone (), + local->appt->repeatEnd = icaltimetype_to_tm_with_zone (&recur->until, + icaltimezone_get_utc_timezone (), default_tz); } else if (recur->count > 0) { time_t last = -1; @@ -1066,37 +1066,37 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit /* The palm does not support count recurrences */ local->appt->repeatForever = 0; - e_cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last, - e_cal_resolve_tzid_cb, ctxt->client, + e_cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last, + e_cal_resolve_tzid_cb, ctxt->client, default_tz); itt = icaltime_from_timet_with_zone (last, TRUE, default_tz); local->appt->repeatEnd = icaltimetype_to_tm (&itt); } else { local->appt->repeatForever = 1; } - + e_cal_component_free_recur_list (list); } /* Exceptions */ e_cal_component_get_exdate_list (comp, &edl); local->appt->exceptions = g_slist_length (edl); - local->appt->exception = g_new0 (struct tm, local->appt->exceptions); + local->appt->exception = g_new0 (struct tm, local->appt->exceptions); for (l = edl, i = 0; l != NULL; l = l->next, i++) { ECalComponentDateTime *dt = l->data; - icaltimezone_convert_time (dt->value, + icaltimezone_convert_time (dt->value, icaltimezone_get_utc_timezone (), default_tz); local->appt->exception[i] = icaltimetype_to_tm (dt->value); } e_cal_component_free_exdate_list (edl); } - + /* Alarm */ local->appt->alarm = 0; if (e_cal_component_has_alarms (comp)) { - GList *uids, *l; + GList *uids, *l; ECalComponentAlarm *alarm; ECalComponentAlarmTrigger trigger; @@ -1104,11 +1104,11 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit for (l = uids; l != NULL; l = l->next) { alarm = e_cal_component_get_alarm (comp, l->data); e_cal_component_alarm_get_trigger (alarm, &trigger); - + if ((trigger.type == E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START && trigger.u.rel_duration.is_neg)) { local->appt->advanceUnits = advMinutes; - local->appt->advance = + local->appt->advance = trigger.u.rel_duration.minutes + trigger.u.rel_duration.hours * 60 + trigger.u.rel_duration.days * 60 * 24 @@ -1116,7 +1116,7 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit if (local->appt->advance > PILOT_MAX_ADVANCE) { local->appt->advanceUnits = advHours; - local->appt->advance = + local->appt->advance = trigger.u.rel_duration.minutes / 60 + trigger.u.rel_duration.hours + trigger.u.rel_duration.days * 24 @@ -1140,7 +1140,7 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit } cal_obj_uid_list_free (uids); } - + e_cal_component_get_classification (comp, &classif); if (classif == E_CAL_COMPONENT_CLASS_PRIVATE) @@ -1148,10 +1148,10 @@ local_record_from_comp (ECalLocalRecord *local, ECalComponent *comp, ECalConduit else local->local.secret = 0; - local->local.archived = 0; + local->local.archived = 0; } -static void +static void local_record_from_uid (ECalLocalRecord *local, const char *uid, ECalConduitContext *ctxt) @@ -1199,7 +1199,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, struct icalrecurrencetype recur; ECalComponentText summary = {NULL, NULL}; ECalComponentDateTime dt = {NULL, NULL}; - GSList *edl = NULL; + GSList *edl = NULL; char *txt; int pos, i; #ifdef PILOT_LINK_0_12 @@ -1212,7 +1212,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, if(buffer == NULL){ return NULL; } - + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){ return NULL; } @@ -1237,7 +1237,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, summary.value = txt = e_pilot_utf8_from_pchar (appt.description); e_cal_component_set_summary (comp, &summary); free (txt); - + /*Category support*/ e_pilot_remote_category_to_local(remote->category, comp, category); @@ -1255,7 +1255,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_set_description_list (comp, &l); free (txt); - } + } if (appt.event && !is_empty_time (appt.begin)) { it = tm_to_icaltimetype (&appt.begin, TRUE); @@ -1272,7 +1272,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_set_dtstart (comp, &dt); } - if (!is_empty_time (appt.end)) { + if (!is_empty_time (appt.end)) { it = tm_to_icaltimetype (&appt.end, FALSE); dt.value = ⁢ e_cal_component_set_dtend (comp, &dt); @@ -1301,19 +1301,19 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, if (appt.repeatDays[i]) recur.by_day[pos++] = get_ical_day (i); } - + break; case repeatMonthlyByDay: recur.freq = ICAL_MONTHLY_RECURRENCE; recur.interval = appt.repeatFrequency; if (appt.repeatDay < domLastSun) - recur.by_day[0] = nth_weekday ((appt.repeatDay / 7) + 1, + recur.by_day[0] = nth_weekday ((appt.repeatDay / 7) + 1, get_ical_day (appt.repeatDay % 7)); else - recur.by_day[0] = nth_weekday (-1, get_ical_day (appt.repeatDay % 7)); + recur.by_day[0] = nth_weekday (-1, get_ical_day (appt.repeatDay % 7)); break; - + case repeatMonthlyByDate: recur.freq = ICAL_MONTHLY_RECURRENCE; recur.interval = appt.repeatFrequency; @@ -1324,7 +1324,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, recur.freq = ICAL_YEARLY_RECURRENCE; recur.interval = appt.repeatFrequency; break; - + default: g_assert_not_reached (); } @@ -1332,12 +1332,12 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, if (recur.freq != ICAL_NO_RECURRENCE) { GSList *list = NULL, *existing; struct icalrecurrencetype *erecur; - + /* recurrence start of week */ recur.week_start = get_ical_day (appt.repeatWeekstart); if (!appt.repeatForever) { - recur.until = tm_to_icaltimetype (&appt.repeatEnd, TRUE); + recur.until = tm_to_icaltimetype (&appt.repeatEnd, TRUE); } list = g_slist_append (list, &recur); @@ -1348,21 +1348,21 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, if (!appt.repeatForever && e_cal_component_has_rrules (in_comp)) { e_cal_component_get_rrule_list (in_comp, &existing); erecur = existing->data; - - /* If the rules are otherwise the same and the existing uses count, + + /* If the rules are otherwise the same and the existing uses count, see if they end at the same point */ - if (rrules_mostly_equal (&recur, erecur) && + if (rrules_mostly_equal (&recur, erecur) && icaltime_is_null_time (erecur->until) && erecur->count > 0) { time_t last, elast; - - e_cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last, + + e_cal_recur_generate_instances (comp, -1, -1, find_last_cb, &last, e_cal_resolve_tzid_cb, client, timezone); - e_cal_recur_generate_instances (in_comp, -1, -1, find_last_cb, &elast, - e_cal_resolve_tzid_cb, client, + e_cal_recur_generate_instances (in_comp, -1, -1, find_last_cb, &elast, + e_cal_resolve_tzid_cb, client, timezone); - + if (last == elast) { recur.until = icaltime_null_time (); recur.count = erecur->count; @@ -1373,7 +1373,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, g_slist_free (list); } else { - e_cal_component_set_rrule_list (comp, NULL); + e_cal_component_set_rrule_list (comp, NULL); } /* Exceptions */ @@ -1382,11 +1382,11 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, ECalComponentDateTime *dt = g_new0 (ECalComponentDateTime, 1); dt->value = g_new0 (struct icaltimetype, 1); - dt->tzid = NULL; - + dt->tzid = NULL; + ex = appt.exception[i]; *dt->value = tm_to_icaltimetype (&ex, TRUE); - + edl = g_slist_prepend (edl, dt); } e_cal_component_set_exdate_list (comp, edl); @@ -1397,10 +1397,10 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, ECalComponentAlarm *alarm = NULL; ECalComponentAlarmTrigger trigger; gboolean found = FALSE; - + if (e_cal_component_has_alarms (comp)) { GList *uids, *l; - + uids = e_cal_component_get_alarm_uids (comp); for (l = uids; l != NULL; l = l->next) { alarm = e_cal_component_get_alarm (comp, l->data); @@ -1438,7 +1438,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_add_alarm (comp, alarm); e_cal_component_alarm_free (alarm); } - + e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_NONE); if (remote->secret) @@ -1447,7 +1447,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PUBLIC); e_cal_component_commit_sequence (comp); - + free_Appointment (&appt); return comp; @@ -1459,7 +1459,7 @@ check_for_slow_setting (GnomePilotConduit *c, ECalConduitContext *ctxt) GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); int map_count; const char *uri; - + /* If there are objects but no log */ map_count = g_hash_table_size (ctxt->map->pid_map); if (map_count == 0) @@ -1472,7 +1472,7 @@ check_for_slow_setting (GnomePilotConduit *c, ECalConduitContext *ctxt) gnome_pilot_conduit_standard_set_slow (conduit, TRUE); e_pilot_map_clear (ctxt->map); } - + if (gnome_pilot_conduit_standard_get_slow (conduit)) { ctxt->map->write_touched_only = TRUE; LOG (g_message ( " doing slow sync\n" )); @@ -1502,7 +1502,7 @@ pre_sync (GnomePilotConduit *conduit, LOG (g_message ( "---------------------------------------------------------\n" )); LOG (g_message ( "pre_sync: Calendar Conduit v.%s", CONDUIT_VERSION )); - ctxt->dbi = dbi; + ctxt->dbi = dbi; ctxt->client = NULL; /* Get the timezone */ @@ -1510,7 +1510,7 @@ pre_sync (GnomePilotConduit *conduit, if (ctxt->timezone == NULL) return -1; LOG (g_message ( " Using timezone: %s", icaltimezone_get_tzid (ctxt->timezone) )); - + if (start_calendar_server (ctxt) != 0) { WARN(_("Could not start evolution-data-server")); gnome_pilot_conduit_error (conduit, _("Could not start evolution-data-server")); @@ -1543,15 +1543,15 @@ pre_sync (GnomePilotConduit *conduit, return -1; ctxt->changed_hash = g_hash_table_new (g_str_hash, g_str_equal); g_free (change_id); - + /* See if we need to split up any events */ for (l = ctxt->changed; l != NULL; l = l->next) { ECalChange *ccc = l->data; GList *multi_comp = NULL, *multi_ccc = NULL; - + if (process_multi_day (ctxt, ccc, &multi_comp, &multi_ccc)) { ctxt->comps = g_list_concat (ctxt->comps, multi_comp); - + added = g_list_concat (added, multi_ccc); removed = g_list_prepend (removed, ccc); } @@ -1571,11 +1571,11 @@ pre_sync (GnomePilotConduit *conduit, } } g_list_free (removed); - + for (l = ctxt->changed; l != NULL; l = l->next) { ECalChange *ccc = l->data; const char *uid; - + e_cal_component_get_uid (ccc->comp, &uid); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { @@ -1596,7 +1596,7 @@ pre_sync (GnomePilotConduit *conduit, e_pilot_map_remove_by_uid (ctxt->map, uid); } } - + /* Set the count information */ num_records = g_list_length (ctxt->comps); gnome_pilot_conduit_sync_abs_set_num_local_records(abs_conduit, num_records); @@ -1639,7 +1639,7 @@ pre_sync (GnomePilotConduit *conduit, if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot) ctxt->map->write_touched_only = TRUE; - + return 0; } @@ -1652,19 +1652,19 @@ post_sync (GnomePilotConduit *conduit, gchar *filename, *change_id; unsigned char *buf; int dlpRetVal, len; - + LOG (g_message ( "post_sync: Calendar Conduit v.%s", CONDUIT_VERSION )); - + /* Write AppBlock to PDA - updates categories */ buf = (unsigned char*)g_malloc (0xffff); - + len = pack_AppointmentAppInfo (&(ctxt->ai), buf, 0xffff); - - dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, + + dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, (unsigned char *)buf, len); - + g_free (buf); - + if (dlpRetVal < 0) { WARN ( ("Could not write pilot's Calendar application block")); WARN ("dlp_WriteAppBlock(...) = %d", dlpRetVal); @@ -1676,11 +1676,11 @@ post_sync (GnomePilotConduit *conduit, g_free (ctxt->cfg->last_uri); ctxt->cfg->last_uri = g_strdup (e_cal_get_uri (ctxt->client)); calconduit_save_configuration (ctxt->cfg); - + filename = map_name (ctxt); e_pilot_map_write (filename, ctxt->map); g_free (filename); - + /* FIX ME ugly hack - our changes musn't count, this does introduce * a race condition if anyone changes a record elsewhere during sycnc */ @@ -1688,7 +1688,7 @@ post_sync (GnomePilotConduit *conduit, if (e_cal_get_changes (ctxt->client, change_id, &changed, NULL)) e_cal_free_change_list (changed); g_free (change_id); - + LOG (g_message ( "---------------------------------------------------------\n" )); return 0; @@ -1703,7 +1703,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, const char *uid; LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); - + e_cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, ID, uid, FALSE); @@ -1716,12 +1716,12 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, ECalConduitContext *ctxt) { const char *uid; - + LOG (g_message ( "set_status_cleared: clearing status\n" )); - + e_cal_component_get_uid (local->comp, &uid); g_hash_table_remove (ctxt->changed_hash, uid); - + return 0; } @@ -1741,7 +1741,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, comps = ctxt->comps; count = 0; - + if (comps != NULL) { LOG (g_message ( "iterating over %d records", g_list_length (comps))); @@ -1797,17 +1797,17 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, if (*local == NULL) { LOG (g_message ( "for_each_modified beginning\n" )); - + iterator = ctxt->changed; - + count = 0; - + LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash) )); - + iterator = next_changed_item (ctxt, iterator); if (iterator != NULL) { ECalChange *ccc = iterator->data; - + *local = g_new0 (ECalLocalRecord, 1); local_record_from_comp (*local, ccc->comp, ctxt); @@ -1825,7 +1825,7 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, iterator = g_list_next (iterator); if (iterator && (iterator = next_changed_item (ctxt, iterator))) { ECalChange *ccc = iterator->data; - + *local = g_new0 (ECalLocalRecord, 1); local_record_from_comp (*local, ccc->comp, ctxt); @@ -1870,7 +1870,7 @@ compare (GnomePilotConduitSyncAbs *conduit, LOG (g_message ( " equal" )); else LOG (g_message ( " not equal" )); - + return retval; } @@ -1882,7 +1882,7 @@ add_record (GnomePilotConduitSyncAbs *conduit, ECalComponent *comp; char *uid; int retval = 0; - + g_return_val_if_fail (remote != NULL, -1); LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) )); @@ -1892,16 +1892,16 @@ add_record (GnomePilotConduitSyncAbs *conduit, /* Give it a new UID otherwise it will be the uid of the default comp */ uid = e_cal_component_gen_uid (); e_cal_component_set_uid (comp, uid); - + if (!e_cal_create_object (ctxt->client, e_cal_component_get_icalcomponent (comp), NULL, NULL)) return -1; e_pilot_map_insert (ctxt->map, remote->ID, uid, FALSE); - g_free (uid); + g_free (uid); g_object_unref (comp); - + return retval; } @@ -1913,7 +1913,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, { ECalComponent *new_comp; int retval = 0; - + g_return_val_if_fail (remote != NULL, -1); LOG (g_message ("replace_record: replace %s with %s\n", @@ -1923,7 +1923,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, g_object_unref (local->comp); local->comp = new_comp; - if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp), + if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp), CALOBJ_MOD_ALL, NULL)) return -1; @@ -1950,7 +1950,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, e_cal_remove_object_with_mod (ctxt->client, uid, NULL, CALOBJ_MOD_ALL, NULL); else e_cal_remove_object (ctxt->client, uid, NULL); - + return 0; } @@ -1962,14 +1962,14 @@ archive_record (GnomePilotConduitSyncAbs *conduit, { const char *uid; int retval = 0; - + g_return_val_if_fail (local != NULL, -1); LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" )); e_cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, local->local.ID, uid, archive); - + return retval; } @@ -1980,24 +1980,24 @@ match (GnomePilotConduitSyncAbs *conduit, ECalConduitContext *ctxt) { const char *uid; - + LOG (g_message ("match: looking for local copy of %s\n", - print_remote (remote))); - + print_remote (remote))); + g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (remote != NULL, -1); *local = NULL; uid = e_pilot_map_lookup_uid (ctxt->map, remote->ID, TRUE); - + if (!uid) return 0; LOG (g_message ( " matched\n" )); - + *local = g_new0 (ECalLocalRecord, 1); local_record_from_uid (*local, uid, ctxt); - + return 0; } @@ -2034,7 +2034,7 @@ fill_widgets (ECalConduitContext *ctxt) { if (ctxt->cfg->source) e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps), - ctxt->cfg->source); + ctxt->cfg->source); e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps), ctxt->cfg->secret); @@ -2047,7 +2047,7 @@ create_settings_window (GnomePilotConduit *conduit, ECalConduitContext *ctxt) { LOG (g_message ( "create_settings_window" )); - + if (!ctxt->cfg->source_list) return -1; @@ -2058,14 +2058,14 @@ create_settings_window (GnomePilotConduit *conduit, gtk_widget_show (ctxt->ps); fill_widgets (ctxt); - + return 0; } static void display_settings (GnomePilotConduit *conduit, ECalConduitContext *ctxt) { LOG (g_message ( "display_settings" )); - + fill_widgets (ctxt); } @@ -2141,7 +2141,7 @@ conduit_get_gpilot_conduit (guint32 pilot_id) void conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit) -{ +{ GtkObject *obj = GTK_OBJECT (conduit); ECalConduitContext *ctxt; diff --git a/calendar/conduits/common/libecalendar-common-conduit.c b/calendar/conduits/common/libecalendar-common-conduit.c index 24f6d0b079..534c9ef8fb 100644 --- a/calendar/conduits/common/libecalendar-common-conduit.c +++ b/calendar/conduits/common/libecalendar-common-conduit.c @@ -33,23 +33,23 @@ #define LOG(x) #ifdef DEBUG_CALCONDUIT #define LOG(x) x -#endif +#endif #ifdef DEBUG_MEMOCONDUIT #define LOG(x) x #endif #ifdef DEBUG_TODOCONDUIT #define LOG(x) x -#endif +#endif #ifdef DEBUG_CONDUIT #define LOG(x) x -#endif +#endif /* * Adds a category to the category app info structure (name and ID), * sets category->renamed[i] to true if possible to rename. - * + * * This will be packed and written to the app info block during post_sync. - * + * * NOTE: cat_to_add MUST be in PCHAR format. Evolution stores categories * in UTF-8 format. A conversion must take place before calling * this function (see e_pilot_utf8_to_pchar() in e-pilot-util.c) @@ -60,14 +60,14 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ int i, j; int retval = 0; /* 0 is the Unfiled category */ LOG(g_message("e_pilot_add_category_if_possible\n")); - + for(i=0; i<PILOT_MAX_CATEGORIES; i++){ /* if strlen is 0, then the category is empty the PalmOS doesn't let 0-length strings for categories */ if(strlen(category->name[i]) == 0){ int cat_to_add_len; - + cat_to_add_len = strlen(cat_to_add); retval = i; @@ -75,7 +75,7 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ /* Have to truncate the category name */ cat_to_add_len = 15; } - + /* only 15 characters for category, 16th is * '\0' can't do direct mem transfer due to * declaration type @@ -87,7 +87,7 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ for(j=cat_to_add_len; j<16; j++) { category->name[i][j] = '\0'; } - + //find a desktop id that is not in use between 128 and 255 int desktopUniqueID; for (desktopUniqueID = 128; desktopUniqueID <= 255; desktopUniqueID++) { @@ -105,17 +105,17 @@ e_pilot_add_category_if_possible(char *cat_to_add, struct CategoryAppInfo *categ } } category->ID[i] = desktopUniqueID; - + category->renamed[i] = TRUE; - + break; } } - + if(retval == 0){ LOG (g_warning ("*** not adding category - category list already full ***")); } - + return retval; } @@ -179,8 +179,8 @@ void e_pilot_remote_category_to_local(int pilotCategory, ECalComponent *comp, st /* store the data on in evolution */ if (category_string == NULL) { /* note: this space is needed to make sure evolution clears the category */ - e_cal_component_set_categories (comp, " "); - } + e_cal_component_set_categories (comp, " "); + } else { /* Since only the first category is synced with the PDA, add the PDA's @@ -189,7 +189,7 @@ void e_pilot_remote_category_to_local(int pilotCategory, ECalComponent *comp, st GSList *newcat_in_list; e_cal_component_get_categories_list (comp, &c_list); - /* remove old item from list so we don't have duplicate entries */ + /* remove old item from list so we don't have duplicate entries */ newcat_in_list = g_slist_find_custom(c_list, category_string, (GCompareFunc)strcmp); if(newcat_in_list != NULL) { diff --git a/calendar/conduits/memo/memo-conduit.c b/calendar/conduits/memo/memo-conduit.c index 74f323987d..f84baf7fed 100644 --- a/calendar/conduits/memo/memo-conduit.c +++ b/calendar/conduits/memo/memo-conduit.c @@ -4,7 +4,7 @@ * Copyright (C) 1998 Free Software Foundation * Copyright (C) 2000 Ximian, Inc. * - * Authors: Eskil Heyn Olsen <deity@eskil.dk> + * Authors: Eskil Heyn Olsen <deity@eskil.dk> * JP Rosevear <jpr@ximian.com> * * This program is free software; you can redistribute it and/or @@ -87,11 +87,11 @@ struct _EMemoLocalRecord { int lastDesktopUniqueID; static void -memoconduit_destroy_record (EMemoLocalRecord *local) +memoconduit_destroy_record (EMemoLocalRecord *local) { g_object_unref (local->comp); free_Memo (local->memo); - g_free (local->memo); + g_free (local->memo); g_free (local); } @@ -109,7 +109,7 @@ struct _EMemoConduitCfg { }; static EMemoConduitCfg * -memoconduit_load_configuration (guint32 pilot_id) +memoconduit_load_configuration (guint32 pilot_id) { EMemoConduitCfg *c; GnomePilotConduitManagement *management; @@ -119,7 +119,7 @@ memoconduit_load_configuration (guint32 pilot_id) g_snprintf (prefix, 255, "/gnome-pilot.d/e-memo-conduit/Pilot_%u/", pilot_id); - + c = g_new0 (EMemoConduitCfg,1); g_assert (c != NULL); @@ -133,10 +133,10 @@ memoconduit_load_configuration (guint32 pilot_id) c->sync_type = GnomePilotConduitSyncTypeNotSet; gtk_object_unref (GTK_OBJECT (config)); gtk_object_unref (GTK_OBJECT (management)); - + /* Custom settings */ gnome_config_push_prefix (prefix); - + if (!e_cal_get_sources (&c->source_list, E_CAL_SOURCE_TYPE_JOURNAL, NULL)) c->source_list = NULL; if (c->source_list) { @@ -150,7 +150,7 @@ memoconduit_load_configuration (guint32 pilot_id) c->source_list = NULL; } } - + c->secret = gnome_config_get_bool ("secret=FALSE"); c->priority = gnome_config_get_int ("priority=3"); c->last_uri = gnome_config_get_string ("last_uri"); @@ -161,7 +161,7 @@ memoconduit_load_configuration (guint32 pilot_id) } static void -memoconduit_save_configuration (EMemoConduitCfg *c) +memoconduit_save_configuration (EMemoConduitCfg *c) { gchar prefix[256]; @@ -180,7 +180,7 @@ memoconduit_save_configuration (EMemoConduitCfg *c) } static EMemoConduitCfg* -memoconduit_dupe_configuration (EMemoConduitCfg *c) +memoconduit_dupe_configuration (EMemoConduitCfg *c) { EMemoConduitCfg *retval; @@ -201,8 +201,8 @@ memoconduit_dupe_configuration (EMemoConduitCfg *c) return retval; } -static void -memoconduit_destroy_configuration (EMemoConduitCfg *c) +static void +memoconduit_destroy_configuration (EMemoConduitCfg *c) { g_return_if_fail (c != NULL); @@ -219,7 +219,7 @@ struct _EMemoConduitContext { EMemoConduitCfg *cfg; EMemoConduitCfg *new_cfg; GtkWidget *ps; - + struct MemoAppInfo ai; ECal *client; @@ -230,15 +230,15 @@ struct _EMemoConduitContext { GList *changed; GHashTable *changed_hash; GList *locals; - + EPilotMap *map; }; static EMemoConduitContext * -e_memo_context_new (guint32 pilot_id) +e_memo_context_new (guint32 pilot_id) { EMemoConduitContext *ctxt = g_new0 (EMemoConduitContext, 1); - + ctxt->cfg = memoconduit_load_configuration (pilot_id); ctxt->new_cfg = memoconduit_dupe_configuration (ctxt->cfg); ctxt->ps = NULL; @@ -255,10 +255,10 @@ e_memo_context_new (guint32 pilot_id) } static gboolean -e_memo_context_foreach_change (gpointer key, gpointer value, gpointer data) +e_memo_context_foreach_change (gpointer key, gpointer value, gpointer data) { g_free (key); - + return TRUE; } @@ -266,14 +266,14 @@ static void e_memo_context_destroy (EMemoConduitContext *ctxt) { GList *l; - + g_return_if_fail (ctxt != NULL); if (ctxt->cfg != NULL) memoconduit_destroy_configuration (ctxt->cfg); if (ctxt->new_cfg != NULL) memoconduit_destroy_configuration (ctxt->new_cfg); - + if (ctxt->client != NULL) g_object_unref (ctxt->client); @@ -295,10 +295,10 @@ e_memo_context_destroy (EMemoConduitContext *ctxt) memoconduit_destroy_record (l->data); g_list_free (ctxt->locals); } - + if (ctxt->changed != NULL) e_cal_free_change_list (ctxt->changed); - + if (ctxt->map != NULL) e_pilot_map_destroy (ctxt->map); @@ -361,7 +361,7 @@ static char *print_remote (GnomePilotRecord *remote) memo.text : ""); free_Memo (&memo); - + return buff; } @@ -372,7 +372,7 @@ start_calendar_server (EMemoConduitContext *ctxt) if (ctxt->cfg->source) { ctxt->client = e_cal_new (ctxt->cfg->source, E_CAL_SOURCE_TYPE_JOURNAL); - if (!e_cal_open (ctxt->client, TRUE, NULL)) + if (!e_cal_open (ctxt->client, TRUE, NULL)) return -1; } else if (!e_cal_open_default (&ctxt->client, E_CAL_SOURCE_TYPE_JOURNAL, NULL, NULL, NULL)) { return -1; @@ -396,41 +396,41 @@ get_default_timezone (void) g_free (location); location = g_strdup ("UTC"); } - + timezone = icaltimezone_get_builtin_timezone (location); g_free (location); g_object_unref (listener); - return timezone; + return timezone; } static char * -map_name (EMemoConduitContext *ctxt) +map_name (EMemoConduitContext *ctxt) { char *filename; - + filename = g_strdup_printf ("%s/.evolution/memos/local/system/pilot-map-memo-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); - + return filename; } static GList * -next_changed_item (EMemoConduitContext *ctxt, GList *changes) +next_changed_item (EMemoConduitContext *ctxt, GList *changes) { ECalChange *ccc; GList *l; - + for (l = changes; l != NULL; l = l->next) { const char *uid; ccc = l->data; - + e_cal_component_get_uid (ccc->comp, &uid); if (g_hash_table_lookup (ctxt->changed_hash, uid)) return l; } - + return NULL; } @@ -443,16 +443,16 @@ compute_status (EMemoConduitContext *ctxt, EMemoLocalRecord *local, const char * local->local.secret = FALSE; ccc = g_hash_table_lookup (ctxt->changed_hash, uid); - + if (ccc == NULL) { local->local.attr = GnomePilotRecordNothing; return; } - + switch (ccc->type) { case E_CAL_CHANGE_ADDED: local->local.attr = GnomePilotRecordNew; - break; + break; case E_CAL_CHANGE_MODIFIED: local->local.attr = GnomePilotRecordModified; break; @@ -475,7 +475,7 @@ local_record_to_pilot_record (EMemoLocalRecord *local, g_assert (local->comp != NULL); g_assert (local->memo != NULL ); - + LOG (g_message ( "local_record_to_pilot_record\n" )); memset (&p, 0, sizeof (GnomePilotRecord)); @@ -504,20 +504,20 @@ local_record_to_pilot_record (EMemoLocalRecord *local, p.record = (unsigned char *)record; p.length = pack_Memo (local->memo, p.record, 0xffff); #endif - return p; + return p; } /* * converts a ECalComponent object to a EMemoLocalRecord */ static void -local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoConduitContext *ctxt) +local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoConduitContext *ctxt) { const char *uid; GSList *d_list = NULL; ECalComponentText *description; ECalComponentClassification classif; - + LOG (g_message ( "local_record_from_comp\n" )); g_return_if_fail (local != NULL); @@ -533,7 +533,7 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu LOG(fprintf(stderr, "local_record_from_comp: local->local.ID == %lu\n", local->local.ID)); compute_status (ctxt, local, uid); - + LOG(fprintf(stderr, "local_record_from_comp: local->local.attr: %d\n", local->local.attr)); local->memo = g_new0 (struct Memo,1); @@ -547,7 +547,7 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu char record[0xffff]; #endif int cat = 0; - + #ifdef PILOT_LINK_0_12 record = pi_buffer_new(DLP_BUF_SIZE); if(record == NULL){ @@ -557,10 +557,10 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu #endif LOG(fprintf(stderr, "local_record_from_comp: calling dlp_ReadRecordById\n")); - if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, + if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, ctxt->dbi->db_handle, #ifdef PILOT_LINK_0_12 - local->local.ID, record, + local->local.ID, record, NULL, NULL, &cat) > 0) { local->local.category = cat; memset (&memo, 0, sizeof (struct Memo)); @@ -570,14 +570,14 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu } pi_buffer_free (record); #else - local->local.ID, &record, + local->local.ID, &record, NULL, NULL, NULL, &cat) > 0) { local->local.category = cat; - } + } #endif LOG(fprintf(stderr, "local_record_from_comp: done calling dlp_ReadRecordById\n")); } - + /*Category support*/ e_pilot_local_category_to_remote(&(local->local.category), comp, &(ctxt->ai.category)); @@ -596,7 +596,7 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu } else { local->memo->text = NULL; } - + e_cal_component_get_classification (comp, &classif); if (classif == E_CAL_COMPONENT_CLASS_PRIVATE) @@ -607,7 +607,7 @@ local_record_from_comp (EMemoLocalRecord *local, ECalComponent *comp, EMemoCondu local->local.archived = 0; } -static void +static void local_record_from_uid (EMemoLocalRecord *local, const char *uid, EMemoConduitContext *ctxt) @@ -617,7 +617,7 @@ local_record_from_uid (EMemoLocalRecord *local, GError *error = NULL; g_assert(local!=NULL); - + LOG(g_message("local_record_from_uid\n")); if (e_cal_get_object (ctxt->client, uid, NULL, &icalcomp, &error)) { @@ -667,11 +667,11 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, if(buffer == NULL){ return NULL; } - + if(pi_buffer_append(buffer, remote->record, remote->length)==NULL){ return NULL; } - + unpack_Memo (&memo, buffer, memo_v1); pi_buffer_free(buffer); #else @@ -680,7 +680,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, #endif utc_zone = icaltimezone_get_utc_timezone (); - now = icaltime_from_timet_with_zone (time (NULL), FALSE, + now = icaltime_from_timet_with_zone (time (NULL), FALSE, utc_zone); if (in_comp == NULL) { @@ -692,10 +692,10 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, } e_cal_component_set_last_modified (comp, &now); - + /*Category support*/ e_pilot_remote_category_to_local(remote->category, comp, &(ai->category)); - + /* The iCal description field */ if (!memo.text) { e_cal_component_set_comment_list (comp, NULL); @@ -713,19 +713,19 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, break; } } - + if(foundNL == FALSE){ if(ntext > 50){ txt2 = g_strndup(memo.text, 50); } else{ txt2 = g_strdup(memo.text); - + } } else{ txt2 = g_strndup(memo.text, idxToUse); /* cuts off '\n' */ - + } sumText.value = txt3 = e_pilot_utf8_from_pchar(txt2); @@ -741,7 +741,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, free (txt); g_free(txt2); free(txt3); - } + } e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_NONE); @@ -752,7 +752,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PUBLIC); e_cal_component_commit_sequence (comp); - + free_Memo(&memo); return comp; @@ -764,7 +764,7 @@ check_for_slow_setting (GnomePilotConduit *c, EMemoConduitContext *ctxt) GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); int map_count; const char *uri; - + /* If there are no objects or objects but no log */ map_count = g_hash_table_size (ctxt->map->pid_map); if (map_count == 0) @@ -783,7 +783,7 @@ check_for_slow_setting (GnomePilotConduit *c, EMemoConduitContext *ctxt) LOG (g_message ( " doing slow sync\n" )); } else { LOG (g_message ( " doing fast sync\n" )); - } + } } /* Pilot syncing callbacks */ @@ -809,9 +809,9 @@ pre_sync (GnomePilotConduit *conduit, LOG (g_message ( "pre_sync: Memo Conduit v.%s", CONDUIT_VERSION )); g_message ("Memo Conduit v.%s", CONDUIT_VERSION); - ctxt->dbi = dbi; + ctxt->dbi = dbi; ctxt->client = NULL; - + if (start_calendar_server (ctxt) != 0) { WARN(_("Could not start evolution-data-server")); gnome_pilot_conduit_error (conduit, _("Could not start evolution-data-server")); @@ -827,18 +827,18 @@ pre_sync (GnomePilotConduit *conduit, /* Set the default timezone on the backend. */ if (ctxt->timezone && !e_cal_set_default_timezone (ctxt->client, ctxt->timezone, NULL)) return -1; - + /* Get the default component */ if (!e_cal_get_default_object (ctxt->client, &icalcomp, NULL)) return -1; - + ctxt->default_comp = e_cal_component_new (); if (!e_cal_component_set_icalcomponent (ctxt->default_comp, icalcomp)) { g_object_unref (ctxt->default_comp); icalcomponent_free (icalcomp); return -1; } - + /* Load the uid <--> pilot id map */ filename = map_name (ctxt); e_pilot_map_read (filename, &ctxt->map); @@ -847,24 +847,24 @@ pre_sync (GnomePilotConduit *conduit, /* Get the local database */ if (!e_cal_get_object_list_as_comp (ctxt->client, "#t", &ctxt->comps, NULL)) return -1; - + /* Count and hash the changes */ change_id = g_strdup_printf ("pilot-sync-evolution-memo-%d", ctxt->cfg->pilot_id); if (!e_cal_get_changes (ctxt->client, change_id, &ctxt->changed, NULL)) return -1; - + ctxt->changed_hash = g_hash_table_new (g_str_hash, g_str_equal); g_free (change_id); - + for (l = ctxt->changed; l != NULL; l = l->next) { ECalChange *ccc = l->data; const char *uid; - + e_cal_component_get_uid (ccc->comp, &uid); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { - + g_hash_table_insert (ctxt->changed_hash, g_strdup (uid), ccc); - + switch (ccc->type) { case E_CAL_CHANGE_ADDED: add_records++; @@ -887,7 +887,7 @@ pre_sync (GnomePilotConduit *conduit, gnome_pilot_conduit_sync_abs_set_num_new_local_records (abs_conduit, add_records); gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records); gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records); - + g_message("num_records: %d\nadd_records: %d\nmod_records: %d\ndel_records: %d\n", num_records, add_records, mod_records, del_records); @@ -923,14 +923,14 @@ pre_sync (GnomePilotConduit *conduit, #endif g_free (buf); - + lastDesktopUniqueID = 128; check_for_slow_setting (conduit, ctxt); if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot) ctxt->map->write_touched_only = TRUE; - + return 0; } @@ -945,14 +945,14 @@ post_sync (GnomePilotConduit *conduit, int dlpRetVal, len; buf = (unsigned char*)g_malloc (0xffff); - + len = pack_MemoAppInfo (&(ctxt->ai), buf, 0xffff); - - dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, + + dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, (unsigned char *)buf, len); - + g_free (buf); - + if (dlpRetVal < 0) { WARN (_("Could not write pilot's Memo application block")); WARN ("dlp_WriteAppBlock(...) = %d", dlpRetVal); @@ -960,14 +960,14 @@ post_sync (GnomePilotConduit *conduit, _("Could not write pilot's Memo application block")); return -1; } - + LOG (g_message ( "post_sync: Memo Conduit v.%s", CONDUIT_VERSION )); g_free (ctxt->cfg->last_uri); ctxt->cfg->last_uri = g_strdup (e_cal_get_uri (ctxt->client)); memoconduit_save_configuration (ctxt->cfg); - + filename = map_name (ctxt); e_pilot_map_write (filename, ctxt->map); g_free (filename); @@ -979,7 +979,7 @@ post_sync (GnomePilotConduit *conduit, if (e_cal_get_changes (ctxt->client, change_id, &changed, NULL)) e_cal_free_change_list (changed); g_free (change_id); - + LOG (g_message ( "---------------------------------------------------------\n" )); return 0; @@ -994,7 +994,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, const char *uid; LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); - + e_cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, ID, uid, FALSE); @@ -1007,12 +1007,12 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, EMemoConduitContext *ctxt) { const char *uid; - + LOG (g_message ( "set_status_cleared: clearing status\n" )); - + e_cal_component_get_uid (local->comp, &uid); g_hash_table_remove (ctxt->changed_hash, uid); - + return 0; } @@ -1032,7 +1032,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, comps = ctxt->comps; count = 0; - + if (comps != NULL) { LOG (g_message ( "for_each: iterating over %d records", g_list_length (comps))); @@ -1089,13 +1089,13 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, if (*local == NULL) { LOG (g_message ( "for_each_modified beginning\n" )); - + iterator = ctxt->changed; - + count = 0; - + LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash) )); - + iterator = next_changed_item (ctxt, iterator); if (iterator != NULL) { ECalChange *ccc = iterator->data; @@ -1163,7 +1163,7 @@ compare (GnomePilotConduitSyncAbs *conduit, LOG (g_message ( " equal" )); else LOG (g_message ( " not equal" )); - + return retval; } @@ -1175,7 +1175,7 @@ add_record (GnomePilotConduitSyncAbs *conduit, ECalComponent *comp; char *uid; int retval = 0; - + g_return_val_if_fail (remote != NULL, -1); LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) )); @@ -1204,7 +1204,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, { ECalComponent *new_comp; int retval = 0; - + g_return_val_if_fail (remote != NULL, -1); LOG (g_message ("replace_record: replace %s with %s\n", @@ -1214,7 +1214,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, g_object_unref (local->comp); local->comp = new_comp; - if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp), + if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp), CALOBJ_MOD_ALL, NULL)) return -1; @@ -1238,7 +1238,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, e_pilot_map_remove_by_uid (ctxt->map, uid); /* FIXME Error handling */ e_cal_remove_object (ctxt->client, uid, NULL); - + return 0; } @@ -1250,14 +1250,14 @@ archive_record (GnomePilotConduitSyncAbs *conduit, { const char *uid; int retval = 0; - + g_return_val_if_fail (local != NULL, -1); LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" )); e_cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, local->local.ID, uid, archive); - + return retval; } @@ -1268,24 +1268,24 @@ match (GnomePilotConduitSyncAbs *conduit, EMemoConduitContext *ctxt) { const char *uid; - + LOG (g_message ("match: looking for local copy of %s\n", - print_remote (remote))); - + print_remote (remote))); + g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (remote != NULL, -1); *local = NULL; uid = e_pilot_map_lookup_uid (ctxt->map, remote->ID, TRUE); - + if (!uid) return 0; LOG (g_message ( " matched\n" )); - + *local = g_new0 (EMemoLocalRecord, 1); local_record_from_uid (*local, uid, ctxt); - + return 0; } @@ -1321,7 +1321,7 @@ static void fill_widgets (EMemoConduitContext *ctxt) { if (ctxt->cfg->source) - e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps), + e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps), ctxt->cfg->source); e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps), ctxt->cfg->secret); @@ -1333,8 +1333,8 @@ create_settings_window (GnomePilotConduit *conduit, EMemoConduitContext *ctxt) { LOG (g_message ( "create_settings_window" )); - - if (!ctxt->cfg->source_list) + + if (!ctxt->cfg->source_list) return -1; ctxt->ps = e_pilot_settings_new (ctxt->cfg->source_list); @@ -1343,7 +1343,7 @@ create_settings_window (GnomePilotConduit *conduit, gtk_widget_show (ctxt->ps); fill_widgets (ctxt); - + return 0; } @@ -1351,7 +1351,7 @@ static void display_settings (GnomePilotConduit *conduit, EMemoConduitContext *ctxt) { LOG (g_message ( "display_settings" )); - + fill_widgets (ctxt); } @@ -1365,7 +1365,7 @@ save_settings (GnomePilotConduit *conduit, EMemoConduitContext *ctxt) ctxt->new_cfg->source = e_pilot_settings_get_source (E_PILOT_SETTINGS (ctxt->ps)); g_object_ref (ctxt->new_cfg->source); ctxt->new_cfg->secret = e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps)); - + memoconduit_save_configuration (ctxt->new_cfg); } @@ -1389,7 +1389,7 @@ conduit_get_gpilot_conduit (guint32 pilot_id) retval = gnome_pilot_conduit_sync_abs_new ("MemoDB", 0x6D656D6F); g_assert (retval != NULL); - + ctxt = e_memo_context_new (pilot_id); gtk_object_set_data (GTK_OBJECT (retval), "memoconduit_context", ctxt); @@ -1424,10 +1424,10 @@ conduit_get_gpilot_conduit (guint32 pilot_id) void conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit) -{ +{ GtkObject *obj = GTK_OBJECT (conduit); EMemoConduitContext *ctxt; - + ctxt = gtk_object_get_data (obj, "memoconduit_context"); e_memo_context_destroy (ctxt); diff --git a/calendar/conduits/todo/todo-conduit.c b/calendar/conduits/todo/todo-conduit.c index 0594d53298..e321940386 100644 --- a/calendar/conduits/todo/todo-conduit.c +++ b/calendar/conduits/todo/todo-conduit.c @@ -4,7 +4,7 @@ * Copyright (C) 1998 Free Software Foundation * Copyright (C) 2000 Ximian, Inc. * - * Authors: Eskil Heyn Olsen <deity@eskil.dk> + * Authors: Eskil Heyn Olsen <deity@eskil.dk> * JP Rosevear <jpr@ximian.com> * * This program is free software; you can redistribute it and/or @@ -61,7 +61,7 @@ void conduit_destroy_gpilot_conduit (GnomePilotConduit*); #define LOG(x) x #else #define LOG(x) -#endif +#endif #define WARN g_warning #define INFO g_message @@ -89,11 +89,11 @@ struct _EToDoLocalRecord { int lastDesktopUniqueID; static void -todoconduit_destroy_record (EToDoLocalRecord *local) +todoconduit_destroy_record (EToDoLocalRecord *local) { g_object_unref (local->comp); free_ToDo (local->todo); - g_free (local->todo); + g_free (local->todo); g_free (local); } @@ -111,7 +111,7 @@ struct _EToDoConduitCfg { }; static EToDoConduitCfg * -todoconduit_load_configuration (guint32 pilot_id) +todoconduit_load_configuration (guint32 pilot_id) { EToDoConduitCfg *c; GnomePilotConduitManagement *management; @@ -121,7 +121,7 @@ todoconduit_load_configuration (guint32 pilot_id) g_snprintf (prefix, 255, "/gnome-pilot.d/e-todo-conduit/Pilot_%u/", pilot_id); - + c = g_new0 (EToDoConduitCfg,1); g_assert (c != NULL); @@ -135,10 +135,10 @@ todoconduit_load_configuration (guint32 pilot_id) c->sync_type = GnomePilotConduitSyncTypeNotSet; gtk_object_unref (GTK_OBJECT (config)); gtk_object_unref (GTK_OBJECT (management)); - + /* Custom settings */ gnome_config_push_prefix (prefix); - + if (!e_cal_get_sources (&c->source_list, E_CAL_SOURCE_TYPE_TODO, NULL)) c->source_list = NULL; if (c->source_list) { @@ -152,7 +152,7 @@ todoconduit_load_configuration (guint32 pilot_id) c->source_list = NULL; } } - + c->secret = gnome_config_get_bool ("secret=FALSE"); c->priority = gnome_config_get_int ("priority=3"); c->last_uri = gnome_config_get_string ("last_uri"); @@ -163,7 +163,7 @@ todoconduit_load_configuration (guint32 pilot_id) } static void -todoconduit_save_configuration (EToDoConduitCfg *c) +todoconduit_save_configuration (EToDoConduitCfg *c) { gchar prefix[256]; @@ -182,7 +182,7 @@ todoconduit_save_configuration (EToDoConduitCfg *c) } static EToDoConduitCfg* -todoconduit_dupe_configuration (EToDoConduitCfg *c) +todoconduit_dupe_configuration (EToDoConduitCfg *c) { EToDoConduitCfg *retval; @@ -203,8 +203,8 @@ todoconduit_dupe_configuration (EToDoConduitCfg *c) return retval; } -static void -todoconduit_destroy_configuration (EToDoConduitCfg *c) +static void +todoconduit_destroy_configuration (EToDoConduitCfg *c) { g_return_if_fail (c != NULL); @@ -220,13 +220,13 @@ struct _EToDoConduitGui { }; static EToDoConduitGui * -e_todo_gui_new (EPilotSettings *ps) +e_todo_gui_new (EPilotSettings *ps) { EToDoConduitGui *gui; GtkWidget *lbl; GtkObject *adj; gint rows; - + g_return_val_if_fail (ps != NULL, NULL); g_return_val_if_fail (E_IS_PILOT_SETTINGS (ps), NULL); @@ -244,12 +244,12 @@ e_todo_gui_new (EPilotSettings *ps) gtk_table_attach_defaults (GTK_TABLE (ps), gui->priority, 1, 2, rows, rows + 1); gtk_widget_show (lbl); gtk_widget_show (gui->priority); - + return gui; } static void -e_todo_gui_fill_widgets (EToDoConduitGui *gui, EToDoConduitCfg *cfg) +e_todo_gui_fill_widgets (EToDoConduitGui *gui, EToDoConduitCfg *cfg) { g_return_if_fail (gui != NULL); g_return_if_fail (cfg != NULL); @@ -258,7 +258,7 @@ e_todo_gui_fill_widgets (EToDoConduitGui *gui, EToDoConduitCfg *cfg) } static void -e_todo_gui_fill_config (EToDoConduitGui *gui, EToDoConduitCfg *cfg) +e_todo_gui_fill_config (EToDoConduitGui *gui, EToDoConduitCfg *cfg) { g_return_if_fail (gui != NULL); g_return_if_fail (cfg != NULL); @@ -267,7 +267,7 @@ e_todo_gui_fill_config (EToDoConduitGui *gui, EToDoConduitCfg *cfg) } static void -e_todo_gui_destroy (EToDoConduitGui *gui) +e_todo_gui_destroy (EToDoConduitGui *gui) { g_free (gui); } @@ -280,7 +280,7 @@ struct _EToDoConduitContext { EToDoConduitCfg *new_cfg; EToDoConduitGui *gui; GtkWidget *ps; - + struct ToDoAppInfo ai; ECal *client; @@ -291,15 +291,15 @@ struct _EToDoConduitContext { GList *changed; GHashTable *changed_hash; GList *locals; - + EPilotMap *map; }; static EToDoConduitContext * -e_todo_context_new (guint32 pilot_id) +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->gui = NULL; @@ -317,10 +317,10 @@ e_todo_context_new (guint32 pilot_id) } static gboolean -e_todo_context_foreach_change (gpointer key, gpointer value, gpointer data) +e_todo_context_foreach_change (gpointer key, gpointer value, gpointer data) { g_free (key); - + return TRUE; } @@ -328,7 +328,7 @@ static void e_todo_context_destroy (EToDoConduitContext *ctxt) { GList *l; - + g_return_if_fail (ctxt != NULL); if (ctxt->cfg != NULL) @@ -337,7 +337,7 @@ e_todo_context_destroy (EToDoConduitContext *ctxt) todoconduit_destroy_configuration (ctxt->new_cfg); if (ctxt->gui != NULL) e_todo_gui_destroy (ctxt->gui); - + if (ctxt->client != NULL) g_object_unref (ctxt->client); @@ -359,10 +359,10 @@ e_todo_context_destroy (EToDoConduitContext *ctxt) todoconduit_destroy_record (l->data); g_list_free (ctxt->locals); } - + if (ctxt->changed != NULL) e_cal_free_change_list (ctxt->changed); - + if (ctxt->map != NULL) e_pilot_map_destroy (ctxt->map); @@ -437,7 +437,7 @@ static char *print_remote (GnomePilotRecord *remote) remote->category); free_ToDo (&todo); - + return buff; } @@ -475,7 +475,7 @@ start_calendar_server (EToDoConduitContext *ctxt) if (ctxt->timezone && !e_cal_set_default_timezone (ctxt->client, ctxt->timezone, NULL)) return -1; - LOG (g_message ( " timezone set to : %s", icaltimezone_get_tzid (ctxt->timezone) )); + LOG (g_message ( " timezone set to : %s", icaltimezone_get_tzid (ctxt->timezone) )); if (e_source_get_property (ctxt->cfg->source, "auth")) { EUri *e_uri; @@ -488,7 +488,7 @@ start_calendar_server (EToDoConduitContext *ctxt) if (ctxt->client) e_cal_set_auth_func (ctxt->client, (ECalAuthFunc) auth_func_cb, NULL); } - if (!e_cal_open (ctxt->client, TRUE, NULL)) + if (!e_cal_open (ctxt->client, TRUE, NULL)) retval = -1; } else if (!e_cal_open_default (&ctxt->client, E_CAL_SOURCE_TYPE_TODO, NULL, NULL, NULL)) { retval = -1; @@ -501,14 +501,14 @@ start_calendar_server (EToDoConduitContext *ctxt) /* Utility routines */ static icaltimezone * -get_timezone (ECal *client, const char *tzid) +get_timezone (ECal *client, const char *tzid) { icaltimezone *timezone = NULL; timezone = icaltimezone_get_builtin_timezone_from_tzid (tzid); if (timezone == NULL) e_cal_get_timezone (client, tzid, &timezone, NULL); - + return timezone; } @@ -527,51 +527,51 @@ get_default_timezone (void) g_free (location); location = g_strdup ("UTC"); } - + timezone = icaltimezone_get_builtin_timezone (location); g_free (location); g_object_unref (listener); - return timezone; + return timezone; } static char * -map_name (EToDoConduitContext *ctxt) +map_name (EToDoConduitContext *ctxt) { char *filename; - + filename = g_strdup_printf ("%s/.evolution/tasks/local/system/pilot-map-todo-%d.xml", g_get_home_dir (), ctxt->cfg->pilot_id); - + return filename; } static gboolean -is_empty_time (struct tm time) +is_empty_time (struct tm time) { - if (time.tm_sec || time.tm_min || time.tm_hour - || time.tm_mday || time.tm_mon || time.tm_year) + if (time.tm_sec || time.tm_min || time.tm_hour + || time.tm_mday || time.tm_mon || time.tm_year) return FALSE; - + return TRUE; } static GList * -next_changed_item (EToDoConduitContext *ctxt, GList *changes) +next_changed_item (EToDoConduitContext *ctxt, GList *changes) { ECalChange *ccc; GList *l; - + for (l = changes; l != NULL; l = l->next) { const char *uid; ccc = l->data; - + e_cal_component_get_uid (ccc->comp, &uid); if (g_hash_table_lookup (ctxt->changed_hash, uid)) return l; } - + return NULL; } @@ -584,16 +584,16 @@ compute_status (EToDoConduitContext *ctxt, EToDoLocalRecord *local, const char * local->local.secret = FALSE; ccc = g_hash_table_lookup (ctxt->changed_hash, uid); - + if (ccc == NULL) { local->local.attr = GnomePilotRecordNothing; return; } - + switch (ccc->type) { case E_CAL_CHANGE_ADDED: local->local.attr = GnomePilotRecordNew; - break; + break; case E_CAL_CHANGE_MODIFIED: local->local.attr = GnomePilotRecordModified; break; @@ -616,7 +616,7 @@ local_record_to_pilot_record (EToDoLocalRecord *local, g_assert (local->comp != NULL); g_assert (local->todo != NULL ); - + LOG (g_message ( "local_record_to_pilot_record\n" )); memset (&p, 0, sizeof (GnomePilotRecord)); @@ -640,19 +640,19 @@ local_record_to_pilot_record (EToDoLocalRecord *local, p.length = buffer->used; memcpy(p.record, buffer->data, buffer->used); - pi_buffer_free(buffer); + pi_buffer_free(buffer); #else p.record = (unsigned char *)record; p.length = pack_ToDo (local->todo, p.record, 0xffff); #endif - return p; + return p; } /* * converts a ECalComponent object to a EToDoLocalRecord */ static void -local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoConduitContext *ctxt) +local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoConduitContext *ctxt) { const char *uid; int *priority; @@ -663,7 +663,7 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu ECalComponentDateTime due; ECalComponentClassification classif; icaltimezone *default_tz = get_default_timezone (); - + LOG (g_message ( "local_record_from_comp\n" )); g_return_if_fail (local != NULL); @@ -692,14 +692,14 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu #else char record[0xffff]; #endif - - if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, + + if (dlp_ReadRecordById (ctxt->dbi->pilot_socket, ctxt->dbi->db_handle, #ifdef PILOT_LINK_0_12 - local->local.ID, record, + local->local.ID, record, NULL, NULL, &cat) > 0) { #else - local->local.ID, &record, + local->local.ID, &record, NULL, NULL, NULL, &cat) > 0) { #endif local->local.category = cat; @@ -708,14 +708,14 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu pi_buffer_free(record); #endif } - + /*Category support*/ e_pilot_local_category_to_remote(&(local->local.category), comp, &(ctxt->ai.category)); /* STOP: don't replace these with g_strdup, since free_ToDo uses free to deallocate */ e_cal_component_get_summary (comp, &summary); - if (summary.value) + if (summary.value) local->todo->description = e_pilot_utf8_to_pchar (summary.value); e_cal_component_get_description_list (comp, &d_list); @@ -729,7 +729,7 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu local->todo->note = NULL; } - e_cal_component_get_due (comp, &due); + e_cal_component_get_due (comp, &due); if (due.value) { icaltimezone_convert_time (due.value, get_timezone (ctxt->client, due.tzid), @@ -739,14 +739,14 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu } else { local->todo->indefinite = 1; } - e_cal_component_free_datetime (&due); + e_cal_component_free_datetime (&due); - e_cal_component_get_status (comp, &status); + e_cal_component_get_status (comp, &status); if (status == ICAL_STATUS_COMPLETED) local->todo->complete = 1; else local->todo->complete = 0; - + e_cal_component_get_priority (comp, &priority); if (priority && *priority != 0) { if (*priority <= 3) @@ -759,12 +759,12 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu local->todo->priority = 4; else local->todo->priority = 5; - + e_cal_component_free_priority (priority); } else { local->todo->priority = ctxt->cfg->priority; - } - + } + e_cal_component_get_classification (comp, &classif); if (classif == E_CAL_COMPONENT_CLASS_PRIVATE) @@ -775,7 +775,7 @@ local_record_from_comp (EToDoLocalRecord *local, ECalComponent *comp, EToDoCondu local->local.archived = 0; } -static void +static void local_record_from_uid (EToDoLocalRecord *local, const char *uid, EToDoConduitContext *ctxt) @@ -785,7 +785,7 @@ local_record_from_uid (EToDoLocalRecord *local, GError *error = NULL; g_assert(local!=NULL); - + LOG(g_message("local_record_from_uid\n")); if (e_cal_get_object (ctxt->client, uid, NULL, &icalcomp, &error)) { @@ -830,7 +830,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, #ifdef PILOT_LINK_0_12 pi_buffer_t * buffer; #endif - + g_return_val_if_fail (remote != NULL, NULL); #ifdef PILOT_LINK_0_12 @@ -851,7 +851,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, #endif utc_zone = icaltimezone_get_utc_timezone (); - now = icaltime_from_timet_with_zone (time (NULL), FALSE, + now = icaltime_from_timet_with_zone (time (NULL), FALSE, utc_zone); if (in_comp == NULL) { @@ -867,10 +867,10 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, summary.value = txt = e_pilot_utf8_from_pchar (todo.description); e_cal_component_set_summary (comp, &summary); free (txt); - + /*Category support*/ e_pilot_remote_category_to_local(remote->category, comp, &(ai->category)); - + /* The iCal description field */ if (!todo.note) { e_cal_component_set_comment_list (comp, NULL); @@ -885,7 +885,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_set_description_list (comp, &l); free (txt); - } + } if (todo.complete) { int percent = 100; @@ -896,9 +896,9 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, } else { int *percent = NULL; icalproperty_status status; - + e_cal_component_set_completed (comp, NULL); - + e_cal_component_get_percent (comp, &percent); if (percent == NULL || *percent == 100) { int p = 0; @@ -934,7 +934,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, default: priority = 9; } - + e_cal_component_set_priority (comp, &priority); e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_NONE); @@ -944,7 +944,7 @@ comp_from_remote_record (GnomePilotConduitSyncAbs *conduit, e_cal_component_set_classification (comp, E_CAL_COMPONENT_CLASS_PUBLIC); e_cal_component_commit_sequence (comp); - + free_ToDo(&todo); return comp; @@ -956,7 +956,7 @@ check_for_slow_setting (GnomePilotConduit *c, EToDoConduitContext *ctxt) GnomePilotConduitStandard *conduit = GNOME_PILOT_CONDUIT_STANDARD (c); int map_count; const char *uri; - + /* If there are no objects or objects but no log */ map_count = g_hash_table_size (ctxt->map->pid_map); if (map_count == 0) @@ -975,7 +975,7 @@ check_for_slow_setting (GnomePilotConduit *c, EToDoConduitContext *ctxt) LOG (g_message ( " doing slow sync\n" )); } else { LOG (g_message ( " doing fast sync\n" )); - } + } } /* Pilot syncing callbacks */ @@ -1001,7 +1001,7 @@ pre_sync (GnomePilotConduit *conduit, LOG (g_message ( "pre_sync: ToDo Conduit v.%s", CONDUIT_VERSION )); g_message ("ToDo Conduit v.%s", CONDUIT_VERSION); - ctxt->dbi = dbi; + ctxt->dbi = dbi; ctxt->client = NULL; /* Get the timezone */ @@ -1015,19 +1015,19 @@ pre_sync (GnomePilotConduit *conduit, gnome_pilot_conduit_error (conduit, _("Could not start evolution-data-server")); return -1; } - + /* Get the default component */ if (!e_cal_get_default_object (ctxt->client, &icalcomp, NULL)) return -1; LOG (g_message ( " Got default component: %p", icalcomp)); - + ctxt->default_comp = e_cal_component_new (); if (!e_cal_component_set_icalcomponent (ctxt->default_comp, icalcomp)) { g_object_unref (ctxt->default_comp); icalcomponent_free (icalcomp); return -1; } - + /* Load the uid <--> pilot id map */ filename = map_name (ctxt); e_pilot_map_read (filename, &ctxt->map); @@ -1036,24 +1036,24 @@ pre_sync (GnomePilotConduit *conduit, /* Get the local database */ if (!e_cal_get_object_list_as_comp (ctxt->client, "#t", &ctxt->comps, NULL)) return -1; - + /* Count and hash the changes */ change_id = g_strdup_printf ("pilot-sync-evolution-todo-%d", ctxt->cfg->pilot_id); if (!e_cal_get_changes (ctxt->client, change_id, &ctxt->changed, NULL)) return -1; - + ctxt->changed_hash = g_hash_table_new (g_str_hash, g_str_equal); g_free (change_id); - + for (l = ctxt->changed; l != NULL; l = l->next) { ECalChange *ccc = l->data; const char *uid; - + e_cal_component_get_uid (ccc->comp, &uid); if (!e_pilot_map_uid_is_archived (ctxt->map, uid)) { - + g_hash_table_insert (ctxt->changed_hash, g_strdup (uid), ccc); - + switch (ccc->type) { case E_CAL_CHANGE_ADDED: add_records++; @@ -1076,7 +1076,7 @@ pre_sync (GnomePilotConduit *conduit, gnome_pilot_conduit_sync_abs_set_num_new_local_records (abs_conduit, add_records); gnome_pilot_conduit_sync_abs_set_num_updated_local_records (abs_conduit, mod_records); gnome_pilot_conduit_sync_abs_set_num_deleted_local_records(abs_conduit, del_records); - + g_message("num_records: %d\nadd_records: %d\nmod_records: %d\ndel_records: %d\n", num_records, add_records, mod_records, del_records); @@ -1093,7 +1093,7 @@ pre_sync (GnomePilotConduit *conduit, buf = (unsigned char*)g_malloc (0xffff); len = dlp_ReadAppBlock (dbi->pilot_socket, dbi->db_handle, 0, (unsigned char *)buf, 0xffff); -#endif +#endif if (len < 0) { WARN (_("Could not read pilot's ToDo application block")); WARN ("dlp_ReadAppBlock(...) = %d", len); @@ -1109,14 +1109,14 @@ pre_sync (GnomePilotConduit *conduit, #endif unpack_ToDoAppInfo (&(ctxt->ai), buf, len); g_free (buf); - + lastDesktopUniqueID = 128; check_for_slow_setting (conduit, ctxt); if (ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyToPilot || ctxt->cfg->sync_type == GnomePilotConduitSyncTypeCopyFromPilot) ctxt->map->write_touched_only = TRUE; - + return 0; } @@ -1131,14 +1131,14 @@ post_sync (GnomePilotConduit *conduit, int dlpRetVal, len; buf = (unsigned char*)g_malloc (0xffff); - + len = pack_ToDoAppInfo (&(ctxt->ai), buf, 0xffff); - - dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, + + dlpRetVal = dlp_WriteAppBlock (dbi->pilot_socket, dbi->db_handle, (unsigned char *)buf, len); - + g_free (buf); - + if (dlpRetVal < 0) { WARN (_("Could not write pilot's ToDo application block")); WARN ("dlp_WriteAppBlock(...) = %d", dlpRetVal); @@ -1146,14 +1146,14 @@ post_sync (GnomePilotConduit *conduit, _("Could not write pilot's ToDo application block")); return -1; } - + LOG (g_message ( "post_sync: ToDo Conduit v.%s", CONDUIT_VERSION )); g_free (ctxt->cfg->last_uri); ctxt->cfg->last_uri = g_strdup (e_cal_get_uri (ctxt->client)); todoconduit_save_configuration (ctxt->cfg); - + filename = map_name (ctxt); e_pilot_map_write (filename, ctxt->map); g_free (filename); @@ -1165,7 +1165,7 @@ post_sync (GnomePilotConduit *conduit, if (e_cal_get_changes (ctxt->client, change_id, &changed, NULL)) e_cal_free_change_list (changed); g_free (change_id); - + LOG (g_message ( "---------------------------------------------------------\n" )); return 0; @@ -1180,7 +1180,7 @@ set_pilot_id (GnomePilotConduitSyncAbs *conduit, const char *uid; LOG (g_message ( "set_pilot_id: setting to %d\n", ID )); - + e_cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, ID, uid, FALSE); @@ -1193,12 +1193,12 @@ set_status_cleared (GnomePilotConduitSyncAbs *conduit, EToDoConduitContext *ctxt) { const char *uid; - + LOG (g_message ( "set_status_cleared: clearing status\n" )); - + e_cal_component_get_uid (local->comp, &uid); g_hash_table_remove (ctxt->changed_hash, uid); - + return 0; } @@ -1218,7 +1218,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, comps = ctxt->comps; count = 0; - + if (comps != NULL) { LOG (g_message ( "iterating over %d records", g_list_length (comps))); @@ -1229,7 +1229,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, * gets messed up. The calling function keeps track of * the *local variable */ unused = g_list_prepend (ctxt->locals, *local); - + iterator = comps; } else { LOG (g_message ( "no events" )); @@ -1243,7 +1243,7 @@ for_each (GnomePilotConduitSyncAbs *conduit, *local = g_new0 (EToDoLocalRecord, 1); local_record_from_comp (*local, iterator->data, ctxt); - + /* NOTE: ignore the return value, otherwise ctxt->locals * gets messed up. The calling function keeps track of * the *local variable */ @@ -1274,20 +1274,20 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, if (*local == NULL) { LOG (g_message ( "for_each_modified beginning\n" )); - + iterator = ctxt->changed; - + count = 0; - + LOG (g_message ( "iterating over %d records", g_hash_table_size (ctxt->changed_hash) )); - + iterator = next_changed_item (ctxt, iterator); if (iterator != NULL) { ECalChange *ccc = iterator->data; - + *local = g_new0 (EToDoLocalRecord, 1); local_record_from_comp (*local, ccc->comp, ctxt); - + /* NOTE: ignore the return value, otherwise ctxt->locals * gets messed up. The calling function keeps track of * the *local variable */ @@ -1302,10 +1302,10 @@ for_each_modified (GnomePilotConduitSyncAbs *conduit, iterator = g_list_next (iterator); if (iterator && (iterator = next_changed_item (ctxt, iterator))) { ECalChange *ccc = iterator->data; - + *local = g_new0 (EToDoLocalRecord, 1); - local_record_from_comp (*local, ccc->comp, ctxt); - + local_record_from_comp (*local, ccc->comp, ctxt); + /* NOTE: ignore the return value, otherwise ctxt->locals * gets messed up. The calling function keeps track of * the *local variable */ @@ -1347,7 +1347,7 @@ compare (GnomePilotConduitSyncAbs *conduit, LOG (g_message ( " equal" )); else LOG (g_message ( " not equal" )); - + return retval; } @@ -1359,7 +1359,7 @@ add_record (GnomePilotConduitSyncAbs *conduit, ECalComponent *comp; char *uid; int retval = 0; - + g_return_val_if_fail (remote != NULL, -1); LOG (g_message ( "add_record: adding %s to desktop\n", print_remote (remote) )); @@ -1389,7 +1389,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, { ECalComponent *new_comp; int retval = 0; - + g_return_val_if_fail (remote != NULL, -1); LOG (g_message ("replace_record: replace %s with %s\n", @@ -1399,7 +1399,7 @@ replace_record (GnomePilotConduitSyncAbs *conduit, g_object_unref (local->comp); local->comp = new_comp; - if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp), + if (!e_cal_modify_object (ctxt->client, e_cal_component_get_icalcomponent (new_comp), CALOBJ_MOD_ALL, NULL)) return -1; @@ -1423,7 +1423,7 @@ delete_record (GnomePilotConduitSyncAbs *conduit, e_pilot_map_remove_by_uid (ctxt->map, uid); /* FIXME Error handling */ e_cal_remove_object (ctxt->client, uid, NULL); - + return 0; } @@ -1435,14 +1435,14 @@ archive_record (GnomePilotConduitSyncAbs *conduit, { const char *uid; int retval = 0; - + g_return_val_if_fail (local != NULL, -1); LOG (g_message ( "archive_record: %s\n", archive ? "yes" : "no" )); e_cal_component_get_uid (local->comp, &uid); e_pilot_map_insert (ctxt->map, local->local.ID, uid, archive); - + return retval; } @@ -1453,24 +1453,24 @@ match (GnomePilotConduitSyncAbs *conduit, EToDoConduitContext *ctxt) { const char *uid; - + LOG (g_message ("match: looking for local copy of %s\n", - print_remote (remote))); - + print_remote (remote))); + g_return_val_if_fail (local != NULL, -1); g_return_val_if_fail (remote != NULL, -1); *local = NULL; uid = e_pilot_map_lookup_uid (ctxt->map, remote->ID, TRUE); - + if (!uid) return 0; LOG (g_message ( " matched\n" )); - + *local = g_new0 (EToDoLocalRecord, 1); local_record_from_uid (*local, uid, ctxt); - + return 0; } @@ -1506,7 +1506,7 @@ static void fill_widgets (EToDoConduitContext *ctxt) { if (ctxt->cfg->source) - e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps), + e_pilot_settings_set_source (E_PILOT_SETTINGS (ctxt->ps), ctxt->cfg->source); e_pilot_settings_set_secret (E_PILOT_SETTINGS (ctxt->ps), ctxt->cfg->secret); @@ -1520,8 +1520,8 @@ create_settings_window (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) { LOG (g_message ( "create_settings_window" )); - - if (!ctxt->cfg->source_list) + + if (!ctxt->cfg->source_list) return -1; ctxt->ps = e_pilot_settings_new (ctxt->cfg->source_list); @@ -1531,7 +1531,7 @@ create_settings_window (GnomePilotConduit *conduit, gtk_widget_show (ctxt->ps); fill_widgets (ctxt); - + return 0; } @@ -1539,7 +1539,7 @@ static void display_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) { LOG (g_message ( "display_settings" )); - + fill_widgets (ctxt); } @@ -1554,7 +1554,7 @@ save_settings (GnomePilotConduit *conduit, EToDoConduitContext *ctxt) g_object_ref (ctxt->new_cfg->source); ctxt->new_cfg->secret = e_pilot_settings_get_secret (E_PILOT_SETTINGS (ctxt->ps)); e_todo_gui_fill_config (ctxt->gui, ctxt->new_cfg); - + todoconduit_save_configuration (ctxt->new_cfg); } @@ -1578,7 +1578,7 @@ conduit_get_gpilot_conduit (guint32 pilot_id) retval = gnome_pilot_conduit_sync_abs_new ("ToDoDB", 0x746F646F); g_assert (retval != NULL); - + ctxt = e_todo_context_new (pilot_id); gtk_object_set_data (GTK_OBJECT (retval), "todoconduit_context", ctxt); @@ -1613,10 +1613,10 @@ conduit_get_gpilot_conduit (guint32 pilot_id) void conduit_destroy_gpilot_conduit (GnomePilotConduit *conduit) -{ +{ GtkObject *obj = GTK_OBJECT (conduit); EToDoConduitContext *ctxt; - + ctxt = gtk_object_get_data (obj, "todoconduit_context"); e_todo_context_destroy (ctxt); diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c index eab6b95606..7022c389be 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c @@ -34,7 +34,7 @@ #include <gtk/gtkwindow.h> #include <gtk/gtk.h> #include <glib/gi18n.h> -#if 0 +#if 0 # include <libgnomeui/gnome-winhints.h> #endif #include <glade/glade.h> @@ -46,7 +46,7 @@ #include <e-util/e-icon-factory.h> - + enum { ALARM_DISPLAY_COLUMN, ALARM_SUMMARY_COLUMN, @@ -55,7 +55,7 @@ enum { ALARM_START_COLUMN, ALARM_END_COLUMN, - + ALARM_FUNCINFO_COLUMN, N_ALARM_COLUMNS @@ -74,16 +74,16 @@ typedef struct { GtkWidget *dialog; GtkWidget *snooze_time_min; GtkWidget *snooze_time_hrs; - GtkWidget *snooze_btn; + GtkWidget *snooze_btn; GtkWidget *minutes_label; GtkWidget *hrs_label; GtkWidget *description; GtkWidget *location; GtkWidget *treeview; GtkWidget *scrolledwindow; - + AlarmFuncInfo *cur_funcinfo; - + } AlarmNotify; @@ -91,9 +91,9 @@ static void tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data); static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, +fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, const gchar *location, time_t occur_start, time_t occur_end); -static void +static void edit_pressed_cb (GtkButton *button, gpointer user_data); static void @@ -137,7 +137,7 @@ dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) GtkTreeModel *model = NULL; AlarmFuncInfo *funcinfo = NULL; GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview)); - + if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1); } @@ -158,7 +158,7 @@ dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) return; } -static void +static void edit_pressed_cb (GtkButton *button, gpointer user_data) { AlarmNotify *an = user_data; @@ -168,14 +168,14 @@ edit_pressed_cb (GtkButton *button, gpointer user_data) GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview)); if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1); + gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1); g_return_if_fail (funcinfo); - + (* funcinfo->func) (ALARM_NOTIFY_EDIT, -1, funcinfo->func_data); } -static void +static void snooze_pressed_cb (GtkButton *button, gpointer user_data) { int snooze_timeout; @@ -188,7 +188,7 @@ snooze_pressed_cb (GtkButton *button, gpointer user_data) gtk_widget_grab_focus ((GtkWidget *) button); if (gtk_tree_selection_get_selected (selection, &model, &iter)) - gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1); + gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &funcinfo, -1); g_return_if_fail (funcinfo); @@ -226,25 +226,25 @@ notified_alarms_dialog_new (void) GtkTreeViewColumn *column = NULL; GtkTreeSelection *selection = NULL; GtkTreeModel *model = GTK_TREE_MODEL (gtk_list_store_new ( - N_ALARM_COLUMNS, - + N_ALARM_COLUMNS, + G_TYPE_STRING, /* Display */ G_TYPE_STRING, /* Summary */ G_TYPE_STRING, /* Description */ G_TYPE_STRING, /* Location */ - + G_TYPE_POINTER, /* Start */ G_TYPE_POINTER, /* End */ - + G_TYPE_POINTER /* FuncInfo*/)); - + an->xml = glade_xml_new (EVOLUTION_GLADEDIR "/alarm-notify.glade", NULL, NULL); if (!an->xml) { g_message ("alarm_notify_dialog(): Could not load the Glade XML file!"); g_free (an); return NULL; } - + an->dialog = glade_xml_get_widget (an->xml, "alarm-notify"); an->snooze_time_min = glade_xml_get_widget (an->xml, "snooze-time-min"); an->minutes_label = glade_xml_get_widget (an->xml, "minutes-label"); @@ -258,7 +258,7 @@ notified_alarms_dialog_new (void) an->snooze_btn = snooze_btn; edit_btn = glade_xml_get_widget (an->xml, "edit-button"); - if (!(an->dialog && an->scrolledwindow && an->treeview && an->snooze_time_min && an->snooze_time_hrs + if (!(an->dialog && an->scrolledwindow && an->treeview && an->snooze_time_min && an->snooze_time_hrs && an->description && an->location && edit_btn && snooze_btn)) { g_message ("alarm_notify_dialog(): Could not find all widgets in Glade file!"); g_object_unref (an->xml); @@ -275,14 +275,14 @@ notified_alarms_dialog_new (void) gtk_tree_view_column_set_attributes (column, renderer, "markup", ALARM_DISPLAY_COLUMN, NULL); - + gtk_tree_view_append_column (GTK_TREE_VIEW (an->treeview), column); - + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); g_signal_connect (G_OBJECT (selection), "changed", G_CALLBACK (tree_selection_changed_cb), an); - + gtk_widget_realize (an->dialog); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (an->dialog)->vbox), 0); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (an->dialog)->action_area), 12); @@ -295,7 +295,7 @@ notified_alarms_dialog_new (void) g_signal_connect (snooze_btn, "clicked", G_CALLBACK (snooze_pressed_cb), an); g_signal_connect (G_OBJECT (an->dialog), "response", G_CALLBACK (dialog_response_cb), an); g_signal_connect (G_OBJECT (an->dialog), "destroy", G_CALLBACK (dialog_destroyed_cb), an); - + if (!GTK_WIDGET_REALIZED (an->dialog)) gtk_widget_realize (an->dialog); icon_list = e_icon_factory_get_icon_list ("stock_alarm"); @@ -304,25 +304,25 @@ notified_alarms_dialog_new (void) g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); g_list_free (icon_list); } - + /* Set callback for updating the snooze "minutes" label */ g_signal_connect (G_OBJECT (an->snooze_time_min), "value_changed", G_CALLBACK (an_update_minutes_label), an); - + /* Set callback for updating the snooze "hours" label */ g_signal_connect (G_OBJECT (an->snooze_time_hrs), "value_changed", G_CALLBACK (an_update_hrs_label), an); - - + + na = g_new0 (AlarmNotificationsDialog, 1); na->treeview = an->treeview; na->dialog = an->dialog; - + return na; } - - + + /** * add_alarm_to_notified_alarms_dialog: * @na: Pointer to the dialog-info @@ -341,9 +341,9 @@ notified_alarms_dialog_new (void) * * Return value: the iter in the treeview of the dialog **/ - -GtkTreeIter -add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, + +GtkTreeIter +add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, time_t occur_start, time_t occur_end, ECalComponentVType vtype, const char *summary, const char *description, const char *location, @@ -368,29 +368,29 @@ add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigge funcinfo = g_new0 (AlarmFuncInfo, 1); funcinfo->func = func; funcinfo->func_data = func_data; - + gtk_list_store_append (GTK_LIST_STORE(model), &iter); current_zone = config_data_get_timezone (); start = timet_to_str_with_zone (occur_start, current_zone); end = timet_to_str_with_zone (occur_end, current_zone); str_time = calculate_time (occur_start, occur_end); - to_display = g_strdup_printf ("<big><b>%s</b></big>\n%s %s", + to_display = g_strdup_printf ("<big><b>%s</b></big>\n%s %s", summary, start, str_time); g_free (start); g_free (end); - gtk_list_store_set (GTK_LIST_STORE(model), &iter, + gtk_list_store_set (GTK_LIST_STORE(model), &iter, ALARM_DISPLAY_COLUMN, to_display, -1); g_free (to_display); g_free (str_time); - + gtk_list_store_set (GTK_LIST_STORE(model), &iter, ALARM_SUMMARY_COLUMN, summary, -1); gtk_list_store_set (GTK_LIST_STORE(model), &iter, ALARM_DESCRIPTION_COLUMN, description, -1); gtk_list_store_set (GTK_LIST_STORE(model), &iter, ALARM_LOCATION_COLUMN, location, -1); gtk_list_store_set (GTK_LIST_STORE(model), &iter, ALARM_START_COLUMN, occur_start, -1); gtk_list_store_set (GTK_LIST_STORE(model), &iter, ALARM_END_COLUMN, occur_end, -1); gtk_list_store_set (GTK_LIST_STORE(model), &iter, ALARM_FUNCINFO_COLUMN, funcinfo, -1); - + return iter; } @@ -400,7 +400,7 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) GtkTreeModel *model; GtkTreeIter iter; AlarmNotify *an = user_data; - + if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gchar *summary, *description, *location; @@ -413,17 +413,17 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) gtk_tree_model_get (model, &iter, ALARM_START_COLUMN, &occur_start, -1); gtk_tree_model_get (model, &iter, ALARM_END_COLUMN, &occur_end, -1);\ gtk_tree_model_get (model, &iter, ALARM_FUNCINFO_COLUMN, &an->cur_funcinfo, -1); - + fill_in_labels (an, summary, description, location, occur_start, occur_end); } else { - gtk_widget_set_sensitive (an->snooze_btn, FALSE); + gtk_widget_set_sensitive (an->snooze_btn, FALSE); } } -static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, +static void +fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, const gchar *location, time_t occur_start, time_t occur_end) { GtkTextTagTable *table = gtk_text_tag_table_new (); diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.h b/calendar/gui/alarm-notify/alarm-notify-dialog.h index fbfc64adc6..43bfb2c523 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.h +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.h @@ -49,8 +49,8 @@ typedef void (* AlarmNotifyFunc) (AlarmNotifyResult result, int snooze_mins, gpo AlarmNotificationsDialog * notified_alarms_dialog_new (void); -GtkTreeIter -add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, +GtkTreeIter +add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, time_t occur_start, time_t occur_end, ECalComponentVType vtype, const char *summary, const char *description, const char *location, diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c index 9044f2d5d6..4d287c8cd2 100644 --- a/calendar/gui/alarm-notify/alarm-notify.c +++ b/calendar/gui/alarm-notify/alarm-notify.c @@ -40,7 +40,7 @@ struct _AlarmNotifyPrivate { /* FIXME do we need per source type uri hashes? or perhaps we just need to hash based on source */ GHashTable *uri_client_hash [E_CAL_SOURCE_TYPE_LAST]; - ESourceList *source_lists [E_CAL_SOURCE_TYPE_LAST]; + ESourceList *source_lists [E_CAL_SOURCE_TYPE_LAST]; ESourceList *selected_calendars; GMutex *mutex; }; @@ -88,23 +88,23 @@ process_removal_in_hash (gpointer key, gpointer value, gpointer data) ProcessRemovalsData *prd = data; GSList *groups, *sources, *p, *q; gboolean found = FALSE; - + /* search the list of selected calendars */ groups = e_source_list_peek_groups (prd->source_list); for (p = groups; p != NULL; p = p->next) { ESourceGroup *group = E_SOURCE_GROUP (p->data); - + sources = e_source_group_peek_sources (group); for (q = sources; q != NULL; q = q->next) { ESource *source = E_SOURCE (q->data); char *source_uri; const char *completion = e_source_get_property (source, "alarm"); - + source_uri = e_source_get_uri (source); if (strcmp (source_uri, uri) == 0) if (!completion || !g_ascii_strcasecmp (completion, "true")) found = TRUE; - + g_free (source_uri); if (found) @@ -128,7 +128,7 @@ list_changed_cb (ESourceList *source_list, gpointer data) int i; g_signal_handlers_block_by_func(source_list, list_changed_cb, data); - + priv = an->priv; /* Figure out the source type */ @@ -140,25 +140,25 @@ list_changed_cb (ESourceList *source_list, gpointer data) } if (source_type == E_CAL_SOURCE_TYPE_LAST) return; - + /* process the additions */ groups = e_source_list_peek_groups (source_list); for (p = groups; p != NULL; p = p->next) { ESourceGroup *group = E_SOURCE_GROUP (p->data); - + sources = e_source_group_peek_sources (group); for (q = sources; q != NULL; q = q->next) { ESource *source = E_SOURCE (q->data); char *uri; const char *completion = e_source_get_property (source, "alarm"); - - if (completion && (!g_ascii_strcasecmp (completion, "false") || + + if (completion && (!g_ascii_strcasecmp (completion, "false") || !g_ascii_strcasecmp (completion, "never"))) continue; - + uri = e_source_get_uri (source); if (!g_hash_table_lookup (priv->uri_client_hash[source_type], uri)) { - d (printf("%s:%d (list_changed_cb) - Adding Calendar %s\n", __FILE__, __LINE__, uri)); + d (printf("%s:%d (list_changed_cb) - Adding Calendar %s\n", __FILE__, __LINE__, uri)); alarm_notify_add_calendar (an, source_type, source, FALSE); } g_free (uri); @@ -177,7 +177,7 @@ list_changed_cb (ESourceList *source_list, gpointer data) } g_list_free (prd.removals); g_signal_handlers_unblock_by_func(source_list, list_changed_cb, data); - + } ESourceList * @@ -194,7 +194,7 @@ load_calendars (AlarmNotify *an, ECalSourceType source_type) GSList *groups, *sources, *p, *q; priv = an->priv; - + if (!e_cal_get_sources (&source_list, source_type, NULL)) { d (printf("%s:%d (load_calendars) - Cannont get sources\n ", __FILE__, __LINE__)); priv->source_lists[source_type] = NULL; @@ -205,22 +205,22 @@ load_calendars (AlarmNotify *an, ECalSourceType source_type) groups = e_source_list_peek_groups (source_list); for (p = groups; p != NULL; p = p->next) { ESourceGroup *group = E_SOURCE_GROUP (p->data); - + sources = e_source_group_peek_sources (group); for (q = sources; q != NULL; q = q->next) { ESource *source = E_SOURCE (q->data); char *uri; const char *completion = e_source_get_property (source, "alarm"); - + if (completion && (!g_ascii_strcasecmp (completion, "false") || - !g_ascii_strcasecmp (completion, "never"))) + !g_ascii_strcasecmp (completion, "never"))) continue; - + uri = e_source_get_uri (source); - d (printf("%s:%d (load_calendars) - Loading Calendar %s \n", __FILE__, __LINE__, uri)); + d (printf("%s:%d (load_calendars) - Loading Calendar %s \n", __FILE__, __LINE__, uri)); alarm_notify_add_calendar (an, source_type, source, FALSE); g_free (uri); - + } } @@ -241,7 +241,7 @@ alarm_notify_init (AlarmNotify *an, AlarmNotifyClass *klass) priv->selected_calendars = config_data_get_calendars ("/apps/evolution/calendar/sources"); d (printf("%s:%d (alarm_notify_init) - Initing Alarm Notify\n", __FILE__, __LINE__)); - + for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) priv->uri_client_hash[i] = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); @@ -267,12 +267,12 @@ alarm_notify_finalize (GObject *object) AlarmNotify *an; AlarmNotifyPrivate *priv; int i; - + g_return_if_fail (object != NULL); g_return_if_fail (IS_ALARM_NOTIFY (object)); - + d (printf("%s:%d (alarm_notify_finalize) - Finalize \n ", __FILE__, __LINE__)); - + an = ALARM_NOTIFY (object); priv = an->priv; @@ -345,8 +345,8 @@ static void alarm_msg_received(EThread *e, EMsg *msg, void *data) { AlarmMsg *m = (AlarmMsg *)msg; - - d(printf("%s:%d (alarm_msg_received) - %p: Received at thread %" G_GINT64_MODIFIER "x\n", __FILE__, __LINE__, m, e_util_pthread_id(pthread_self()))); + + d(printf("%s:%d (alarm_msg_received) - %p: Received at thread %" G_GINT64_MODIFIER "x\n", __FILE__, __LINE__, m, e_util_pthread_id(pthread_self()))); if (m->receive_msg) { m->receive_msg (e, m, data); } @@ -354,9 +354,9 @@ alarm_msg_received(EThread *e, EMsg *msg, void *data) /** * alarm_notify_new: - * + * * Creates a new #AlarmNotify object. - * + * * Return value: A newly-created #AlarmNotify, or NULL if its corresponding * CORBA object could not be created. **/ @@ -364,10 +364,10 @@ AlarmNotify * alarm_notify_new (void) { AlarmNotify *an; - + d (printf("%s:%d (alarm_notify_new) - Alarm Notify New \n ", __FILE__, __LINE__)); - /* Create a thread for alarm queue operation*/ + /* Create a thread for alarm queue operation*/ alarm_channel_setup(&alarm_reply_port, &alarm_reply_channel, alarm_msgport_replied); alarm_operation_thread = e_thread_new(E_THREAD_QUEUE); @@ -378,7 +378,7 @@ alarm_notify_new (void) an = g_object_new (TYPE_ALARM_NOTIFY, "poa", bonobo_poa_get_threaded (ORBIT_THREAD_HINT_PER_REQUEST, NULL), NULL); - + return an; } @@ -389,9 +389,9 @@ cal_opened_cb (ECal *client, ECalendarStatus status, gpointer user_data) AlarmNotify *an = ALARM_NOTIFY (user_data); priv = an->priv; - + d (printf("%s:%d (cal_opened_cb) %s - Calendar Status %d\n", __FILE__, __LINE__, e_cal_get_uri (client), status)); - + if (status == E_CALENDAR_STATUS_OK) alarm_queue_add_client (client); else { @@ -408,7 +408,7 @@ cal_opened_cb (ECal *client, ECalendarStatus status, gpointer user_data) * @uri: URI of the calendar to load. * @load_afterwards: Whether this calendar should be loaded in the future * when the alarm daemon starts up. - * + * * Tells the alarm notification service to load a calendar and start monitoring * its alarms. It can optionally be made to save the URI of this calendar so * that it can be loaded in the future when the alarm daemon starts up. @@ -430,7 +430,7 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource e_uri = e_uri_new (str_uri); pass_key = e_uri_to_string (e_uri, FALSE); e_uri_free (e_uri); - + g_mutex_lock (an->priv->mutex); /* See if we already know about this uri */ if (g_hash_table_lookup (priv->uri_client_hash[source_type], str_uri)) { @@ -455,11 +455,11 @@ alarm_notify_add_calendar (AlarmNotify *an, ECalSourceType source_type, ESource return; } } - + client = auth_new_cal_from_source (source, source_type); if (client) { - d (printf("%s:%d (alarm_notify_add_calendar) %s - Calendar Open Async... %p\n", __FILE__, __LINE__, str_uri, client)); + d (printf("%s:%d (alarm_notify_add_calendar) %s - Calendar Open Async... %p\n", __FILE__, __LINE__, str_uri, client)); g_hash_table_insert (priv->uri_client_hash[source_type], g_strdup (str_uri), client); g_signal_connect (G_OBJECT (client), "cal_opened", G_CALLBACK (cal_opened_cb), an); e_cal_open_async (client, FALSE); @@ -474,7 +474,7 @@ alarm_notify_remove_calendar (AlarmNotify *an, ECalSourceType source_type, const { AlarmNotifyPrivate *priv; ECal *client; - + priv = an->priv; client = g_hash_table_lookup (priv->uri_client_hash[source_type], str_uri); diff --git a/calendar/gui/alarm-notify/alarm-notify.h b/calendar/gui/alarm-notify/alarm-notify.h index 342dd1dba1..8d11367bca 100644 --- a/calendar/gui/alarm-notify/alarm-notify.h +++ b/calendar/gui/alarm-notify/alarm-notify.h @@ -47,7 +47,7 @@ struct _AlarmMsg { void (*receive_msg)(EThread *e, struct _AlarmMsg *msg, void *data); /* message received */ void *data; - + /* Private Usage */ struct _AlarmMsgPrivate *priv; }; diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 5a086266b8..e166791ade 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -173,7 +173,7 @@ static void query_objects_removed_cb (ECal *client, GList *objects, gpointer dat static void remove_client_alarms (ClientAlarms *ca); static void update_cqa (CompQueuedAlarms *cqa, ECalComponent *comp); -static void update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa); +static void update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa); static void tray_list_remove_cqa (CompQueuedAlarms *cqa); static void on_dialog_objs_removed_cb (ECal *client, GList *objects, gpointer data); @@ -199,7 +199,7 @@ queue_midnight_refresh (void) midnight = time_day_end_with_zone (time (NULL), zone); d(printf("%s:%d (queue_midnight_refresh) - Refresh at %s \n",__FILE__, __LINE__, ctime(&midnight))); - + midnight_refresh_id = alarm_add (midnight, midnight_refresh_cb, NULL, NULL); if (!midnight_refresh_id) { d(printf("%s:%d (queue_midnight_refresh) - Could not setup the midnight refresh alarm\n",__FILE__, __LINE__)); @@ -212,9 +212,9 @@ static void add_client_alarms_cb (gpointer key, gpointer value, gpointer data) { ClientAlarms *ca = (ClientAlarms *)data; - + d(printf("%s:%d (add_client_alarms_cb) - Adding %p\n",__FILE__, __LINE__, ca)); - + ca = value; load_alarms_for_today (ca); } @@ -230,13 +230,13 @@ midnight_refresh_async (EThread *e, AlarmMsg *msg, void *data) struct _midnight_refresh_msg *list = msg->data; d(printf("%s:%d (midnight_refresh_async) \n",__FILE__, __LINE__)); - + /* Re-load the alarms for all clients */ g_hash_table_foreach (client_alarms_hash, add_client_alarms_cb, NULL); /* Re-schedule the midnight update */ if (list->remove && midnight_refresh_id != NULL) { - d(printf("%s:%d (midnight_refresh_async) - Reschedule the midnight update \n",__FILE__, __LINE__)); + d(printf("%s:%d (midnight_refresh_async) - Reschedule the midnight update \n",__FILE__, __LINE__)); alarm_remove (midnight_refresh_id); midnight_refresh_id = NULL; } @@ -249,7 +249,7 @@ midnight_refresh_cb (gpointer alarm_id, time_t trigger, gpointer data) { AlarmMsg *msg; struct _midnight_refresh_msg *list; - + /* These two structures will be freed by the msg destroy function*/ msg = malloc (sizeof (AlarmMsg)); msg->receive_msg = midnight_refresh_async; @@ -420,7 +420,7 @@ alarm_trigger_cb (gpointer alarm_id, time_t trigger, gpointer data) #ifdef HAVE_LIBNOTIFY popup_notification (trigger, cqa, alarm_id, TRUE); #endif - display_notification (trigger, cqa, alarm_id, TRUE); + display_notification (trigger, cqa, alarm_id, TRUE); break; case E_CAL_COMPONENT_ALARM_EMAIL: @@ -462,13 +462,13 @@ add_component_alarms (ClientAlarms *ca, ECalComponentAlarms *alarms) cqa->queued_alarms = NULL; d(printf("%s:%d (add_component_alarms) - Creating CQA %p\n",__FILE__, __LINE__, cqa)); - + for (l = alarms->alarms; l; l = l->next) { ECalComponentAlarmInstance *instance; gpointer alarm_id; QueuedAlarm *qa; time_t tnow = time(NULL); - + instance = l->data; if (!has_known_notification (cqa->alarms->comp, instance->auid)) { @@ -517,11 +517,11 @@ load_alarms (ClientAlarms *ca, time_t start, time_t end) char *str_query, *iso_start, *iso_end; d(printf("%s:%d (load_alarms) \n",__FILE__, __LINE__)); - + iso_start = isodate_from_time_t (start); if (!iso_start) return; - + iso_end = isodate_from_time_t (end); if (!iso_end) { g_free (iso_start); @@ -535,7 +535,7 @@ load_alarms (ClientAlarms *ca, time_t start, time_t end) /* create the live query */ if (ca->query) { - d(printf("%s:%d (load_alarms) - Disconnecting old queries \n",__FILE__, __LINE__)); + d(printf("%s:%d (load_alarms) - Disconnecting old queries \n",__FILE__, __LINE__)); g_signal_handlers_disconnect_matched (ca->query, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, ca); g_object_unref (ca->query); ca->query = NULL; @@ -546,7 +546,7 @@ load_alarms (ClientAlarms *ca, time_t start, time_t end) g_warning (G_STRLOC ": Could not get query for client"); } else { d(printf("%s:%d (load_alarms) - Setting Call backs \n",__FILE__, __LINE__)); - + g_signal_connect (G_OBJECT (ca->query), "objects_added", G_CALLBACK (query_objects_changed_cb), ca); g_signal_connect (G_OBJECT (ca->query), "objects_modified", @@ -579,7 +579,7 @@ load_alarms_for_today (ClientAlarms *ca) from = MAX (config_data_get_last_notification_time () + 1, day_start); day_end = time_day_end_with_zone (now, zone); - d(printf("%s:%d (load_alarms_for_today) - From %s to %s\n",__FILE__, __LINE__, ctime (&from), ctime(&day_end))); + d(printf("%s:%d (load_alarms_for_today) - From %s to %s\n",__FILE__, __LINE__, ctime (&from), ctime(&day_end))); load_alarms (ca, from, day_end); } @@ -640,16 +640,16 @@ remove_comp (ClientAlarms *ca, ECalComponentId *id) g_free (id->rid); id->rid = NULL; } - + cqa = lookup_comp_queued_alarms (ca, id); - if (!cqa) + if (!cqa) return; /* If a component is present, then it means we must have alarms queued * for it. */ g_return_if_fail (cqa->queued_alarms != NULL); - + d(printf("%s:%d (remove_comp) - Removing CQA %p\n",__FILE__, __LINE__, cqa)); remove_alarms (cqa, TRUE); } @@ -663,18 +663,18 @@ struct _query_msg { gpointer data; }; -static GList * +static GList * duplicate_ical (GList *in_list) { GList *l, *out_list = NULL; for (l = in_list; l; l = l->next) { out_list = g_list_prepend (out_list, icalcomponent_new_clone (l->data)); } - + return g_list_reverse (out_list); } -static GList * +static GList * duplicate_ecal (GList *in_list) { GList *l, *out_list = NULL; @@ -686,7 +686,7 @@ duplicate_ecal (GList *in_list) id->rid = g_strdup (old->rid); out_list = g_list_prepend (out_list, id); } - + return g_list_reverse (out_list); } @@ -703,11 +703,11 @@ query_objects_changed_async (EThread *e, AlarmMsg *msg, void *data) struct _query_msg *list = msg->data; ECal *client; GList *objects; - + client = list->client; ca = list->data; objects = list->objects; - + from = config_data_get_last_notification_time (); if (from == -1) from = time (NULL); @@ -717,9 +717,9 @@ query_objects_changed_async (EThread *e, AlarmMsg *msg, void *data) zone = config_data_get_timezone (); day_end = time_day_end_with_zone (time (NULL), zone); - + d(printf("%s:%d (query_objects_changed_async) - Querying for object between %s to %s\n",__FILE__, __LINE__, ctime(&from), ctime(&day_end))); - + for (l = objects; l != NULL; l = l->next) { ECalComponentId *id; GSList *sl; @@ -753,7 +753,7 @@ query_objects_changed_async (EThread *e, AlarmMsg *msg, void *data) d(printf("%s:%d (query_objects_changed_async) - Alarm Already Exist for %s\n",__FILE__, __LINE__, id->uid)); /* if the alarms or the alarms list is empty remove it after updating the cqa structure */ if (alarms == NULL || alarms->alarms == NULL) { - + /* update the cqa and its queued alarms for changes in summary and alarm_uid */ update_cqa (cqa, comp); @@ -766,7 +766,7 @@ query_objects_changed_async (EThread *e, AlarmMsg *msg, void *data) remove_alarms (cqa, FALSE); cqa->alarms = alarms; cqa->queued_alarms = NULL; - + /* add the new alarms */ for (sl = cqa->alarms->alarms; sl; sl = sl->next) { ECalComponentAlarmInstance *instance; @@ -782,7 +782,7 @@ query_objects_changed_async (EThread *e, AlarmMsg *msg, void *data) alarm_id = alarm_add (instance->trigger, alarm_trigger_cb, cqa, NULL); if (!alarm_id) { - d(printf("%s:%d (query_objects_changed_async) -Unable to schedule trigger for %s \n",__FILE__, __LINE__, ctime(&(instance->trigger)))); + d(printf("%s:%d (query_objects_changed_async) -Unable to schedule trigger for %s \n",__FILE__, __LINE__, ctime(&(instance->trigger)))); continue; } @@ -790,11 +790,11 @@ query_objects_changed_async (EThread *e, AlarmMsg *msg, void *data) qa->alarm_id = alarm_id; qa->instance = instance; qa->snooze = FALSE; - qa->orig_trigger = instance->trigger; + qa->orig_trigger = instance->trigger; cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa); d(printf("%s:%d (query_objects_changed_async) - Adding %p to queue \n",__FILE__, __LINE__, qa)); } - + cqa->queued_alarms = g_slist_reverse (cqa->queued_alarms); g_object_unref (comp); comp = NULL; @@ -817,7 +817,7 @@ query_objects_changed_cb (ECal *client, GList *objects, gpointer data) list->data = data; msg->data = list; - d(printf("%s:%d (query_objects_changed_cb) - Posting a task\n",__FILE__, __LINE__)); + d(printf("%s:%d (query_objects_changed_cb) - Posting a task\n",__FILE__, __LINE__)); e_thread_put(alarm_operation_thread, (EMsg *)msg); } @@ -833,18 +833,18 @@ query_objects_removed_async (EThread *e, AlarmMsg *msg, void *data) struct _query_msg *list = msg->data; ECal *client; GList *objects; - + client = list->client; ca = list->data; objects = list->objects; - + d(printf("%s:%d (query_objects_removed_async) - Removing %d objects\n",__FILE__, __LINE__, g_list_length(objects))); - - for (l = objects; l != NULL; l = l->next) { + + for (l = objects; l != NULL; l = l->next) { /* If the alarm is already triggered remove it. */ tray_list_remove_cqa (lookup_comp_queued_alarms (ca, l->data)); remove_comp (ca, l->data); - g_hash_table_remove (ca->uid_alarms_hash, l->data); + g_hash_table_remove (ca->uid_alarms_hash, l->data); e_cal_component_free_id (l->data); } @@ -864,10 +864,10 @@ query_objects_removed_cb (ECal *client, GList *objects, gpointer data) list = malloc (sizeof (struct _query_msg)); list->client = client; list->objects = duplicate_ecal (objects); - list->data = data; + list->data = data; msg->data = list; - d(printf("%s:%d (query_objects_removed_cb) - Posting a task\n",__FILE__, __LINE__)); + d(printf("%s:%d (query_objects_removed_cb) - Posting a task\n",__FILE__, __LINE__)); e_thread_put(alarm_operation_thread, (EMsg *)msg); } @@ -916,7 +916,7 @@ edit_component (ECal *client, ECalComponent *comp) GNOME_Evolution_Calendar_CompEditorFactory_CompEditorMode corba_type; d(printf("%s:%d (edit_component) - Client %p\n",__FILE__, __LINE__, client)); - + e_cal_component_get_uid (comp, &uid); uri = e_cal_get_uri (client); @@ -939,9 +939,9 @@ edit_component (ECal *client, ECalComponent *comp) corba_type = GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_TODO; break; default: - corba_type = GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT; + corba_type = GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT; } - + GNOME_Evolution_Calendar_CompEditorFactory_editExisting (factory, uri, (char *) uid, corba_type, &ev); if (BONOBO_EX (&ev)) @@ -1001,7 +1001,7 @@ free_tray_icon_data (TrayIconData *tray_data) g_object_unref (tray_data->comp); tray_data->comp = NULL; - + tray_data->cqa = NULL; tray_data->alarm_id = NULL; tray_data->tray_icon = NULL; @@ -1021,11 +1021,11 @@ on_dialog_objs_removed_async (EThread *e, AlarmMsg *msg, void *data) GList *objects; d(printf("%s:%d (on_dialog_objs_removed_async)\n",__FILE__, __LINE__)); - + client = list->client; tray_data = list->data; objects = list->objects; - + e_cal_component_get_uid (tray_data->comp, &our_uid); g_return_if_fail (our_uid && *our_uid); @@ -1061,7 +1061,7 @@ on_dialog_objs_removed_cb (ECal *client, GList *objects, gpointer data) msg->data = list; d(printf("%s:%d (on_dialog_objs_removed_cb) - Posting a task \n",__FILE__, __LINE__)); - e_thread_put(alarm_operation_thread, (EMsg *)msg); + e_thread_put(alarm_operation_thread, (EMsg *)msg); } struct _tray_cqa_msg { @@ -1076,12 +1076,12 @@ tray_list_remove_cqa_async(EThread *e, AlarmMsg *msg, void *data) GList *list = tray_icons_list; d(printf("%s:%d (tray_list_remove_cqa_async) - Removing CQA %p from tray list\n",__FILE__, __LINE__, cqa)); - + while (list) { TrayIconData *tray_data = list->data; GList *tmp = list; GtkTreeModel *model; - + list = list->next; if (tray_data->cqa == cqa) { d(printf("%s:%d (tray_list_remove_cqa_async) - Found.\n", __FILE__, __LINE__)); @@ -1093,9 +1093,9 @@ tray_list_remove_cqa_async(EThread *e, AlarmMsg *msg, void *data) free_tray_icon_data (tray_data); } } - + d(printf("%s:%d (tray_list_remove_cqa_async) - %d alarms left.\n", __FILE__, __LINE__, g_list_length (tray_icons_list))); - + if (alarm_notifications_dialog) { if (!g_list_length (tray_icons_list)) { gtk_widget_destroy (alarm_notifications_dialog->dialog); @@ -1140,11 +1140,11 @@ tray_list_remove_async(EThread *e, AlarmMsg *msg, void *data) while (list != NULL) { TrayIconData *tray_data = list->data; - + if (!tray_data->snooze_set){ GList *temp = list->next; gboolean status; - + tray_icons_list = g_list_remove_link (tray_icons_list, list); status = remove_queued_alarm (tray_data->cqa, tray_data->alarm_id, FALSE, TRUE); if (status) { @@ -1157,11 +1157,11 @@ tray_list_remove_async(EThread *e, AlarmMsg *msg, void *data) g_list_free_1 (list); if (tray_icons_list != list) /* List head is modified */ list = tray_icons_list; - else + else list = temp; } else list = list->next; - } + } } static void @@ -1190,7 +1190,7 @@ tray_list_remove_data_async(EThread *e, AlarmMsg *msg, void *data) TrayIconData *tray_data = tmsg->data; d(printf("%s:%d (tray_list_remove_data_async) - Removing %p from tray list\n",__FILE__, __LINE__, tray_data)); - + tray_icons_list = g_list_remove_all (tray_icons_list, tray_data); free_tray_icon_data (tray_data); tray_data = NULL; @@ -1219,23 +1219,23 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) TrayIconData *tray_data = data; d(printf("%s:%d (notify_dialog_cb) - Received from dialog\n",__FILE__, __LINE__)); - + g_signal_handlers_disconnect_matched (tray_data->query, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, on_dialog_objs_removed_cb, NULL); switch (result) { case ALARM_NOTIFY_SNOOZE: - d(printf("%s:%d (notify_dialog_cb) - Creating a snooze\n",__FILE__, __LINE__)); + d(printf("%s:%d (notify_dialog_cb) - Creating a snooze\n",__FILE__, __LINE__)); create_snooze (tray_data->cqa, tray_data->alarm_id, snooze_mins); tray_data->snooze_set = TRUE; tray_list_remove_data (tray_data); if (alarm_notifications_dialog) { - GtkTreeSelection *selection = + GtkTreeSelection *selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); GtkTreeIter iter; GtkTreeModel *model = NULL; - + /* We can` also use tray_data->iter */ if (gtk_tree_selection_get_selected (selection, &model, &iter)) { gtk_list_store_remove (GTK_LIST_STORE (model), &iter); @@ -1249,9 +1249,9 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) gtk_tree_selection_select_iter (selection, &iter); } } - + } - + break; case ALARM_NOTIFY_EDIT: @@ -1263,20 +1263,20 @@ notify_dialog_cb (AlarmNotifyResult result, int snooze_mins, gpointer data) d(printf("%s:%d (notify_dialog_cb) - Dialog close\n",__FILE__, __LINE__)); if (alarm_notifications_dialog) { GtkTreeIter iter; - GtkTreeModel *model = + GtkTreeModel *model = gtk_tree_view_get_model ( GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); gboolean valid = gtk_tree_model_get_iter_first (model, &iter); - - /* Maybe we should warn about this first? */ + + /* Maybe we should warn about this first? */ while (valid) { valid = gtk_list_store_remove (GTK_LIST_STORE (model), &iter); } - + gtk_widget_destroy (alarm_notifications_dialog->dialog); g_free (alarm_notifications_dialog); alarm_notifications_dialog = NULL; - + /* Task to remove the tray icons */ tray_list_remove_icons (); } @@ -1309,14 +1309,14 @@ open_alarm_dialog (TrayIconData *tray_data) if (!alarm_notifications_dialog) alarm_notifications_dialog = notified_alarms_dialog_new (); - + if (alarm_notifications_dialog) { GtkTreeSelection *selection = NULL; - + selection = gtk_tree_view_get_selection ( GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); - + tray_data->iter = add_alarm_to_notified_alarms_dialog ( alarm_notifications_dialog, tray_data->trigger, @@ -1327,11 +1327,11 @@ open_alarm_dialog (TrayIconData *tray_data) tray_data->description, tray_data->location, notify_dialog_cb, tray_data); - + gtk_tree_selection_select_iter (selection, &tray_data->iter); } - + } return TRUE; @@ -1341,25 +1341,25 @@ static gint tray_icon_clicked_cb (GtkWidget *widget, GdkEventButton *event, gpointer user_data) { if (event->type == GDK_BUTTON_PRESS) { - d(printf("%s:%d (tray_icon_clicked_cb) - left click and %d alarms\n",__FILE__, __LINE__, g_list_length (tray_icons_list))); + d(printf("%s:%d (tray_icon_clicked_cb) - left click and %d alarms\n",__FILE__, __LINE__, g_list_length (tray_icons_list))); if (event->button == 1 && g_list_length (tray_icons_list) > 0) { GList *tmp; for (tmp = tray_icons_list; tmp; tmp = tmp->next) { open_alarm_dialog (tmp->data); } - + return TRUE; } else if (event->button == 3) { - d(printf("%s:%d (tray_icon_clicked_cb) - right click\n",__FILE__, __LINE__)); + d(printf("%s:%d (tray_icon_clicked_cb) - right click\n",__FILE__, __LINE__)); if (tray_blink_id > -1) g_source_remove (tray_blink_id); tray_blink_id = -1; - - + + gtk_status_icon_set_visible (tray_icon, FALSE); g_object_unref (tray_icon); - tray_icon = NULL; + tray_icon = NULL; return TRUE; } } @@ -1400,7 +1400,7 @@ tray_icon_blink_cb (gpointer data) GdkPixbuf *pixbuf; tray_blink_state = tray_blink_state == TRUE ? FALSE: TRUE; - + pixbuf = e_icon_factory_get_icon (tray_blink_state == TRUE? "stock_appointment-reminder-excl" : "stock_appointment-reminder", @@ -1420,7 +1420,7 @@ static void tray_list_add_async (EThread *e, AlarmMsg *msg, void *data) { struct _tray_msg *list = msg->data; - d(printf("%s:%d (tray_list_add_async) - Add %p\n",__FILE__, __LINE__, list->data)); + d(printf("%s:%d (tray_list_add_async) - Add %p\n",__FILE__, __LINE__, list->data)); tray_icons_list = g_list_prepend (tray_icons_list, list->data); } @@ -1437,8 +1437,8 @@ tray_list_add_new (TrayIconData *data) list = malloc (sizeof (struct _tray_msg)); list->data = data; msg->data = list; - - d(printf("%s:%d (tray_list_add_new) - Posting a task\n",__FILE__, __LINE__)); + + d(printf("%s:%d (tray_list_add_new) - Posting a task\n",__FILE__, __LINE__)); e_thread_put(alarm_operation_thread, (EMsg *)msg); } @@ -1458,15 +1458,15 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, ECalComponentOrganizer organiser; d(printf("%s:%d (display_notification)\n",__FILE__, __LINE__)); - + comp = cqa->alarms->comp; qa = lookup_queued_alarm (cqa, alarm_id); if (!qa) return; - + /* get a sensible description for the event */ e_cal_component_get_summary (comp, &text); - e_cal_component_get_organizer (comp, &organiser); + e_cal_component_get_organizer (comp, &organiser); if (text.value) summary = text.value; @@ -1502,7 +1502,7 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, G_CALLBACK (popup_menu), NULL); } - + current_zone = config_data_get_timezone (); alarm_str = timet_to_str_with_zone (trigger, current_zone); start_str = timet_to_str_with_zone (qa->instance->occur_start, current_zone); @@ -1578,17 +1578,17 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, char *body; d(printf("%s:%d (popup_notification)\n",__FILE__, __LINE__)); - + comp = cqa->alarms->comp; qa = lookup_queued_alarm (cqa, alarm_id); if (!qa) return; if (!notify_is_initted ()) notify_init("Evolution Alarm Notify"); - + /* get a sensible description for the event */ e_cal_component_get_summary (comp, &text); - e_cal_component_get_organizer (comp, &organiser); + e_cal_component_get_organizer (comp, &organiser); if (text.value) @@ -1620,12 +1620,12 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, if (location) body = g_strdup_printf ("%s %s\n%s %s", _("Location:"), location, start_str, time_str); else - body = g_strdup_printf ("%s %s", start_str, time_str); + body = g_strdup_printf ("%s %s", start_str, time_str); } n = notify_notification_new (summary, body, "stock_appointment-reminder", NULL); if (!notify_notification_show(n, NULL)) - g_warning ("Could not send notification to daemon\n"); + g_warning ("Could not send notification to daemon\n"); /* create the private structure */ g_free (start_str); @@ -1650,7 +1650,7 @@ audio_notification (time_t trigger, CompQueuedAlarms *cqa, int flag = 0; d(printf("%s:%d (audio_notification)\n",__FILE__, __LINE__)); - + comp = cqa->alarms->comp; qa = lookup_queued_alarm (cqa, alarm_id); if (!qa) @@ -1691,7 +1691,7 @@ mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id) /* FIXME */ d(printf("%s:%d (mail_notification)\n",__FILE__, __LINE__)); - + if (!e_cal_get_static_capability (cqa->parent_client->client, CAL_STATIC_CAPABILITY_NO_EMAIL_ALARMS)) return; @@ -1713,17 +1713,17 @@ mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id) /* Performs notification of a procedure alarm */ static gboolean -procedure_notification_dialog (const char *cmd, const char *url) +procedure_notification_dialog (const char *cmd, const char *url) { GtkWidget *dialog, *label, *checkbox; char *str; int btn; d(printf("%s:%d (procedure_notification_dialog)\n",__FILE__, __LINE__)); - + if (config_data_is_blessed_program (url)) return TRUE; - + dialog = gtk_dialog_new_with_buttons (_("Warning"), NULL, 0, GTK_STOCK_NO, GTK_RESPONSE_CANCEL, @@ -1746,7 +1746,7 @@ procedure_notification_dialog (const char *cmd, const char *url) checkbox = gtk_check_button_new_with_label (_("Do not ask me about this program again.")); gtk_widget_show (checkbox); - gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), + gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 4); /* Run the dialog */ @@ -1771,7 +1771,7 @@ procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id int result; d(printf("%s:%d (procedure_notification)\n",__FILE__, __LINE__)); - + comp = cqa->alarms->comp; qa = lookup_queued_alarm (cqa, alarm_id); if (!qa) @@ -1805,7 +1805,7 @@ procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id result = 0; if (procedure_notification_dialog (cmd, url)) result = gnome_execute_shell (NULL, cmd); - + if (cmd != (char *) url) g_free (cmd); @@ -1831,14 +1831,14 @@ check_midnight_refresh (gpointer user_data) icaltimezone *zone; d(printf("%s:%d (check_midnight_refresh)\n",__FILE__, __LINE__)); - + zone = config_data_get_timezone (); new_midnight = time_day_end_with_zone (time (NULL), zone); if (new_midnight > midnight) { AlarmMsg *msg; struct _midnight_refresh_msg *list; - + /* These two structures will be freed by the msg destroy function*/ msg = malloc (sizeof (AlarmMsg)); msg->receive_msg = midnight_refresh_async; @@ -1850,7 +1850,7 @@ check_midnight_refresh (gpointer user_data) msg->data = list; d(printf("%s:%d (check_midnight_refresh) - Posting a task to refresh\n",__FILE__, __LINE__)); - e_thread_put(alarm_operation_thread, (EMsg *)msg); + e_thread_put(alarm_operation_thread, (EMsg *)msg); } return TRUE; @@ -1869,7 +1869,7 @@ alarm_queue_init (gpointer data) g_return_if_fail (alarm_queue_inited == FALSE); d(printf("%s:%d (alarm_queue_init)\n",__FILE__, __LINE__)); - + client_alarms_hash = g_hash_table_new (g_direct_hash, g_direct_equal); queue_midnight_refresh (); @@ -1896,12 +1896,12 @@ free_client_alarms_cb (gpointer key, gpointer value, gpointer user_data) ClientAlarms *ca = value; d(printf("%s:%d (free_client_alarms_cb) - %p\n",__FILE__, __LINE__, ca)); - + if (ca) { remove_client_alarms (ca); if (ca->client) { d(printf("%s:%d (free_client_alarms_cb) - Disconnecting Client \n",__FILE__, __LINE__)); - + g_signal_handlers_disconnect_matched (ca->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, ca); g_object_unref (ca->client); @@ -1909,7 +1909,7 @@ free_client_alarms_cb (gpointer key, gpointer value, gpointer user_data) if (ca->query) { d(printf("%s:%d (free_client_alarms_cb) - Disconnecting Query \n",__FILE__, __LINE__)); - + g_signal_handlers_disconnect_matched (ca->query, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, ca); g_object_unref (ca->query); @@ -1940,7 +1940,7 @@ alarm_queue_done (void) g_return_if_fail (g_hash_table_size (client_alarms_hash) == 0); d(printf("%s:%d (alarm_queue_done)\n",__FILE__, __LINE__)); - + g_hash_table_foreach_remove (client_alarms_hash, (GHRFunc) free_client_alarms_cb, NULL); g_hash_table_destroy (client_alarms_hash); client_alarms_hash = NULL; @@ -1953,7 +1953,7 @@ alarm_queue_done (void) alarm_queue_inited = FALSE; } -static gboolean +static gboolean compare_ids (gpointer a, gpointer b) { ECalComponentId *id, *id1; @@ -1967,12 +1967,12 @@ compare_ids (gpointer a, gpointer b) return g_str_equal (id->rid, id1->rid); else if (!(id->rid && id1->rid)) return TRUE; - } + } } return FALSE; } -static guint +static guint hash_ids (gpointer a) { ECalComponentId *id =a; @@ -2002,7 +2002,7 @@ static void alarm_queue_add_async (EThread *e, AlarmMsg *msg, void *data) } d(printf("%s:%d (alarm_queue_add_async) - %p\n",__FILE__, __LINE__, client)); - + ca = g_new (ClientAlarms, 1); ca->client = client; @@ -2018,7 +2018,7 @@ static void alarm_queue_add_async (EThread *e, AlarmMsg *msg, void *data) g_signal_connect (client, "cal_opened", G_CALLBACK (cal_opened_cb), ca); - } + } } /** @@ -2072,12 +2072,12 @@ static gboolean remove_comp_by_id (gpointer key, gpointer value, gpointer userdata) { ClientAlarms *ca = (ClientAlarms *)userdata; - + d(printf("%s:%d (remove_comp_by_id)\n",__FILE__, __LINE__)); - + /* if (!g_hash_table_size (ca->uid_alarms_hash)) */ /* return; */ - + remove_cqa (ca, (ECalComponentId *)key, (CompQueuedAlarms *) value); return TRUE; @@ -2088,10 +2088,10 @@ remove_comp_by_id (gpointer key, gpointer value, gpointer userdata) { static void remove_client_alarms (ClientAlarms *ca) { - d(printf("%s:%d (remove_client_alarms) - size %d \n",__FILE__, __LINE__, g_hash_table_size (ca->uid_alarms_hash))); + d(printf("%s:%d (remove_client_alarms) - size %d \n",__FILE__, __LINE__, g_hash_table_size (ca->uid_alarms_hash))); g_hash_table_foreach_remove (ca->uid_alarms_hash, (GHRFunc)remove_comp_by_id, ca); - + /* The hash table should be empty now */ g_return_if_fail (g_hash_table_size (ca->uid_alarms_hash) == 0); } @@ -2122,7 +2122,7 @@ alarm_queue_remove_async (EThread *e, AlarmMsg *msg, void *data) /* Clean up */ if (ca->client) { d(printf("%s:%d (alarm_queue_remove_async) - Disconnecting Client \n",__FILE__, __LINE__)); - + g_signal_handlers_disconnect_matched (ca->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, ca); g_object_unref (ca->client); @@ -2131,7 +2131,7 @@ alarm_queue_remove_async (EThread *e, AlarmMsg *msg, void *data) if (ca->query) { d(printf("%s:%d (alarm_queue_remove_async) - Disconnecting Query \n",__FILE__, __LINE__)); - + g_signal_handlers_disconnect_matched (ca->query, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, ca); g_object_unref (ca->query); @@ -2176,9 +2176,9 @@ alarm_queue_remove_client (ECal *client, gboolean immediately) e_thread_put(alarm_operation_thread, (EMsg *)msg); } -/* Update non-time related variables for various structures on modification of an existing component +/* Update non-time related variables for various structures on modification of an existing component to be called only from query_objects_changed_cb */ -static void +static void update_cqa (CompQueuedAlarms *cqa, ECalComponent *newcomp) { ECalComponent *oldcomp; @@ -2195,7 +2195,7 @@ update_cqa (CompQueuedAlarms *cqa, ECalComponent *newcomp) to = time_day_end_with_zone (time (NULL), zone); d(printf("%s:%d (update_cqa) - Generating alarms between %s and %s\n",__FILE__, __LINE__, ctime(&from), ctime(&to))); - alarms = e_cal_util_generate_alarms_for_comp (newcomp, from, to, omit, + alarms = e_cal_util_generate_alarms_for_comp (newcomp, from, to, omit, e_cal_resolve_tzid_cb, cqa->parent_client->client, zone); /* Update auids in Queued Alarms*/ @@ -2208,14 +2208,14 @@ update_cqa (CompQueuedAlarms *cqa, ECalComponent *newcomp) else { if (e_cal_component_get_alarm (oldcomp, check_auid)) { /* Need to update QueuedAlarms */ if (alarms == NULL) { - d(printf("%s:%d (update_cqa) - No alarms found in the modified component\n",__FILE__, __LINE__)); + d(printf("%s:%d (update_cqa) - No alarms found in the modified component\n",__FILE__, __LINE__)); break; } update_qa (alarms, qa); } else g_warning ("Failed in auid lookup for old component also\n"); - } + } } /* Update the actual component stored in CompQueuedAlarms structure */ @@ -2240,4 +2240,4 @@ update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa) break; } } -} +} diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index 38e0638ec8..5239812c99 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -145,13 +145,13 @@ setup_timeout (void) * current time we timeout immediately */ diff = MAX (0, ar->trigger - time (NULL)); now = time (NULL); - + /* Add the time out */ g_message ("Setting timeout for %d %lu %lu", diff, ar->trigger, now); g_message (" %s", ctime (&ar->trigger)); g_message (" %s", ctime (&now)); timeout_id = g_timeout_add (diff * 1000, alarm_ready_cb, NULL); - + } /* Used from g_list_insert_sorted(); compares the trigger times of two AlarmRecord structures. */ @@ -175,7 +175,7 @@ queue_alarm (AlarmRecord *ar) /* Track the current head of the list in case there are changes */ old_head = alarms; - /* Insert the new alarm in order if the alarm's trigger time is + /* Insert the new alarm in order if the alarm's trigger time is after the current time */ alarms = g_list_insert_sorted (alarms, ar, compare_alarm_by_time); @@ -226,7 +226,7 @@ alarm_add (time_t trigger, AlarmFunction alarm_fn, gpointer data, /** * alarm_remove: * @alarm: A queued alarm identifier. - * + * * Removes an alarm from the alarm queue. **/ void @@ -274,7 +274,7 @@ alarm_remove (gpointer alarm) /** * alarm_done: - * + * * Terminates the alarm timer mechanism. This should be called at the end of * the program. **/ diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index c35d2b4a6c..e7120d4b38 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -101,10 +101,10 @@ config_data_get_calendars (const char *key) ESourceList *cal_sources; gboolean state; GSList *gconf_list; - + if (!inited) conf_client = gconf_client_get_default (); - + gconf_list = gconf_client_get_list (conf_client, key, GCONF_VALUE_STRING, @@ -117,12 +117,12 @@ config_data_get_calendars (const char *key) return cal_sources; } - state = gconf_client_get_bool (conf_client, + state = gconf_client_get_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", NULL); if (!state) /* Should be old client*/ { GSList *source; - gconf_client_set_bool (conf_client, + gconf_client_set_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", TRUE, NULL); @@ -149,11 +149,11 @@ config_data_get_calendars (const char *key) } return cal_sources; - + } void -config_data_replace_string_list (const char *key, +config_data_replace_string_list (const char *key, const char *old, const char *new) { @@ -166,9 +166,9 @@ config_data_replace_string_list (const char *key, key, GCONF_VALUE_STRING, NULL); - + for (tmp = source; tmp; tmp = tmp->next) { - + if (strcmp (tmp->data, old) == 0) { gboolean state; @@ -205,7 +205,7 @@ config_data_get_timezone (void) ensure_inited (); - location = gconf_client_get_string (conf_client, + location = gconf_client_get_string (conf_client, "/apps/evolution/calendar/display/timezone", NULL); if (location && location[0]) { @@ -246,7 +246,7 @@ config_data_get_notify_with_tray (void) /** * config_data_set_last_notification_time: * @t: A time value. - * + * * Saves the last notification time so that it can be fetched the next time the * alarm daemon is run. This way the daemon can show alarms that should have * triggered while it was not running. @@ -271,9 +271,9 @@ config_data_set_last_notification_time (time_t t) /** * config_data_get_last_notification_time: - * + * * Queries the last saved value for alarm notification times. - * + * * Return value: The last saved value, or -1 if no value had been saved before. **/ time_t @@ -295,7 +295,7 @@ config_data_get_last_notification_time (void) /** * config_data_save_blessed_program: * @program: a program name - * + * * Saves a program name as "blessed" **/ void @@ -317,9 +317,9 @@ config_data_save_blessed_program (const char *program) /** * config_data_is_blessed_program: * @program: a program name - * + * * Checks to see if a program is blessed - * + * * Return value: TRUE if program is blessed, FALSE otherwise **/ gboolean diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c index 3a87002c65..83c2421d38 100644 --- a/calendar/gui/alarm-notify/notify-main.c +++ b/calendar/gui/alarm-notify/notify-main.c @@ -78,7 +78,7 @@ save_session_cb (GnomeClient *client, GnomeSaveStyle save_style, gint shutdown, args[1] = NULL; gnome_client_set_restart_command (client, 1, args); g_free (args[0]); - + return TRUE; } @@ -157,7 +157,7 @@ main (int argc, char **argv) init_session (); /* FIXME Ideally we should not use camel libraries in calendar, though it is the case - currently for attachments. Remove this once that is fixed. + currently for attachments. Remove this once that is fixed. Initialise global camel_object_type */ camel_object_get_type(); diff --git a/calendar/gui/cal-search-bar.c b/calendar/gui/cal-search-bar.c index 7c498b79ef..d82d0e7ce6 100644 --- a/calendar/gui/cal-search-bar.c +++ b/calendar/gui/cal-search-bar.c @@ -65,7 +65,7 @@ enum { SEARCH_COMMENT_CONTAINS, SEARCH_LOCATION_CONTAINS, SEARCH_ATTENDEE_CONTAINS - + }; /* Comments are disabled because they are kind of useless right now, see bug 33247 */ @@ -164,7 +164,7 @@ cal_search_bar_class_init (CalSearchBarClass *klass) klass->sexp_changed = NULL; klass->category_changed = NULL; - search_bar_class->search_activated = cal_search_bar_search_activated; + search_bar_class->search_activated = cal_search_bar_search_activated; object_class->destroy = cal_search_bar_destroy; } @@ -217,13 +217,13 @@ cal_search_bar_destroy (GtkObject *object) free_categories (priv->categories); priv->categories = NULL; } - + if (priv->search_rule) { g_object_unref (priv->search_rule); priv->search_rule = NULL; } - - /* FIXME + + /* FIXME if (priv->search_context) { g_object_unref (priv->search_context); priv->search_context = NULL; @@ -232,7 +232,7 @@ cal_search_bar_destroy (GtkObject *object) g_free (priv); cal_search->priv = NULL; } - + if (GTK_OBJECT_CLASS (cal_search_bar_parent_class)->destroy) (* GTK_OBJECT_CLASS (cal_search_bar_parent_class)->destroy) (object); } @@ -266,11 +266,11 @@ get_current_category (CalSearchBar *cal_search) if (priv->view_flag == CAL_SEARCH_TASKS_DEFAULT) i = viewid - CATEGORIES_TASKS_OFFSET; - else if (priv->view_flag == CAL_SEARCH_MEMOS_DEFAULT) + else if (priv->view_flag == CAL_SEARCH_MEMOS_DEFAULT) i = viewid - CATEGORIES_MEMOS_OFFSET; else if (priv->view_flag == CAL_SEARCH_CALENDAR_DEFAULT) i = viewid - CATEGORIES_CALENDAR_OFFSET; - + if (i >= 0 && i < priv->categories->len) return priv->categories->pdata[i]; else @@ -296,7 +296,7 @@ get_show_option_sexp (CalSearchBar *cal_search) if (viewid == CATEGORIES_UNMATCHED) return g_strdup ("(has-categories? #f)"); /* Unfiled items */ - else if (viewid == CATEGORIES_ALL) + else if (viewid == CATEGORIES_ALL) return NULL; /* All items */ switch (priv->view_flag) { @@ -345,9 +345,9 @@ get_show_option_sexp (CalSearchBar *cal_search) g_free (due); return ret; - } else if (viewid == COMPLETED_TASK) + } else if (viewid == COMPLETED_TASK) return g_strdup ("(is-completed?)"); - else if (viewid == TASK_WITH_ATTACHMENT) + else if (viewid == TASK_WITH_ATTACHMENT) return g_strdup ("(has-attachments?)"); break; case CAL_SEARCH_CALENDAR_DEFAULT: @@ -369,7 +369,7 @@ get_show_option_sexp (CalSearchBar *cal_search) g_free (end); return ret; - } else if (viewid == N_DAY_APPOINTMENT) { + } else if (viewid == N_DAY_APPOINTMENT) { start_range = time (NULL); end_range = time_add_day (start_range, 7); start = isodate_from_time_t (start_range); @@ -415,17 +415,17 @@ notify_e_cal_view_contains (CalSearchBar *cal_search, const char *field, const c if (text && *text) { sexp = g_strdup_printf ("(contains? \"%s\" \"%s\")", field, text); g_free (text); - } else + } else sexp = g_strdup ("(contains? \"summary\" \"\")"); /* Show all */ /* Apply the selected view on search */ - if (view && *view){ + if (view && *view){ sexp = g_strconcat ("(and ",sexp, view, ")", NULL); } - + notify_sexp_changed (cal_search, sexp); - + g_free (sexp); } @@ -463,7 +463,7 @@ regen_query (CalSearchBar *cal_search) cal_search->priv->start = -1; cal_search->priv->end = -1; - + /* Get the selected view */ show_option_sexp = get_show_option_sexp (cal_search); @@ -495,11 +495,11 @@ regen_query (CalSearchBar *cal_search) out = g_string_new (""); filter_rule_build_code (efb->current_query, out); - if (show_option_sexp && *show_option_sexp) + if (show_option_sexp && *show_option_sexp) sexp = g_strconcat ("(and ", out->str, show_option_sexp, ")", NULL); - + notify_sexp_changed (cal_search, sexp ? sexp : out->str); - + g_string_free (out, TRUE); g_free(sexp); break; @@ -590,7 +590,7 @@ setup_category_options (CalSearchBar *cal_search, CALSearchBarItem *subitems, gi } index = i + offset; } - + subitems[index].search.id = -1; /* terminator */ subitems[index].search.text = NULL; subitems[index].image = NULL; @@ -604,7 +604,7 @@ make_suboptions (CalSearchBar *cal_search) CalSearchBarPrivate *priv; CALSearchBarItem *subitems = NULL; GtkWidget *menu; - + priv = cal_search->priv; g_return_if_fail (priv->categories != NULL); @@ -624,7 +624,7 @@ make_suboptions (CalSearchBar *cal_search) subitems[1].search.id = CATEGORIES_UNMATCHED; subitems[1].image = NULL; - subitems[2].search.text = NULL; + subitems[2].search.text = NULL; subitems[2].search.id = 0; subitems[2].image = NULL; @@ -650,7 +650,7 @@ make_suboptions (CalSearchBar *cal_search) /* All the other items */ setup_category_options (cal_search, subitems, 8, CATEGORIES_TASKS_OFFSET); - + menu = generate_viewoption_menu (subitems); e_search_bar_set_viewoption_menu ((ESearchBar *)cal_search, menu); @@ -686,15 +686,15 @@ make_suboptions (CalSearchBar *cal_search) subitems[1].search.id = CATEGORIES_UNMATCHED; subitems[1].image = NULL; - subitems[2].search.text = NULL; + subitems[2].search.text = NULL; subitems[2].search.id = 0; subitems[2].image = NULL; - subitems[3].search.text = _("Active Appointments"); + subitems[3].search.text = _("Active Appointments"); subitems[3].search.id = ACTIVE_APPONTMENT; subitems[3].image = NULL; - subitems[4].search.text = _("Next 7 Days' Appointments"); + subitems[4].search.text = _("Next 7 Days' Appointments"); subitems[4].search.id = N_DAY_APPOINTMENT; subitems[4].image = NULL; @@ -705,7 +705,7 @@ make_suboptions (CalSearchBar *cal_search) e_search_bar_set_viewoption_menu ((ESearchBar *)cal_search, menu); } - if(subitems != NULL) + if(subitems != NULL) g_free (subitems); } @@ -720,9 +720,9 @@ search_menu_activated (ESearchBar *esb, int id) * cal_search_bar_construct: * @cal_search: A calendar search bar. * @flags: bitfield of items to appear in the search menu - * + * * Constructs a calendar search bar by binding its menu and option items. - * + * * Return value: The same value as @cal_search. **/ CalSearchBar * @@ -733,12 +733,12 @@ cal_search_bar_construct (CalSearchBar *cal_search, guint32 flags) int i, j; char *xmlfile = NULL; char *userfile = NULL; - FilterPart *part; + FilterPart *part; RuleContext *search_context; FilterRule *search_rule; - + g_return_val_if_fail (IS_CAL_SEARCH_BAR (cal_search), NULL); - + items = g_alloca ((G_N_ELEMENTS (search_option_items) + 1) * sizeof (ESearchBarItem)); for (i = 0, j = 0; i < G_N_ELEMENTS (search_option_items); i++, bit <<= 1) { if ((flags & bit) != 0) { @@ -748,7 +748,7 @@ cal_search_bar_construct (CalSearchBar *cal_search, guint32 flags) j++; } } - + items[j].text = NULL; items[j].id = -1; search_context = rule_context_new (); @@ -773,16 +773,16 @@ cal_search_bar_construct (CalSearchBar *cal_search, guint32 flags) g_object_set_data_full (G_OBJECT (search_context), "user", userfile, g_free); g_object_set_data_full (G_OBJECT (search_context), "system", xmlfile, g_free); - rule_context_load (search_context, xmlfile, userfile); + rule_context_load (search_context, xmlfile, userfile); search_rule = filter_rule_new (); part = rule_context_next_part (search_context, NULL); - + if (part == NULL) g_warning ("Could not load calendar search; no parts."); - else + else filter_rule_add_part (search_rule, filter_part_clone (part)); - e_filter_bar_new_construct (search_context, xmlfile, userfile, NULL, cal_search, + e_filter_bar_new_construct (search_context, xmlfile, userfile, NULL, cal_search, (EFilterBar*) cal_search ); e_search_bar_set_menu ((ESearchBar *) cal_search, calendar_search_items); @@ -795,16 +795,16 @@ cal_search_bar_construct (CalSearchBar *cal_search, guint32 flags) g_free (xmlfile); g_free (userfile); - + return cal_search; } /** * cal_search_bar_new: * flags: bitfield of items to appear in the search menu - * + * * creates a new calendar search bar. - * + * * return value: a newly-created calendar search bar. you should connect to the * "sexp_changed" signal to monitor changes in the generated sexps. **/ @@ -854,7 +854,7 @@ sort_categories (GPtrArray *categories) * cal_search_bar_set_categories: * @cal_search: A calendar search bar. * @categories: Array of pointers to strings for the category names. - * + * * Sets the list of categories that are to be shown in the drop-down list * of a calendar search bar. The search bar will automatically add an item * for "unfiled" components, that is, those that have no categories assigned @@ -880,10 +880,10 @@ cal_search_bar_set_categories (CalSearchBar *cal_search, GPtrArray *categories) /** * cal_search_bar_get_category: * @cal_search: A calendar search bar. - * + * * Queries the currently selected category name in a calendar search bar. * If "All" or "Unfiled" are selected, this function will return NULL. - * + * * Return value: Name of the selected category, or NULL if there is no * selected category. **/ @@ -897,13 +897,13 @@ cal_search_bar_get_category (CalSearchBar *cal_search) return category; } -void +void cal_search_bar_get_time_range (CalSearchBar *cal_search, time_t *start, time_t *end) { CalSearchBarPrivate *priv; g_return_if_fail (IS_CAL_SEARCH_BAR (cal_search)); - + priv = cal_search->priv; *start = priv->start; diff --git a/calendar/gui/calendar-commands.c b/calendar/gui/calendar-commands.c index 7c6576bf2a..b4d46d358e 100644 --- a/calendar/gui/calendar-commands.c +++ b/calendar/gui/calendar-commands.c @@ -409,7 +409,7 @@ calendar_control_sensitize_calendar_commands (BonoboControl *control, GnomeCalen if (bonobo_ui_component_get_container (uic) == CORBA_OBJECT_NIL) return; - + view = gnome_calendar_get_current_view_widget (gcal); menu = gnome_calendar_get_calendar_menu (gcal); diff --git a/calendar/gui/calendar-component.c b/calendar/gui/calendar-component.c index 6168988aad..607e199f81 100644 --- a/calendar/gui/calendar-component.c +++ b/calendar/gui/calendar-component.c @@ -82,16 +82,16 @@ static gint num_drag_types = sizeof(drag_types) / sizeof(drag_types[0]); #define PARENT_TYPE bonobo_object_get_type () static BonoboObjectClass *parent_class = NULL; -typedef struct +typedef struct { ESourceList *source_list; ESourceList *task_source_list; ESourceList *memo_source_list; - + GSList *source_selection; GSList *task_source_selection; GSList *memo_source_selection; - + GnomeCalendar *calendar; EInfoLabel *info_label; @@ -106,7 +106,7 @@ typedef struct EUserCreatableItemsHandler *creatable_items_handler; EActivityHandler *activity_handler; - + float vpane_pos; } CalendarComponentView; @@ -135,7 +135,7 @@ static void calcomp_vpane_realized (GtkWidget *vpane, CalendarComponentView *view) { gtk_paned_set_position (GTK_PANED (vpane), (int)(view->vpane_pos*vpane->allocation.height)); - + } static gboolean @@ -190,7 +190,7 @@ ensure_sources (CalendarComponent *component) group = E_SOURCE_GROUP (g->data); - /* compare only file:// part. If user home dir name changes we do not want to create + /* compare only file:// part. If user home dir name changes we do not want to create one more group */ if (!on_this_computer && !strncmp (base_uri_proto, e_source_group_peek_base_uri (group), 7)) @@ -225,11 +225,11 @@ ensure_sources (CalendarComponent *component) homedir name changes */ if (strcmp (base_uri_proto, e_source_group_peek_base_uri (on_this_computer))) { e_source_group_set_base_uri (on_this_computer, base_uri_proto); - + /* *sigh* . We shouldn't need this sync call here as set_base_uri call results in synching to gconf, but that happens in idle loop and too late to prevent user seeing "Can not Open ... because of invalid uri" error.*/ - e_source_list_sync (source_list,NULL); + e_source_list_sync (source_list,NULL); } } else { @@ -247,7 +247,7 @@ ensure_sources (CalendarComponent *component) /* Create the default Person addressbook */ personal_source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); e_source_group_add_source (on_this_computer, personal_source, -1); - + calendars_selected = calendar_config_get_calendars_selected (); if (!primary_calendar && !calendars_selected) { GSList selected; @@ -277,7 +277,7 @@ ensure_sources (CalendarComponent *component) } if (contacts) { GSList *sources = e_source_group_peek_sources (contacts); - if (sources) + if (sources) birthdays_source = E_SOURCE (sources->data); /* There is only one source under Contacts Group*/ } else { @@ -299,7 +299,7 @@ ensure_sources (CalendarComponent *component) if (!e_source_get_property (birthdays_source, "delete")) e_source_set_property(birthdays_source, "delete", "no"); - + if (e_source_peek_color_spec (birthdays_source) == NULL) e_source_set_color_spec (birthdays_source, "#DDBECE"); @@ -316,7 +316,7 @@ ensure_sources (CalendarComponent *component) g_object_unref (personal_source); if (birthdays_source) g_object_unref (birthdays_source); - + g_free (base_uri_proto); g_free (base_uri); } @@ -328,10 +328,10 @@ static gboolean is_in_selection (GSList *selection, ESource *source) { GSList *l; - + for (l = selection; l; l = l->next) { ESource *selected_source = l->data; - + if (!strcmp (e_source_peek_uid (selected_source), e_source_peek_uid (source))) return TRUE; } @@ -343,10 +343,10 @@ static gboolean is_in_uids (GSList *uids, ESource *source) { GSList *l; - + for (l = uids; l; l = l->next) { const char *uid = l->data; - + if (!strcmp (uid, e_source_peek_uid (source))) return TRUE; } @@ -358,7 +358,7 @@ static void update_uris_for_selection (CalendarComponentView *component_view) { GSList *selection, *l, *uids_selected = NULL; - + selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (component_view->source_selector)); for (l = component_view->source_selection; l; l = l->next) { @@ -370,11 +370,11 @@ update_uris_for_selection (CalendarComponentView *component_view) for (l = selection; l; l = l->next) { ESource *selected_source = l->data; - + if (gnome_calendar_add_source (component_view->calendar, E_CAL_SOURCE_TYPE_EVENT, selected_source)) uids_selected = g_slist_append (uids_selected, (char *) e_source_peek_uid (selected_source)); } - + e_source_selector_free_selection (component_view->source_selection); component_view->source_selection = selection; @@ -416,10 +416,10 @@ update_selection (CalendarComponentView *component_view) for (l = selection; l; l = l->next) { ESource *source = l->data; - if (!is_in_uids (uids_selected, source)) + if (!is_in_uids (uids_selected, source)) e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), source); } - + e_source_selector_free_selection (selection); /* Make sure the whole selection is there */ @@ -428,9 +428,9 @@ update_selection (CalendarComponentView *component_view) ESource *source; source = e_source_list_peek_source_by_uid (component_view->source_list, uid); - if (source) + if (source) e_source_selector_select_source (E_SOURCE_SELECTOR (component_view->source_selector), source); - + g_free (uid); } g_slist_free (uids_selected); @@ -463,7 +463,7 @@ update_task_memo_selection (CalendarComponentView *component_view, ECalSourceTyp gnome_calendar_remove_source_by_uid (component_view->calendar, type, uid); else if (!is_in_uids (uids_selected, source)) gnome_calendar_remove_source (component_view->calendar, type, source); - + g_free (uid); } g_slist_free (source_selection); @@ -495,7 +495,7 @@ update_primary_selection (CalendarComponentView *component_view) source = e_source_list_peek_source_by_uid (component_view->source_list, uid); g_free (uid); } - + if (source) { e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector), source); } else { @@ -526,7 +526,7 @@ update_primary_task_memo_selection (CalendarComponentView *component_view, ECalS g_free (uid); } - + if (source) gnome_calendar_set_default_source (component_view->calendar, type, source); } @@ -537,7 +537,7 @@ copy_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data) { CalendarComponentView *component_view = data; ESource *selected_source; - + selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; @@ -575,7 +575,7 @@ delete_calendar_cb (EPopup *ep, EPopupItem *pitem, void *data) e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), selected_source); } - + e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); e_source_list_sync (component_view->source_list, NULL); } @@ -622,7 +622,7 @@ popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *eve GSList *menus = NULL; int i; GtkMenu *menu; - + /** @HookPoint-ECalPopup: Calendar Source Selector Context Menu * @Id: org.gnome.evolution.calendar.source.popup * @Class: org.gnome.evolution.calendar.popup:1.0 @@ -633,10 +633,10 @@ popup_event_cb(ESourceSelector *selector, ESource *insource, GdkEventButton *eve ep = e_cal_popup_new("org.gnome.evolution.calendar.source.popup"); t = e_cal_popup_target_new_source(ep, selector); t->target.widget = (GtkWidget *)component_view->calendar; - + for (i=0;i<sizeof(ecc_source_popups)/sizeof(ecc_source_popups[0]);i++) menus = g_slist_prepend(menus, &ecc_source_popups[i]); - + e_popup_add_items((EPopup *)ep, menus, NULL, ecc_source_popup_free, component_view); menu = e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0); @@ -802,7 +802,7 @@ config_primary_selection_changed_cb (GConfClient *client, guint id, GConfEntry * { CalendarComponent *calendar_component = data; CalendarComponentPrivate *priv = calendar_component->priv; - + if (priv->create_ecal) { g_object_unref (priv->create_ecal); priv->create_ecal = NULL; @@ -848,13 +848,13 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme char *rid = NULL; priv = calendar_component->priv; - + l = g_list_last (priv->views); if (!l) return; view = l->data; - + if (!strncmp (uri, "calendar:", 9)) { EUri *euri = e_uri_new (uri); const char *p; @@ -866,17 +866,17 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme if (p) { while (*p) { len = strcspn (p, "=&"); - + /* If it's malformed, give up. */ if (p[len] != '=') break; - + header = (char *) p; header[len] = '\0'; p += len + 1; - + clen = strcspn (p, "&"); - + content = g_strndup (p, clen); if (!g_ascii_strcasecmp (header, "startdate")) { @@ -902,14 +902,14 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme } if (start != -1) { - + if (end == -1) end = start; gnome_calendar_set_selected_time_range (view->calendar, start, end); } if (src_uid && uid) gnome_calendar_edit_appointment (view->calendar, src_uid, uid, rid); - + g_free (src_uid); g_free (uid); g_free (rid); @@ -942,11 +942,11 @@ impl_upgradeFromVersion (PortableServer_Servant servant, } static gboolean -selector_tree_drag_drop (GtkWidget *widget, - GdkDragContext *context, - int x, - int y, - guint time, +selector_tree_drag_drop (GtkWidget *widget, + GdkDragContext *context, + int x, + int y, + guint time, CalendarComponent *component) { GtkTreeViewColumn *column; @@ -956,12 +956,12 @@ selector_tree_drag_drop (GtkWidget *widget, GtkTreeModel *model; GtkTreeIter iter; gpointer data; - - if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path, + + if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &column, &cell_x, &cell_y)) return FALSE; - - + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); if (!gtk_tree_model_get_iter (model, &iter, path)) { @@ -970,17 +970,17 @@ selector_tree_drag_drop (GtkWidget *widget, } gtk_tree_model_get (model, &iter, 0, &data, -1); - + if (E_IS_SOURCE_GROUP (data)) { g_object_unref (data); gtk_tree_path_free (path); return FALSE; } - + gtk_tree_path_free (path); return TRUE; } - + static gboolean selector_tree_drag_motion (GtkWidget *widget, GdkDragContext *context, @@ -995,21 +995,21 @@ selector_tree_drag_motion (GtkWidget *widget, GtkTreeModel *model; GtkTreeIter iter; GdkDragAction action = GDK_ACTION_DEFAULT; - + if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) goto finish; - + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); - + if (!gtk_tree_model_get_iter (model, &iter, path)) goto finish; - + gtk_tree_model_get (model, &iter, 0, &data, -1); if (E_IS_SOURCE_GROUP (data) || e_source_get_readonly (data)) goto finish; - + gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), path, GTK_TREE_VIEW_DROP_INTO_OR_BEFORE); action = context->suggested_action; @@ -1030,11 +1030,11 @@ update_single_object (ECal *client, icalcomponent *icalcomp) icalcomponent *tmp_icalcomp; uid = (char *) icalcomponent_get_uid (icalcomp); - + if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL)) return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL); - return e_cal_create_object (client, icalcomp, &uid, NULL); + return e_cal_create_object (client, icalcomp, &uid, NULL); } static gboolean @@ -1052,7 +1052,7 @@ update_objects (ECal *client, icalcomponent *icalcomp) subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT); while (subcomp) { gboolean success; - + kind = icalcomponent_isa (subcomp); if (kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; @@ -1078,10 +1078,10 @@ update_objects (ECal *client, icalcomponent *icalcomp) } static void -selector_tree_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, +selector_tree_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, GtkSelectionData *data, guint info, guint time, @@ -1099,20 +1099,20 @@ selector_tree_drag_data_received (GtkWidget *widget, if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) goto finish; - + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); - + if (!gtk_tree_model_get_iter (model, &iter, path)) goto finish; - - + + gtk_tree_model_get (model, &iter, 0, &source, -1); if (E_IS_SOURCE_GROUP (source) || e_source_get_readonly (source)) goto finish; icalcomp = icalparser_parse_string ((char *)data->data); - + if (icalcomp) { char * uid; @@ -1122,18 +1122,18 @@ selector_tree_drag_data_received (GtkWidget *widget, icalcomponent_set_uid (icalcomp, uid); } - client = auth_new_cal_from_source (source, + client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); - + if (client) { if (e_cal_open (client, TRUE, NULL)) { success = TRUE; update_objects (client, icalcomp); } - + g_object_unref (client); } - + icalcomponent_free (icalcomp); } @@ -1144,12 +1144,12 @@ selector_tree_drag_data_received (GtkWidget *widget, gtk_tree_path_free (path); gtk_drag_finish (context, success, context->action == GDK_ACTION_MOVE, time); -} +} static void selector_tree_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, gpointer data) { - gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), + gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), NULL, GTK_TREE_VIEW_DROP_BEFORE); } @@ -1161,57 +1161,57 @@ control_activate_cb (BonoboControl *control, gboolean activate, gpointer data) if (activate) { BonoboUIComponent *uic; uic = bonobo_control_get_ui_component (component_view->view_control); - + e_user_creatable_items_handler_activate (component_view->creatable_items_handler, uic); - } + } } static void config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) -{ +{ CalendarComponent *calendar_component = data; CalendarComponentPrivate *priv; - + priv = calendar_component->priv; g_object_unref (priv->create_ecal); priv->create_ecal = NULL; - + priv->notifications = g_list_remove (priv->notifications, GUINT_TO_POINTER (id)); } static ECal * -setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView *component_view) +setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView *component_view) { CalendarComponentPrivate *priv; ESource *source = NULL; char *uid; guint not; - + priv = calendar_component->priv; /* Try to use the client from the calendar first to avoid re-opening things */ if (component_view) { ECal *default_ecal; - + default_ecal = gnome_calendar_get_default_client (component_view->calendar); if (default_ecal) return default_ecal; } - + /* If there is an existing fall back, use that */ if (priv->create_ecal) - return priv->create_ecal; + return priv->create_ecal; - /* Get the current primary calendar, or try to set one if it doesn't already exist */ + /* Get the current primary calendar, or try to set one if it doesn't already exist */ uid = calendar_config_get_primary_calendar (); if (uid) { source = e_source_list_peek_source_by_uid (priv->source_list, uid); g_free (uid); priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); - } + } if (!priv->create_ecal) { /* Try to create a default if there isn't one */ @@ -1219,19 +1219,19 @@ setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView if (source) priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); } - + if (priv->create_ecal) { icaltimezone *zone; - + zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (priv->create_ecal, zone, NULL); if (!e_cal_open (priv->create_ecal, FALSE, NULL)) { GtkWidget *dialog; - + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, - _("Unable to open the calendar '%s' for creating events and meetings"), + _("Unable to open the calendar '%s' for creating events and meetings"), e_source_peek_name (source)); gtk_dialog_run (GTK_DIALOG (dialog)); @@ -1244,7 +1244,7 @@ setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView } else { GtkWidget *dialog; - + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("There is no calendar available for creating events and meetings")); @@ -1252,10 +1252,10 @@ setup_create_ecal (CalendarComponent *calendar_component, CalendarComponentView gtk_widget_destroy (dialog); return NULL; - } + } /* Handle the fact it may change on us */ - not = calendar_config_add_notification_primary_calendar (config_create_ecal_changed_cb, + not = calendar_config_add_notification_primary_calendar (config_create_ecal_changed_cb, calendar_component); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); @@ -1297,7 +1297,7 @@ create_new_event (CalendarComponent *calendar_component, CalendarComponentView * e_comp_editor_registry_add (comp_editor_registry, COMP_EDITOR (editor), TRUE); } - return TRUE; + return TRUE; } static void @@ -1307,18 +1307,18 @@ create_local_item_cb (EUserCreatableItemsHandler *handler, const char *item_type CalendarComponentPrivate *priv; CalendarComponentView *component_view = NULL; GList *l; - + priv = calendar_component->priv; - + for (l = priv->views; l; l = l->next) { component_view = l->data; if (component_view->creatable_items_handler == handler) break; - + component_view = NULL; } - + if (strcmp (item_type_name, CREATE_EVENT_ID) == 0) create_new_event (calendar_component, component_view, FALSE, FALSE); else if (strcmp (item_type_name, CREATE_ALLDAY_EVENT_ID) == 0) @@ -1338,12 +1338,12 @@ create_component_view (CalendarComponent *calendar_component) GtkWidget *statusbar_widget; guint not; AtkObject *a11y; - + priv = calendar_component->priv; /* Create the calendar component view */ component_view = g_new0 (CalendarComponentView, 1); - + vpane = gtk_vpaned_new (); g_signal_connect_after (vpane, "realize", G_CALLBACK(calcomp_vpane_realized), component_view); @@ -1355,20 +1355,20 @@ create_component_view (CalendarComponent *calendar_component) component_view->task_source_list = g_object_ref (priv->task_source_list); component_view->memo_source_list = g_object_ref (priv->memo_source_list); component_view->vpane_pos = calendar_config_get_tag_vpane_pos (); - + /* Create sidebar selector */ component_view->source_selector = e_source_selector_new (calendar_component->priv->source_list); e_source_selector_set_select_new ((ESourceSelector *)component_view->source_selector, TRUE); a11y = gtk_widget_get_accessible (GTK_WIDGET (component_view->source_selector)); atk_object_set_name (a11y, _("Calendar Source Selector")); - g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), + g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), calendar_component); - g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave), + g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave), calendar_component); - g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop), + g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop), calendar_component); - g_signal_connect (component_view->source_selector, "drag-data-received", + g_signal_connect (component_view->source_selector, "drag-data-received", G_CALLBACK (selector_tree_drag_data_received), calendar_component); gtk_drag_dest_set(component_view->source_selector, GTK_DEST_DEFAULT_ALL, drag_types, @@ -1392,9 +1392,9 @@ create_component_view (CalendarComponent *calendar_component) gtk_box_pack_start(GTK_BOX (vbox), GTK_WIDGET (component_view->info_label), FALSE, TRUE, 0); gtk_box_pack_start(GTK_BOX (vbox), selector_scrolled_window, TRUE, TRUE, 0); gtk_widget_show (vbox); - - gtk_paned_pack1 (GTK_PANED (vpane), vbox, FALSE, FALSE); - + + gtk_paned_pack1 (GTK_PANED (vpane), vbox, FALSE, FALSE); + component_view->sidebar_control = bonobo_control_new (vpane); /* Create main view */ @@ -1404,15 +1404,15 @@ create_component_view (CalendarComponent *calendar_component) return NULL; } - + component_view->calendar = (GnomeCalendar *) bonobo_control_get_widget (component_view->view_control); - gtk_paned_pack2 (GTK_PANED (vpane), gnome_calendar_get_tag (component_view->calendar), FALSE, FALSE); + gtk_paned_pack2 (GTK_PANED (vpane), gnome_calendar_get_tag (component_view->calendar), FALSE, FALSE); /* This signal is thrown if backends die - we update the selector */ - g_signal_connect (component_view->calendar, "source_added", + g_signal_connect (component_view->calendar, "source_added", G_CALLBACK (source_added_cb), component_view); - g_signal_connect (component_view->calendar, "source_removed", + g_signal_connect (component_view->calendar, "source_removed", G_CALLBACK (source_removed_cb), component_view); /* Create status bar */ @@ -1422,9 +1422,9 @@ create_component_view (CalendarComponent *calendar_component) gtk_widget_show (statusbar_widget); component_view->statusbar_control = bonobo_control_new (statusbar_widget); - + gnome_calendar_set_activity_handler (component_view->calendar, component_view->activity_handler); - + /* connect after setting the initial selections, or we'll get unwanted calls to calendar_control_sensitize_calendar_commands */ g_signal_connect (component_view->source_selector, "selection_changed", @@ -1444,7 +1444,7 @@ create_component_view (CalendarComponent *calendar_component) G_CALLBACK (calendar_dates_changed_cb), component_view); /* Load the selection from the last run */ - update_selection (component_view); + update_selection (component_view); update_primary_selection (component_view); update_task_memo_selection (component_view, E_CAL_SOURCE_TYPE_TODO); update_primary_task_memo_selection (component_view, E_CAL_SOURCE_TYPE_TODO); @@ -1453,19 +1453,19 @@ create_component_view (CalendarComponent *calendar_component) /* If the tasks/memos selection changes elsewhere, update it for the mini mini tasks view sidebar */ - not = calendar_config_add_notification_tasks_selected (config_tasks_selection_changed_cb, + not = calendar_config_add_notification_tasks_selected (config_tasks_selection_changed_cb, component_view); component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not)); - not = calendar_config_add_notification_memos_selected (config_memos_selection_changed_cb, + not = calendar_config_add_notification_memos_selected (config_memos_selection_changed_cb, component_view); component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not)); - not = calendar_config_add_notification_primary_tasks (config_primary_tasks_selection_changed_cb, + not = calendar_config_add_notification_primary_tasks (config_primary_tasks_selection_changed_cb, component_view); component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not)); - - not = calendar_config_add_notification_primary_memos (config_primary_memos_selection_changed_cb, + + not = calendar_config_add_notification_primary_memos (config_primary_memos_selection_changed_cb, component_view); component_view->notifications = g_list_prepend (component_view->notifications, GUINT_TO_POINTER (not)); @@ -1474,21 +1474,21 @@ create_component_view (CalendarComponent *calendar_component) static void destroy_component_view (CalendarComponentView *component_view) -{ +{ GList *l; - + if (component_view->source_list) g_object_unref (component_view->source_list); if (component_view->task_source_list) g_object_unref (component_view->task_source_list); - + if (component_view->memo_source_list) g_object_unref (component_view->memo_source_list); if (component_view->source_selection) e_source_selector_free_selection (component_view->source_selection); - + for (l = component_view->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); g_list_free (component_view->notifications); @@ -1518,12 +1518,12 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was) CalendarComponent *calendar_component = data; CalendarComponentPrivate *priv; GList *l; - + priv = calendar_component->priv; for (l = priv->views; l; l = l->next) { CalendarComponentView *component_view = l->data; - + if (G_OBJECT (component_view->view_control) == where_the_object_was) { priv->views = g_list_remove (priv->views, component_view); destroy_component_view (component_view); @@ -1542,7 +1542,7 @@ impl_createView (PortableServer_Servant servant, CalendarComponentPrivate *priv; CalendarComponentView *component_view; EComponentView *ecv; - + priv = calendar_component->priv; /* Create the calendar component view */ @@ -1556,7 +1556,7 @@ impl_createView (PortableServer_Servant servant, g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, calendar_component); priv->views = g_list_append (priv->views, component_view); - + /* TODO: Make CalendarComponentView just subclass EComponentView */ ecv = e_component_view_new_controls (parent, "calendar", component_view->sidebar_control, component_view->view_control, component_view->statusbar_control); @@ -1619,7 +1619,7 @@ impl_requestCreateItem (PortableServer_Servant servant, { CalendarComponent *calendar_component = CALENDAR_COMPONENT (bonobo_object_from_servant (servant)); gboolean result = FALSE; - + if (strcmp (item_type_name, CREATE_EVENT_ID) == 0) result = create_new_event (calendar_component, NULL, FALSE, FALSE); else if (strcmp (item_type_name, CREATE_ALLDAY_EVENT_ID) == 0) @@ -1644,7 +1644,7 @@ impl_dispose (GObject *object) CalendarComponent *calendar_component = CALENDAR_COMPONENT (object); CalendarComponentPrivate *priv = calendar_component->priv; GList *l; - + if (priv->source_list != NULL) { g_object_unref (priv->source_list); priv->source_list = NULL; @@ -1662,12 +1662,12 @@ impl_dispose (GObject *object) for (l = priv->views; l; l = l->next) { CalendarComponentView *component_view = l->data; - + g_object_weak_unref (G_OBJECT (component_view->view_control), view_destroyed_cb, calendar_component); } g_list_free (priv->views); priv->views = NULL; - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); g_list_free (priv->notifications); @@ -1681,14 +1681,14 @@ impl_finalize (GObject *object) { CalendarComponentPrivate *priv = CALENDAR_COMPONENT (object)->priv; GList *l; - + for (l = priv->views; l; l = l->next) { CalendarComponentView *component_view = l->data; - + destroy_component_view (component_view); } g_list_free (priv->views); - + g_free (priv->base_directory); g_free (priv->config_directory); g_free (priv); @@ -1719,7 +1719,7 @@ calendar_component_init (CalendarComponent *component) { CalendarComponentPrivate *priv; guint not; - + priv = g_new0 (CalendarComponentPrivate, 1); priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL); @@ -1731,7 +1731,7 @@ calendar_component_init (CalendarComponent *component) * calendar_component_peek_gconf_client(). */ priv->gconf_client = gconf_client_get_default (); - not = calendar_config_add_notification_primary_calendar (config_primary_selection_changed_cb, + not = calendar_config_add_notification_primary_calendar (config_primary_selection_changed_cb, component); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index 46714ec324..e8cc126f5d 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -77,7 +77,7 @@ void calendar_config_remove_notification (guint id) { calendar_config_init (); - + gconf_client_notify_remove (config, id); } @@ -141,9 +141,9 @@ calendar_config_add_notification_calendars_selected (GConfClientNotifyFunc func, guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_SELECTED_CALENDARS, func, data, NULL, NULL); - + return id; } @@ -171,9 +171,9 @@ calendar_config_add_notification_primary_calendar (GConfClientNotifyFunc func, g guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_CALENDAR, func, data, NULL, NULL); - + return id; } @@ -192,7 +192,7 @@ calendar_config_get_timezone (void) static void set_standard_offsets (icalcomponent *zone_comp, int offset) { - icalcomponent *dl_comp, *s_comp; + icalcomponent *dl_comp, *s_comp; icalproperty *offset_from, *offset_to; /* Set the offset of the standard component to all the daylight components also */ @@ -217,19 +217,19 @@ calendar_config_get_icaltimezone (void) icaltimezone *zone = NULL; calendar_config_init (); - + location = calendar_config_get_timezone (); if (location) { icalcomponent *icalcomp, *dl_comp; - + zone = icaltimezone_get_builtin_timezone (location); icalcomp = icaltimezone_get_component (zone); - + if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) { g_free (location); return zone; - } + } if (!calendar_config_get_daylight_saving () && zone) { icalcomponent *zone_comp, *s_comp; @@ -237,7 +237,7 @@ calendar_config_get_icaltimezone (void) icaltimezone *st_zone = NULL; int offset; char *n_tzid, *tzid; - + tzid = icaltimezone_get_tzid (zone); n_tzid = g_strconcat (tzid, "-(Standard)", NULL); @@ -255,10 +255,10 @@ calendar_config_get_icaltimezone (void) if (!s_comp) { g_free (n_tzid); icalcomponent_free (zone_comp); - g_free (location); + g_free (location); return zone; } - + offset_to = icalcomponent_get_first_property (s_comp, ICAL_TZOFFSETTO_PROPERTY); offset = icalproperty_get_tzoffsetto (offset_to); @@ -274,10 +274,10 @@ calendar_config_get_icaltimezone (void) st_zone = icaltimezone_new (); icaltimezone_set_component (st_zone, zone_comp); - + zone = st_zone; g_hash_table_insert (custom_zones, n_tzid, zone); - } + } g_free (location); } @@ -304,9 +304,9 @@ calendar_config_add_notification_timezone (GConfClientNotifyFunc func, gpointer guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_TIMEZONE, func, data, NULL, NULL); - + return id; } @@ -314,16 +314,16 @@ gboolean calendar_config_get_daylight_saving (void) { calendar_config_init (); - + return gconf_client_get_bool (config, CALENDAR_CONFIG_DAYLIGHT_SAVING, NULL); - + } void calendar_config_set_daylight_saving (gboolean daylight_saving) { calendar_config_init (); - + gconf_client_set_bool (config, CALENDAR_CONFIG_DAYLIGHT_SAVING, daylight_saving, NULL); } @@ -333,9 +333,9 @@ calendar_config_add_notification_daylight_saving (GConfClientNotifyFunc func, gp guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAYLIGHT_SAVING, func, data, NULL, NULL); - + return id; } @@ -370,9 +370,9 @@ calendar_config_add_notification_24_hour_format (GConfClientNotifyFunc func, gpo guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_24HOUR, func, data, NULL, NULL); - + return id; } @@ -445,7 +445,7 @@ calendar_config_set_show_status (gboolean state) } /* Show timezone */ -gboolean +gboolean calendar_config_get_show_timezone (void) { calendar_config_init (); @@ -453,22 +453,22 @@ calendar_config_get_show_timezone (void) return gconf_client_get_bool (config, CALENDAR_CONFIG_SHOW_TIMEZONE, NULL); } -void +void calendar_config_set_show_timezone (gboolean status) { calendar_config_init (); - gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_TIMEZONE, status, NULL); + gconf_client_set_bool (config, CALENDAR_CONFIG_SHOW_TIMEZONE, status, NULL); } -gboolean +gboolean calendar_config_get_show_categories (void) { calendar_config_init (); return gconf_client_get_bool (config, CALENDAR_CONFIG_SHOW_CATEGORIES, NULL); } -void +void calendar_config_set_show_categories (gboolean status) { calendar_config_init (); @@ -495,16 +495,16 @@ calendar_config_set_week_start_day (gint week_start_day) gconf_client_set_int (config, CALENDAR_CONFIG_WEEK_START, week_start_day, NULL); } -guint +guint calendar_config_add_notification_week_start_day (GConfClientNotifyFunc func, gpointer data) { guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_WEEK_START, func, data, NULL, NULL); - - return id; + + return id; } /* The start and end times of the work-day. */ @@ -525,16 +525,16 @@ calendar_config_set_day_start_hour (gint day_start_hour) gconf_client_set_int (config, CALENDAR_CONFIG_DAY_START_HOUR, day_start_hour, NULL); } -guint +guint calendar_config_add_notification_day_start_hour (GConfClientNotifyFunc func, gpointer data) { guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_START_HOUR, func, data, NULL, NULL); - - return id; + + return id; } gint @@ -554,16 +554,16 @@ calendar_config_set_day_start_minute (gint day_start_min) gconf_client_set_int (config, CALENDAR_CONFIG_DAY_START_MINUTE, day_start_min, NULL); } -guint +guint calendar_config_add_notification_day_start_minute (GConfClientNotifyFunc func, gpointer data) { guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_START_MINUTE, func, data, NULL, NULL); - - return id; + + return id; } gint @@ -583,16 +583,16 @@ calendar_config_set_day_end_hour (gint day_end_hour) gconf_client_set_int (config, CALENDAR_CONFIG_DAY_END_HOUR, day_end_hour, NULL); } -guint +guint calendar_config_add_notification_day_end_hour (GConfClientNotifyFunc func, gpointer data) { guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_END_HOUR, func, data, NULL, NULL); - - return id; + + return id; } gint @@ -612,16 +612,16 @@ calendar_config_set_day_end_minute (gint day_end_min) gconf_client_set_int (config, CALENDAR_CONFIG_DAY_END_MINUTE, day_end_min, NULL); } -guint +guint calendar_config_add_notification_day_end_minute (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_DAY_END_MINUTE, func, data, NULL, NULL); - - return id; + + return id; } /* The time divisions in the Day/Work-Week view in minutes (5/10/15/30/60). */ @@ -648,9 +648,9 @@ calendar_config_add_notification_time_divisions (GConfClientNotifyFunc func, gpo guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_TIME_DIVISIONS, func, data, NULL, NULL); - + return id; } @@ -704,15 +704,15 @@ calendar_config_set_dnav_show_week_no (gboolean show_week_no) gconf_client_set_bool (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, show_week_no, NULL); } -guint +guint calendar_config_add_notification_dnav_show_week_no (GConfClientNotifyFunc func, gpointer data) { guint id; calendar_config_init (); - + id = gconf_client_notify_add (config, CALENDAR_CONFIG_DN_SHOW_WEEK_NUMBERS, func, data, NULL, NULL); - + return id; } @@ -854,11 +854,11 @@ guint calendar_config_add_notification_tasks_selected (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_TASKS_SELECTED_TASKS, func, data, NULL, NULL); - + return id; } @@ -884,11 +884,11 @@ guint calendar_config_add_notification_primary_tasks (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_TASKS, func, data, NULL, NULL); - + return id; } @@ -932,11 +932,11 @@ guint calendar_config_add_notification_memos_selected (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_MEMOS_SELECTED_MEMOS, func, data, NULL, NULL); - + return id; } @@ -962,11 +962,11 @@ guint calendar_config_add_notification_primary_memos (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_PRIMARY_MEMOS, func, data, NULL, NULL); - + return id; } /***************************************/ @@ -993,11 +993,11 @@ guint calendar_config_add_notification_compress_weekend (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_COMPRESS_WEEKEND, func, data, NULL, NULL); - + return id; } @@ -1023,11 +1023,11 @@ guint calendar_config_add_notification_show_event_end (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_SHOW_EVENT_END, func, data, NULL, NULL); - + return id; } @@ -1049,16 +1049,16 @@ calendar_config_set_working_days (CalWeekdays days) gconf_client_set_int (config, CALENDAR_CONFIG_WORKING_DAYS, days, NULL); } -guint +guint calendar_config_add_notification_working_days (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_WORKING_DAYS , func, data, NULL, NULL); - - return id; + + return id; } /* Settings to hide completed tasks. */ @@ -1079,16 +1079,16 @@ calendar_config_set_hide_completed_tasks (gboolean hide) gconf_client_set_bool (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED, hide, NULL); } -guint +guint calendar_config_add_notification_hide_completed_tasks (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED , func, data, NULL, NULL); - - return id; + + return id; } CalUnits @@ -1137,16 +1137,16 @@ calendar_config_set_hide_completed_tasks_units (CalUnits cu) g_free (units); } -guint +guint calendar_config_add_notification_hide_completed_tasks_units (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_UNITS , func, data, NULL, NULL); - - return id; + + return id; } gint @@ -1166,16 +1166,16 @@ calendar_config_set_hide_completed_tasks_value (gint value) gconf_client_set_int (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_VALUE, value, NULL); } -guint +guint calendar_config_add_notification_hide_completed_tasks_value (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); id = gconf_client_notify_add (config, CALENDAR_CONFIG_TASKS_HIDE_COMPLETED_VALUE , func, data, NULL, NULL); - - return id; + + return id; } /** @@ -1514,7 +1514,7 @@ calendar_config_set_default_reminder_units (CalUnits units) /** * calendar_config_get_hide_completed_tasks_sexp: * - * @get_completed: Whether to form subexpression that + * @get_completed: Whether to form subexpression that * gets completed or not completed tasks. * Returns the subexpression to use to filter out completed tasks according * to the config settings. The returned sexp should be freed. @@ -1594,18 +1594,18 @@ calendar_config_set_free_busy_template (const gchar *template) gconf_client_set_string (config, CALENDAR_CONFIG_TEMPLATE, template, NULL); } -guint -calendar_config_add_notification_free_busy_template (GConfClientNotifyFunc func, +guint +calendar_config_add_notification_free_busy_template (GConfClientNotifyFunc func, gpointer data) { guint id; - + calendar_config_init (); - id = gconf_client_notify_add (config, CALENDAR_CONFIG_TEMPLATE, func, data, + id = gconf_client_notify_add (config, CALENDAR_CONFIG_TEMPLATE, func, data, NULL, NULL); - - return id; + + return id; } void diff --git a/calendar/gui/calendar-config.h b/calendar/gui/calendar-config.h index ec7d3dee16..5e0dbc9059 100644 --- a/calendar/gui/calendar-config.h +++ b/calendar/gui/calendar-config.h @@ -246,7 +246,7 @@ void calendar_config_set_free_busy (GSList * url_list); gchar *calendar_config_get_free_busy_template (void); void calendar_config_set_free_busy_template (const gchar *template); -guint calendar_config_add_notification_free_busy_template (GConfClientNotifyFunc func, +guint calendar_config_add_notification_free_busy_template (GConfClientNotifyFunc func, gpointer data); /* Shows the timezone dialog if the user hasn't set a default timezone. */ diff --git a/calendar/gui/calendar-view-factory.c b/calendar/gui/calendar-view-factory.c index 563803ae5d..262fe3dd00 100644 --- a/calendar/gui/calendar-view-factory.c +++ b/calendar/gui/calendar-view-factory.c @@ -171,10 +171,10 @@ calendar_view_factory_new_view (GalViewFactory *factory, const char *name) * calendar_view_factory_construct: * @cal_view_factory: A calendar view factory. * @view_type: Type of calendar views that the factory will create. - * + * * Constructs a calendar view factory by setting the type of views it will * create. - * + * * Return value: The same value as @cal_view_factory. **/ CalendarViewFactory * @@ -196,9 +196,9 @@ calendar_view_factory_construct (CalendarViewFactory *cal_view_factory, /** * calendar_view_factory_new: * @view_type: Type of calendar views that the factory will create. - * + * * Creates a new factory for calendar views. - * + * * Return value: A newly-created calendar view factory. **/ CalendarViewFactory * diff --git a/calendar/gui/calendar-view.c b/calendar/gui/calendar-view.c index e75a81052b..ea59c70fd1 100644 --- a/calendar/gui/calendar-view.c +++ b/calendar/gui/calendar-view.c @@ -207,9 +207,9 @@ calendar_view_clone (GalView *view) * @cal_view: A calendar view. * @view_type: The type of calendar view that this object will represent. * @title: Title for the view. - * + * * Constructs a calendar view by setting its view type and title. - * + * * Return value: The same value as @cal_view. **/ CalendarView * @@ -235,9 +235,9 @@ calendar_view_construct (CalendarView *cal_view, * calendar_view_new: * @view_type: The type of calendar view that this object will represent. * @title: Title for the view. - * + * * Creates a new calendar view object. - * + * * Return value: A newly-created calendar view. **/ CalendarView * @@ -252,9 +252,9 @@ calendar_view_new (GnomeCalendarViewType view_type, const char *title) /** * calendar_view_get_view_type: * @cal_view: A calendar view. - * + * * Queries the calendar view type of a calendar view. - * + * * Return value: Type of calendar view. **/ GnomeCalendarViewType diff --git a/calendar/gui/comp-editor-factory.c b/calendar/gui/comp-editor-factory.c index dd508987d4..a7f6a3b493 100644 --- a/calendar/gui/comp-editor-factory.c +++ b/calendar/gui/comp-editor-factory.c @@ -71,7 +71,7 @@ typedef struct { /* Client of the calendar */ ECal *client; - + /* Count editors using this client */ int editor_count; @@ -245,16 +245,16 @@ edit_existing (OpenClient *oc, const char *uid) return; } - + comp = e_cal_component_new (); if (!e_cal_component_set_icalcomponent (comp, icalcomp)) { g_object_unref (comp); icalcomponent_free (icalcomp); return; } - + /* Create the appropriate type of editor */ - + vtype = e_cal_component_get_vtype (comp); if (itip_organizer_is_user (comp, oc->client)) flags |= COMP_EDITOR_USER_ORG; @@ -264,7 +264,7 @@ edit_existing (OpenClient *oc, const char *uid) case E_CAL_COMPONENT_EVENT: if (e_cal_component_has_attendees (comp)) flags |= COMP_EDITOR_MEETING; - + editor = COMP_EDITOR (event_editor_new (oc->client, flags)); break; @@ -292,7 +292,7 @@ static ECalComponent * get_default_task (ECal *client) { ECalComponent *comp; - + comp = cal_comp_task_new_with_defaults (client); return comp; @@ -304,7 +304,7 @@ edit_new (OpenClient *oc, const GNOME_Evolution_Calendar_CompEditorFactory_CompE { ECalComponent *comp; CompEditor *editor; - + switch (type) { case GNOME_Evolution_Calendar_CompEditorFactory_EDITOR_MODE_EVENT: editor = COMP_EDITOR (event_editor_new (oc->client, FALSE)); @@ -540,7 +540,7 @@ impl_editExisting (PortableServer_Servant servant, OpenClient *oc; CompEditor *editor; ECalSourceType source_type; - + factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant)); switch (corba_type) { @@ -550,7 +550,7 @@ impl_editExisting (PortableServer_Servant servant, default: source_type = E_CAL_SOURCE_TYPE_EVENT; } - + oc = lookup_open_client (factory, source_type, str_uri, ev); if (!oc) return; @@ -594,7 +594,7 @@ impl_editNew (PortableServer_Servant servant, CompEditorFactory *factory; OpenClient *oc; ECalSourceType source_type; - + factory = COMP_EDITOR_FACTORY (bonobo_object_from_servant (servant)); switch (corba_type) { @@ -619,9 +619,9 @@ impl_editNew (PortableServer_Servant servant, /** * comp_editor_factory_new: - * + * * Creates a new calendar component editor factory. - * + * * Return value: A newly-created component editor factory. **/ CompEditorFactory * diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index 0be96dbefa..07d06a8f19 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -37,7 +37,7 @@ * cal_comp_util_add_exdate: * @comp: A calendar component object. * @itt: Time for the exception. - * + * * Adds an exception date to the current list of EXDATE properties in a calendar * component object. **/ @@ -85,7 +85,7 @@ e_cal_component_compare_tzid (const char *tzid1, const char *tzid2) * cal_comp_util_compare_event_timezones: * @comp: A calendar component object. * @client: A #ECal. - * + * * Checks if the component uses the given timezone for both the start and * the end time, or if the UTC offsets of the start and end times are the same * as in the given zone. @@ -191,14 +191,14 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, * @comp: A calendar component. * @client: Calendar client where the component purportedly lives. * @widget: Widget to be used as the basis for UTF8 conversion. - * + * * Assumming a calendar component with an empty SUMMARY property (as per * string_is_empty()), asks whether the user wants to delete it based on * whether the appointment is on the calendar server or not. If the * component is on the server, this function will present a confirmation * dialog and delete the component if the user tells it to. If the component * is not on the server it will just return TRUE. - * + * * Return value: A result code indicating whether the component * was not on the server and is to be deleted locally, whether it * was on the server and the user deleted it, or whether the @@ -223,7 +223,7 @@ cal_comp_is_on_server (ECalComponent *comp, ECal *client) * the user. */ e_cal_component_get_uid (comp, &uid); - + /*TODO We should not be checking for this here. But since e_cal_util_construct_instance does not create the instances of all day events, so we dafault to old behaviour */ if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) { @@ -246,10 +246,10 @@ cal_comp_is_on_server (ECalComponent *comp, ECal *client) /** * cal_comp_event_new_with_defaults: - * + * * Creates a new VEVENT component and adds any default alarms to it as set in * the program's configuration values. - * + * * Return value: A newly-created calendar component. **/ ECalComponent * @@ -272,7 +272,7 @@ cal_comp_event_new_with_defaults (ECal *client) e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT); } - + if (!calendar_config_get_use_default_reminder ()) return comp; @@ -303,11 +303,11 @@ cal_comp_event_new_with_defaults (ECal *client) trigger.u.rel_duration.minutes = interval; break; - case CAL_HOURS: + case CAL_HOURS: trigger.u.rel_duration.hours = interval; break; - case CAL_DAYS: + case CAL_DAYS: trigger.u.rel_duration.days = interval; break; @@ -324,7 +324,7 @@ cal_comp_event_new_with_defaults (ECal *client) } ECalComponent * -cal_comp_event_new_with_current_time (ECal *client, gboolean all_day) +cal_comp_event_new_with_current_time (ECal *client, gboolean all_day) { ECalComponent *comp; struct icaltimetype itt; @@ -334,23 +334,23 @@ cal_comp_event_new_with_current_time (ECal *client, gboolean all_day) comp = cal_comp_event_new_with_defaults (client); g_return_val_if_fail (comp, NULL); - + zone = calendar_config_get_icaltimezone (); if (all_day) { itt = icaltime_from_timet_with_zone (time (NULL), 1, zone); dt.value = &itt; dt.tzid = icaltimezone_get_tzid (zone); - + e_cal_component_set_dtstart (comp, &dt); - e_cal_component_set_dtend (comp, &dt); + e_cal_component_set_dtend (comp, &dt); } else { itt = icaltime_current_time_with_zone (zone); icaltime_adjust (&itt, 0, 1, -itt.minute, -itt.second); - + dt.value = &itt; dt.tzid = icaltimezone_get_tzid (zone); - + e_cal_component_set_dtstart (comp, &dt); icaltime_adjust (&itt, 0, 1, 0, 0); e_cal_component_set_dtend (comp, &dt); @@ -367,7 +367,7 @@ cal_comp_task_new_with_defaults (ECal *client) if (!e_cal_get_default_object (client, &icalcomp, NULL)) icalcomp = icalcomponent_new (ICAL_VTODO_COMPONENT); - + comp = e_cal_component_new (); if (!e_cal_component_set_icalcomponent (comp, icalcomp)) { icalcomponent_free (icalcomp); @@ -386,7 +386,7 @@ cal_comp_memo_new_with_defaults (ECal *client) if (!e_cal_get_default_object (client, &icalcomp, NULL)) icalcomp = icalcomponent_new (ICAL_VJOURNAL_COMPONENT); - + comp = e_cal_component_new (); if (!e_cal_component_set_icalcomponent (comp, icalcomp)) { icalcomponent_free (icalcomp); @@ -400,7 +400,7 @@ cal_comp_memo_new_with_defaults (ECal *client) /** * cal_comp_util_get_n_icons: * @comp: A calendar component object. - * + * * Get the number of icons owned by the component. * * Returns: the number of icons owned by the component. diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index 342f8be472..7267c29380 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -71,7 +71,7 @@ typedef struct { /* The client */ ECal *ecal; - + /* Toplevel */ GtkWidget *toplevel; @@ -89,7 +89,7 @@ typedef struct { GtkWidget *repeat_unit; GtkWidget *option_notebook; - + /* Display alarm widgets */ GtkWidget *dalarm_group; GtkWidget *dalarm_message; @@ -212,7 +212,7 @@ alarm_to_dialog (Dialog *dialog) gboolean repeat; ECalComponentAlarmAction action; char *email; - int i; + int i; /* Clean the page */ clear_widgets (dialog); @@ -232,7 +232,7 @@ alarm_to_dialog (Dialog *dialog) && e_cal_get_alarm_email_address (dialog->ecal, &email, NULL)) { ECalComponentAttendee *a; GSList attendee_list; - + a = g_new0 (ECalComponentAttendee, 1); a->value = email; attendee_list.data = a; @@ -429,7 +429,7 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) icalcomponent *icalcomp; icalproperty *icalprop; GList *l; - + /* Attendees */ name_selector_model = e_name_selector_peek_model (dialog->name_selector); e_name_selector_model_peek_section (name_selector_model, section_name, NULL, &destination_store); @@ -440,7 +440,7 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) ECalComponentAttendee *a; dest = l->data; - + a = g_new0 (ECalComponentAttendee, 1); a->value = e_destination_get_email (dest); a->cn = e_destination_get_name (dest); @@ -455,7 +455,7 @@ malarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (dialog->malarm_message))) return; - + /* Description */ text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->malarm_description)); gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start); @@ -574,11 +574,11 @@ palarm_widgets_to_alarm (Dialog *dialog, ECalComponentAlarm *alarm) description.value = str; description.altrep = NULL; - + e_cal_component_alarm_set_description (alarm, &description); g_free (str); - + /* remove the X-EVOLUTION-NEEDS-DESCRIPTION property, so that * we don't re-set the alarm's description */ icalcomp = e_cal_component_alarm_get_icalcomponent (alarm); @@ -621,7 +621,7 @@ populate_widgets_from_alarm (Dialog *dialog) e_dialog_option_menu_set (dialog->time, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START, time_map); break; - case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END: + case E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END: e_dialog_option_menu_set (dialog->time, E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_END, time_map); break; default: @@ -790,7 +790,7 @@ get_widgets (Dialog *dialog) dialog->malarm_addressbook = GW ("malarm-addressbook"); dialog->malarm_message = GW ("malarm-message"); dialog->malarm_description = GW ("malarm-description"); - + dialog->palarm_group = GW ("palarm-group"); dialog->palarm_program = GW ("palarm-program"); dialog->palarm_args = GW ("palarm-args"); @@ -821,7 +821,7 @@ get_widgets (Dialog *dialog) && dialog->malarm_description && dialog->palarm_group && dialog->palarm_program - && dialog->palarm_args); + && dialog->palarm_args); } #if 0 @@ -910,7 +910,7 @@ check_custom_sound (Dialog *dialog) { char *str, *dir; gboolean sens; - + str = gtk_file_chooser_get_filename ( GTK_FILE_CHOOSER (dialog->aalarm_file_chooser)); @@ -943,7 +943,7 @@ static void aalarm_attach_changed_cb (GtkWidget *widget, gpointer data) { Dialog *dialog = data; - + check_custom_sound (dialog); } @@ -954,7 +954,7 @@ check_custom_message (Dialog *dialog) GtkTextBuffer *text_buffer; GtkTextIter text_iter_start, text_iter_end; gboolean sens; - + text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (dialog->dalarm_description)); gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start); gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end); @@ -982,7 +982,7 @@ static void dalarm_description_changed_cb (GtkWidget *widget, gpointer data) { Dialog *dialog = data; - + check_custom_message (dialog); } @@ -991,7 +991,7 @@ check_custom_program (Dialog *dialog) { char *str; gboolean sens; - + str = e_dialog_editable_get (dialog->palarm_program); sens = str && *str; @@ -1002,7 +1002,7 @@ static void palarm_program_changed_cb (GtkWidget *widget, gpointer data) { Dialog *dialog = data; - + check_custom_program (dialog); } @@ -1037,7 +1037,7 @@ malarm_addresses_changed_cb (GtkWidget *editable, gpointer data) { Dialog *dialog = data; - + check_custom_email (dialog); } @@ -1057,7 +1057,7 @@ static void malarm_description_changed_cb (GtkWidget *widget, gpointer data) { Dialog *dialog = data; - + check_custom_email (dialog); } @@ -1068,7 +1068,7 @@ action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) char *dir; ECalComponentAlarmAction action; int page = 0, i; - + action = e_dialog_option_menu_get (dialog->action, action_map); for (i = 0; action_map[i] != -1 ; i++) { if (action == action_map[i]) { @@ -1076,11 +1076,11 @@ action_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) break; } } - + gtk_notebook_set_current_page ( GTK_NOTEBOOK (dialog->option_notebook), page); - switch (action) { + switch (action) { case E_CAL_COMPONENT_ALARM_AUDIO: dir = calendar_config_get_dir_path (); if ( dir && *dir ) @@ -1114,7 +1114,7 @@ init_widgets (Dialog *dialog) { GtkWidget *menu; GtkTextBuffer *text_buffer; - + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dialog->action)); g_signal_connect (menu, "selection_done", G_CALLBACK (action_selection_done_cb), @@ -1158,12 +1158,12 @@ alarm_dialog_run (GtkWidget *parent, ECal *ecal, ECalComponentAlarm *alarm) int response_id; GList *icon_list; char *gladefile; - + g_return_val_if_fail (alarm != NULL, FALSE); dialog.alarm = alarm; dialog.ecal = ecal; - + gladefile = g_build_filename (EVOLUTION_GLADEDIR, "alarm-dialog.glade", NULL); @@ -1201,7 +1201,7 @@ alarm_dialog_run (GtkWidget *parent, ECal *ecal, ECalComponentAlarm *alarm) gtk_window_set_transient_for (GTK_WINDOW (dialog.toplevel), GTK_WINDOW (parent)); - + response_id = gtk_dialog_run (GTK_DIALOG (dialog.toplevel)); if (response_id == GTK_RESPONSE_OK) diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c index de59361519..4b2be10d48 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.c +++ b/calendar/gui/dialogs/alarm-list-dialog.c @@ -59,7 +59,7 @@ typedef struct { /* The list store */ EAlarmList *list_store; - + /* Toplevel */ GtkWidget *toplevel; @@ -68,7 +68,7 @@ typedef struct { GtkWidget *edit; GtkWidget *delete; GtkWidget *box; - + } Dialog; /* Gets the widgets from the XML file and returns TRUE if they are all available. */ @@ -83,7 +83,7 @@ get_widgets (Dialog *dialog) dialog->box = GW ("vbox53"); dialog->list = GW ("list"); - dialog->add = GW ("add"); + dialog->add = GW ("add"); dialog->edit = GW ("edit"); dialog->delete = GW ("delete"); @@ -130,7 +130,7 @@ add_clicked_cb (GtkButton *button, gpointer data) GtkTreeIter iter; icalcomponent *icalcomp; icalproperty *icalprop; - + view = GTK_TREE_VIEW (dialog->list); alarm = e_cal_component_alarm_new (); @@ -139,7 +139,7 @@ add_clicked_cb (GtkButton *button, gpointer data) icalprop = icalproperty_new_x ("1"); icalproperty_set_x_name (icalprop, "X-EVOLUTION-NEEDS-DESCRIPTION"); icalcomponent_add_property (icalcomp, icalprop); - + if (alarm_dialog_run (dialog->toplevel, dialog->ecal, alarm)) { e_alarm_list_append (dialog->list_store, &iter, alarm); gtk_tree_selection_select_iter (gtk_tree_view_get_selection (view), &iter); @@ -271,9 +271,9 @@ alarm_list_dialog_run (GtkWidget *parent, ECal *ecal, EAlarmList *list_store) int response_id; GList *icon_list; char *gladefile; - + dialog.ecal = ecal; - dialog.list_store = list_store; + dialog.list_store = list_store; gladefile = g_build_filename (EVOLUTION_GLADEDIR, "alarm-list-dialog.glade", @@ -294,7 +294,7 @@ alarm_list_dialog_run (GtkWidget *parent, ECal *ecal, EAlarmList *list_store) init_widgets (&dialog); sensitize_buttons (&dialog); - + gtk_widget_ensure_style (dialog.toplevel); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->vbox), 0); gtk_container_set_border_width (GTK_CONTAINER (GTK_DIALOG (dialog.toplevel)->action_area), 12); @@ -323,10 +323,10 @@ alarm_list_dialog_peek (ECal *ecal, EAlarmList *list_store) { Dialog *dialog; char *gladefile; - + dialog = (Dialog *)g_new (Dialog, 1); dialog->ecal = ecal; - dialog->list_store = list_store; + dialog->list_store = list_store; gladefile = g_build_filename (EVOLUTION_GLADEDIR, "alarm-list-dialog.glade", @@ -347,7 +347,7 @@ alarm_list_dialog_peek (ECal *ecal, EAlarmList *list_store) init_widgets (dialog); sensitize_buttons (dialog); - + g_object_unref (dialog->xml); /* Free the other stuff when the parent really gets destroyed. */ diff --git a/calendar/gui/dialogs/cal-attachment-select-file.c b/calendar/gui/dialogs/cal-attachment-select-file.c index aa57f95dc7..c8f5e89057 100644 --- a/calendar/gui/dialogs/cal-attachment-select-file.c +++ b/calendar/gui/dialogs/cal-attachment-select-file.c @@ -58,9 +58,9 @@ run_selector(CompEditor *editor, const char *title, guint32 flags, gboolean *sho GtkWidget *showinline = NULL; char *path; GList *icon_list; - + path = g_object_get_data ((GObject *) editor, "attach_path"); - + if (flags & SELECTOR_MODE_SAVE) selection = gtk_file_chooser_dialog_new (title, NULL, @@ -75,49 +75,49 @@ run_selector(CompEditor *editor, const char *title, guint32 flags, gboolean *sho GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, GTK_STOCK_OPEN, GTK_RESPONSE_OK, NULL); - + gtk_dialog_set_default_response (GTK_DIALOG (selection), GTK_RESPONSE_OK); gtk_file_chooser_set_local_only (GTK_FILE_CHOOSER (selection), FALSE); - + if ((flags & SELECTOR_MODE_SAVE) == 0) gtk_file_chooser_set_select_multiple ((GtkFileChooser *) selection, (flags & SELECTOR_MODE_MULTI)); - + /* restore last path used */ if (!path) gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (selection), g_get_home_dir ()); else gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (selection), path); - + if (showinline_p) { showinline = gtk_check_button_new_with_mnemonic (_("_Suggest automatic display of attachment")); gtk_widget_show (showinline); gtk_file_chooser_set_extra_widget (GTK_FILE_CHOOSER (selection), showinline); } - + gtk_window_set_transient_for ((GtkWindow *) selection, (GtkWindow *) editor); gtk_window_set_wmclass ((GtkWindow *) selection, "fileselection", "Evolution:editor"); gtk_window_set_modal ((GtkWindow *) selection, TRUE); - + icon_list = e_icon_factory_get_icon_list ("mail-message-new"); if (icon_list) { gtk_window_set_icon_list (GTK_WINDOW (selection), icon_list); g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); g_list_free (icon_list); } - + if (gtk_dialog_run ((GtkDialog *) selection) == GTK_RESPONSE_OK) { if (showinline_p) *showinline_p = gtk_toggle_button_get_active ((GtkToggleButton *) showinline); - + path = g_path_get_dirname (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selection))); - + g_object_set_data_full ((GObject *) editor, "attach_path", g_strdup_printf ("%s/", path), g_free); g_free (path); } else { gtk_widget_destroy (selection); selection = NULL; } - + return selection; } @@ -139,7 +139,7 @@ comp_editor_select_file (CompEditor *editor, const char *title, gboolean save_mo guint32 flags = save_mode ? SELECTOR_MODE_SAVE : SELECTOR_MODE_MULTI; GtkWidget *selection; char *name = NULL; - + selection = run_selector (editor, title, flags, NULL); if (selection) { name = g_strdup (gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (selection))); @@ -154,15 +154,15 @@ comp_editor_select_file_attachments (CompEditor *editor, gboolean *showinline_p) { GtkWidget *selection; GPtrArray *list = NULL; - + selection = run_selector (editor, _("Attach file(s)"), SELECTOR_MODE_MULTI, showinline_p); - + if (selection) { GSList *l, *n; - + if ((l = gtk_file_chooser_get_uris (GTK_FILE_CHOOSER (selection)))) { list = g_ptr_array_new (); - + while (l) { n = l->next; g_ptr_array_add (list, l->data); @@ -170,10 +170,10 @@ comp_editor_select_file_attachments (CompEditor *editor, gboolean *showinline_p) l = n; } } - + gtk_widget_destroy (selection); } - + return list; } diff --git a/calendar/gui/dialogs/cal-prefs-dialog.c b/calendar/gui/dialogs/cal-prefs-dialog.c index afea9a8df2..a916359b2b 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.c +++ b/calendar/gui/dialogs/cal-prefs-dialog.c @@ -124,11 +124,11 @@ timezone_changed (GtkWidget *widget, CalendarPrefsDialog *prefs) zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (prefs->timezone)); icalcomp = icaltimezone_get_component (zone); - if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) + if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, FALSE); - else + else gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, TRUE); - + calendar_config_set_timezone (icaltimezone_get_location (zone)); } @@ -334,7 +334,7 @@ alarms_selection_changed (ESourceSelector *selector, CalendarPrefsDialog *prefs) alarm = e_source_get_property (source, "alarm"); if (alarm && !g_ascii_strcasecmp (alarm, "never")) continue; - + g_message ("Unsetting for %s", e_source_peek_name (source)); e_source_set_property (source, "alarm", "false"); } @@ -356,7 +356,7 @@ alarms_selection_changed (ESourceSelector *selector, CalendarPrefsDialog *prefs) e_source_selector_free_selection (selection); /* FIXME show an error if this fails? */ - e_source_list_sync (source_list, NULL); + e_source_list_sync (source_list, NULL); } static void @@ -406,7 +406,7 @@ setup_changes (CalendarPrefsDialog *prefs) g_signal_connect (G_OBJECT (prefs->default_reminder_units), "changed", G_CALLBACK (default_reminder_units_changed), prefs); g_signal_connect (G_OBJECT (prefs->alarm_list_widget), "selection_changed", G_CALLBACK (alarms_selection_changed), prefs); - + g_signal_connect (G_OBJECT (prefs->template_url), "changed", G_CALLBACK (template_url_changed), prefs); } @@ -506,14 +506,14 @@ show_config (CalendarPrefsDialog *prefs) g_free (location); icalcomp = icaltimezone_get_component (zone); - if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) + if (!(dl_comp = icalcomponent_get_first_component (icalcomp, ICAL_XDAYLIGHT_COMPONENT))) gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, FALSE); - else + else gtk_widget_set_sensitive ((GtkWidget *) prefs->daylight_saving, TRUE); - + set = calendar_config_get_daylight_saving (); gtk_toggle_button_set_active ((GtkToggleButton *) prefs->daylight_saving, set); - + /* Working Days. */ working_days = calendar_config_get_working_days (); mask = 1 << 0; @@ -665,7 +665,7 @@ calendar_prefs_dialog_construct (CalendarPrefsDialog *prefs) /* Alarms tab */ prefs->scrolled_window = glade_xml_get_widget (gui, "calendar-source-scrolled-window"); - + /* Free/Busy tab */ prefs->template_url = glade_xml_get_widget (gui, "template_url"); target = e_cal_config_target_new_prefs (ec, prefs->gconf); diff --git a/calendar/gui/dialogs/cal-prefs-dialog.h b/calendar/gui/dialogs/cal-prefs-dialog.h index d6f84aae4d..d0df6e4a12 100644 --- a/calendar/gui/dialogs/cal-prefs-dialog.h +++ b/calendar/gui/dialogs/cal-prefs-dialog.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * David Trowbridge <trowbrds cs colorado edu> * Damon Chaplin <damon@ximian.com> * * Copyright (C) 2005 Novell, Inc. (www.novell.com) * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/dialogs/calendar-setup.c b/calendar/gui/dialogs/calendar-setup.c index a7b2e15b80..3f6bcf4e45 100644 --- a/calendar/gui/dialogs/calendar-setup.c +++ b/calendar/gui/dialogs/calendar-setup.c @@ -243,15 +243,15 @@ eccp_get_source_name (EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, return entry; } -static void +static void offline_status_changed_cb (GtkWidget *widget, CalendarSourceDialog *sdialog) { - + if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget))) e_source_set_property (sdialog->source, "offline_sync", "1"); - else - e_source_set_property (sdialog->source, "offline_sync", "0"); - + else + e_source_set_property (sdialog->source, "offline_sync", "0"); + } static GtkWidget * @@ -268,9 +268,9 @@ eccp_general_offline (EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, else { row = ((GtkTable*)parent)->nrows; - if (sdialog->source_type == E_CAL_SOURCE_TYPE_EVENT) + if (sdialog->source_type == E_CAL_SOURCE_TYPE_EVENT) offline_setting = gtk_check_button_new_with_mnemonic (_("Cop_y calendar contents locally for offline operation")); - else if (sdialog->source_type == E_CAL_SOURCE_TYPE_TODO) + else if (sdialog->source_type == E_CAL_SOURCE_TYPE_TODO) offline_setting = gtk_check_button_new_with_mnemonic (_("Cop_y task list contents locally for offline operation")); else if(sdialog->source_type == E_CAL_SOURCE_TYPE_JOURNAL) offline_setting = gtk_check_button_new_with_mnemonic (_("Cop_y memo list contents locally for offline operation")); @@ -280,7 +280,7 @@ eccp_general_offline (EConfig *ec, EConfigItem *item, struct _GtkWidget *parent, gtk_table_attach (GTK_TABLE (parent), offline_setting, 1, 2, row, row+1, GTK_EXPAND | GTK_FILL, 0, 0, 0); } - + gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (offline_setting), (offline_sync && g_str_equal (offline_sync, "1")) ? TRUE : FALSE); if (is_local) gtk_widget_hide (offline_setting); @@ -397,7 +397,7 @@ static ECalConfigItem ecmp_items[] = { { 0 }, }; -/** +/** * cs_load_sources: * @sdialog: dialog where to load sources list * @conf_key: configuration key where to get sources' list @@ -463,7 +463,7 @@ calendar_setup_edit_calendar (struct _GtkWindow *parent, ESource *source, ESourc e_source_set_absolute_uri (sdialog->source, NULL); e_source_set_group (sdialog->source, sdialog->source_group); - sdialog->source_type = E_CAL_SOURCE_TYPE_EVENT; + sdialog->source_type = E_CAL_SOURCE_TYPE_EVENT; sdialog->config = ec = e_cal_config_new (E_CONFIG_BOOK, "org.gnome.evolution.calendar.calendarProperties"); for (i = 0; eccp_items[i].path; i++) items = g_slist_prepend (items, &eccp_items[i]); @@ -478,7 +478,7 @@ calendar_setup_edit_calendar (struct _GtkWindow *parent, ESource *source, ESourc sdialog->window = e_config_create_window ((EConfig *)ec, NULL, _("Calendar Properties")); else sdialog->window = e_config_create_window ((EConfig *)ec, NULL, _("New Calendar")); - + /* forces initial validation */ if (!sdialog->original_source) e_config_target_changed ((EConfig *)ec, E_CONFIG_TARGET_CHANGED_STATE); diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c index ffecf671c8..93dfc1d4b1 100644 --- a/calendar/gui/dialogs/cancel-comp.c +++ b/calendar/gui/dialogs/cancel-comp.c @@ -33,7 +33,7 @@ /* is_past_event: - * + * * returns TRUE if @comp is in the past, FALSE otherwise. * Comparision is based only on date part, time part is ignored. */ @@ -56,10 +56,10 @@ is_past_event (ECalComponent *comp) /** * cancel_component_dialog: - * + * * Pops up a dialog box asking the user whether he wants to send a * cancel and delete an iTip/iMip message - * + * * Return value: TRUE if the user clicked Yes, FALSE otherwise. **/ gboolean @@ -67,12 +67,12 @@ cancel_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, g { ECalComponentVType vtype; const char *id; - + if (deleting && e_cal_get_save_schedules (client)) return TRUE; - + vtype = e_cal_component_get_vtype (comp); - + switch (vtype) { case E_CAL_COMPONENT_EVENT: if (is_past_event (comp)) { @@ -103,7 +103,7 @@ cancel_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, g g_message (G_STRLOC ": Cannot handle object of type %d", vtype); return FALSE; } - + if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES) return TRUE; else diff --git a/calendar/gui/dialogs/changed-comp.c b/calendar/gui/dialogs/changed-comp.c index 6afae1a6b3..bfc89604e3 100644 --- a/calendar/gui/dialogs/changed-comp.c +++ b/calendar/gui/dialogs/changed-comp.c @@ -37,10 +37,10 @@ * @comp: A calendar component * @deleted: Whether the object is being deleted or updated * @changed: Whether or not the user has made changes - * + * * Pops up a dialog box asking the user whether changes made (if any) * should be thrown away because the item has been updated elsewhere - * + * * Return value: TRUE if the user clicked Yes, FALSE otherwise. **/ gboolean @@ -51,7 +51,7 @@ changed_component_dialog (GtkWindow *parent, ECalComponent *comp, gboolean delet char *str; gint response; GList *icon_list; - + vtype = e_cal_component_get_vtype (comp); if (deleted) { @@ -76,7 +76,7 @@ changed_component_dialog (GtkWindow *parent, ECalComponent *comp, gboolean delet if (changed) str = g_strdup_printf (_("%s You have made changes. Forget those changes and close the editor?"), str); else - str = g_strdup_printf (_("%s You have made no changes, close the editor?"), str); + str = g_strdup_printf (_("%s You have made no changes, close the editor?"), str); } else { switch (vtype) { @@ -100,20 +100,20 @@ changed_component_dialog (GtkWindow *parent, ECalComponent *comp, gboolean delet if (changed) str = g_strdup_printf (_("%s You have made changes. Forget those changes and update the editor?"), str); else - str = g_strdup_printf (_("%s You have made no changes, update the editor?"), str); + str = g_strdup_printf (_("%s You have made no changes, update the editor?"), str); } - + dialog = gtk_message_dialog_new (parent, GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_YES_NO, str); - + icon_list = e_icon_factory_get_icon_list ("stock_calendar"); if (icon_list) { gtk_window_set_icon_list (GTK_WINDOW (dialog), icon_list); g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); g_list_free (icon_list); } - + response = gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 897764dfa8..174f7eb50d 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -58,10 +58,10 @@ static guint comp_editor_page_signals[LAST_SIGNAL]; /** * comp_editor_page_get_type: - * + * * Registers the #CompEditorPage class if necessary, and returns the type ID * associated to it. - * + * * Return value: The type ID of the #CompEditorPage class. **/ GtkType @@ -143,23 +143,23 @@ comp_editor_page_class_init (CompEditorPageClass *class) NULL, NULL, g_cclosure_marshal_VOID__OBJECT, G_TYPE_NONE, 1, G_TYPE_OBJECT); - comp_editor_page_signals[FOCUS_IN] = + comp_editor_page_signals[FOCUS_IN] = g_signal_new ("focus_in", G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (CompEditorPageClass, focus_in), NULL, NULL, g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - comp_editor_page_signals[FOCUS_OUT] = + G_TYPE_NONE, 1, G_TYPE_POINTER); + comp_editor_page_signals[FOCUS_OUT] = g_signal_new ("focus_out", G_TYPE_FROM_CLASS (class), G_SIGNAL_RUN_FIRST, G_STRUCT_OFFSET (CompEditorPageClass, focus_out), NULL, NULL, g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - + G_TYPE_NONE, 1, G_TYPE_POINTER); + class->changed = NULL; class->summary_changed = NULL; class->dates_changed = NULL; @@ -213,9 +213,9 @@ comp_editor_page_destroy (GtkObject *object) /** * comp_editor_page_get_widget: * @page: An editor page. - * + * * Queries the main widget of an editor page. - * + * * Return value: The widget that is the page's upper container. It should * normally be inserted in a notebook widget. **/ @@ -232,7 +232,7 @@ comp_editor_page_get_widget (CompEditorPage *page) /** * comp_editor_page_focus_main_widget: * @page: An editor page. - * + * * Makes an editor page focus its main widget. This is used by the component * editor when it first pops up so that it can focus the main widget in the * first page. @@ -251,7 +251,7 @@ comp_editor_page_focus_main_widget (CompEditorPage *page) * comp_editor_page_fill_widgets: * @page: An editor page. * @comp: A calendar component. - * + * * Fills the widgets of an editor page with the data from a calendar component. **/ gboolean @@ -268,7 +268,7 @@ comp_editor_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) * comp_editor_page_fill_component: * @page: An editor page. * @comp: A calendar component. - * + * * Takes the data from the widgets of an editor page and sets it on a calendar * component, replacing the contents of the properties that the editor page * knows how to manipulate. @@ -338,7 +338,7 @@ comp_editor_page_set_e_cal (CompEditorPage *page, ECal *client) * comp_editor_page_set_summary: * @page: An editor page * @summary: The text of the new summary value - * + * * Sets the summary value for this group of widgets **/ void @@ -373,7 +373,7 @@ comp_editor_page_unset_focused_widget (CompEditorPage *page, GtkWidget *widget) * @page: An editor page * @widget: The widget that has the current focus **/ -void +void comp_editor_page_set_focused_widget (CompEditorPage *page, GtkWidget *widget) { g_return_if_fail (page!= NULL); @@ -388,7 +388,7 @@ comp_editor_page_set_focused_widget (CompEditorPage *page, GtkWidget *widget) * comp_editor_page_set_dates: * @page: An editor page * @dates: A collection of various dates in time_t format - * + * * Sets the date values for this group of widgets **/ void @@ -404,7 +404,7 @@ comp_editor_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) /** * comp_editor_page_notify_changed: * @page: An editor page. - * + * * Makes an editor page emit the "changed" signal. This is meant to be * used only by page implementations. **/ @@ -419,9 +419,9 @@ comp_editor_page_notify_changed (CompEditorPage *page) /** * comp_editor_page_notify_needs_send: - * @page: - * - * + * @page: + * + * **/ void comp_editor_page_notify_needs_send (CompEditorPage *page) @@ -429,13 +429,13 @@ comp_editor_page_notify_needs_send (CompEditorPage *page) g_return_if_fail (page != NULL); g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); - gtk_signal_emit (GTK_OBJECT (page), comp_editor_page_signals[NEEDS_SEND]); + gtk_signal_emit (GTK_OBJECT (page), comp_editor_page_signals[NEEDS_SEND]); } /** * comp_editor_page_notify_summary_changed: * @page: An editor page. - * + * * Makes an editor page emit the "summary_changed" signal. This is meant to be * used only by page implementations. **/ @@ -446,7 +446,7 @@ comp_editor_page_notify_summary_changed (CompEditorPage *page, g_return_if_fail (page != NULL); g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); - + gtk_signal_emit (GTK_OBJECT (page), comp_editor_page_signals[SUMMARY_CHANGED], summary); @@ -455,7 +455,7 @@ comp_editor_page_notify_summary_changed (CompEditorPage *page, /** * comp_editor_page_notify_dates_changed: * @page: An editor page. - * + * * Makes an editor page emit the "dates_changed" signal. This is meant to be * used only by page implementations. **/ @@ -474,7 +474,7 @@ comp_editor_page_notify_dates_changed (CompEditorPage *page, /** * comp_editor_page_notify_client_changed: * @page: An editor page. - * + * * Makes an editor page emit the "client_changed" signal. This is meant to be * used only by page implementations. **/ diff --git a/calendar/gui/dialogs/comp-editor-util.c b/calendar/gui/dialogs/comp-editor-util.c index 8aa7bbd734..dabf01745e 100644 --- a/calendar/gui/dialogs/comp-editor-util.c +++ b/calendar/gui/dialogs/comp-editor-util.c @@ -43,7 +43,7 @@ * comp_editor_dates: * @dates: A structure to be filled out with dates of a component * @comp: The component to extract the dates from - * + * * Extracts the dates from the calendar component into the * CompEditorPageDates structure. Call comp_editor_free_dates() to free the * results. @@ -57,7 +57,7 @@ comp_editor_dates (CompEditorPageDates *dates, ECalComponent *comp) dates->end = NULL; dates->due = NULL; dates->complete = NULL; - + /* Note that the ECalComponentDateTime's returned contain allocated icaltimetype and tzid values, so we just take over ownership of those. */ @@ -119,7 +119,7 @@ write_label_piece (struct icaltimetype *tt, char *buffer, int size, struct tm tmp_tm = { 0 }; struct icaltimetype tt_copy = *tt; int len; - + /* FIXME: May want to convert the time to an appropriate zone. */ if (stext != NULL) @@ -145,7 +145,7 @@ write_label_piece (struct icaltimetype *tt, char *buffer, int size, len = strlen (buffer); e_time_format_date_and_time (&tmp_tm, - calendar_config_get_24_hour_format (), + calendar_config_get_24_hour_format (), !tt_copy.is_date, FALSE, &buffer[len], size - len); if (etext != NULL) @@ -156,7 +156,7 @@ write_label_piece (struct icaltimetype *tt, char *buffer, int size, * comp_editor_date_label: * @dates: The dates to use in constructing a label * @label: The label whose text is to be set - * + * * Set the text of a label based on the dates available and the user's * formatting preferences **/ @@ -192,7 +192,7 @@ comp_editor_date_label (CompEditorPageDates *dates, GtkWidget *label) else write_label_piece (dates->complete, buffer, 1024, _("Completed "), NULL, NULL); } - + if (due_set && dates->complete == NULL) { if (start_set) write_label_piece (dates->due->value, buffer, 1024, _(" (Due "), ")", NULL); @@ -207,7 +207,7 @@ static void date_edit_destroy_cb (EDateEdit *date_edit, gpointer data) { EDateEditConfig *config = data; - + g_object_unref (config); } @@ -218,9 +218,9 @@ date_edit_destroy_cb (EDateEdit *date_edit, gpointer data) * @make_time_insensitive: Whether the time field is made insensitive rather * than hiding it. This is useful if you want to preserve the layout of the * widgets. - * + * * Creates a new #EDateEdit widget, configured using the calendar's preferences. - * + * * Return value: A newly-created #EDateEdit widget. **/ GtkWidget * @@ -229,7 +229,7 @@ comp_editor_new_date_edit (gboolean show_date, gboolean show_time, { EDateEdit *dedit; EDateEditConfig *config; - + dedit = E_DATE_EDIT (e_date_edit_new ()); e_date_edit_set_show_date (dedit, show_date); @@ -239,10 +239,10 @@ comp_editor_new_date_edit (gboolean show_date, gboolean show_time, #else e_date_edit_set_make_time_insensitive (dedit, FALSE); #endif - + config = e_date_edit_config_new (dedit); g_signal_connect (G_OBJECT (dedit), "destroy", G_CALLBACK (date_edit_destroy_cb), config); - + return GTK_WIDGET (dedit); } @@ -280,10 +280,10 @@ comp_editor_get_current_time (GtkObject *object, gpointer data) /** * comp_editor_strip_categories: * @categories: A string of category names entered by the user. - * + * * Takes a string of the form "categ, categ, categ, ..." and removes the * whitespace between categories to result in "categ,categ,categ,..." - * + * * Return value: The category names stripped of surrounding whitespace * and separated with commas. **/ @@ -329,7 +329,7 @@ comp_editor_strip_categories (const char *categories) start = p; end = p; } else - end = g_utf8_next_char(p) - 1; + end = g_utf8_next_char(p) - 1; } } diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index e2ca1b5730..2b2b797775 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -81,7 +81,7 @@ struct _CompEditorPrivate { /* Client to use */ ECal *client; - + /* Source client (where comp lives currently) */ ECal *source_client; @@ -98,7 +98,7 @@ struct _CompEditorPrivate { GtkNotebook *notebook; /* Focussed Widget*/ - GtkWidget *focused_entry; + GtkWidget *focused_entry; /* Attachment handling */ GtkWidget *attachment_bar; @@ -109,20 +109,20 @@ struct _CompEditorPrivate { GtkWidget *attachment_expander_num; guint32 attachment_bar_visible : 1; - - /* TODO use this flags for setting all the boolean variables + + /* TODO use this flags for setting all the boolean variables below */ CompEditorFlags flags; - + gboolean changed; gboolean needs_send; CalObjModType mod; - + gboolean existing_org; gboolean user_org; gboolean is_group_item; - + gboolean warned; char *help_section; @@ -212,12 +212,12 @@ attach_message(CompEditor *editor, CamelMimeMessage *msg) g_free(desc); } else camel_mime_part_set_description(mime_part, _("Attached message")); - + i = e_attachment_bar_get_num_attachments (E_ATTACHMENT_BAR (editor->priv->attachment_bar)); i++; filename = g_strdup_printf ("email%d",i); camel_mime_part_set_filename (mime_part, filename); - + camel_medium_set_content_object((CamelMedium *)mime_part, (CamelDataWrapper *)msg); camel_mime_part_set_content_type(mime_part, "message/rfc822"); e_attachment_bar_attach_mime_part(E_ATTACHMENT_BAR(editor->priv->attachment_bar), mime_part); @@ -259,7 +259,7 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele stream = camel_stream_mem_new (); camel_stream_write (stream, (char *)selection->data, selection->length); camel_stream_reset (stream); - + msg = camel_mime_message_new (); if (camel_data_wrapper_construct_from_stream((CamelDataWrapper *)msg, stream) != -1) { attach_message(editor, msg); @@ -276,7 +276,7 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele tmp = g_strndup ((char *)selection->data, selection->length); urls = g_strsplit (tmp, "\n", 0); g_free (tmp); - + for (i = 0; urls[i] != NULL; i++) { str = g_strstrip (urls[i]); if (urls[i][0] == '#') { @@ -309,7 +309,7 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele g_free (str); } } - + g_free (urls); success = TRUE; break; @@ -317,15 +317,15 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele case DND_TYPE_TEXT_CALENDAR: content_type = gdk_atom_name (selection->type); d(printf ("dropping a %s\n", content_type)); - + mime_part = camel_mime_part_new (); camel_mime_part_set_content (mime_part, (char *)selection->data, selection->length, content_type); camel_mime_part_set_disposition (mime_part, "inline"); - + e_attachment_bar_attach_mime_part (E_ATTACHMENT_BAR (editor->priv->attachment_bar), mime_part); - + camel_object_unref (mime_part); g_free (content_type); @@ -393,7 +393,7 @@ drop_action(CompEditor *editor, GdkDragContext *context, guint32 action, GtkSele desc = g_strdup_printf(ngettext("Attached message", "%d attached messages", uids->len), uids->len); camel_mime_part_set_description(mime_part, desc); g_free(desc); - + num = e_attachment_bar_get_num_attachments (E_ATTACHMENT_BAR (editor->priv->attachment_bar)); num++; filename = g_strdup_printf ("email%d", num); @@ -591,23 +591,23 @@ listen_for_changes (CompEditor *editor) G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); - + g_object_unref (priv->view); priv->view = NULL; } - + /* Listen for changes */ if (priv->comp) e_cal_component_get_uid (priv->comp, &uid); if (uid) { char *query; - + query = g_strdup_printf ("(uid? \"%s\")", uid); e_cal_get_query (priv->source_client, query, &priv->view, NULL); g_free (query); } - + if (priv->view) { g_signal_connect (priv->view, "objects_modified", G_CALLBACK (obj_modified_cb), editor); @@ -654,9 +654,9 @@ get_attachment_list (CompEditor *editor) char *attach_file_url; char *safe_fname, *utf8_safe_fname; char *filename; - + wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (p->data)); - + /* Extract the content from the stream and write it down * as a mime part file into the directory denoting the * calendar source */ @@ -682,7 +682,7 @@ get_attachment_list (CompEditor *editor) g_free (filename); continue; } - + if (camel_data_wrapper_decode_to_stream (wrapper, (CamelStream *) stream) == -1) { g_free (attach_file_url); camel_stream_close (stream); @@ -747,7 +747,7 @@ save_comp (CompEditor *editor) /* retrieve all timezones */ comp_editor_page_fill_timezones (l->data, timezones); } - + /* If we are not the organizer, we don't update the sequence number */ if (!e_cal_component_has_organizer (clone) || itip_organizer_is_user (clone, priv->client) || itip_sentby_is_user (clone)) e_cal_component_commit_sequence (clone); @@ -762,11 +762,11 @@ save_comp (CompEditor *editor) /* send timezones */ g_hash_table_foreach (timezones, (GHFunc) send_timezone, editor); g_hash_table_destroy (timezones); - + /* Attachments*/ - + e_cal_component_set_attachment_list (priv->comp, - get_attachment_list (editor)); + get_attachment_list (editor)); icalcomp = e_cal_component_get_icalcomponent (priv->comp); /* send the component to the server */ if (!cal_comp_is_on_server (priv->comp, priv->client)) { @@ -812,7 +812,7 @@ save_comp (CompEditor *editor) if (delay_set) return TRUE; } - + if (!result) { GtkWidget *dialog; @@ -835,7 +835,7 @@ save_comp (CompEditor *editor) e_cal_get_source (priv->source_client)) && cal_comp_is_on_server (priv->comp, priv->source_client)) { /* Comp found a new home. Remove it from old one. */ - + if (e_cal_component_is_instance (priv->comp) || e_cal_component_has_recurrences (priv->comp)) e_cal_remove_object_with_mod (priv->source_client, orig_uid, NULL, CALOBJ_MOD_ALL, NULL); @@ -846,7 +846,7 @@ save_comp (CompEditor *editor) * again this session. */ g_object_unref (priv->source_client); priv->source_client = g_object_ref (priv->client); - + listen_for_changes (editor); } @@ -864,19 +864,19 @@ save_comp_with_send (CompEditor *editor) gboolean delegate; priv = editor->priv; - + send = priv->changed && priv->needs_send; delegate = priv->flags & COMP_EDITOR_DELEGATE; - + if (delegate) { icalcomponent *icalcomp = e_cal_component_get_icalcomponent (priv->comp); icalproperty *icalprop; - + icalprop = icalproperty_new_x ("1"); icalproperty_set_x_name (icalprop, "X-EVOLUTION-DELEGATED"); icalcomponent_add_property (icalcomp, icalprop); } - + if (!save_comp (editor)) return FALSE; @@ -889,7 +889,7 @@ save_comp_with_send (CompEditor *editor) } else { if (!comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REQUEST)) return FALSE; - + if (delegate) return comp_editor_send_comp (editor, E_CAL_COMPONENT_METHOD_REPLY); } @@ -933,7 +933,7 @@ prompt_and_save_changes (CompEditor *editor, gboolean send) if (e_cal_component_is_instance (priv->comp)) if (!recur_component_dialog (priv->client, priv->comp, &priv->mod, GTK_WINDOW (editor), FALSE)) return FALSE; - + if (send && save_comp_with_send (editor)) return TRUE; else if (!send && save_comp (editor)) @@ -954,7 +954,7 @@ delete_event_cb (GtkWidget *widget, GdkEvent *event, gpointer data) CompEditor *editor = COMP_EDITOR (data); commit_all_fields (editor); - + if (prompt_and_save_changes (editor, TRUE)) close_dialog (editor); @@ -966,7 +966,7 @@ attachment_bar_changed_cb (EAttachmentBar *bar, void *data) { CompEditor *editor = COMP_EDITOR (data); - + guint attachment_num = e_attachment_bar_get_num_attachments ( E_ATTACHMENT_BAR (editor->priv->attachment_bar)); if (attachment_num) { @@ -979,37 +979,37 @@ attachment_bar_changed_cb (EAttachmentBar *bar, gtk_widget_show (editor->priv->attachment_expander_icon); e_expander_set_expanded(E_EXPANDER(editor->priv->attachment_expander),TRUE); - + } else { gtk_label_set_text (GTK_LABEL (editor->priv->attachment_expander_num), ""); gtk_widget_hide (editor->priv->attachment_expander_icon); e_expander_set_expanded(E_EXPANDER(editor->priv->attachment_expander),FALSE); } - - + + /* Mark the editor as changed so it prompts about unsaved changes on close */ comp_editor_set_changed (editor, TRUE); } -static void -attachment_expander_activate_cb (EExpander *expander, - void *data) -{ - CompEditor *editor = COMP_EDITOR (data); - gboolean show = e_expander_get_expanded (expander); - - /* Update the expander label */ - if (show) - gtk_label_set_text_with_mnemonic (GTK_LABEL (editor->priv->attachment_expander_label), - _("Hide Attachment _Bar")); - else - gtk_label_set_text_with_mnemonic (GTK_LABEL (editor->priv->attachment_expander_label), - _("Show Attachment _Bar")); +static void +attachment_expander_activate_cb (EExpander *expander, + void *data) +{ + CompEditor *editor = COMP_EDITOR (data); + gboolean show = e_expander_get_expanded (expander); + + /* Update the expander label */ + if (show) + gtk_label_set_text_with_mnemonic (GTK_LABEL (editor->priv->attachment_expander_label), + _("Hide Attachment _Bar")); + else + gtk_label_set_text_with_mnemonic (GTK_LABEL (editor->priv->attachment_expander_label), + _("Show Attachment _Bar")); } -static gboolean +static gboolean open_attachment (EAttachmentBar *bar, CompEditor *editor) { GnomeIconList *icon_list; @@ -1017,7 +1017,7 @@ open_attachment (EAttachmentBar *bar, CompEditor *editor) int num; char *attach_file_url; GError *error = NULL; - + if (E_IS_ATTACHMENT_BAR (bar)) { icon_list = GNOME_ICON_LIST (bar); p = gnome_icon_list_get_selection (icon_list); @@ -1028,7 +1028,7 @@ open_attachment (EAttachmentBar *bar, CompEditor *editor) char *filename = NULL; const char *local_store = e_cal_get_local_attachment_store (editor->priv->client); - e_cal_component_get_uid (editor->priv->comp, &comp_uid); + e_cal_component_get_uid (editor->priv->comp, &comp_uid); num = GPOINTER_TO_INT (p->data); list = e_attachment_bar_get_attachment (bar, num); attachment = list->data; @@ -1039,7 +1039,7 @@ open_attachment (EAttachmentBar *bar, CompEditor *editor) camel_mime_part_get_filename(attachment->body)); attach_file_url = g_build_path ("/", local_store, filename, NULL); - + /* launch the url now */ /* TODO should send GError and handle error conditions * here */ @@ -1050,14 +1050,14 @@ open_attachment (EAttachmentBar *bar, CompEditor *editor) g_free (filename); g_free (attach_file_url); } return TRUE; - } else + } else return FALSE; } -static gboolean +static gboolean attachment_bar_icon_clicked_cb (EAttachmentBar *bar, GdkEvent *event, CompEditor *editor) { - if (E_IS_ATTACHMENT_BAR (bar) && event->type == GDK_2BUTTON_PRESS) + if (E_IS_ATTACHMENT_BAR (bar) && event->type == GDK_2BUTTON_PRESS) if (open_attachment (bar, editor)) return TRUE; return FALSE; @@ -1070,7 +1070,7 @@ cab_open(EPopup *ep, EPopupItem *item, void *data) { EAttachmentBar *bar = data; CompEditor *editor = COMP_EDITOR (gtk_widget_get_toplevel (GTK_WIDGET (bar))); - + if (!open_attachment (bar, editor)) g_message ("\n Open failed"); } @@ -1097,20 +1097,20 @@ cab_add(EPopup *ep, EPopupItem *item, void *data) if (!g_ascii_strcasecmp (url->protocol, "file")) e_attachment_bar_attach (bar, url->path, is_inline ? "inline" : "attachment"); - else + else e_attachment_bar_attach_remote_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); g_free (file_list->pdata[i]); camel_url_free (url); } - - g_ptr_array_free (file_list, TRUE); + + g_ptr_array_free (file_list, TRUE); } static void cab_properties(EPopup *ep, EPopupItem *item, void *data) { EAttachmentBar *bar = data; - + e_attachment_bar_edit_selected(bar); } @@ -1138,17 +1138,17 @@ cab_popup_position(GtkMenu *menu, int *x, int *y, gboolean *push_in, gpointer us GnomeIconList *icon_list = user_data; GList *selection; GnomeCanvasPixbuf *image; - + gdk_window_get_origin (((GtkWidget*) bar)->window, x, y); - + selection = gnome_icon_list_get_selection (icon_list); if (selection == NULL) return; - + image = gnome_icon_list_get_icon_pixbuf_item (icon_list, GPOINTER_TO_INT(selection->data)); if (image == NULL) return; - + /* Put menu to the center of icon. */ *x += (int)(image->item.x1 + image->item.x2) / 2; *y += (int)(image->item.y1 + image->item.y2) / 2; @@ -1197,7 +1197,7 @@ cab_popup(EAttachmentBar *bar, GdkEventButton *event, int id) /* GtkWidget methods. */ -static gboolean +static gboolean popup_menu_event (GtkWidget *widget) { cab_popup((EAttachmentBar *)widget, NULL, -1); @@ -1211,10 +1211,10 @@ button_press_event (GtkWidget *widget, GdkEventButton *event) EAttachmentBar *bar = (EAttachmentBar *)widget; GnomeIconList *icon_list = GNOME_ICON_LIST(widget); int icon_number = -1; - + if (event->button != 3) return FALSE; - + if (!gnome_icon_list_get_selection (icon_list)) { icon_number = gnome_icon_list_get_icon_at (icon_list, event->x, event->y); if (icon_number >= 0) { @@ -1224,7 +1224,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event) } cab_popup(bar, event, icon_number); - + return TRUE; } @@ -1236,7 +1236,7 @@ key_press_event(GtkWidget *widget, GdkEventKey *event) e_attachment_bar_remove_selected (bar); return TRUE; } - + return FALSE; } @@ -1245,13 +1245,13 @@ editor_key_press_event(GtkWidget *widget, GdkEventKey *event, CompEditor *editor { if (event->keyval == GDK_Escape) { commit_all_fields (editor); - + if (prompt_and_save_changes (editor, TRUE)) close_dialog (editor); return TRUE; } - + return FALSE; } /* Menu callbacks */ @@ -1270,23 +1270,23 @@ menu_file_save_cb (BonoboUIComponent *uic, if (e_attachment_bar_get_download_count (E_ATTACHMENT_BAR (editor->priv->attachment_bar)) ){ gboolean response = 1; /*FIXME: Cannot use mail functions from calendar!!!! */ -#if 0 +#if 0 ECalComponentVType vtype = e_cal_component_get_vtype(editor->priv->comp); if (vtype == E_CAL_COMPONENT_EVENT) - response = em_utils_prompt_user((GtkWindow *)widget, - NULL, - "calendar:ask-send-event-pending-download", + response = em_utils_prompt_user((GtkWindow *)widget, + NULL, + "calendar:ask-send-event-pending-download", NULL); else - response = em_utils_prompt_user((GtkWindow *)widget, - NULL, - "calendar:ask-send-task-pending-download", + response = em_utils_prompt_user((GtkWindow *)widget, + NULL, + "calendar:ask-send-task-pending-download", NULL); #endif - if (!response) + if (!response) return; - } + } if (!e_cal_is_read_only (priv->client, &read_only, NULL) || read_only) { e_error_run ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (editor)), "calendar:prompt-read-only-cal", NULL); @@ -1305,10 +1305,10 @@ menu_file_save_cb (BonoboUIComponent *uic, if (!correct) return; - if (!text.value) + if (!text.value) if (!send_component_prompt_subject ((GtkWindow *) editor, priv->client, priv->comp)) return; - if (save_comp_with_send (editor)) + if (save_comp_with_send (editor)) close_dialog (editor); } @@ -1323,16 +1323,16 @@ menu_file_print_cb (BonoboUIComponent *uic, ECalComponent *comp; GList *l; icalcomponent *icalcomp = e_cal_component_get_icalcomponent (priv->comp); - + comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp)); for (l = priv->pages; l != NULL; l = l->next) comp_editor_page_fill_component (l->data, comp); - + print_comp (comp, priv->client, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); - g_object_unref (comp); + g_object_unref (comp); } static void @@ -1345,14 +1345,14 @@ menu_file_print_preview_cb (BonoboUIComponent *uic, ECalComponent *comp; GList *l; icalcomponent *icalcomp = e_cal_component_get_icalcomponent (priv->comp); - + comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp)); for (l = priv->pages; l != NULL; l = l->next) - comp_editor_page_fill_component (l->data, comp); + comp_editor_page_fill_component (l->data, comp); print_comp (comp, priv->client, TRUE); - g_object_unref (comp); + g_object_unref (comp); } static void @@ -1361,7 +1361,7 @@ menu_file_close_cb (BonoboUIComponent *uic, const char *path) { CompEditor *editor = (CompEditor *) data; - + commit_all_fields (editor); if (prompt_and_save_changes (editor, TRUE)) @@ -1409,8 +1409,8 @@ menu_edit_selectall_cb (BonoboUIComponent *uic, if (GTK_IS_ENTRY (priv->focused_entry)) { gtk_editable_set_position (GTK_EDITABLE (priv->focused_entry), -1); gtk_editable_select_region (GTK_EDITABLE (priv->focused_entry), 0, -1); - } - if (GTK_IS_TEXT_VIEW (priv->focused_entry)) + } + if (GTK_IS_TEXT_VIEW (priv->focused_entry)) g_signal_emit_by_name (priv->focused_entry, "select-all", TRUE); } @@ -1421,7 +1421,7 @@ menu_edit_cut_cb (BonoboUIComponent *uic, { CompEditor *editor = data; CompEditorPrivate *priv = editor->priv; - + if (GTK_IS_ENTRY (priv->focused_entry)) gtk_editable_cut_clipboard (GTK_EDITABLE (priv->focused_entry)); if (GTK_IS_TEXT_VIEW (priv->focused_entry)) @@ -1454,13 +1454,13 @@ menu_insert_attachment_cb (BonoboUIComponent *uic, if (!g_ascii_strcasecmp (url->protocol, "file")) e_attachment_bar_attach (bar, url->path, is_inline ? "inline" : "attachment"); - else + else e_attachment_bar_attach_remote_file (bar, file_list->pdata[i], is_inline ? "inline" : "attachment"); g_free (file_list->pdata[i]); camel_url_free (url); } - - g_ptr_array_free (file_list, TRUE); + + g_ptr_array_free (file_list, TRUE); } static void @@ -1469,7 +1469,7 @@ menu_help_cb (BonoboUIComponent *uic, const char *path) { CompEditor *editor = (CompEditor *) data; - + comp_editor_show_help (editor); } @@ -1477,17 +1477,17 @@ static BonoboUIVerb verbs [] = { BONOBO_UI_VERB ("FileSave", menu_file_save_cb), BONOBO_UI_VERB ("CalendarPrint", menu_file_print_cb), - BONOBO_UI_VERB ("CalendarPrintPreview", menu_file_print_preview_cb), + BONOBO_UI_VERB ("CalendarPrintPreview", menu_file_print_preview_cb), BONOBO_UI_VERB ("FileClose", menu_file_close_cb), BONOBO_UI_VERB ("EditCopy", menu_edit_copy_cb), BONOBO_UI_VERB ("EditPaste", menu_edit_paste_cb), BONOBO_UI_VERB ("EditCut", menu_edit_cut_cb), - BONOBO_UI_VERB ("EditSelectAll", menu_edit_selectall_cb), + BONOBO_UI_VERB ("EditSelectAll", menu_edit_selectall_cb), BONOBO_UI_VERB ("InsertAttachments", menu_insert_attachment_cb), - + BONOBO_UI_VERB ("Help", menu_help_cb), - + BONOBO_UI_VERB_END }; @@ -1530,7 +1530,7 @@ setup_widgets (CompEditor *editor) gtk_notebook_set_show_tabs (priv->notebook, FALSE); g_signal_connect (editor, "delete_event", G_CALLBACK (delete_event_cb), editor); - g_signal_connect (editor, "key_press_event", G_CALLBACK (editor_key_press_event), editor); + g_signal_connect (editor, "key_press_event", G_CALLBACK (editor_key_press_event), editor); /*Attachments */ priv->attachment_scrolled_window = gtk_scrolled_window_new (NULL, NULL); @@ -1538,7 +1538,7 @@ setup_widgets (CompEditor *editor) GTK_SHADOW_IN); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (priv->attachment_scrolled_window), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - + priv->attachment_bar = e_attachment_bar_new (NULL); g_signal_connect (priv->attachment_bar, "button_press_event", G_CALLBACK (button_press_event), NULL); @@ -1552,7 +1552,7 @@ setup_widgets (CompEditor *editor) g_signal_connect (priv->attachment_bar, "changed", G_CALLBACK (attachment_bar_changed_cb), editor); g_signal_connect (GNOME_ICON_LIST (priv->attachment_bar), "event", - G_CALLBACK (attachment_bar_icon_clicked_cb), editor); + G_CALLBACK (attachment_bar_icon_clicked_cb), editor); priv->attachment_expander_label = gtk_label_new_with_mnemonic (_("Show Attachment _Bar")); priv->attachment_expander_num = gtk_label_new (""); @@ -1560,12 +1560,12 @@ setup_widgets (CompEditor *editor) gtk_misc_set_alignment (GTK_MISC (priv->attachment_expander_label), 0.0, 0.5); gtk_misc_set_alignment (GTK_MISC (priv->attachment_expander_num), 1.0, 0.5); expander_hbox = gtk_hbox_new (FALSE, 0); - + attachment_pixbuf = e_icon_factory_get_icon ("mail-attachment", E_ICON_SIZE_MENU); priv->attachment_expander_icon = gtk_image_new_from_pixbuf (attachment_pixbuf); gtk_misc_set_alignment (GTK_MISC (priv->attachment_expander_icon), 1, 0.5); gtk_widget_set_size_request (priv->attachment_expander_icon, 100, -1); - g_object_unref (attachment_pixbuf); + g_object_unref (attachment_pixbuf); gtk_box_pack_start (GTK_BOX (expander_hbox), priv->attachment_expander_label, TRUE, TRUE, 0); @@ -1584,8 +1584,8 @@ setup_widgets (CompEditor *editor) gtk_box_pack_start (GTK_BOX (vbox), priv->attachment_expander, FALSE, FALSE, GNOME_PAD_SMALL); gtk_widget_show (priv->attachment_expander); - e_expander_set_expanded (E_EXPANDER (priv->attachment_expander), FALSE); - g_signal_connect_after (priv->attachment_expander, "activate", + e_expander_set_expanded (E_EXPANDER (priv->attachment_expander), FALSE); + g_signal_connect_after (priv->attachment_expander, "activate", G_CALLBACK (attachment_expander_activate_cb), editor); } @@ -1617,7 +1617,7 @@ comp_editor_init (CompEditor *editor) editor->uic = bonobo_ui_component_new_default (); /* FIXME: handle bonobo exceptions */ bonobo_ui_component_set_container (editor->uic, bonobo_object_corba_objref (BONOBO_OBJECT (container)), NULL); - + bonobo_ui_component_add_verb_list_with_data (editor->uic, verbs, editor); bonobo_ui_component_freeze (editor->uic, NULL); @@ -1678,7 +1678,7 @@ comp_editor_finalize (GObject *object) g_object_unref (priv->client); priv->client = NULL; } - + if (priv->source_client) { g_object_unref (priv->source_client); priv->source_client = NULL; @@ -1759,8 +1759,8 @@ close_dialog (CompEditor *editor) notification back when we are in an inconsistent state */ if (priv->view) g_signal_handlers_disconnect_matched (G_OBJECT (priv->view), - G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); - + G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); + gtk_widget_destroy (GTK_WIDGET (editor)); } @@ -1883,10 +1883,10 @@ comp_editor_get_changed (CompEditor *editor) return priv->changed; } -void +void comp_editor_set_flags (CompEditor *editor, CompEditorFlags flags) { - + CompEditorPrivate *priv; g_return_if_fail (editor != NULL); @@ -1898,10 +1898,10 @@ comp_editor_set_flags (CompEditor *editor, CompEditorFlags flags) } -CompEditorFlags +CompEditorFlags comp_editor_get_flags (CompEditor *editor) { - + CompEditorPrivate *priv; g_return_val_if_fail (editor != NULL, FALSE); @@ -1982,11 +1982,11 @@ static void page_unmapped_cb (GtkWidget *page_widget, * comp_editor_append_page: * @editor: A component editor * @page: A component editor page - * @label: Label of the page. Should be NULL if add is FALSE. + * @label: Label of the page. Should be NULL if add is FALSE. * @add: Add's the page into the notebook if TRUE * * Appends a page to the notebook if add is TRUE else - * just adds it to the list of pages. + * just adds it to the list of pages. **/ void comp_editor_append_page (CompEditor *editor, @@ -2029,7 +2029,7 @@ comp_editor_append_page (CompEditor *editor, is_first_page = (priv->pages == NULL); priv->pages = g_list_append (priv->pages, page); - + if (add) gtk_notebook_append_page (priv->notebook, page_widget, label_widget); @@ -2085,7 +2085,7 @@ comp_editor_remove_page (CompEditor *editor, CompEditorPage *page) page_num = gtk_notebook_page_num (priv->notebook, page_widget); if (page_num == -1) return; - + /* Disconnect all the signals added in append_page(). */ g_signal_handlers_disconnect_matched (page, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, editor); g_signal_handlers_disconnect_matched (page_widget, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, page); @@ -2240,7 +2240,7 @@ make_title_from_string (ECalComponent *comp, const char *str, gboolean is_group_ break; case E_CAL_COMPONENT_TODO: if (is_group_item) - type_string = _("Assigned Task - %s"); + type_string = _("Assigned Task - %s"); else type_string = _("Task - %s"); break; @@ -2345,7 +2345,7 @@ attachment_guess_mime_type (const char *file_name) return type; } -static void +static void set_attachment_list (CompEditor *editor, GSList *attach_list) { GSList *p = NULL; @@ -2355,10 +2355,10 @@ set_attachment_list (CompEditor *editor, GSList *attach_list) if (e_attachment_bar_get_num_attachments (E_ATTACHMENT_BAR (editor->priv->attachment_bar))) { /* To prevent repopulating the - * bar due to redraw functions in fill_widget. + * bar due to redraw functions in fill_widget. * Assumes it can be set only once. - */ - return; + */ + return; } for (p = attach_list; p != NULL; p = p->next) { @@ -2367,32 +2367,32 @@ set_attachment_list (CompEditor *editor, GSList *attach_list) CamelDataWrapper *wrapper; CamelStream *stream; struct stat statbuf; - char *mime_type, *file_name; + char *mime_type, *file_name; char *ptr; attach_filename = (char *) p->data; - /* should we assert if g_str_has_prefix (attach_filename, "file://")) + /* should we assert if g_str_has_prefix (attach_filename, "file://")) * here */ /* get url sans protocol and add it to the bar. - * how to set the filename properly */ + * how to set the filename properly */ file_name = g_filename_from_uri (attach_filename, NULL, NULL); if (!file_name) continue; - + if (g_stat (file_name, &statbuf) < 0) { g_warning ("Cannot attach file %s: %s", file_name, g_strerror (errno)); g_free (file_name); continue; } - + /* return if it's not a regular file */ if (!S_ISREG (statbuf.st_mode)) { g_warning ("Cannot attach file %s: not a regular file", file_name); g_free (file_name); return; } - + stream = camel_stream_fs_new_with_name (file_name, O_RDONLY, 0); if (!stream) { g_warning ("Cannot attach file %s: %s", file_name, g_strerror (errno)); @@ -2407,7 +2407,7 @@ set_attachment_list (CompEditor *editor, GSList *attach_list) } else { wrapper = camel_data_wrapper_new (); } - + camel_data_wrapper_construct_from_stream (wrapper, stream); camel_data_wrapper_set_mime_type (wrapper, mime_type); g_free (mime_type); @@ -2418,18 +2418,18 @@ set_attachment_list (CompEditor *editor, GSList *attach_list) } camel_object_unref (stream); - + part = camel_mime_part_new (); camel_medium_set_content_object (CAMEL_MEDIUM (part), wrapper); camel_object_unref (wrapper); - + camel_mime_part_set_disposition (part, "attachment"); ptr = strstr (file_name, comp_uid); if (ptr) { ptr += strlen(comp_uid); if (*ptr++ == '-') - camel_mime_part_set_filename (part, ptr); + camel_mime_part_set_filename (part, ptr); } g_free (file_name); @@ -2437,7 +2437,7 @@ set_attachment_list (CompEditor *editor, GSList *attach_list) e_expander_set_expanded (E_EXPANDER (editor->priv->attachment_expander), TRUE); camel_object_unref (part); - } + } } static void @@ -2455,7 +2455,7 @@ fill_widgets (CompEditor *editor) set_attachment_list (editor, attachment_list); g_slist_foreach (attachment_list, (GFunc)g_free, NULL); g_slist_free (attachment_list); - } + } for (l = priv->pages; l != NULL; l = l->next) comp_editor_page_fill_widgets (l->data, priv->comp); @@ -2499,7 +2499,7 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp) { CompEditorPrivate *priv; const char *uid; - + g_return_if_fail (editor != NULL); g_return_if_fail (IS_COMP_EDITOR (editor)); @@ -2512,11 +2512,11 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp) if (comp) priv->comp = e_cal_component_clone (comp); - + priv->existing_org = e_cal_component_has_organizer (comp); priv->user_org = (itip_organizer_is_user (comp, priv->client) || itip_sentby_is_user (comp)); priv->warned = FALSE; - + set_title_from_comp (editor); set_icon_from_comp (editor); e_cal_component_get_uid (comp, &uid); @@ -2532,10 +2532,10 @@ real_edit_comp (CompEditor *editor, ECalComponent *comp) static void set_attendees_for_delegation (ECalComponent *comp, const char *address, ECalComponentItipMethod method) { - icalproperty *prop; + icalproperty *prop; icalparameter *param; icalcomponent *icalcomp; - + icalcomp = e_cal_component_get_icalcomponent (comp); for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); @@ -2550,7 +2550,7 @@ set_attendees_for_delegation (ECalComponent *comp, const char *address, ECalComp ((delfrom && *delfrom) && g_str_equal (itip_strip_mailto (delfrom), address)))) { icalcomponent_remove_property (icalcomp, prop); - } + } } @@ -2565,8 +2565,8 @@ get_users_from_memo_comp (ECalComponent *comp, GList **users) char **emails, **iter; icalcomp = e_cal_component_get_icalcomponent (comp); - - for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); icalprop; + + for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); icalprop; icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) { if (g_str_equal (icalproperty_get_x_name (icalprop), "X-EVOLUTION-RECIPIENTS")) { break; @@ -2593,7 +2593,7 @@ real_send_comp (CompEditor *editor, ECalComponentItipMethod method) ECalComponent *send_comp; char *address = NULL; GList *users = NULL; - + g_return_val_if_fail (editor != NULL, FALSE); g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE); @@ -2601,9 +2601,9 @@ real_send_comp (CompEditor *editor, ECalComponentItipMethod method) send_comp = e_cal_component_clone (priv->comp); - if (e_cal_component_get_vtype (send_comp) == E_CAL_COMPONENT_JOURNAL) + if (e_cal_component_get_vtype (send_comp) == E_CAL_COMPONENT_JOURNAL) get_users_from_memo_comp (send_comp, &users); - + /* The user updates the delegated status to the Organizer, so remove all other attendees */ if ((priv->flags & COMP_EDITOR_DELEGATE)) { address = itip_get_comp_attendee (send_comp, priv->client); @@ -2611,7 +2611,7 @@ real_send_comp (CompEditor *editor, ECalComponentItipMethod method) if (address) set_attendees_for_delegation (send_comp, address, method); } - + if (!e_cal_component_has_attachments (priv->comp)) { if (itip_send_comp (method, send_comp, priv->client, NULL, NULL, users)) { @@ -2624,7 +2624,7 @@ real_send_comp (CompEditor *editor, ECalComponentItipMethod method) int num_attachments, i; GSList *attach_list = NULL; GSList *mime_attach_list; - + num_attachments = e_cal_component_get_num_attachments (send_comp); for (i = 0; i < num_attachments ; i++) { @@ -2645,7 +2645,7 @@ real_send_comp (CompEditor *editor, ECalComponentItipMethod method) g_object_unref (send_comp); g_free (address); comp_editor_set_changed (editor, TRUE); - + return FALSE; } @@ -2689,7 +2689,7 @@ comp_editor_get_comp (CompEditor *editor) /** * comp_editor_get_current_comp - * + * * @param editor * @param correct Set this no non-NULL if you are interested to know if * all pages reported success when filling component. @@ -2771,12 +2771,12 @@ gboolean comp_editor_close (CompEditor *editor) { gboolean close; - + g_return_val_if_fail (editor != NULL, FALSE); g_return_val_if_fail (IS_COMP_EDITOR (editor), FALSE); commit_all_fields (editor); - + close = prompt_and_save_changes (editor, TRUE); if (close) close_dialog (editor); @@ -2790,7 +2790,7 @@ comp_editor_close (CompEditor *editor) * be freed by the caller. */ GSList * -comp_editor_get_mime_attach_list (CompEditor *editor) +comp_editor_get_mime_attach_list (CompEditor *editor) { struct CalMimeAttach *cal_mime_attach; GSList *attach_list = NULL, *l, *parts; @@ -2798,7 +2798,7 @@ comp_editor_get_mime_attach_list (CompEditor *editor) /* TODO assert sanity of bar */ parts = e_attachment_bar_get_parts (E_ATTACHMENT_BAR (editor->priv->attachment_bar)); for (l = parts; l ; l = l->next) { - + CamelDataWrapper *wrapper; CamelStreamMem *mstream; unsigned char *buffer = NULL; @@ -2807,10 +2807,10 @@ comp_editor_get_mime_attach_list (CompEditor *editor) cal_mime_attach = g_malloc0 (sizeof (struct CalMimeAttach)); wrapper = camel_medium_get_content_object (CAMEL_MEDIUM (l->data)); mstream = (CamelStreamMem *) camel_stream_mem_new (); - + camel_data_wrapper_decode_to_stream (wrapper, (CamelStream *) mstream); buffer = g_memdup (mstream->buffer->data, mstream->buffer->len); - + cal_mime_attach->encoded_data = (char *)buffer; cal_mime_attach->length = mstream->buffer->len; cal_mime_attach->filename = g_strdup (camel_mime_part_get_filename @@ -2820,15 +2820,15 @@ comp_editor_get_mime_attach_list (CompEditor *editor) desc = _("attachment"); cal_mime_attach->description = g_strdup (desc); cal_mime_attach->content_type = g_strdup (camel_data_wrapper_get_mime_type (wrapper)); - + disp = camel_mime_part_get_disposition ((CamelMimePart *)l->data); - if (disp && !g_ascii_strcasecmp(disp, "inline")) + if (disp && !g_ascii_strcasecmp(disp, "inline")) cal_mime_attach->disposition = TRUE; - + attach_list = g_slist_append (attach_list, cal_mime_attach); camel_object_unref (mstream); - + } g_slist_free (parts); @@ -2864,7 +2864,7 @@ comp_editor_focus (CompEditor *editor) /** * comp_editor_notify_client_changed: * @editor: A component editor. - * + * * Makes an editor emit the "client_changed" signal. **/ void @@ -2880,7 +2880,7 @@ comp_editor_notify_client_changed (CompEditor *editor, ECal *client) priv = editor->priv; priv->changed = TRUE; - + g_object_unref (priv->client); priv->client = client; @@ -2909,7 +2909,7 @@ page_changed_cb (GtkObject *obj, gpointer data) _("Changes made to this item may be discarded if an update arrives")); priv->warned = TRUE; } - + } static void @@ -2921,7 +2921,7 @@ needs_send_cb (GtkObject *obj, gpointer data) } /* Focus out widget callback */ -static void +static void page_focus_out_widget_cb (GtkObject *obj, GtkWidget *widget, gpointer data) { CompEditor *editor = COMP_EDITOR (data); @@ -2936,7 +2936,7 @@ page_focus_out_widget_cb (GtkObject *obj, GtkWidget *widget, gpointer data) static void page_focus_in_widget_cb (GtkObject *obj, GtkWidget *widget, gpointer data) { - + CompEditor *editor = COMP_EDITOR (data); CompEditorPrivate *priv; @@ -3016,7 +3016,7 @@ obj_modified_cb (ECal *client, GList *objects, gpointer data) _("Unable to use current version!")); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); - + icalcomponent_free (icalcomp); } diff --git a/calendar/gui/dialogs/comp-editor.h b/calendar/gui/dialogs/comp-editor.h index e761061939..7243808386 100644 --- a/calendar/gui/dialogs/comp-editor.h +++ b/calendar/gui/dialogs/comp-editor.h @@ -107,7 +107,7 @@ gboolean comp_editor_save_comp (CompEditor *editor, void comp_editor_delete_comp (CompEditor *editor); gboolean comp_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method); -GSList *comp_editor_get_mime_attach_list (CompEditor *editor); +GSList *comp_editor_get_mime_attach_list (CompEditor *editor); gboolean comp_editor_close (CompEditor *editor); void comp_editor_focus (CompEditor *editor); diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c index 2644f18c13..8446608222 100644 --- a/calendar/gui/dialogs/delete-comp.c +++ b/calendar/gui/dialogs/delete-comp.c @@ -47,11 +47,11 @@ * the component instead. * @widget: A widget to use as a basis for conversion from UTF8 into font * encoding. - * + * * Pops up a dialog box asking the user whether he wants to delete a number of * calendar components. The dialog will not appear, however, if the * configuration option for confirmation is turned off. - * + * * Return value: TRUE if the user clicked Yes, FALSE otherwise. If the * configuration option for confirmation is turned off, this function will * unconditionally return TRUE. @@ -65,7 +65,7 @@ delete_component_dialog (ECalComponent *comp, const char *id; char *arg0 = NULL; int response; - + if (comp) { g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), FALSE); g_return_val_if_fail (n_comps == 1, FALSE); @@ -82,14 +82,14 @@ delete_component_dialog (ECalComponent *comp, if (comp) { ECalComponentText summary; - + vtype = e_cal_component_get_vtype (comp); - + if (!consider_as_untitled) { e_cal_component_get_summary (comp, &summary); arg0 = g_strdup (summary.value); } - + switch (vtype) { case E_CAL_COMPONENT_EVENT: if (arg0) @@ -146,14 +146,14 @@ delete_component_dialog (ECalComponent *comp, vtype); return FALSE; } - + if (n_comps > 1) arg0 = g_strdup_printf ("%d", n_comps); } - + response = e_error_run ((GtkWindow *) gtk_widget_get_toplevel (widget), id, arg0, NULL); g_free (arg0); - + return response == GTK_RESPONSE_YES; } @@ -167,7 +167,7 @@ cb_toggled_cb (GtkWidget *toggle, gpointer data) gtk_widget_set_sensitive (entry, active); } -gboolean +gboolean prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *parent) { char *message = NULL; @@ -175,7 +175,7 @@ prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *pare GtkMessageDialog *dialog = NULL; GtkWidget *cb, *label, *entry, *vbox, *sw, *frame; gboolean ret_val = FALSE; - + type = e_cal_component_get_vtype (comp); switch (type) { @@ -193,13 +193,13 @@ prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *pare return FALSE; } - dialog = (GtkMessageDialog *) gtk_message_dialog_new_with_markup - ((GtkWindow *) gtk_widget_get_toplevel (parent), GTK_DIALOG_MODAL, + dialog = (GtkMessageDialog *) gtk_message_dialog_new_with_markup + ((GtkWindow *) gtk_widget_get_toplevel (parent), GTK_DIALOG_MODAL, GTK_MESSAGE_QUESTION, GTK_BUTTONS_OK_CANCEL, "<b>%s</b>", message); g_free (message); gtk_window_set_resizable (GTK_WINDOW (dialog), TRUE); - + gtk_box_set_spacing ((GtkBox *) (GTK_DIALOG (dialog)->vbox), 12); vbox = GTK_WIDGET (GTK_DIALOG (dialog)->vbox); @@ -207,7 +207,7 @@ prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *pare gtk_container_add (GTK_CONTAINER (vbox), cb); label = gtk_label_new_with_mnemonic ("_Retract comment"); - + frame = gtk_frame_new (NULL); gtk_frame_set_label_widget ((GtkFrame *) frame, label); gtk_frame_set_label_align ((GtkFrame *) frame, 0, 0); @@ -216,7 +216,7 @@ prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *pare sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy ((GtkScrolledWindow *)sw, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); - + entry = gtk_text_view_new (); gtk_scrolled_window_add_with_viewport ((GtkScrolledWindow *)sw, entry); gtk_label_set_mnemonic_widget ((GtkLabel *)label, entry); @@ -237,7 +237,7 @@ prompt_retract_dialog (ECalComponent *comp, char **retract_text, GtkWidget *pare gtk_text_buffer_get_start_iter (text_buffer, &text_iter_start); gtk_text_buffer_get_end_iter (text_buffer, &text_iter_end); - *retract_text = gtk_text_buffer_get_text (text_buffer, &text_iter_start, + *retract_text = gtk_text_buffer_get_text (text_buffer, &text_iter_start, &text_iter_end, FALSE); } } diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c index a3bcfb76ee..d8f4df3cfc 100644 --- a/calendar/gui/dialogs/delete-error.c +++ b/calendar/gui/dialogs/delete-error.c @@ -33,9 +33,9 @@ /** * delete_error_dialog: - * + * * Shows any applicable error messages as the result of deleting and object - * + * **/ void delete_error_dialog (GError *error, ECalComponentVType vtype) @@ -43,10 +43,10 @@ delete_error_dialog (GError *error, ECalComponentVType vtype) GList *icon_list = NULL; GtkWidget *dialog; const char *str; - + if (!error) return; - + switch (error->code) { case E_CALENDAR_STATUS_CORBA_EXCEPTION: switch (vtype) { @@ -98,11 +98,11 @@ delete_error_dialog (GError *error, ECalComponentVType vtype) break; case E_CALENDAR_STATUS_OK: case E_CALENDAR_STATUS_OBJECT_NOT_FOUND: - default: + default: /* If not found, we don't care - its gone anyhow */ return; } - + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, str); @@ -110,13 +110,13 @@ delete_error_dialog (GError *error, ECalComponentVType vtype) icon_list = e_icon_factory_get_icon_list ("stock_calendar"); else if (vtype == E_CAL_COMPONENT_TODO) icon_list = e_icon_factory_get_icon_list ("stock_todo"); - + if (icon_list) { gtk_window_set_icon_list (GTK_WINDOW (dialog), icon_list); g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); g_list_free (icon_list); } - + gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); } diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index 0340194b22..8f2fbb4ed7 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -49,7 +49,7 @@ struct _EDelegateDialogPrivate { GtkWidget *addressbook; ENameSelector *name_selector; - GtkWidget *entry; + GtkWidget *entry; }; static const char *section_name = "Delegate To"; @@ -167,7 +167,7 @@ e_delegate_dialog_construct (EDelegateDialog *edd, const char *name, const char e_name_selector_model_peek_section (name_selector_model, section_name, NULL, &destination_store); e_destination_store_append_destination (destination_store, dest); g_object_unref (dest); - + g_signal_connect((priv->addressbook), "clicked", G_CALLBACK (addressbook_clicked_cb), edd); @@ -193,7 +193,7 @@ get_widgets (EDelegateDialog *edd) priv->app = GW ("delegate-dialog"); priv->hbox = GW ("delegate-hbox"); - priv->addressbook = GW ("addressbook"); + priv->addressbook = GW ("addressbook"); return (priv->app && priv->hbox @@ -206,7 +206,7 @@ addressbook_clicked_cb (GtkWidget *widget, gpointer data) EDelegateDialog *edd = data; EDelegateDialogPrivate *priv; ENameSelectorDialog *name_selector_dialog; - + priv = edd->priv; name_selector_dialog = e_name_selector_peek_dialog (priv->name_selector); @@ -251,7 +251,7 @@ e_delegate_dialog_get_delegate (EDelegateDialog *edd) EDestinationStore *destination_store; GList *destinations; EDestination *destination; - + g_return_val_if_fail (edd != NULL, NULL); g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL); @@ -269,7 +269,7 @@ e_delegate_dialog_get_delegate (EDelegateDialog *edd) g_free (priv->address); priv->address = g_strdup (e_destination_get_email (destination)); } - + g_list_free (destinations); return g_strdup (priv->address); } @@ -283,7 +283,7 @@ e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) EDestinationStore *destination_store; GList *destinations; EDestination *destination; - + g_return_val_if_fail (edd != NULL, NULL); g_return_val_if_fail (E_IS_DELEGATE_DIALOG (edd), NULL); @@ -301,7 +301,7 @@ e_delegate_dialog_get_delegate_name (EDelegateDialog *edd) g_free (priv->name); priv->name = g_strdup (e_destination_get_name (destination)); } - + g_list_free (destinations); return g_strdup (priv->name); } diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c index 01fe01529e..2d776c1df6 100644 --- a/calendar/gui/dialogs/e-send-options-utils.c +++ b/calendar/gui/dialogs/e-send-options-utils.c @@ -23,8 +23,8 @@ #include <glib.h> #include <string.h> -void -e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, char * type) +void +e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, char * type) { ESendOptionsGeneral *gopts = NULL; ESendOptionsStatusTracking *sopts; @@ -32,20 +32,20 @@ e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, ESourceList *source_list; const char *uid; const char *value; - + gopts = sod->data->gopts; sopts = sod->data->sopts; - + if (!strcmp (type, "calendar")) source_list = e_source_list_new_for_gconf (gconf, "/apps/evolution/calendar/sources"); - else + else source_list = e_source_list_new_for_gconf (gconf, "/apps/evolution/tasks/sources"); - + uid = e_source_peek_uid (source); source = e_source_list_peek_source_by_uid (source_list, uid); /* priority */ - value = e_source_get_property (source, "priority"); + value = e_source_get_property (source, "priority"); if (value) { if (!strcmp (value, "high")) gopts->priority = E_PRIORITY_HIGH; @@ -57,20 +57,20 @@ e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, gopts->priority = E_PRIORITY_UNDEFINED; } /* Reply requested */ - value = e_source_get_property (source, "reply-requested"); + value = e_source_get_property (source, "reply-requested"); if (value) { if (!strcmp (value, "none")) gopts->reply_enabled = FALSE; else if (!strcmp (value, "convinient")) { gopts->reply_enabled = TRUE; - gopts->reply_convenient = TRUE; + gopts->reply_convenient = TRUE; } else { gint i = atoi (value); gopts->reply_within = i; } } /* Delay delivery */ - value = e_source_get_property (source, "delay-delivery"); + value = e_source_get_property (source, "delay-delivery"); if (value) { if (!strcmp (value, "none")) gopts->delay_enabled = FALSE; @@ -78,9 +78,9 @@ e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, gopts->delay_enabled = TRUE; gopts->delay_until = icaltime_as_timet (icaltime_from_string (value)); } - } + } /* Expiration Date */ - value = e_source_get_property (source, "expiration"); + value = e_source_get_property (source, "expiration"); if (value) { if (!strcmp (value, "none")) gopts->expiration_enabled = FALSE; @@ -94,7 +94,7 @@ e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, } } /* status tracking */ - value = e_source_get_property (source, "status-tracking"); + value = e_source_get_property (source, "status-tracking"); if (value) { if (!strcmp (value, "none")) sopts->tracking_enabled = FALSE; @@ -110,44 +110,44 @@ e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, } /* Return Notifications */ - - value = e_source_get_property (source, "return-open"); + + value = e_source_get_property (source, "return-open"); if (value) { if (!strcmp (value, "none")) sopts->opened = E_RETURN_NOTIFY_NONE; - else + else sopts->opened = E_RETURN_NOTIFY_MAIL; } - - value = e_source_get_property (source, "return-accept"); + + value = e_source_get_property (source, "return-accept"); if (value) { if (!strcmp (value, "none")) sopts->accepted = E_RETURN_NOTIFY_NONE; - else + else sopts->accepted = E_RETURN_NOTIFY_MAIL; } - value = e_source_get_property (source, "return-decline"); + value = e_source_get_property (source, "return-decline"); if (value) { if (!strcmp (value, "none")) sopts->declined = E_RETURN_NOTIFY_NONE; - else + else sopts->declined = E_RETURN_NOTIFY_MAIL; } - - value = e_source_get_property (source, "return-complete"); + + value = e_source_get_property (source, "return-complete"); if (value) { if (!strcmp (value, "none")) sopts->completed = E_RETURN_NOTIFY_NONE; - else + else sopts->completed = E_RETURN_NOTIFY_MAIL; } g_object_unref (gconf); } -void -e_sendoptions_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp) +void +e_sendoptions_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp) { int i = 1; icalproperty *prop; @@ -164,19 +164,19 @@ e_sendoptions_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp if (e_sendoptions_get_need_general_options (sod)) { prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", gopts->priority)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-PRIORITY"); - icalcomponent_add_property (icalcomp, prop); + icalcomponent_add_property (icalcomp, prop); if (gopts->reply_enabled) { - if (gopts->reply_convenient) - prop = icalproperty_new_x ("convenient"); - else + if (gopts->reply_convenient) + prop = icalproperty_new_x ("convenient"); + else prop = icalproperty_new_x ((const char *) g_strdup_printf ( "%d", gopts->reply_within)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-REPLY"); icalcomponent_add_property (icalcomp, prop); } if (gopts->expiration_enabled && gopts->expire_after) { - prop = icalproperty_new_x ((const char *) g_strdup_printf ( "%d", gopts->expire_after)); + prop = icalproperty_new_x ((const char *) g_strdup_printf ( "%d", gopts->expire_after)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-EXPIRE"); icalcomponent_add_property (icalcomp, prop); } @@ -184,35 +184,35 @@ e_sendoptions_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp if (gopts->delay_enabled) { struct icaltimetype temp; icaltimezone *zone = calendar_config_get_icaltimezone (); - temp = icaltime_from_timet_with_zone (gopts->delay_until, FALSE, zone); + temp = icaltime_from_timet_with_zone (gopts->delay_until, FALSE, zone); prop = icalproperty_new_x (icaltime_as_ical_string (temp)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-DELAY"); icalcomponent_add_property (icalcomp, prop); } } - - if (sopts->tracking_enabled) - prop = icalproperty_new_x ((const char *) g_strdup_printf ( "%d", sopts->track_when)); + + if (sopts->tracking_enabled) + prop = icalproperty_new_x ((const char *) g_strdup_printf ( "%d", sopts->track_when)); else prop = icalproperty_new_x ("0"); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-TRACKINFO"); icalcomponent_add_property (icalcomp, prop); - - - prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->opened)); + + + prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->opened)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-OPENED"); icalcomponent_add_property (icalcomp, prop); - - prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->accepted)); + + prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->accepted)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-ACCEPTED"); icalcomponent_add_property (icalcomp, prop); - prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->declined)); + prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->declined)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-DECLINED"); icalcomponent_add_property (icalcomp, prop); - prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->completed)); + prop = icalproperty_new_x ((const char *) g_strdup_printf ("%d", sopts->completed)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-COMPLETED"); icalcomponent_add_property (icalcomp, prop); } diff --git a/calendar/gui/dialogs/e-send-options-utils.h b/calendar/gui/dialogs/e-send-options-utils.h index a1a2b99842..560a37ea9d 100644 --- a/calendar/gui/dialogs/e-send-options-utils.h +++ b/calendar/gui/dialogs/e-send-options-utils.h @@ -26,6 +26,6 @@ #include <libecal/e-cal-component.h> #include <libedataserver/e-source-list.h> -void e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, char* type); +void e_sendoptions_utils_set_default_data (ESendOptionsDialog *sod, ESource *source, char* type); void e_sendoptions_utils_fill_component (ESendOptionsDialog *sod, ECalComponent *comp); #endif diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index eb86ea07b4..e5081f8a34 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -51,7 +51,7 @@ struct _EventEditorPrivate { EMeetingStore *model; gboolean is_meeting; gboolean meeting_shown; - gboolean updating; + gboolean updating; }; @@ -74,14 +74,14 @@ event_editor_class_init (EventEditorClass *klass) { GObjectClass *gobject_class; CompEditorClass *editor_class; - + gobject_class = (GObjectClass *) klass; editor_class = (CompEditorClass *) klass; editor_class->set_e_cal = event_editor_set_e_cal; editor_class->edit_comp = event_editor_edit_comp; editor_class->send_comp = event_editor_send_comp; - + gobject_class->finalize = event_editor_finalize; } @@ -114,11 +114,11 @@ menu_view_role_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - event_page_set_view_role (ee->priv->event_page, atoi(state)); - calendar_config_set_show_role (atoi(state)); + event_page_set_view_role (ee->priv->event_page, atoi(state)); + calendar_config_set_show_role (atoi(state)); } static void @@ -129,12 +129,12 @@ menu_view_status_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - + event_page_set_view_status (ee->priv->event_page, atoi(state)); - calendar_config_set_show_status (atoi(state)); + calendar_config_set_show_status (atoi(state)); } static void @@ -145,11 +145,11 @@ menu_view_type_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - event_page_set_view_type (ee->priv->event_page, atoi(state)); - calendar_config_set_show_type (atoi(state)); + event_page_set_view_type (ee->priv->event_page, atoi(state)); + calendar_config_set_show_type (atoi(state)); } static void @@ -160,11 +160,11 @@ menu_view_rsvp_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - event_page_set_view_rsvp (ee->priv->event_page, atoi(state)); - calendar_config_set_show_rsvp (atoi(state)); + event_page_set_view_rsvp (ee->priv->event_page, atoi(state)); + calendar_config_set_show_rsvp (atoi(state)); } static void @@ -187,11 +187,11 @@ menu_show_time_busy_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - event_page_set_show_time_busy (ee->priv->event_page, atoi(state)); + event_page_set_show_time_busy (ee->priv->event_page, atoi(state)); } static void @@ -202,10 +202,10 @@ menu_all_day_event_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - event_page_set_all_day_event (ee->priv->event_page, atoi(state)); + event_page_set_all_day_event (ee->priv->event_page, atoi(state)); } static void @@ -216,10 +216,10 @@ menu_show_time_zone_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - event_page_set_show_timezone (ee->priv->event_page, atoi(state)); + event_page_set_show_timezone (ee->priv->event_page, atoi(state)); calendar_config_set_show_timezone (atoi(state)); } @@ -231,11 +231,11 @@ menu_show_categories_cb (BonoboUIComponent *component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - event_page_set_show_categories (ee->priv->event_page, atoi(state)); + event_page_set_show_categories (ee->priv->event_page, atoi(state)); calendar_config_set_show_categories (atoi(state)); } @@ -251,7 +251,7 @@ menu_class_public_cb (BonoboUIComponent *ui_component, return; comp_editor_page_notify_changed (COMP_EDITOR_PAGE (ee->priv->event_page)); - + event_page_set_classification (ee->priv->event_page, E_CAL_COMPONENT_CLASS_PUBLIC); } @@ -265,7 +265,7 @@ menu_class_private_cb (BonoboUIComponent *ui_component, EventEditor *ee = (EventEditor *) user_data; if (state[0] == '0') return; - + comp_editor_page_notify_changed (COMP_EDITOR_PAGE (ee->priv->event_page)); event_page_set_classification (ee->priv->event_page, E_CAL_COMPONENT_CLASS_PRIVATE); @@ -295,7 +295,7 @@ menu_action_recurrence_cb (BonoboUIComponent *ui_component, gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - + gtk_widget_show (ee->priv->recur_window); } @@ -304,13 +304,13 @@ menu_action_freebusy_cb (BonoboUIComponent *ui_component, const char *path, Bonobo_UIComponent_EventType type, const char *state, - gpointer user_data) + gpointer user_data) { EventEditor *ee = (EventEditor *) user_data; - - if (!ee->priv->sched_window) + + if (!ee->priv->sched_window) create_schedule_page (ee); - else + else gtk_widget_show (ee->priv->sched_window); } @@ -329,7 +329,7 @@ menu_all_day_event_cmd (BonoboUIComponent *uic, void *data, const char *path) { - /* TODO + /* TODO EventEditor *ee = (EventEditor *) data; event_page_set_all_day_event (ee->priv->event_page, atoi(state));*/ @@ -340,10 +340,10 @@ menu_show_time_zone_cmd (BonoboUIComponent *uic, void *data, const char *path) { - /* TODO + /* TODO EventEditor *ee = (EventEditor *) data; - - event_page_set_show_timezone (ee->priv->event_page, atoi(state)); + + event_page_set_show_timezone (ee->priv->event_page, atoi(state)); calendar_config_set_show_timezone (atoi(state)); */ } @@ -353,7 +353,7 @@ menu_action_recurrence_cmd (BonoboUIComponent *uic, const char *path) { EventEditor *ee = (EventEditor *) data; - + gtk_widget_show (ee->priv->recur_window); } @@ -395,9 +395,9 @@ menu_action_freebusy_cmd (BonoboUIComponent *uic, { EventEditor *ee = (EventEditor *) data; - if (!ee->priv->sched_window) + if (!ee->priv->sched_window) create_schedule_page (ee); - else + else gtk_widget_show (ee->priv->sched_window); } @@ -407,18 +407,18 @@ menu_insert_send_options_cmd (BonoboUIComponent *uic, const char *path) { EventEditor *ee = (EventEditor *) data; - + event_page_sendoptions_clicked_cb (ee->priv->event_page); } static BonoboUIVerb verbs [] = { BONOBO_UI_VERB ("ActionAlarm", menu_action_alarm_cmd), BONOBO_UI_VERB ("ActionAllDayEvent", menu_all_day_event_cmd), - BONOBO_UI_VERB ("ViewTimeZone", menu_show_time_zone_cmd), + BONOBO_UI_VERB ("ViewTimeZone", menu_show_time_zone_cmd), BONOBO_UI_VERB ("ActionRecurrence", menu_action_recurrence_cmd), BONOBO_UI_VERB ("ActionFreeBusy", menu_action_freebusy_cmd), BONOBO_UI_VERB ("InsertSendOptions", menu_insert_send_options_cmd), - + BONOBO_UI_VERB_END }; @@ -433,14 +433,14 @@ static EPixmap pixmaps[] = { E_PIXMAP ("/Toolbar/ActionAlarm", "stock_alarm", E_ICON_SIZE_LARGE_TOOLBAR), E_PIXMAP ("/Toolbar/ActionAllDayEvent", "stock_new-24h-appointment", E_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/ViewTimeZone", "stock_timezone", E_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/ActionRecurrence", "stock_task-recurring", E_ICON_SIZE_LARGE_TOOLBAR), + E_PIXMAP ("/Toolbar/ViewTimeZone", "stock_timezone", E_ICON_SIZE_LARGE_TOOLBAR), + E_PIXMAP ("/Toolbar/ActionRecurrence", "stock_task-recurring", E_ICON_SIZE_LARGE_TOOLBAR), /* These two will have an absolute path to the png file filled * in at run-time, see event_editor_init(). */ E_PIXMAP ("/Toolbar/ActionFreeBusy", NULL, E_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/commands/ActionFreeBusy", NULL, E_ICON_SIZE_MENU), + E_PIXMAP ("/commands/ActionFreeBusy", NULL, E_ICON_SIZE_MENU), E_PIXMAP_END }; @@ -458,7 +458,7 @@ event_editor_init (EventEditor *ee) priv->model = E_MEETING_STORE (e_meeting_store_new ()); priv->meeting_shown = TRUE; - priv->updating = FALSE; + priv->updating = FALSE; priv->is_meeting = FALSE; bonobo_ui_component_freeze (editor->uic, NULL); @@ -486,7 +486,7 @@ event_editor_init (EventEditor *ee) bonobo_ui_component_add_listener ( editor->uic, "ViewStatus", menu_view_status_cb, editor); - + /* Show hide the type fields */ status = calendar_config_get_show_type (); bonobo_ui_component_set_prop ( @@ -517,15 +517,15 @@ event_editor_init (EventEditor *ee) bonobo_ui_component_add_listener ( editor->uic, "ActionAlarm", menu_action_alarm_cb, editor); - + bonobo_ui_component_add_listener ( - editor->uic, "ActionAllDayEvent", + editor->uic, "ActionAllDayEvent", menu_all_day_event_cb, editor); - + bonobo_ui_component_add_listener ( - editor->uic, "ActionShowTimeBusy", + editor->uic, "ActionShowTimeBusy", menu_show_time_busy_cb, editor); - + status = calendar_config_get_show_timezone (); bonobo_ui_component_set_prop ( editor->uic, "/commands/ViewTimeZone", @@ -556,10 +556,10 @@ event_editor_init (EventEditor *ee) menu_class_confidential_cb, editor); bonobo_ui_component_add_listener ( - editor->uic, "ActionRecurrence", + editor->uic, "ActionRecurrence", menu_action_recurrence_cb, editor); bonobo_ui_component_add_listener ( - editor->uic, "ActionFreeBusy", + editor->uic, "ActionFreeBusy", menu_action_freebusy_cb, editor); /* NOTE: Make sure the 6 and 7 below correspond to the correct @@ -571,14 +571,14 @@ event_editor_init (EventEditor *ee) } e_pixmaps_update (editor->uic, pixmaps); - bonobo_ui_component_thaw (editor->uic, NULL); + bonobo_ui_component_thaw (editor->uic, NULL); comp_editor_set_help_section (COMP_EDITOR (ee), "usage-calendar-apts"); } /* Handler for the delete event. It hides the window without destroying it. Connected to the recur dialog and Free busy dialog */ -static gboolean +static gboolean window_delete_event (GtkWidget *widget, GdkEvent *event, gpointer user_data) { gtk_widget_hide (widget); @@ -597,7 +597,7 @@ event_editor_construct (EventEditor *ee, ECal *client) priv->event_page = event_page_new (priv->model, client, COMP_EDITOR(ee)->uic); g_object_ref_sink (priv->event_page); - comp_editor_append_page (COMP_EDITOR (ee), + comp_editor_append_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->event_page), _("Appoint_ment"), TRUE); g_signal_connect (G_OBJECT (priv->event_page), "client_changed", @@ -611,7 +611,7 @@ event_editor_construct (EventEditor *ee, ECal *client) g_signal_connect ((GtkWidget *) priv->recur_window, "delete-event", G_CALLBACK(window_delete_event), NULL); priv->recur_page = recurrence_page_new (); g_object_ref_sink (priv->recur_page); - gtk_container_add ((GtkContainer *) (GTK_DIALOG (priv->recur_window)->vbox), + gtk_container_add ((GtkContainer *) (GTK_DIALOG (priv->recur_window)->vbox), comp_editor_page_get_widget (COMP_EDITOR_PAGE (priv->recur_page))); gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (priv->recur_window))); comp_editor_append_page (COMP_EDITOR (ee), COMP_EDITOR_PAGE (priv->recur_page), NULL, FALSE); @@ -621,9 +621,9 @@ event_editor_construct (EventEditor *ee, ECal *client) event_page_show_options (priv->event_page); comp_editor_set_group_item (COMP_EDITOR (ee), TRUE); - if (!((flags & COMP_EDITOR_USER_ORG) || (flags & COMP_EDITOR_DELEGATE)|| (flags & COMP_EDITOR_NEW_ITEM))) + if (!((flags & COMP_EDITOR_USER_ORG) || (flags & COMP_EDITOR_DELEGATE)|| (flags & COMP_EDITOR_NEW_ITEM))) bonobo_ui_component_set_prop (editor->uic, "/commands/ActionFreeBusy", "hidden", "1", NULL); - + event_page_set_meeting (priv->event_page, TRUE); priv->meeting_shown=TRUE; } else { @@ -649,14 +649,14 @@ event_editor_set_e_cal (CompEditor *editor, ECal *client) { EventEditor *ee; EventEditorPrivate *priv; - + ee = EVENT_EDITOR (editor); priv = ee->priv; e_meeting_store_set_e_cal (priv->model, client); - + if (COMP_EDITOR_CLASS (event_editor_parent_class)->set_e_cal) - COMP_EDITOR_CLASS (event_editor_parent_class)->set_e_cal (editor, client); + COMP_EDITOR_CLASS (event_editor_parent_class)->set_e_cal (editor, client); } static void @@ -669,10 +669,10 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) ECalComponentDateTime dtstart, dtend; ECal *client; GSList *attendees = NULL; - + ee = EVENT_EDITOR (editor); priv = ee->priv; - + priv->updating = TRUE; delegate = (comp_editor_get_flags (COMP_EDITOR (editor)) & COMP_EDITOR_DELEGATE); @@ -694,26 +694,26 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) /* Get meeting related stuff */ e_cal_component_get_organizer (comp, &organizer); e_cal_component_get_attendee_list (comp, &attendees); - + /* Set up the attendees */ if (attendees != NULL) { GSList *l; int row; char *user_email; - user_email = itip_get_comp_attendee (comp, client); - + user_email = itip_get_comp_attendee (comp, client); + if (!priv->meeting_shown) { bonobo_ui_component_set_prop (editor->uic, "/commands/ActionFreeBusy", "hidden", "0", NULL); } - + if (!(delegate && e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY))) { for (l = attendees; l != NULL; l = l->next) { ECalComponentAttendee *ca = l->data; EMeetingAttendee *ia; - + if (delegate && !g_str_equal (itip_strip_mailto (ca->value), user_email)) continue; - + ia = E_MEETING_ATTENDEE (e_meeting_attendee_new_from_e_cal_component_attendee (ca)); /* If we aren't the organizer or the attendee is just delegated, don't allow editing */ @@ -751,10 +751,10 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE); } } - - event_page_set_meeting (priv->event_page, TRUE); + + event_page_set_meeting (priv->event_page, TRUE); priv->meeting_shown = TRUE; - } + } e_cal_component_free_attendee_list (attendees); comp_editor_set_needs_send (COMP_EDITOR (ee), priv->meeting_shown && (itip_organizer_is_user (comp, client) || itip_sentby_is_user (comp))); @@ -775,12 +775,12 @@ event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method) if (method == E_CAL_COMPONENT_METHOD_PUBLISH || method == E_CAL_COMPONENT_METHOD_CANCEL) goto parent; - + comp = event_page_get_cancel_comp (priv->event_page); if (comp != NULL) { ECal *client; gboolean result; - + client = e_meeting_store_get_e_cal (priv->model); result = itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL, NULL, NULL); @@ -788,7 +788,7 @@ event_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method) if (!result) return FALSE; - else + else return TRUE; } @@ -816,7 +816,7 @@ event_editor_finalize (GObject *object) g_object_unref (priv->event_page); priv->event_page = NULL; } - + if (priv->recur_page) { g_object_unref (priv->recur_page); priv->recur_page = NULL; @@ -864,13 +864,13 @@ show_meeting (EventEditor *ee) EventEditorPrivate *priv; CompEditor *editor = COMP_EDITOR (ee); CompEditorFlags flags = comp_editor_get_flags (editor); - + priv = ee->priv; event_page_set_meeting (priv->event_page, TRUE); if (!priv->meeting_shown) { bonobo_ui_component_set_prop (editor->uic, "/commands/ActionFreeBusy", "hidden", "0", NULL); - + priv->meeting_shown = TRUE; comp_editor_set_changed (COMP_EDITOR (ee), FALSE); diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index b9b354f017..a60b87c4c9 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -82,7 +82,7 @@ struct _EventPagePrivate { EAccountList *accounts; GList *address_strings; - EMeetingAttendee *ia; + EMeetingAttendee *ia; char *default_address; char *user_add; ECalComponent *comp; @@ -94,7 +94,7 @@ struct _EventPagePrivate { /* Lists of attendees */ GPtrArray *deleted_attendees; - + GtkWidget *start_time; GtkWidget *end_time; GtkWidget *end_time_selector; @@ -112,7 +112,7 @@ struct _EventPagePrivate { GtkWidget *description; ECalComponentClassification classification; - + gboolean show_time_as_busy; GtkWidget *alarm_dialog; @@ -124,7 +124,7 @@ struct _EventPagePrivate { GtkWidget *categories; GtkWidget *source_selector; - + /* Meeting related items */ GtkWidget *list_box; GtkWidget *organizer_table; @@ -147,14 +147,14 @@ struct _EventPagePrivate { gboolean updating; EAlarmList *alarm_list_store; - + gboolean sendoptions_shown; ESendOptionsDialog *sod; char *old_summary; CalUnits alarm_units; int alarm_interval; - + /* This is TRUE if both the start & end timezone are the same. If the start timezone is then changed, we updated the end timezone to the same value, since 99% of events start and end in one timezone. */ @@ -176,7 +176,7 @@ static gboolean event_page_fill_timezones (CompEditorPage *page, GHashTable *tim static void event_page_set_summary (CompEditorPage *page, const char *summary); static void event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates); static void notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, struct icaltimetype *end_tt); -static gboolean check_start_before_end (struct icaltimetype *start_tt, icaltimezone *start_zone, +static gboolean check_start_before_end (struct icaltimetype *start_tt, icaltimezone *start_zone, struct icaltimetype *end_tt, icaltimezone *end_zone, gboolean adjust_end_time); static void set_attendees (ECalComponent *comp, const GPtrArray *attendees); static void hour_sel_changed ( GtkSpinButton *widget, EventPage *epage); @@ -258,14 +258,14 @@ event_page_init (EventPage *epage) priv->ia = NULL; priv->default_address = NULL; priv->invite = NULL; - + priv->model = NULL; priv->list_view = NULL; - + priv->updating = FALSE; - + priv->alarm_interval = -1; - + priv->sendoptions_shown = FALSE; priv->is_meeting = FALSE; priv->sync_timezones = FALSE; @@ -277,7 +277,7 @@ static void cleanup_attendees (GPtrArray *attendees) { int i; - + for (i = 0; i < attendees->len; i++) g_object_unref (g_ptr_array_index (attendees, i)); } @@ -295,7 +295,7 @@ event_page_finalize (GObject *object) epage = EVENT_PAGE (object); priv = epage->priv; - + for (l = priv->address_strings; l != NULL; l = l->next) g_free (l->data); g_list_free (priv->address_strings); @@ -305,7 +305,7 @@ event_page_finalize (GObject *object) cleanup_attendees (priv->deleted_attendees); g_ptr_array_free (priv->deleted_attendees, TRUE); - + if (priv->main) g_object_unref (priv->main); @@ -446,7 +446,7 @@ set_all_day (EventPage *epage, gboolean all_day) priv = epage->priv; set_all_day_event_menu (epage, all_day); - + /* TODO implement for in end time selector */ if (all_day) gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); @@ -476,7 +476,7 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD if (!e_cal_get_timezone (COMP_EDITOR_PAGE (epage)->client, start_date->tzid, &start_zone, NULL)) { g_warning ("Couldn't get timezone from server: %s", - start_date->tzid ? start_date->tzid : ""); + start_date->tzid ? start_date->tzid : ""); } } @@ -490,7 +490,7 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD *end_tt = *start_tt; icaltime_adjust (end_tt, 1, 0, 0, 0); } - + if (start_tt->is_date && end_tt->is_date) { all_day_event = TRUE; if (icaltime_compare_date_only (*end_tt, *start_tt) > 0) { @@ -527,23 +527,23 @@ update_time (EventPage *epage, ECalComponentDateTime *start_date, ECalComponentD are the same. */ g_signal_handlers_block_matched (priv->start_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_block_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - + if (start_zone) e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->start_timezone), start_zone); def_zone = calendar_config_get_icaltimezone (); if (!def_zone || !start_zone || strcmp (icaltimezone_get_tzid(def_zone), icaltimezone_get_tzid (start_zone))) homezone = FALSE; - + event_page_set_show_timezone (epage, (calendar_config_get_show_timezone()|| !homezone) & !all_day_event); - + /*unblock the endtimezone widget*/ g_signal_handlers_unblock_matched (priv->end_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_unblock_matched (priv->start_timezone, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - priv->sync_timezones = TRUE; + priv->sync_timezones = TRUE; - update_end_time_selector (epage); + update_end_time_selector (epage); } /* Fills the widgets with default values */ @@ -582,13 +582,13 @@ clear_widgets (EventPage *epage) /* Alarm */ e_dialog_option_menu_set (priv->alarm_time, ALARM_NONE, alarm_map); - + /* Categories */ e_dialog_editable_set (priv->categories, NULL); } static gboolean -is_custom_alarm (ECalComponentAlarm *ca, char *old_summary, CalUnits user_units, int user_interval, int *alarm_type) +is_custom_alarm (ECalComponentAlarm *ca, char *old_summary, CalUnits user_units, int user_interval, int *alarm_type) { ECalComponentAlarmTrigger trigger; ECalComponentAlarmRepeat repeat; @@ -598,7 +598,7 @@ is_custom_alarm (ECalComponentAlarm *ca, char *old_summary, CalUnits user_units, icalproperty *icalprop; icalattach *attach; gboolean needs_desc = FALSE; - + e_cal_component_alarm_get_action (ca, &action); if (action != E_CAL_COMPONENT_ALARM_DISPLAY) return TRUE; @@ -619,7 +619,7 @@ is_custom_alarm (ECalComponentAlarm *ca, char *old_summary, CalUnits user_units, icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY); } - if (!needs_desc) { + if (!needs_desc) { e_cal_component_alarm_get_description (ca, &desc); if (!desc.value || !old_summary || strcmp (desc.value, old_summary)) return TRUE; @@ -628,14 +628,14 @@ is_custom_alarm (ECalComponentAlarm *ca, char *old_summary, CalUnits user_units, e_cal_component_alarm_get_repeat (ca, &repeat); if (repeat.repetitions != 0) return TRUE; - + if (e_cal_component_alarm_has_attendees (ca)) return TRUE; - + e_cal_component_alarm_get_trigger (ca, &trigger); if (trigger.type != E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START) return TRUE; - + if (trigger.u.rel_duration.is_neg != 1) return TRUE; @@ -652,7 +652,7 @@ is_custom_alarm (ECalComponentAlarm *ca, char *old_summary, CalUnits user_units, *alarm_type = ALARM_1_DAY; return FALSE; } - + if (trigger.u.rel_duration.days == 0 && trigger.u.rel_duration.hours == 1 && trigger.u.rel_duration.minutes == 0) { @@ -660,47 +660,47 @@ is_custom_alarm (ECalComponentAlarm *ca, char *old_summary, CalUnits user_units, *alarm_type = ALARM_1_HOUR; return FALSE; } - + if (trigger.u.rel_duration.days == 0 && trigger.u.rel_duration.hours == 0 && trigger.u.rel_duration.minutes == 15) { if (alarm_type) - *alarm_type = ALARM_15_MINUTES; + *alarm_type = ALARM_15_MINUTES; return FALSE; } if (user_interval != -1) { switch (user_units) { - case CAL_DAYS: + case CAL_DAYS: if (trigger.u.rel_duration.days == user_interval && trigger.u.rel_duration.hours == 0 && trigger.u.rel_duration.minutes == 0) { if (alarm_type) - *alarm_type = ALARM_USER_TIME; + *alarm_type = ALARM_USER_TIME; return FALSE; } break; - + case CAL_HOURS: if (trigger.u.rel_duration.days == 0 && trigger.u.rel_duration.hours == user_interval && trigger.u.rel_duration.minutes == 0) { if (alarm_type) - *alarm_type = ALARM_USER_TIME; + *alarm_type = ALARM_USER_TIME; return FALSE; } break; - + case CAL_MINUTES: if (trigger.u.rel_duration.days == 0 && trigger.u.rel_duration.hours == 0 && trigger.u.rel_duration.minutes == user_interval) { if (alarm_type) - *alarm_type = ALARM_USER_TIME; + *alarm_type = ALARM_USER_TIME; return FALSE; } break; - } + } } return TRUE; @@ -711,7 +711,7 @@ is_custom_alarm_uid_list (ECalComponent *comp, GList *alarms, char *old_summary, { ECalComponentAlarm *ca; gboolean result; - + if (g_list_length (alarms) > 1) return TRUE; @@ -723,13 +723,13 @@ is_custom_alarm_uid_list (ECalComponent *comp, GList *alarms, char *old_summary, } static gboolean -is_custom_alarm_store (EAlarmList *alarm_list_store, char *old_summary, CalUnits user_units, int user_interval, int *alarm_type) +is_custom_alarm_store (EAlarmList *alarm_list_store, char *old_summary, CalUnits user_units, int user_interval, int *alarm_type) { const ECalComponentAlarm *alarm; GtkTreeModel *model; GtkTreeIter iter; gboolean valid_iter; - + model = GTK_TREE_MODEL (alarm_list_store); valid_iter = gtk_tree_model_get_iter_first (model, &iter); @@ -743,7 +743,7 @@ is_custom_alarm_store (EAlarmList *alarm_list_store, char *old_summary, CalUnit valid_iter = gtk_tree_model_iter_next (model, &iter); if (valid_iter) return TRUE; - + return FALSE; } @@ -779,7 +779,7 @@ event_page_set_view_rsvp (EventPage *epage, gboolean state) e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", state); } -void +void event_page_set_classification (EventPage *epage, ECalComponentClassification class) { epage->priv->classification = class; @@ -790,7 +790,7 @@ create_image_event_box (const char *image_text, const char *tip_text) { GtkWidget *image, *box; GtkTooltips *tip; - + box = gtk_event_box_new (); tip = gtk_tooltips_new (); image = e_icon_factory_get_image (image_text, E_ICON_SIZE_MENU); @@ -799,7 +799,7 @@ create_image_event_box (const char *image_text, const char *tip_text) gtk_widget_show_all (box); gtk_tooltips_set_tip (tip, box, tip_text, NULL); - return box; + return box; } static void @@ -807,36 +807,36 @@ sensitize_widgets (EventPage *epage) { gboolean read_only, custom, alarm, sens = TRUE, sensitize; EventPagePrivate *priv; - gboolean delegate; - + gboolean delegate; + priv = epage->priv; if (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_MEETING) sens = COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_USER_ORG; if (!e_cal_is_read_only (COMP_EDITOR_PAGE (epage)->client, &read_only, NULL)) read_only = TRUE; - + delegate = COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE; - + sensitize = !read_only && sens; alarm = e_dialog_option_menu_get (priv->alarm_time, alarm_map) != ALARM_NONE; - custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL) || + custom = is_custom_alarm_store (priv->alarm_list_store, priv->old_summary, priv->alarm_units, priv->alarm_interval, NULL) || e_dialog_option_menu_get (priv->alarm_time, alarm_map) == ALARM_CUSTOM ? TRUE:FALSE; if (alarm && !priv->alarm_icon) { priv->alarm_icon = create_image_event_box ("stock_bell", _("This event has alarms")); gtk_box_pack_start ((GtkBox *)priv->status_icons, priv->alarm_icon, FALSE, FALSE, 6); } - - /* The list of organizers is set to be non-editable. Otherwise any - * change in the displayed list causes an 'Account not found' error. + + /* The list of organizers is set to be non-editable. Otherwise any + * change in the displayed list causes an 'Account not found' error. */ gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); gtk_editable_set_editable (GTK_EDITABLE (priv->summary), !read_only); gtk_editable_set_editable (GTK_EDITABLE (priv->location), sensitize); - gtk_widget_set_sensitive (priv->alarm_box, custom); + gtk_widget_set_sensitive (priv->alarm_box, custom); gtk_widget_set_sensitive (priv->start_time, sensitize); gtk_widget_set_sensitive (priv->start_timezone, sensitize); gtk_widget_set_sensitive (priv->end_time, sensitize); @@ -848,9 +848,9 @@ sensitize_widgets (EventPage *epage) if ( (COMP_EDITOR_PAGE(epage)->flags) & COMP_EDITOR_PAGE_NEW_ITEM ) { if (priv->all_day_event) gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); - else + else gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 0); - } else + } else gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); gtk_widget_set_sensitive (priv->hour_selector, sensitize); @@ -868,7 +868,7 @@ sensitize_widgets (EventPage *epage) e_meeting_list_view_set_editable (priv->list_view, (!read_only && sens) || delegate); gtk_widget_set_sensitive (priv->remove, (!read_only && sens) || delegate); gtk_widget_set_sensitive (priv->invite, (!read_only && sens) || delegate); - gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only); + gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only); bonobo_ui_component_set_prop (priv->uic, "/commands/InsertAttachments", "sensitive", sensitize ? "1" : "0" , NULL); @@ -905,9 +905,9 @@ sensitize_widgets (EventPage *epage) gtk_widget_show (priv->list_box); gtk_widget_show (priv->attendee_box); gtk_widget_show (priv->organizer); - gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("Or_ganizer:")); + gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("Or_ganizer:")); } - + } void @@ -928,7 +928,7 @@ event_page_show_options (EventPage *page) page->priv->sendoptions_shown = TRUE; } -void +void event_page_set_meeting (EventPage *page, gboolean set) { g_return_if_fail (IS_EVENT_PAGE (page)); @@ -937,7 +937,7 @@ event_page_set_meeting (EventPage *page, gboolean set) sensitize_widgets (page); } -void +void event_page_set_delegate (EventPage *page, gboolean set) { g_return_if_fail (IS_EVENT_PAGE (page)); @@ -950,17 +950,17 @@ event_page_set_delegate (EventPage *page, gboolean set) static EAccount * get_current_account (EventPage *epage) -{ +{ EventPagePrivate *priv; EIterator *it; const char *str; - + priv = epage->priv; str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry)); if (!str) return NULL; - + for (it = e_list_get_iterator((EList *)priv->accounts); e_iterator_is_valid(it); e_iterator_next(it)) { EAccount *a = (EAccount *)e_iterator_get(it); char *full = g_strdup_printf("%s <%s>", a->id->name, a->id->address); @@ -971,12 +971,12 @@ get_current_account (EventPage *epage) return a; } - + g_free (full); } g_object_unref (it); - - return NULL; + + return NULL; } /* fill_widgets handler for the event page */ @@ -994,7 +994,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) gchar *backend_addr = NULL; GSList *l; gboolean validated = TRUE; - + g_return_val_if_fail (page->client != NULL, FALSE); epage = EVENT_PAGE (page); @@ -1005,15 +1005,15 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* Don't send off changes during this time */ priv->updating = TRUE; - + /* Clean out old data */ if (priv->comp != NULL) g_object_unref (priv->comp); priv->comp = NULL; - + cleanup_attendees (priv->deleted_attendees); g_ptr_array_set_size (priv->deleted_attendees, 0); - + /* Clean the page */ clear_widgets (epage); @@ -1021,18 +1021,18 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* Component for cancellation */ priv->comp = e_cal_component_clone (comp); - + e_cal_component_get_summary (comp, &text); e_dialog_editable_set (priv->summary, text.value); priv->old_summary = g_strdup (text.value); - + e_cal_component_get_location (comp, &location); e_dialog_editable_set (priv->location, location); e_cal_component_get_description_list (comp, &l); if (l && l->data) { ECalComponentText *dtext; - + dtext = l->data; gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), dtext->value ? dtext->value : "", -1); @@ -1043,9 +1043,9 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) set_subscriber_info_string (epage, backend_addr); if (priv->is_meeting) { - ECalComponentOrganizer organizer; + ECalComponentOrganizer organizer; - priv->user_add = itip_get_comp_attendee (comp, COMP_EDITOR_PAGE (epage)->client); + priv->user_add = itip_get_comp_attendee (comp, COMP_EDITOR_PAGE (epage)->client); /* Organizer strings */ event_page_select_organizer (epage, backend_addr); @@ -1057,7 +1057,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) const gchar *strip = itip_strip_mailto (organizer.value); gchar *string; GList *list = NULL; - + if (itip_organizer_is_user (comp, page->client) || itip_sentby_is_user (comp)) { if (e_cal_get_static_capability ( page->client, @@ -1105,7 +1105,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (!(backend_addr && *backend_addr) || !g_ascii_strcasecmp (backend_addr, a->id->address)) { e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address)); e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name)); - } else { + } else { e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", backend_addr)); e_meeting_attendee_set_sentby (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address)); } @@ -1120,7 +1120,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } } - if (backend_addr) + if (backend_addr) g_free (backend_addr); /* Start and end times */ @@ -1134,7 +1134,7 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) validated = FALSE; } else update_time (epage, &start_date, &end_date); - + e_cal_component_free_datetime (&start_date); e_cal_component_free_datetime (&end_date); @@ -1175,22 +1175,22 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* Alarms */ g_signal_handlers_block_matched (priv->alarm_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_block_matched (priv->alarm_list_store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - + if (e_cal_component_has_alarms (comp)) { GList *alarms, *list; int alarm_type; - + alarms = e_cal_component_get_alarm_uids (comp); if (!is_custom_alarm_uid_list (comp, alarms, priv->old_summary, priv->alarm_units, priv->alarm_interval, &alarm_type)) e_dialog_option_menu_set (priv->alarm_time, alarm_type, alarm_map); - else + else e_dialog_option_menu_set (priv->alarm_time, ALARM_CUSTOM, alarm_map); - + for (list = alarms; list != NULL; list = list->next) { ECalComponentAlarm *ca; - + ca = e_cal_component_get_alarm (comp, list->data); - e_alarm_list_append (priv->alarm_list_store, NULL, ca); + e_alarm_list_append (priv->alarm_list_store, NULL, ca); e_cal_component_alarm_free (ca); } @@ -1204,14 +1204,14 @@ event_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* Categories */ e_cal_component_get_categories (comp, &categories); e_dialog_editable_set (priv->categories, categories); - + /* Source */ e_source_combo_box_set_active ( E_SOURCE_COMBO_BOX (priv->source_selector), e_cal_get_source (page->client)); e_cal_component_get_uid (comp, &uid); - if (!(COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) + if (!(COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE) && !(COMP_EDITOR_PAGE (epage)->flags && COMP_EDITOR_PAGE_NEW_ITEM)) { event_page_hide_options (epage); } @@ -1377,7 +1377,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) e_cal_component_set_transparency (comp, busy ? E_CAL_COMPONENT_TRANSP_OPAQUE : E_CAL_COMPONENT_TRANSP_TRANSPARENT); /* send options */ - if (priv->sendoptions_shown && priv->sod) + if (priv->sendoptions_shown && priv->sod) e_sendoptions_utils_fill_component (priv->sod, comp); /* Alarm */ @@ -1389,19 +1389,19 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) gboolean valid_iter; model = GTK_TREE_MODEL (priv->alarm_list_store); - + for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter; valid_iter = gtk_tree_model_iter_next (model, &iter)) { ECalComponentAlarm *alarm, *alarm_copy; icalcomponent *icalcomp; icalproperty *icalprop; - + alarm = (ECalComponentAlarm *) e_alarm_list_get_alarm (priv->alarm_list_store, &iter); if (!alarm) { g_warning ("alarm is NULL\n"); continue; } - + /* We set the description of the alarm if it's got * the X-EVOLUTION-NEEDS-DESCRIPTION property. */ @@ -1438,51 +1438,51 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) int alarm_type; ca = e_cal_component_alarm_new (); - + e_cal_component_get_summary (comp, &summary); - + if (summary.value) e_cal_component_alarm_set_description (ca, &summary); - + e_cal_component_alarm_set_action (ca, E_CAL_COMPONENT_ALARM_DISPLAY); memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger)); - trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; + trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; trigger.u.rel_duration.is_neg = 1; - + alarm_type = e_dialog_option_menu_get (priv->alarm_time, alarm_map); switch (alarm_type) { case ALARM_15_MINUTES: trigger.u.rel_duration.minutes = 15; break; - + case ALARM_1_HOUR: trigger.u.rel_duration.hours = 1; break; - + case ALARM_1_DAY: trigger.u.rel_duration.days = 1; break; case ALARM_USER_TIME: switch (calendar_config_get_default_reminder_units ()) { - case CAL_DAYS: + case CAL_DAYS: trigger.u.rel_duration.days = priv->alarm_interval; break; - + case CAL_HOURS: trigger.u.rel_duration.hours = priv->alarm_interval; break; - + case CAL_MINUTES: trigger.u.rel_duration.minutes = priv->alarm_interval; break; } break; - + default: break; - } + } e_cal_component_alarm_set_trigger (ca, trigger); e_cal_component_add_alarm (comp, ca); @@ -1495,9 +1495,9 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) if (!priv->existing) { EAccount *a; gchar *backend_addr = NULL, *org_addr = NULL, *sentby = NULL; - + e_cal_get_cal_address (priv->client, &backend_addr, NULL); - + /* Find the identity for the organizer or sentby field */ a = get_current_account (epage); @@ -1505,14 +1505,14 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) if (a == NULL) { e_notice (page, GTK_MESSAGE_ERROR, _("The organizer selected no longer has an account.")); - return FALSE; + return FALSE; } if (a->id->address == NULL || strlen (a->id->address) == 0) { e_notice (page, GTK_MESSAGE_ERROR, _("An organizer is required.")); return FALSE; - } + } if (!(backend_addr && *backend_addr) || !g_ascii_strcasecmp (backend_addr, a->id->address)) { org_addr = g_strdup_printf ("MAILTO:%s", a->id->address); @@ -1569,7 +1569,7 @@ event_page_fill_component (CompEditorPage *page, ECalComponent *comp) } e_cal_component_set_attendee_list (comp, attendee_list); e_cal_component_free_attendee_list (attendee_list); - } else + } else set_attendees (comp, e_meeting_store_get_attendees (priv->model)); } @@ -1613,7 +1613,7 @@ event_page_set_summary (CompEditorPage *page, const char *summary) static void event_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) -{ +{ update_time (EVENT_PAGE (page), dates->start, dates->end); } @@ -1665,7 +1665,7 @@ void update_end_time_selector (EventPage *epage) e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), &end_tt.hour, &end_tt.minute); - + end_timet = icaltime_as_timet (end_tt); start_timet = icaltime_as_timet (start_tt); @@ -1726,7 +1726,7 @@ edit_clicked_cb (GtkButton *btn, EventPage *epage) GtkTreePath *path = NULL; GtkTreeViewColumn *focus_col; gint row = 0; - + priv = epage->priv; gtk_tree_view_get_cursor (GTK_TREE_VIEW (priv->list_view), &path, NULL); @@ -1754,16 +1754,16 @@ add_clicked_cb (GtkButton *btn, EventPage *epage) } static gboolean -existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) +existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) { GSList *attendees, *l; const gchar *ia_address; const gchar *ia_sentby = NULL; - + ia_address = itip_strip_mailto (e_meeting_attendee_get_address (ia)); if (!ia_address) return FALSE; - + if (e_meeting_attendee_is_set_sentby (ia)) ia_sentby = itip_strip_mailto (e_meeting_attendee_get_sentby (ia)); @@ -1773,7 +1773,7 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) ECalComponentAttendee *attendee = l->data; const char *address; const char *sentby = NULL; - + address = itip_strip_mailto (attendee->value); if (attendee->sentby) sentby = itip_strip_mailto (attendee->sentby); @@ -1783,19 +1783,19 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) return TRUE; } } - + e_cal_component_free_attendee_list (attendees); - + return FALSE; } static void -remove_attendee (EventPage *epage, EMeetingAttendee *ia) +remove_attendee (EventPage *epage, EMeetingAttendee *ia) { EventPagePrivate *priv; int pos = 0; gboolean delegate = (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE); - + priv = epage->priv; /* If the user deletes the organizer attendee explicitly, @@ -1803,22 +1803,22 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia) if (ia == priv->ia) { g_object_unref (priv->ia); priv->ia = NULL; - } - + } + /* If this was a delegatee, no longer delegate */ if (e_meeting_attendee_is_set_delfrom (ia)) { EMeetingAttendee *ib; - + ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delfrom (ia), &pos); if (ib != NULL) { e_meeting_attendee_set_delto (ib, NULL); - - if (!delegate) + + if (!delegate) e_meeting_attendee_set_edit_level (ib, E_MEETING_ATTENDEE_EDIT_FULL); - } + } } - - /* Handle deleting all attendees in the delegation chain */ + + /* Handle deleting all attendees in the delegation chain */ while (ia != NULL) { EMeetingAttendee *ib = NULL; @@ -1826,16 +1826,16 @@ remove_attendee (EventPage *epage, EMeetingAttendee *ia) g_object_ref (ia); g_ptr_array_add (priv->deleted_attendees, ia); } - + if (e_meeting_attendee_get_delto (ia) != NULL) ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delto (ia), NULL); - + e_meeting_list_view_remove_attendee_from_name_selector (priv->list_view, ia); e_meeting_store_remove_attendee (priv->model, ia); ia = ib; } - + sensitize_widgets (epage); } @@ -1851,7 +1851,7 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage) GtkTreeModel *model = NULL; gboolean valid_iter; char *address; - + priv = epage->priv; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); @@ -1861,10 +1861,10 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage) return; } paths = g_list_reverse (paths); - + for (tmp = paths; tmp; tmp=tmp->next) { path = tmp->data; - + gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->model), &iter, path); gtk_tree_model_get (GTK_TREE_MODEL (priv->model), &iter, E_MEETING_STORE_ADDRESS_COL, &address, -1); @@ -1874,35 +1874,35 @@ remove_clicked_cb (GtkButton *btn, EventPage *epage) g_warning ("Cannot delete attendee\n"); continue; } else if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL) { - g_warning("Not enough rights to delete attendee: %s\n", e_meeting_attendee_get_address(ia)); + g_warning("Not enough rights to delete attendee: %s\n", e_meeting_attendee_get_address(ia)); continue; } - + remove_attendee (epage, ia); } - + /* Select closest item after removal */ valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path); if (!valid_iter) { gtk_tree_path_prev (path); valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path); } - + if (valid_iter) { gtk_tree_selection_unselect_all (selection); gtk_tree_selection_select_iter (selection, &iter); } - + g_list_foreach (paths, (GFunc) gtk_tree_path_free, NULL); g_list_free (paths); } static void -invite_cb (GtkWidget *widget, gpointer data) +invite_cb (GtkWidget *widget, gpointer data) { EventPage *page; EventPagePrivate *priv; - + page = EVENT_PAGE (data); priv = page->priv; @@ -1912,7 +1912,7 @@ invite_cb (GtkWidget *widget, gpointer data) static void attendee_added_cb (EMeetingListView *emlv, EMeetingAttendee *ia, gpointer user_data) { - EventPage *epage = EVENT_PAGE (user_data); + EventPage *epage = EVENT_PAGE (user_data); EventPagePrivate *priv; gboolean delegate = (COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_DELEGATE); @@ -1922,15 +1922,15 @@ attendee_added_cb (EMeetingListView *emlv, EMeetingAttendee *ia, gpointer user_d if (existing_attendee (ia, priv->comp)) e_meeting_store_remove_attendee (priv->model, ia); else { - if (!e_cal_get_static_capability (COMP_EDITOR_PAGE(epage)->client, + if (!e_cal_get_static_capability (COMP_EDITOR_PAGE(epage)->client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) { const char *delegator_id = e_meeting_attendee_get_delfrom (ia); EMeetingAttendee *delegator; delegator = e_meeting_store_find_attendee (priv->model, delegator_id, NULL); - e_meeting_attendee_set_delto (delegator, + e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address (ia))); - + e_meeting_attendee_set_delfrom (ia, g_strdup_printf ("MAILTO:%s", delegator_id)); gtk_widget_set_sensitive (priv->invite, FALSE); gtk_widget_set_sensitive (priv->add, FALSE); @@ -1954,7 +1954,7 @@ static void popup_delete_cb (EPopup *ep, EPopupItem *pitem, void *data) { EventPage *epage = data; - + remove_clicked_cb (NULL, epage); } @@ -1967,7 +1967,7 @@ enum { static EPopupItem context_menu_items[] = { { E_POPUP_ITEM, "10.delete", N_("_Remove"), popup_delete_cb, NULL, GTK_STOCK_REMOVE, ATTENDEE_CAN_DELETE }, - { E_POPUP_ITEM, "15.add", N_("_Add "), popup_add_cb, NULL, GTK_STOCK_ADD, ATTENDEE_CAN_ADD }, + { E_POPUP_ITEM, "15.add", N_("_Add "), popup_add_cb, NULL, GTK_STOCK_ADD, ATTENDEE_CAN_ADD }, }; static void @@ -2000,7 +2000,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, EventPage *epage) GtkTreeSelection *selection; if (gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path)) { - + gtk_tree_model_get (GTK_TREE_MODEL (priv->model), &iter, E_MEETING_STORE_ADDRESS_COL, &address, -1); ia = e_meeting_store_find_attendee (priv->model, address, &priv->row); g_free (address); @@ -2009,7 +2009,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, EventPage *epage) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); gtk_tree_selection_unselect_all (selection); gtk_tree_selection_select_path (selection, path); - + if (e_meeting_attendee_get_edit_level (ia) == E_MEETING_ATTENDEE_EDIT_FULL) disable_mask &= ~ATTENDEE_CAN_DELETE; } @@ -2025,7 +2025,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, EventPage *epage) for (i=0;i<sizeof(context_menu_items)/sizeof(context_menu_items[0]);i++) menus = g_slist_prepend(menus, &context_menu_items[i]); - + e_popup_add_items((EPopup *)ep, menus, NULL, context_popup_free, epage); menu = e_popup_create_menu_once((EPopup *)ep, NULL, disable_mask); gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, event->time); @@ -2035,9 +2035,9 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, EventPage *epage) static gboolean list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage) { - + EventPagePrivate *priv= epage->priv; - + if (event->type == GDK_2BUTTON_PRESS && COMP_EDITOR_PAGE (epage)->flags & COMP_EDITOR_PAGE_USER_ORG) { EMeetingAttendee *attendee; @@ -2051,7 +2051,7 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, EventPage *epage) return TRUE; } - return FALSE; + return FALSE; } @@ -2059,7 +2059,7 @@ static gboolean list_key_press (EMeetingListView *list_view, GdkEventKey *event, EventPage *epage) { if (event->keyval == GDK_Delete) { - + remove_clicked_cb (NULL, epage); return TRUE; @@ -2104,14 +2104,14 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) /* TODO implement the for portion in end time selector */ gtk_widget_set_sensitive (priv->end_time_selector, !all_day); - if (all_day) + if (all_day) gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); - else + else gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 0); - + if (all_day) { bonobo_ui_component_set_prop (epage->priv->uic, "/commands/ViewTimeZone", "sensitive", "0", NULL); - + /* Round down to the start of the day. */ start_tt.hour = 0; start_tt.minute = 0; @@ -2129,7 +2129,7 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) icaltimezone *start_zone; bonobo_ui_component_set_prop (epage->priv->uic, "/commands/ViewTimeZone", "sensitive", "1", NULL); - + if (end_tt.year == start_tt.year && end_tt.month == start_tt.month && end_tt.day == start_tt.day) { @@ -2155,7 +2155,7 @@ event_page_set_all_day_event (EventPage *epage, gboolean all_day) &end_tt, start_zone, TRUE); } - + event_page_set_show_timezone (epage, calendar_config_get_show_timezone() & !all_day); g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); @@ -2196,17 +2196,17 @@ event_page_show_alarm (EventPage *epage) gtk_widget_show (epage->priv->alarm_dialog); } -void +void event_page_set_show_timezone (EventPage *epage, gboolean state) { if (state) { gtk_widget_show_all (epage->priv->start_timezone); - gtk_widget_show (epage->priv->timezone_label); + gtk_widget_show (epage->priv->timezone_label); } else { gtk_widget_hide (epage->priv->start_timezone); gtk_widget_hide (epage->priv->timezone_label); } - + } void @@ -2214,7 +2214,7 @@ event_page_set_show_categories (EventPage *epage, gboolean state) { if (state) { gtk_widget_show (epage->priv->categories_btn); - gtk_widget_show (epage->priv->categories); + gtk_widget_show (epage->priv->categories); } else { gtk_widget_hide (epage->priv->categories_btn); gtk_widget_hide (epage->priv->categories); @@ -2222,7 +2222,7 @@ event_page_set_show_categories (EventPage *epage, gboolean state) } /*If the msg has some value set, the icon should always be set */ -void +void event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *msg) { EventPagePrivate *priv; @@ -2232,10 +2232,10 @@ event_page_set_info_string (EventPage *epage, const gchar *icon, const gchar *ms gtk_image_set_from_stock (GTK_IMAGE (priv->info_icon), icon, GTK_ICON_SIZE_BUTTON); gtk_label_set_text (GTK_LABEL(priv->info_string), msg); - if (msg && icon) - gtk_widget_show (priv->info_hbox); - else - gtk_widget_hide (priv->info_hbox); + if (msg && icon) + gtk_widget_show (priv->info_hbox); + else + gtk_widget_hide (priv->info_hbox); } /* Gets the widgets from the XML file and returns if they are all available. */ @@ -2285,7 +2285,7 @@ get_widgets (EventPage *epage) g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); - priv->categories = GW ("categories"); + priv->categories = GW ("categories"); priv->categories_btn = GW ("categories-button"); priv->organizer = GW ("organizer"); priv->summary = GW ("summary"); @@ -2302,30 +2302,30 @@ get_widgets (EventPage *epage) priv->remove = GW ("remove-attendee"); priv->edit = GW ("edit-attendee"); priv->list_box = GW ("list-box"); - + priv->calendar_label = GW ("calendar-label"); priv->attendee_box = GW ("attendee-box"); priv->org_cal_label = GW ("org-cal-label"); priv->list_view = e_meeting_list_view_new (priv->model); - + sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); gtk_widget_show (sw); gtk_container_add (GTK_CONTAINER (sw), GTK_WIDGET (priv->list_view)); gtk_box_pack_start (GTK_BOX (priv->list_box), sw, TRUE, TRUE, 0); - + /* Glade's visibility flag doesn't seem to work for custom widgets */ priv->start_time = GW ("start-time"); gtk_widget_show (priv->start_time); - + priv->time_hour = GW ("time-hour"); priv->hour_selector = GW ("hour_selector"); priv->minute_selector = GW ("minute_selector"); priv->end_time_selector = GW ("end-time-selector"); - + priv->end_time = GW ("end-time"); gtk_widget_show_all (priv->time_hour); gtk_widget_hide (priv->end_time); @@ -2374,13 +2374,13 @@ summary_changed_cb (GtkEditable *editable, gpointer data) EventPage *epage; EventPagePrivate *priv; gchar *summary; - + epage = EVENT_PAGE (data); priv = epage->priv; - + if (priv->updating) return; - + summary = e_dialog_editable_get (GTK_WIDGET (editable)); comp_editor_page_notify_summary_changed (COMP_EDITOR_PAGE (epage), summary); @@ -2401,7 +2401,7 @@ notify_dates_changed (EventPage *epage, struct icaltimetype *start_tt, gboolean all_day_event; icaltimezone *start_zone = NULL; priv = epage->priv; - + all_day_event = priv->all_day_event; start_dt.value = start_tt; @@ -2485,7 +2485,7 @@ times_updated (EventPage *epage, gboolean adjust_end_time) gboolean date_set, all_day_event; gboolean set_start_date = FALSE, set_end_date = FALSE; icaltimezone *start_zone; - + priv = epage->priv; if (priv->updating) @@ -2575,7 +2575,7 @@ static void start_date_changed_cb (GtkWidget *dedit, gpointer data) { EventPage *epage; - + epage = EVENT_PAGE (data); hour_minute_changed (epage); @@ -2590,7 +2590,7 @@ static void end_date_changed_cb (GtkWidget *dedit, gpointer data) { EventPage *epage; - + epage = EVENT_PAGE (data); times_updated (epage, FALSE); @@ -2654,9 +2654,9 @@ event_page_sendoptions_clicked_cb (EventPage *epage) E_SOURCE_COMBO_BOX (priv->source_selector)); e_sendoptions_utils_set_default_data (priv->sod, source, "calendar"); priv->sod->data->initialized = TRUE; - } + } - if (e_cal_get_static_capability (COMP_EDITOR_PAGE (epage)->client, + if (e_cal_get_static_capability (COMP_EDITOR_PAGE (epage)->client, CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS)) { e_sendoptions_set_need_general_options (priv->sod, FALSE); } @@ -2671,10 +2671,10 @@ field_changed_cb (GtkWidget *widget, gpointer data) { EventPage *epage; EventPagePrivate *priv; - + epage = EVENT_PAGE (data); priv = epage->priv; - + if (!priv->updating) comp_editor_page_notify_changed (COMP_EDITOR_PAGE (epage)); } @@ -2693,7 +2693,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_EVENT); if (client) { icaltimezone *zone; - + zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (client, zone, NULL); } @@ -2727,7 +2727,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, EventPage *epage) gchar *backend_addr = NULL; e_cal_get_cal_address(client, &backend_addr, NULL); - + if (priv->is_meeting) event_page_select_organizer (epage, backend_addr); @@ -2747,13 +2747,13 @@ set_subscriber_info_string (EventPage *epage, const char *backend_address) { ECal *client = COMP_EDITOR_PAGE (epage)->client; ESource *source; - + source = e_cal_get_source (client); - + if (e_source_get_property (source, "subscriber")) - /* Translators: This string is used when we are creating an Event + /* Translators: This string is used when we are creating an Event (meeting or appointment) on behalf of some other user */ - event_page_set_info_string (epage, GTK_STOCK_DIALOG_INFO, + event_page_set_info_string (epage, GTK_STOCK_DIALOG_INFO, g_strdup_printf(_("You are acting on behalf of %s"), backend_address)); else event_page_set_info_string (epage, NULL, NULL); @@ -2764,7 +2764,7 @@ alarm_changed_cb (GtkWidget *widget, gpointer data) { EventPage *epage; EventPagePrivate *priv; - + epage = EVENT_PAGE (data); priv = epage->priv; @@ -2774,43 +2774,43 @@ alarm_changed_cb (GtkWidget *widget, gpointer data) icalcomponent *icalcomp; icalproperty *icalprop; int alarm_type; - - ca = e_cal_component_alarm_new (); - + + ca = e_cal_component_alarm_new (); + e_cal_component_alarm_set_action (ca, E_CAL_COMPONENT_ALARM_DISPLAY); memset (&trigger, 0, sizeof (ECalComponentAlarmTrigger)); - trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; + trigger.type = E_CAL_COMPONENT_ALARM_TRIGGER_RELATIVE_START; trigger.u.rel_duration.is_neg = 1; - + alarm_type = e_dialog_option_menu_get (priv->alarm_time, alarm_map); switch (alarm_type) { case ALARM_15_MINUTES: e_alarm_list_clear (priv->alarm_list_store); trigger.u.rel_duration.minutes = 15; break; - + case ALARM_1_HOUR: e_alarm_list_clear (priv->alarm_list_store); trigger.u.rel_duration.hours = 1; break; - + case ALARM_1_DAY: - e_alarm_list_clear (priv->alarm_list_store); + e_alarm_list_clear (priv->alarm_list_store); trigger.u.rel_duration.days = 1; break; case ALARM_USER_TIME: - e_alarm_list_clear (priv->alarm_list_store); + e_alarm_list_clear (priv->alarm_list_store); switch (calendar_config_get_default_reminder_units ()) { - case CAL_DAYS: + case CAL_DAYS: trigger.u.rel_duration.days = priv->alarm_interval; break; - + case CAL_HOURS: trigger.u.rel_duration.hours = priv->alarm_interval; break; - + case CAL_MINUTES: trigger.u.rel_duration.minutes = priv->alarm_interval; break; @@ -2818,14 +2818,14 @@ alarm_changed_cb (GtkWidget *widget, gpointer data) break; case ALARM_CUSTOM: gtk_widget_set_sensitive (priv->alarm_box, TRUE); - + default: break; } - + if (alarm_type != ALARM_CUSTOM) { e_cal_component_alarm_set_trigger (ca, trigger); - + icalcomp = e_cal_component_alarm_get_icalcomponent (ca); icalprop = icalproperty_new_x ("1"); icalproperty_set_x_name (icalprop, "X-EVOLUTION-NEEDS-DESCRIPTION"); @@ -2843,24 +2843,24 @@ alarm_changed_cb (GtkWidget *widget, gpointer data) gtk_container_remove (GTK_CONTAINER (priv->status_icons), priv->alarm_icon); priv->alarm_icon = NULL; } - } - - sensitize_widgets (epage); + } + + sensitize_widgets (epage); } -static void +static void alarm_store_inserted_cb (EAlarmList *alarm_list_store, GtkTreePath *path, GtkTreeIter *iter, gpointer data) { field_changed_cb (NULL, data); } -static void +static void alarm_store_deleted_cb (EAlarmList *alarm_list_store, GtkTreePath *path, gpointer data) { field_changed_cb (NULL, data); } -static void +static void alarm_store_changed_cb (EAlarmList *alarm_list_store, GtkTreePath *path, GtkTreeIter *iter, gpointer data) { field_changed_cb (NULL, data); @@ -2877,18 +2877,18 @@ alarm_custom_clicked_cb (GtkWidget *widget, gpointer data) GtkTreeIter iter; gboolean valid_iter; GtkWidget *toplevel; - + epage = EVENT_PAGE (data); priv = epage->priv; /* Make a copy of the list store in case the user cancels */ temp_list_store = e_alarm_list_new (); model = GTK_TREE_MODEL (priv->alarm_list_store); - + for (valid_iter = gtk_tree_model_get_iter_first (model, &iter); valid_iter; valid_iter = gtk_tree_model_iter_next (model, &iter)) { ECalComponentAlarm *alarm; - + alarm = (ECalComponentAlarm *) e_alarm_list_get_alarm (priv->alarm_list_store, &iter); if (alarm == NULL) { g_warning ("alarm is NULL\n"); @@ -2896,18 +2896,18 @@ alarm_custom_clicked_cb (GtkWidget *widget, gpointer data) } e_alarm_list_append (temp_list_store, NULL, alarm); - } - + } + toplevel = gtk_widget_get_toplevel (priv->main); if (alarm_list_dialog_run (toplevel, COMP_EDITOR_PAGE (epage)->client, temp_list_store)) { g_object_unref (priv->alarm_list_store); priv->alarm_list_store = temp_list_store; - comp_editor_page_notify_changed (COMP_EDITOR_PAGE (epage)); + comp_editor_page_notify_changed (COMP_EDITOR_PAGE (epage)); } else { g_object_unref (temp_list_store); - } - + } + /* If the user erases everything, uncheck the alarm toggle */ valid_iter = gtk_tree_model_get_iter_first (GTK_TREE_MODEL (priv->alarm_list_store), &iter); @@ -2925,7 +2925,7 @@ init_widgets (EventPage *epage) char *menu_label = NULL; GtkTreeSelection *selection; GtkWidget *cus_item, *menu; - + priv = epage->priv; /* Make sure the EDateEdit widgets use our timezones to get the @@ -2967,7 +2967,7 @@ init_widgets (EventPage *epage) /* Categories */ g_signal_connect((priv->categories_btn), "clicked", G_CALLBACK (categories_clicked_cb), epage); - + /* Source selector */ g_signal_connect((priv->source_selector), "changed", G_CALLBACK (source_changed_cb), epage); @@ -2984,19 +2984,19 @@ init_widgets (EventPage *epage) g_signal_connect((priv->start_timezone), "changed", G_CALLBACK (start_timezone_changed_cb), epage); - e_meeting_list_view_column_set_visible (priv->list_view, "Attendee ", + e_meeting_list_view_column_set_visible (priv->list_view, "Attendee ", TRUE); e_meeting_list_view_column_set_visible (priv->list_view, "Role", calendar_config_get_show_role()); e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", calendar_config_get_show_rsvp()); e_meeting_list_view_column_set_visible (priv->list_view, "Status", calendar_config_get_show_status()); e_meeting_list_view_column_set_visible (priv->list_view, "Type", calendar_config_get_show_type()); - + selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); g_signal_connect (G_OBJECT (priv->list_view), "button_press_event", G_CALLBACK (button_press_event), epage); g_signal_connect (G_OBJECT (priv->list_view), "event", G_CALLBACK (list_view_event), epage); - g_signal_connect (priv->list_view, "key_press_event", G_CALLBACK (list_key_press), epage); + g_signal_connect (priv->list_view, "key_press_event", G_CALLBACK (list_key_press), epage); /* Add attendee button */ g_signal_connect (priv->add, "clicked", G_CALLBACK (add_clicked_cb), epage); @@ -3008,7 +3008,7 @@ init_widgets (EventPage *epage) g_signal_connect (priv->edit, "clicked", G_CALLBACK (edit_clicked_cb), epage); /* Contacts button */ - g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), epage); + g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), epage); /* Alarm dialog */ g_signal_connect (GTK_DIALOG (priv->alarm_dialog), "response", G_CALLBACK (gtk_widget_hide), priv->alarm_dialog); @@ -3020,7 +3020,7 @@ init_widgets (EventPage *epage) gtk_window_set_modal (GTK_WINDOW (priv->alarm_dialog), TRUE); /* Meeting List View */ - g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), epage); + g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), epage); gtk_widget_show (GTK_WIDGET (priv->list_view)); @@ -3031,7 +3031,7 @@ init_widgets (EventPage *epage) } else { gtk_widget_show (priv->categories_btn); gtk_widget_show (priv->categories); - } + } /* End time selector */ gtk_option_menu_set_history (GTK_OPTION_MENU (priv->end_time_selector), 1); @@ -3049,24 +3049,24 @@ init_widgets (EventPage *epage) priv->alarm_units = calendar_config_get_default_reminder_units (); priv->alarm_interval = calendar_config_get_default_reminder_interval (); - menu_label = ""; + menu_label = ""; switch (priv->alarm_units) { case CAL_DAYS: if (priv->alarm_interval != 1) { menu_label = g_strdup_printf (ngettext("%d day before appointment", "%d days before appointment", priv->alarm_interval), priv->alarm_interval); - } + } break; - + case CAL_HOURS: if (priv->alarm_interval != 1) { menu_label = g_strdup_printf (ngettext("%d hour before appointment", "%d hours before appointment", priv->alarm_interval), priv->alarm_interval); - } + } break; - + case CAL_MINUTES: if (priv->alarm_interval != 15) { menu_label = g_strdup_printf (ngettext("%d minute before appointment", "%d minutes before appointment", priv->alarm_interval), priv->alarm_interval); - } + } break; } @@ -3076,23 +3076,23 @@ init_widgets (EventPage *epage) } menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), cus_item); + gtk_menu_shell_append (GTK_MENU_SHELL (menu), cus_item); cus_item = gtk_menu_item_new_with_label (_("Customize")); gtk_widget_show (cus_item); menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); gtk_menu_shell_append (GTK_MENU_SHELL (menu), cus_item); - + cus_item = gtk_menu_item_new_with_label (_("None")); gtk_widget_show (cus_item); menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->alarm_time)); gtk_menu_shell_prepend (GTK_MENU_SHELL (menu), cus_item); - + g_signal_connect (priv->alarm_time, "changed", G_CALLBACK (field_changed_cb), epage); g_signal_connect (priv->alarm_time, "changed", G_CALLBACK (alarm_changed_cb), epage); - + /* Belongs to priv->description */ g_signal_connect((text_buffer), "changed", G_CALLBACK (field_changed_cb), epage); @@ -3180,9 +3180,9 @@ event_page_select_organizer (EventPage *epage, const char *backend_address) /** * event_page_construct: * @epage: An event page. - * + * * Constructs an event page by loading its Glade data. - * + * * Return value: The same object as @epage, or NULL if the widgets could not be * created. **/ @@ -3206,13 +3206,13 @@ event_page_construct (EventPage *epage, EMeetingStore *model, ECal *client) g_free (gladefile); if (!priv->xml) { - g_message ("event_page_construct(): " + g_message ("event_page_construct(): " "Could not load the Glade XML file!"); return NULL; } if (!get_widgets (epage)) { - g_message ("event_page_construct(): " + g_message ("event_page_construct(): " "Could not find all widgets in the XML file!"); return NULL; } @@ -3222,10 +3222,10 @@ event_page_construct (EventPage *epage, EMeetingStore *model, ECal *client) e_iterator_is_valid(it); e_iterator_next(it)) { gchar *full = NULL; - + a = (EAccount *)e_iterator_get(it); - + /* skip disabled accounts */ if (!a->enabled) continue; @@ -3234,7 +3234,7 @@ event_page_construct (EventPage *epage, EMeetingStore *model, ECal *client) priv->address_strings = g_list_append(priv->address_strings, full); } - + g_object_unref(it); if (priv->address_strings) @@ -3243,7 +3243,7 @@ event_page_construct (EventPage *epage, EMeetingStore *model, ECal *client) g_warning ("No potential organizers!"); if (!init_widgets (epage)) { - g_message ("event_page_construct(): " + g_message ("event_page_construct(): " "Could not initialize the widgets!"); return NULL; } @@ -3253,9 +3253,9 @@ event_page_construct (EventPage *epage, EMeetingStore *model, ECal *client) /** * event_page_new: - * + * * Creates a new event page. - * + * * Return value: A newly-created event page, or NULL if the page could * not be created. **/ @@ -3329,22 +3329,22 @@ set_attendees (ECalComponent *comp, const GPtrArray *attendees) { GSList *comp_attendees = NULL, *l; int i; - + for (i = 0; i < attendees->len; i++) { EMeetingAttendee *ia = g_ptr_array_index (attendees, i); ECalComponentAttendee *ca; - + ca = e_meeting_attendee_as_e_cal_component_attendee (ia); - + comp_attendees = g_slist_prepend (comp_attendees, ca); - + } comp_attendees = g_slist_reverse (comp_attendees); - + e_cal_component_set_attendee_list (comp, comp_attendees); for (l = comp_attendees; l != NULL; l = l->next) - g_free (l->data); + g_free (l->data); g_slist_free (comp_attendees); } @@ -3360,9 +3360,9 @@ event_page_get_cancel_comp (EventPage *page) if (priv->deleted_attendees->len == 0) return NULL; - + set_attendees (priv->comp, priv->deleted_attendees); - + return e_cal_component_clone (priv->comp); } diff --git a/calendar/gui/dialogs/memo-editor.c b/calendar/gui/dialogs/memo-editor.c index b6a7de8cf1..1c5b28c512 100644 --- a/calendar/gui/dialogs/memo-editor.c +++ b/calendar/gui/dialogs/memo-editor.c @@ -41,8 +41,8 @@ struct _MemoEditorPrivate { MemoPage *memo_page; - - gboolean updating; + + gboolean updating; }; static void memo_editor_set_e_cal (CompEditor *editor, ECal *client); @@ -99,11 +99,11 @@ menu_show_categories_cb (BonoboUIComponent *component, gpointer user_data) { MemoEditor *me = (MemoEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - memo_page_set_show_categories (me->priv->memo_page, atoi(state)); + memo_page_set_show_categories (me->priv->memo_page, atoi(state)); calendar_config_set_show_categories (atoi(state)); } @@ -133,7 +133,7 @@ menu_class_private_cb (BonoboUIComponent *ui_component, MemoEditor *me = (MemoEditor *) user_data; if (state[0] == '0') return; - + comp_editor_page_notify_changed (COMP_EDITOR_PAGE (me->priv->memo_page)); memo_page_set_classification (me->priv->memo_page, E_CAL_COMPONENT_CLASS_PRIVATE); } @@ -161,11 +161,11 @@ memo_editor_init (MemoEditor *me) CompEditor *editor = COMP_EDITOR(me); gboolean status; char *xmlfile; - + priv = g_new0 (MemoEditorPrivate, 1); me->priv = priv; - priv->updating = FALSE; + priv->updating = FALSE; bonobo_ui_component_freeze (editor->uic, NULL); @@ -174,7 +174,7 @@ memo_editor_init (MemoEditor *me) xmlfile, "evolution-memo-editor", NULL); g_free (xmlfile); - + status = calendar_config_get_show_categories (); bonobo_ui_component_set_prop ( editor->uic, "/commands/ViewCategories", @@ -196,7 +196,7 @@ memo_editor_init (MemoEditor *me) editor->uic, "ActionClassConfidential", menu_class_confidential_cb, editor); - bonobo_ui_component_thaw (editor->uic, NULL); + bonobo_ui_component_thaw (editor->uic, NULL); /* TODO add help stuff */ /* comp_editor_set_help_section (COMP_EDITOR (me), "usage-calendar-memo"); */ @@ -209,12 +209,12 @@ memo_editor_construct (MemoEditor *me, ECal *client) CompEditor *editor = COMP_EDITOR (me); gboolean read_only = FALSE; guint32 flags = comp_editor_get_flags (editor); - + priv = me->priv; priv->memo_page = memo_page_new (editor->uic, flags); g_object_ref_sink (priv->memo_page); - comp_editor_append_page (COMP_EDITOR (me), + comp_editor_append_page (COMP_EDITOR (me), COMP_EDITOR_PAGE (priv->memo_page), _("Memo"), TRUE); g_signal_connect (G_OBJECT (priv->memo_page), "client_changed", @@ -222,11 +222,11 @@ memo_editor_construct (MemoEditor *me, ECal *client) if (!e_cal_is_read_only (client, &read_only, NULL)) read_only = TRUE; - + bonobo_ui_component_set_prop (editor->uic, "/Toolbar/ecal3", "hidden", "1", NULL); comp_editor_set_e_cal (COMP_EDITOR (me), client); - - + + init_widgets (me); @@ -273,7 +273,7 @@ memo_editor_finalize (GObject *object) g_object_unref (priv->memo_page); priv->memo_page = NULL; } - + g_free (priv); if (G_OBJECT_CLASS (memo_editor_parent_class)->finalize) diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 6255b7aef6..d89e7a4049 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -83,7 +83,7 @@ struct _MemoPagePrivate { GtkWidget *to_button; GtkWidget *to_hbox; GtkWidget *to_entry; - + /* Summary */ GtkWidget *summary_label; GtkWidget *summary_entry; @@ -91,7 +91,7 @@ struct _MemoPagePrivate { /* Start date */ GtkWidget *start_label; GtkWidget *start_date; - + GtkWidget *categories_btn; GtkWidget *categories; @@ -129,10 +129,10 @@ G_DEFINE_TYPE (MemoPage, memo_page, TYPE_COMP_EDITOR_PAGE) /** * memo_page_get_type: - * + * * Registers the #TaskPage class if necessary, and returns the type ID * associated to it. - * + * * Return value: The type ID of the #TaskPage class. **/ @@ -150,7 +150,7 @@ memo_page_class_init (MemoPageClass *klass) editor_page_class->focus_main_widget = memo_page_focus_main_widget; editor_page_class->fill_widgets = memo_page_fill_widgets; editor_page_class->fill_component = memo_page_fill_component; - + object_class->finalize = memo_page_finalize; } @@ -194,7 +194,7 @@ memo_page_finalize (GObject *object) mpage = MEMO_PAGE (object); priv = mpage->priv; - + for (l = priv->address_strings; l != NULL; l = l->next) g_free (l->data); g_list_free (priv->address_strings); @@ -286,7 +286,7 @@ clear_widgets (MemoPage *mpage) e_dialog_editable_set (priv->categories, NULL); } -void +void memo_page_set_classification (MemoPage *page, ECalComponentClassification class) { page->priv->classification = class; @@ -297,32 +297,32 @@ sensitize_widgets (MemoPage *mpage) { gboolean read_only, sens = FALSE, sensitize; MemoPagePrivate *priv; - + priv = mpage->priv; if (!e_cal_is_read_only (COMP_EDITOR_PAGE (mpage)->client, &read_only, NULL)) read_only = TRUE; - + if (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_IS_SHARED) sens = COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_PAGE_USER_ORG; else sens = TRUE; sensitize = (!read_only && sens); - + priv = mpage->priv; - /* The list of organizers is set to be non-editable. Otherwise any - * change in the displayed list causes an 'Account not found' error. + /* The list of organizers is set to be non-editable. Otherwise any + * change in the displayed list causes an 'Account not found' error. */ gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->org_combo)->entry), FALSE); - + gtk_text_view_set_editable (GTK_TEXT_VIEW (priv->memo_content), sensitize); gtk_widget_set_sensitive (priv->start_date, sensitize); gtk_widget_set_sensitive (priv->categories_btn, !read_only); gtk_editable_set_editable (GTK_EDITABLE (priv->categories), !read_only); gtk_editable_set_editable (GTK_EDITABLE (priv->summary_entry), sensitize); - + if (COMP_EDITOR_PAGE (mpage)->flags & COMP_EDITOR_IS_SHARED) { if (priv->to_entry) { gtk_editable_set_editable (GTK_EDITABLE (priv->to_entry), !read_only); @@ -357,18 +357,18 @@ memo_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) priv = mpage->priv; priv->updating = TRUE; - + /* Clean the screen */ clear_widgets (mpage); /* Summary */ e_cal_component_get_summary (comp, &text); e_dialog_editable_set (priv->summary_entry, text.value); - + e_cal_component_get_description_list (comp, &l); if (l && l->data) { ECalComponentText *dtext; - + dtext = l->data; gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), dtext->value ? dtext->value : "", -1); @@ -398,7 +398,7 @@ memo_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) break; } case E_CAL_COMPONENT_CLASS_PRIVATE: - { + { cl = E_CAL_COMPONENT_CLASS_PRIVATE; break; } @@ -446,7 +446,7 @@ memo_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } } - if (backend_addr) + if (backend_addr) g_free (backend_addr); /* Source */ @@ -461,7 +461,7 @@ memo_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) return TRUE; } -static gboolean +static gboolean fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) { EDestinationStore *destination_store; @@ -504,16 +504,16 @@ fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) break; } } - + if (book) { GList *contacts = NULL; EContact *n_con = NULL; char *qu; EBookQuery *query; - qu = g_strdup_printf ("(is \"full_name\" \"%s\")", + qu = g_strdup_printf ("(is \"full_name\" \"%s\")", (char *) e_contact_get (contact, E_CONTACT_FULL_NAME)); - query = e_book_query_from_string (qu); + query = e_book_query_from_string (qu); if (!e_book_get_contacts (book, query, &contacts, NULL)) { g_warning ("Could not get contact from the book \n"); @@ -524,7 +524,7 @@ fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) e_destination_set_contact (des, n_con, 0); list_dests = e_destination_list_get_dests (des); - g_list_foreach (contacts, (GFunc) g_object_unref, NULL); + g_list_foreach (contacts, (GFunc) g_object_unref, NULL); g_list_free (contacts); } @@ -538,22 +538,22 @@ fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) card_dest.data = destination; list_dests = &card_dest; } - } - + } + for (l = list_dests; l; l = l->next) { EDestination *dest = l->data; const char *name, *attendee = NULL; - + name = e_destination_get_name (dest); /* If we couldn't get the attendee prior, get the email address as the default */ if (attendee == NULL || *attendee == '\0') { attendee = e_destination_get_email (dest); } - + if (attendee == NULL || *attendee == '\0') continue; - + if (!str) { str = g_string_new (NULL); g_string_prepend (str, attendee); @@ -571,7 +571,7 @@ fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) icalprop = icalproperty_new_x (str->str); icalproperty_set_x_name (icalprop, "X-EVOLUTION-RECIPIENTS"); icalcomponent_add_property (icalcomp, icalprop); - + g_string_free (str, FALSE); return TRUE; } else @@ -580,17 +580,17 @@ fill_comp_with_recipients (ENameSelector *name_selector, ECalComponent *comp) static EAccount * get_current_account (MemoPage *page) -{ +{ MemoPagePrivate *priv; EIterator *it; const char *str; - + priv = page->priv; str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->org_combo)->entry)); if (!str) return NULL; - + for (it = e_list_get_iterator((EList *)priv->accounts); e_iterator_is_valid(it); e_iterator_next(it)) { EAccount *a = (EAccount *)e_iterator_get(it); char *full = g_strdup_printf("%s <%s>", a->id->name, a->id->address); @@ -601,12 +601,12 @@ get_current_account (MemoPage *page) return a; } - + g_free (full); } g_object_unref (it); - - return NULL; + + return NULL; } /* fill_component handler for the memo page */ @@ -686,7 +686,7 @@ memo_page_fill_component (CompEditorPage *page, ECalComponent *comp) l.next = NULL; e_cal_component_set_description_list (comp, &l); - + g_free(txt); } @@ -708,7 +708,7 @@ memo_page_fill_component (CompEditorPage *page, ECalComponent *comp) &start_tt.month, &start_tt.day)) e_cal_component_set_dtstart (comp, &start_date); - else + else e_cal_component_set_dtstart (comp, NULL); /* Classification. */ @@ -730,7 +730,7 @@ memo_page_fill_component (CompEditorPage *page, ECalComponent *comp) EAccount *a; gchar *backend_addr = NULL, *org_addr = NULL, *sentby = NULL; - + e_cal_get_cal_address (page->client, &backend_addr, NULL); /* Find the identity for the organizer or sentby field */ @@ -740,14 +740,14 @@ memo_page_fill_component (CompEditorPage *page, ECalComponent *comp) if (a == NULL) { e_notice (page, GTK_MESSAGE_ERROR, _("The organizer selected no longer has an account.")); - return FALSE; + return FALSE; } if (a->id->address == NULL || strlen (a->id->address) == 0) { e_notice (page, GTK_MESSAGE_ERROR, _("An organizer is required.")); return FALSE; - } + } if (!(backend_addr && *backend_addr) || !g_ascii_strcasecmp (backend_addr, a->id->address)) { org_addr = g_strdup_printf ("MAILTO:%s", a->id->address); @@ -778,7 +778,7 @@ memo_page_set_show_categories (MemoPage *page, gboolean state) { if (state) { gtk_widget_show (page->priv->categories_btn); - gtk_widget_show (page->priv->categories); + gtk_widget_show (page->priv->categories); } else { gtk_widget_hide (page->priv->categories_btn); gtk_widget_hide (page->priv->categories); @@ -786,7 +786,7 @@ memo_page_set_show_categories (MemoPage *page, gboolean state) } /*If the msg has some value set, the icon should always be set */ -void +void memo_page_set_info_string (MemoPage *mpage, const gchar *icon, const gchar *msg) { MemoPagePrivate *priv; @@ -797,9 +797,9 @@ memo_page_set_info_string (MemoPage *mpage, const gchar *icon, const gchar *msg) gtk_label_set_text (GTK_LABEL(priv->info_string), msg); if (msg && icon) - gtk_widget_show (priv->info_hbox); + gtk_widget_show (priv->info_hbox); else - gtk_widget_hide (priv->info_hbox); + gtk_widget_hide (priv->info_hbox); } /* Gets the widgets from the XML file and returns if they are all available. */ @@ -837,7 +837,7 @@ get_widgets (MemoPage *mpage) priv->org_label = GW ("org-label"); priv->org_combo = GW ("org-combo"); - + priv->to_button = GW ("to-button"); priv->to_hbox = GW ("to-hbox"); @@ -846,7 +846,7 @@ get_widgets (MemoPage *mpage) priv->start_label = GW ("start-label"); priv->start_date = GW ("start-date"); - + priv->memo_content = GW ("memo_content"); priv->categories_btn = GW ("categories-button"); @@ -885,10 +885,10 @@ field_changed_cb (GtkWidget *widget, gpointer data) { MemoPage *mpage; MemoPagePrivate *priv; - + mpage = MEMO_PAGE (data); priv = mpage->priv; - + if (!priv->updating) comp_editor_page_notify_changed (COMP_EDITOR_PAGE (mpage)); } @@ -948,13 +948,13 @@ set_subscriber_info_string (MemoPage *mpage, const char *backend_address) { ECal *client = COMP_EDITOR_PAGE (mpage)->client; ESource *source; - + source = e_cal_get_source (client); - + if (e_source_get_property (source, "subscriber")) - /* Translators: This string is used when we are creating a Memo + /* Translators: This string is used when we are creating a Memo on behalf of some other user */ - memo_page_set_info_string (mpage, GTK_STOCK_DIALOG_INFO, + memo_page_set_info_string (mpage, GTK_STOCK_DIALOG_INFO, g_strdup_printf(_("You are acting on behalf of %s"), backend_address)); else memo_page_set_info_string (mpage, NULL, NULL); @@ -991,13 +991,13 @@ summary_changed_cb (GtkEditable *editable, gpointer data) MemoPage *mpage; MemoPagePrivate *priv; gchar *summary; - + mpage = MEMO_PAGE (data); priv = mpage->priv; - + if (priv->updating) return; - + summary = e_dialog_editable_get (GTK_WIDGET (editable)); comp_editor_page_notify_summary_changed (COMP_EDITOR_PAGE (mpage), summary); @@ -1005,12 +1005,12 @@ summary_changed_cb (GtkEditable *editable, gpointer data) } static void -to_button_clicked_cb (GtkButton *button, gpointer data) +to_button_clicked_cb (GtkButton *button, gpointer data) { MemoPage *page = data; MemoPagePrivate *priv = page->priv; ENameSelectorDialog *name_selector_dialog; - + name_selector_dialog = e_name_selector_peek_dialog (priv->name_selector); gtk_widget_show (GTK_WIDGET (name_selector_dialog)); } @@ -1058,7 +1058,7 @@ init_widgets (MemoPage *mpage) /* Source selector */ g_signal_connect((priv->source_selector), "changed", G_CALLBACK (source_changed_cb), mpage); - + /* Connect the default signal handler to use to make sure the "changed" field gets set whenever a field is changed. */ @@ -1068,13 +1068,13 @@ init_widgets (MemoPage *mpage) g_signal_connect((priv->categories), "changed", G_CALLBACK (field_changed_cb), mpage); - + g_signal_connect((priv->summary_entry), "changed", G_CALLBACK (field_changed_cb), mpage); - + g_signal_connect((priv->source_selector), "changed", G_CALLBACK (field_changed_cb), mpage); - + g_signal_connect((priv->start_date), "changed", G_CALLBACK (field_changed_cb), mpage); @@ -1082,13 +1082,13 @@ init_widgets (MemoPage *mpage) ENameSelectorDialog *name_selector_dialog; name_selector_dialog = e_name_selector_peek_dialog (priv->name_selector); - + g_signal_connect (name_selector_dialog, "response", G_CALLBACK (response_cb), mpage); g_signal_connect ((priv->to_button), "clicked", G_CALLBACK (to_button_clicked_cb), mpage); g_signal_connect ((priv->to_entry), "changed", G_CALLBACK (field_changed_cb), mpage); } - + memo_page_set_show_categories (mpage, calendar_config_get_show_categories()); return TRUE; @@ -1099,7 +1099,7 @@ get_to_entry (ENameSelector *name_selector) { ENameSelectorModel *name_selector_model; ENameSelectorEntry *name_selector_entry; - + name_selector_model = e_name_selector_peek_model (name_selector); e_name_selector_model_add_section (name_selector_model, "To", _("To"), NULL); name_selector_entry = (ENameSelectorEntry *)e_name_selector_peek_section_list (name_selector, "To"); @@ -1128,9 +1128,9 @@ memo_page_select_organizer (MemoPage *mpage, const char *backend_address) if (source) user_addr = e_source_get_property (source, "subscriber"); - if (user_addr) + if (user_addr) subscribed_cal = TRUE; - else + else user_addr = backend_address; priv->default_address = NULL; @@ -1156,9 +1156,9 @@ memo_page_select_organizer (MemoPage *mpage, const char *backend_address) /** * memo_page_construct: * @mpage: An memo page. - * + * * Constructs an memo page by loading its Glade data. - * + * * Return value: The same object as @mpage, or NULL if the widgets could not be * created. **/ @@ -1213,7 +1213,7 @@ memo_page_construct (MemoPage *mpage) gtk_widget_show (priv->org_label); gtk_widget_show (priv->org_combo); - + if (flags & COMP_EDITOR_PAGE_NEW_ITEM) { priv->name_selector = e_name_selector_new (); priv->to_entry = get_to_entry (priv->name_selector); @@ -1225,7 +1225,7 @@ memo_page_construct (MemoPage *mpage) } if (!init_widgets (mpage)) { - g_message ("memo_page_construct(): " + g_message ("memo_page_construct(): " "Could not initialize the widgets!"); return NULL; } @@ -1235,9 +1235,9 @@ memo_page_construct (MemoPage *mpage) /** * memo_page_new: - * + * * Creates a new memo page. - * + * * Return value: A newly-created task page, or NULL if the page could * not be created. **/ diff --git a/calendar/gui/dialogs/recur-comp.c b/calendar/gui/dialogs/recur-comp.c index 4f11f9536d..ecf1436abc 100644 --- a/calendar/gui/dialogs/recur-comp.c +++ b/calendar/gui/dialogs/recur-comp.c @@ -41,16 +41,16 @@ recur_component_dialog (ECal *client, GtkWidget *placeholder, *vbox; ECalComponentVType vtype; gboolean ret; - + g_return_val_if_fail (E_IS_CAL_COMPONENT (comp), FALSE); vtype = e_cal_component_get_vtype (comp); - + switch (vtype) { case E_CAL_COMPONENT_EVENT: if (!delegated) str = g_strdup_printf (_("You are modifying a recurring event. What would you like to modify?")); - else + else str = g_strdup_printf (_("You are delegating a recurring event. What would you like to delegate?")); break; diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 93a9fd05ba..c86137a5a5 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -148,7 +148,7 @@ struct _RecurrencePagePrivate { GtkWidget *recurs; gboolean custom; - + GtkWidget *params; GtkWidget *interval_value; GtkWidget *interval_unit; @@ -170,7 +170,7 @@ struct _RecurrencePagePrivate { GtkWidget *month_num_menu; enum month_num_options month_num; - + /* For ending date, created by hand */ GtkWidget *ending_date_edit; struct icaltimetype ending_date_tt; @@ -193,7 +193,7 @@ struct _RecurrencePagePrivate { /* For the recurrence preview, the actual widget */ GtkWidget *preview_calendar; EMiniCalendarConfig *preview_calendar_config; - + gboolean updating; }; @@ -354,7 +354,7 @@ clear_widgets (RecurrencePage *rpage) priv = rpage->priv; priv->custom = FALSE; - + priv->weekday_day_mask = 0; priv->month_index = 1; @@ -382,7 +382,7 @@ clear_widgets (RecurrencePage *rpage) menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (priv->ending_menu)); g_signal_handlers_block_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_option_menu_set (priv->ending_menu, + e_dialog_option_menu_set (priv->ending_menu, ENDING_FOR, ending_types_map); g_signal_handlers_unblock_matched (menu, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); @@ -476,12 +476,12 @@ sensitize_recur_widgets (RecurrencePage *rpage) GtkWidget *label; priv = rpage->priv; - + if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_MEETING) sens = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG; recurs = e_dialog_toggle_get (priv->recurs); - + /* We can't preview that well for instances right now */ if (e_cal_component_is_instance (priv->comp)) gtk_widget_set_sensitive (priv->preview_calendar, FALSE); @@ -524,13 +524,13 @@ sensitize_buttons (RecurrencePage *rpage) priv = rpage->priv; if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_MEETING) sensitize = COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_USER_ORG; - + selected_rows = gtk_tree_selection_count_selected_rows ( gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->exception_list))); if (!e_cal_is_read_only (COMP_EDITOR_PAGE (rpage)->client, &read_only, NULL)) read_only = TRUE; - + if (!read_only) { e_cal_component_get_uid (priv->comp, &uid); @@ -646,7 +646,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) case ICAL_MONTHLY_RECURRENCE: { enum month_num_options month_num; enum month_day_options month_day; - + g_return_if_fail (GTK_BIN (priv->special)->child != NULL); g_return_if_fail (priv->month_day_menu != NULL); g_return_if_fail (GTK_IS_OPTION_MENU (priv->month_day_menu)); @@ -662,7 +662,7 @@ simple_recur_to_comp (RecurrencePage *rpage, ECalComponent *comp) month_num = -1; else month_num++; - + switch (month_day) { case MONTH_DAY_NTH: if (month_num == -1) @@ -786,7 +786,7 @@ fill_component (RecurrencePage *rpage, ECalComponent *comp) model = GTK_TREE_MODEL (priv->exception_list_store); recurs = e_dialog_toggle_get (priv->recurs); - + if (recurs && priv->custom) { /* We just keep whatever the component has currently */ } else if (recurs) { @@ -844,7 +844,7 @@ preview_recur (RecurrencePage *rpage) ECalComponentDateTime cdt; GSList *l; icaltimezone *zone = NULL; - + priv = rpage->priv; /* If our component has not been set yet through ::fill_widgets(), we @@ -955,7 +955,7 @@ month_num_submenu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) { GtkWidget *item; int month_index; - + item = gtk_menu_get_active (GTK_MENU (menu_shell)); item = gtk_menu_get_active (GTK_MENU (gtk_menu_item_get_submenu (GTK_MENU_ITEM (item)))); @@ -969,14 +969,14 @@ make_recur_month_num_submenu (const char *title, int start, int end) { GtkWidget *submenu, *item; int i; - + submenu = gtk_menu_new (); for (i = start; i < end; i++) { item = gtk_menu_item_new_with_label (_(e_cal_recur_nth[i])); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item); gtk_object_set_user_data (GTK_OBJECT (item), GINT_TO_POINTER (i + 1)); gtk_widget_show (item); - } + } item = gtk_menu_item_new_with_label (_(title)); gtk_widget_show (item); @@ -990,28 +990,28 @@ make_recur_month_num_menu (int month_index) { static const char *options[] = { /* TRANSLATORS: Entire string is for example: This appointment recurs/Every [x] month(s) on the [first] [Monday] [forever]' - * (dropdown menu options are in [square brackets]). This means that after 'first', either the string 'day' or + * (dropdown menu options are in [square brackets]). This means that after 'first', either the string 'day' or * the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("first"), /* TRANSLATORS: here, "second" is the ordinal number (like "third"), not the time division (like "minute") * Entire string is for example: This appointment recurs/Every [x] month(s) on the [second] [Monday] [forever]' - * (dropdown menu options are in [square brackets]). This means that after 'second', either the string 'day' or + * (dropdown menu options are in [square brackets]). This means that after 'second', either the string 'day' or * the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("second"), /* TRANSLATORS: Entire string is for example: This appointment recurs/Every [x] month(s) on the [third] [Monday] [forever]' - * (dropdown menu options are in [square brackets]). This means that after 'third', either the string 'day' or + * (dropdown menu options are in [square brackets]). This means that after 'third', either the string 'day' or * the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("third"), /* TRANSLATORS: Entire string is for example: This appointment recurs/Every [x] month(s) on the [fourth] [Monday] [forever]' - * (dropdown menu options are in [square brackets]). This means that after 'fourth', either the string 'day' or + * (dropdown menu options are in [square brackets]). This means that after 'fourth', either the string 'day' or * the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("fourth"), /* TRANSLATORS: Entire string is for example: This appointment recurs/Every [x] month(s) on the [last] [Monday] [forever]' - * (dropdown menu options are in [square brackets]). This means that after 'last', either the string 'day' or + * (dropdown menu options are in [square brackets]). This means that after 'last', either the string 'day' or * the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("last") @@ -1044,20 +1044,20 @@ make_recur_month_num_menu (int month_index) gtk_menu_shell_append(GTK_MENU_SHELL(menu), submenu_item); gtk_widget_show (submenu_item); - /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of - * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) + /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of + * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) * on the [Other date] [1st to 10th] [7th] [forever]' (dropdown menu options are in [square brackets]). */ item = make_recur_month_num_submenu (_("1st to 10th"), 0, 10); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item); - /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of - * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) + /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of + * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) * on the [Other date] [11th to 20th] [17th] [forever]' (dropdown menu options are in [square brackets]). */ item = make_recur_month_num_submenu (_("11th to 20th"), 10, 20); gtk_menu_shell_append(GTK_MENU_SHELL(submenu), item); - /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of - * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) + /* TRANSLATORS: This is a submenu option string to split the date range into three submenus to choose the exact day of + * the month to setup an appointment recurrence. The entire string is for example: This appointment recurs/Every [x] month(s) * on the [Other date] [21th to 31th] [27th] [forever]' (dropdown menu options are in [square brackets]). */ item = make_recur_month_num_submenu (_("21st to 31st"), 20, 31); @@ -1081,7 +1081,7 @@ make_recur_month_menu (void) { static const char *options[] = { /* For Translator : 'day' is part of the sentence of the form 'appointment recurs/Every [x] month(s) on the [first] [day] [forever]' - (dropdown menu options are in [square brackets]). This means that after 'first', either the string 'day' or + (dropdown menu options are in [square brackets]). This means that after 'first', either the string 'day' or the name of a week day (like 'Monday' or 'Friday') always follow. */ N_("day"), N_("Monday"), @@ -1144,7 +1144,7 @@ month_num_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) e_dialog_option_menu_set (priv->month_num_menu, 0, month_num_options_map); e_dialog_option_menu_set (priv->month_num_menu, month_num, month_num_options_map); } - + if (month_num == MONTH_NUM_DAY && month_day != MONTH_DAY_NTH) e_dialog_option_menu_set (priv->month_day_menu, MONTH_DAY_NTH, @@ -1171,7 +1171,7 @@ month_day_menu_selection_done_cb (GtkMenuShell *menu_shell, gpointer data) rpage = RECURRENCE_PAGE (data); priv = rpage->priv; - + month_num = e_dialog_option_menu_get (priv->month_num_menu, month_num_options_map); month_day = e_dialog_option_menu_get (priv->month_day_menu, @@ -1220,7 +1220,7 @@ make_monthly_special (RecurrencePage *rpage) hbox = gtk_hbox_new (FALSE, 2); gtk_container_add (GTK_CONTAINER (priv->special), hbox); - /* TRANSLATORS: Entire string is for example: 'This appointment recurs/Every [x] month(s) on the [second] [Tuesday] [forever]' + /* TRANSLATORS: Entire string is for example: 'This appointment recurs/Every [x] month(s) on the [second] [Tuesday] [forever]' * (dropdown menu options are in [square brackets])." */ label = gtk_label_new (_("on the")); @@ -1359,11 +1359,11 @@ make_ending_until_special (RecurrencePage *rpage) gtk_widget_show_all (GTK_WIDGET (de)); /* Set the value */ - + if (COMP_EDITOR_PAGE (rpage)->flags & COMP_EDITOR_PAGE_NEW_ITEM) { e_cal_component_get_dtstart (priv->comp, &dt_start); /* Setting the default until time to 2 weeks */ - icaltime_adjust (dt_start.value, 14, 0, 0, 0); + icaltime_adjust (dt_start.value, 14, 0, 0, 0); e_date_edit_set_date (de, dt_start.value->year, dt_start.value->month, dt_start.value->day); e_cal_component_free_datetime (&dt_start); } else { @@ -1502,7 +1502,7 @@ fill_ending_date (RecurrencePage *rpage, struct icalrecurrencetype *r) ECal *client = COMP_EDITOR_PAGE (rpage)->client; ECalComponentDateTime dt; icaltimezone *from_zone, *to_zone; - + e_cal_component_get_dtstart (priv->comp, &dt); if (dt.value->is_date) @@ -1566,7 +1566,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) rpage = RECURRENCE_PAGE (page); priv = rpage->priv; - /* Keep a copy of the component so that we can expand the recurrence + /* Keep a copy of the component so that we can expand the recurrence * set for the preview. */ @@ -1577,7 +1577,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (!e_cal_component_has_organizer (comp)) page->flags |= COMP_EDITOR_PAGE_USER_ORG; - + /* Don't send off changes during this time */ priv->updating = TRUE; @@ -1763,7 +1763,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (nth == -1) { ECalComponentDateTime dt; - + e_cal_component_get_dtstart (comp, &dt); priv->month_index = dt.value->day; priv->month_num = MONTH_NUM_LAST; @@ -1772,7 +1772,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) priv->month_num = MONTH_NUM_DAY; } priv->month_day = MONTH_DAY_NTH; - + } else if (n_by_day == 1) { enum icalrecurrencetype_weekday weekday; int pos; @@ -1828,7 +1828,7 @@ recurrence_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (pos == -1) priv->month_num = MONTH_NUM_LAST; - else + else priv->month_num = pos - 1; priv->month_day = month_day; } else @@ -1936,7 +1936,7 @@ recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) dt.tzid = dates->start->tzid; e_cal_component_set_dtstart (priv->comp, &dt); } - + if (dates->end) { icaltime = *dates->end->value; dt.tzid = dates->end->tzid; @@ -1948,7 +1948,7 @@ recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) if (mask != priv->weekday_blocked_day_mask) { priv->weekday_day_mask = priv->weekday_day_mask | mask; priv->weekday_blocked_day_mask = mask; - + if (priv->weekday_picker != NULL) { weekday_picker_set_days (WEEKDAY_PICKER (priv->weekday_picker), priv->weekday_day_mask); @@ -1972,7 +1972,7 @@ recurrence_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) g_date_free (start); g_date_free (end); } - + /* Make sure the preview gets updated. */ preview_recur (rpage); } @@ -2005,26 +2005,26 @@ get_widgets (RecurrencePage *rpage) g_object_ref (priv->main); gtk_container_remove (GTK_CONTAINER (priv->main->parent), priv->main); - + priv->recurs = GW ("recurs"); priv->params = GW ("params"); - + priv->interval_value = GW ("interval-value"); priv->interval_unit = GW ("interval-unit"); priv->special = GW ("special"); priv->ending_menu = GW ("ending-menu"); priv->ending_special = GW ("ending-special"); priv->custom_warning_bin = GW ("custom-warning-bin"); - + priv->exception_list = GW ("exception-list"); priv->exception_add = GW ("exception-add"); priv->exception_modify = GW ("exception-modify"); priv->exception_delete = GW ("exception-delete"); - + priv->preview_bin = GW ("preview-bin"); #undef GW - + return (priv->recurs && priv->params && priv->interval_value @@ -2077,7 +2077,7 @@ type_toggled_cb (GtkToggleButton *toggle, gpointer data) if (!gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (priv->recurs)) || read_only) gtk_widget_set_sensitive (priv->exception_add, FALSE); - else + else gtk_widget_set_sensitive (priv->exception_add, TRUE); } @@ -2127,7 +2127,7 @@ create_exception_dialog (RecurrencePage *rpage, const char *title, GtkWidget **d { RecurrencePagePrivate *priv; GtkWidget *dialog, *toplevel; - + priv = rpage->priv; toplevel = gtk_widget_get_toplevel (priv->main); @@ -2140,7 +2140,7 @@ create_exception_dialog (RecurrencePage *rpage, const char *title, GtkWidget **d *date_edit = comp_editor_new_date_edit (TRUE, FALSE, TRUE); gtk_widget_show (*date_edit); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), *date_edit, FALSE, TRUE, 6); - + return dialog; } @@ -2151,33 +2151,33 @@ exception_add_cb (GtkWidget *widget, gpointer data) RecurrencePage *rpage; GtkWidget *dialog, *date_edit; gboolean date_set; - + rpage = RECURRENCE_PAGE (data); dialog = create_exception_dialog (rpage, _("Add exception"), &date_edit); - + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { ECalComponentDateTime dt; struct icaltimetype icaltime = icaltime_null_time (); field_changed (rpage); - + dt.value = &icaltime; - + /* We use DATE values for exceptions, so we don't need a TZID. */ dt.tzid = NULL; icaltime.is_date = 1; - + date_set = e_date_edit_get_date (E_DATE_EDIT (date_edit), &icaltime.year, &icaltime.month, &icaltime.day); g_return_if_fail (date_set); - + append_exception (rpage, &dt); preview_recur (rpage); } - + gtk_widget_destroy (dialog); } @@ -2202,34 +2202,34 @@ exception_modify_cb (GtkWidget *widget, gpointer data) } current_dt = e_date_time_list_get_date_time (priv->exception_list_store, &iter); - + dialog = create_exception_dialog (rpage, _("Modify exception"), &date_edit); - e_date_edit_set_date (E_DATE_EDIT (date_edit), + e_date_edit_set_date (E_DATE_EDIT (date_edit), current_dt->value->year, current_dt->value->month, current_dt->value->day); - + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_ACCEPT) { ECalComponentDateTime dt; struct icaltimetype icaltime = icaltime_null_time (); struct icaltimetype *tt; field_changed (rpage); - + dt.value = &icaltime; tt = dt.value; - e_date_edit_get_date (E_DATE_EDIT (date_edit), + e_date_edit_get_date (E_DATE_EDIT (date_edit), &tt->year, &tt->month, &tt->day); tt->hour = 0; tt->minute = 0; tt->second = 0; tt->is_date = 1; - + /* No TZID, since we are using a DATE value now. */ dt.tzid = NULL; - + e_date_time_list_set_date_time (priv->exception_list_store, &iter, &dt); preview_recur (rpage); } - + gtk_widget_destroy (dialog); } @@ -2303,7 +2303,7 @@ field_changed (RecurrencePage *rpage) RecurrencePagePrivate *priv; priv = rpage->priv; - + if (!priv->updating) comp_editor_page_notify_changed (COMP_EDITOR_PAGE (rpage)); } @@ -2349,13 +2349,13 @@ init_widgets (RecurrencePage *rpage) rpage); /* Recurrence units */ - + g_signal_connect(GTK_OPTION_MENU (priv->interval_unit), "changed", G_CALLBACK (interval_selection_done_cb), rpage); /* Recurrence ending */ - + g_signal_connect(GTK_OPTION_MENU (priv->ending_menu), "changed", G_CALLBACK (ending_selection_done_cb), rpage); diff --git a/calendar/gui/dialogs/save-comp.c b/calendar/gui/dialogs/save-comp.c index 08736ff7b1..7ea90d5a7b 100644 --- a/calendar/gui/dialogs/save-comp.c +++ b/calendar/gui/dialogs/save-comp.c @@ -30,11 +30,11 @@ /** * save_component_dialog: * @parent: Window to use as the transient dialog's parent. - * @comp: Pointer to the EcalComponent + * @comp: Pointer to the EcalComponent * * Pops up a dialog box asking the user whether he wants to save changes for * a calendar component. - * + * * Return value: the response_id of the button selected. **/ diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index e7e4e0ad31..36afc0ba7a 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -46,7 +46,7 @@ /* Private part of the SchedulePage structure */ -struct _SchedulePagePrivate { +struct _SchedulePagePrivate { /* Glade XML data */ GladeXML *xml; @@ -55,10 +55,10 @@ struct _SchedulePagePrivate { /* Model */ EMeetingStore *model; - + /* Selector */ EMeetingTimeSelector *sel; - + /* The timezone we use. Note that we use the same timezone for the start and end date. We convert the end date if it is passed in in another timezone. */ @@ -125,7 +125,7 @@ schedule_page_finalize (GObject *object) { SchedulePage *spage; SchedulePagePrivate *priv; - + g_return_if_fail (object != NULL); g_return_if_fail (IS_SCHEDULE_PAGE (object)); @@ -199,7 +199,7 @@ client_changed_cb (CompEditorPage *page, ECal *client, gpointer user_data) /* Set date/time */ static void -update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalComponentDateTime *end_date) +update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalComponentDateTime *end_date) { SchedulePagePrivate *priv; struct icaltimetype start_tt, end_tt; @@ -228,7 +228,7 @@ update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalCompone /* FIXME: Handle error better. */ g_warning ("Couldn't get timezone from server: %s", end_date->tzid ? end_date->tzid : ""); - } + } } start_tt = *start_date->value; @@ -237,15 +237,15 @@ update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalCompone icaltime_adjust (&end_tt, 1, 0, 0, 0); } else { end_tt = *end_date->value; - } - + } + /* If the end zone is not the same as the start zone, we convert it. */ priv->zone = start_zone; if (start_zone != end_zone) { icaltimezone_convert_time (&end_tt, end_zone, start_zone); } e_meeting_store_set_zone (priv->model, priv->zone); - + all_day = (start_tt.is_date && end_tt.is_date) ? TRUE : FALSE; /* For All Day Events, if DTEND is after DTSTART, we subtract 1 day @@ -268,7 +268,7 @@ update_time (SchedulePage *spage, ECalComponentDateTime *start_date, ECalCompone } - + /* Fills the widgets with default values */ static void clear_widgets (SchedulePage *spage) @@ -301,10 +301,10 @@ schedule_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) validated = FALSE; else update_time (spage, &start_date, &end_date); - + e_cal_component_free_datetime (&start_date); e_cal_component_free_datetime (&end_date); - + priv->updating = FALSE; sensitize_widgets (spage); @@ -324,12 +324,12 @@ schedule_page_set_dates (CompEditorPage *page, CompEditorPageDates *dates) { SchedulePage *spage; SchedulePagePrivate *priv; - + spage = SCHEDULE_PAGE (page); priv = spage->priv; priv->updating = TRUE; - + update_time (spage, dates->start, dates->end); priv->updating = FALSE; @@ -370,7 +370,7 @@ get_widgets (SchedulePage *spage) } static gboolean -init_widgets (SchedulePage *spage) +init_widgets (SchedulePage *spage) { SchedulePagePrivate *priv; @@ -398,20 +398,20 @@ schedule_page_set_meeting_time (SchedulePage *spage, icaltimetype *start_tt, ica } } - e_meeting_time_selector_set_meeting_time (priv->sel, start_tt->year, start_tt->month, start_tt->day, + e_meeting_time_selector_set_meeting_time (priv->sel, start_tt->year, start_tt->month, start_tt->day, start_tt->hour, start_tt->minute, end_tt->year, end_tt->month, end_tt->day, end_tt->hour, end_tt->minute); e_meeting_time_selector_set_all_day (priv->sel, all_day); - + } /** * schedule_page_construct: * @spage: An schedule page. - * + * * Constructs an schedule page by loading its Glade data. - * - * Return value: The same object as @spage, or NULL if the widgets could not + * + * Return value: The same object as @spage, or NULL if the widgets could not * be created. **/ SchedulePage * @@ -419,7 +419,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingStore *ems) { SchedulePagePrivate *priv; char *gladefile; - + priv = spage->priv; gladefile = g_build_filename (EVOLUTION_GLADEDIR, @@ -443,7 +443,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingStore *ems) /* Model */ g_object_ref (ems); priv->model = ems; - + /* Selector */ priv->sel = E_MEETING_TIME_SELECTOR (e_meeting_time_selector_new (ems)); gtk_widget_set_size_request ((GtkWidget *) priv->sel, -1, 400); @@ -456,7 +456,7 @@ schedule_page_construct (SchedulePage *spage, EMeetingStore *ems) gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->sel), TRUE, TRUE, 6); if (!init_widgets (spage)) { - g_message ("schedule_page_construct(): " + g_message ("schedule_page_construct(): " "Could not initialize the widgets!"); return NULL; } @@ -468,9 +468,9 @@ schedule_page_construct (SchedulePage *spage, EMeetingStore *ems) /** * schedule_page_new: - * + * * Creates a new schedule page. - * + * * Return value: A newly-created schedule page, or NULL if the page could * not be created. **/ @@ -492,12 +492,12 @@ void schedule_page_update_free_busy (SchedulePage *spage) { SchedulePagePrivate *priv; - + g_return_if_fail (spage != NULL); g_return_if_fail (IS_SCHEDULE_PAGE (spage)); - + priv = spage->priv; - + e_meeting_time_selector_refresh_free_busy (priv->sel, 0, TRUE); } @@ -508,7 +508,7 @@ schedule_page_set_name_selector (SchedulePage *spage, ENameSelector *name_select g_return_if_fail (spage != NULL); g_return_if_fail (IS_SCHEDULE_PAGE (spage)); - + priv = spage->priv; e_meeting_list_view_set_name_selector (priv->sel->list_view, name_selector); @@ -523,12 +523,12 @@ times_changed_cb (GtkWidget *widget, gpointer data) ECalComponentDateTime start_dt, end_dt; struct icaltimetype start_tt = icaltime_null_time (); struct icaltimetype end_tt = icaltime_null_time (); - + priv = spage->priv; if (priv->updating) return; - + e_date_edit_get_date (E_DATE_EDIT (priv->sel->start_date_edit), &start_tt.year, &start_tt.month, @@ -562,7 +562,7 @@ times_changed_cb (GtkWidget *widget, gpointer data) } dates.start = &start_dt; - dates.end = &end_dt; + dates.end = &end_dt; dates.due = NULL; dates.complete = NULL; diff --git a/calendar/gui/dialogs/select-source-dialog.c b/calendar/gui/dialogs/select-source-dialog.c index db15963717..7fef786e0f 100644 --- a/calendar/gui/dialogs/select-source-dialog.c +++ b/calendar/gui/dialogs/select-source-dialog.c @@ -64,13 +64,13 @@ select_source_dialog (GtkWindow *parent, ECalSourceType obj_type) icon_list = e_icon_factory_get_icon_list ("stock_todo"); else if (obj_type == E_CAL_SOURCE_TYPE_JOURNAL) icon_list = e_icon_factory_get_icon_list ("stock_journal"); - + if (icon_list) { gtk_window_set_icon_list (GTK_WINDOW (dialog), icon_list); g_list_foreach (icon_list, (GFunc) g_object_unref, NULL); g_list_free (icon_list); } - + if (gtk_dialog_run (GTK_DIALOG (dialog)) == GTK_RESPONSE_OK) { selected_source = e_source_selector_dialog_peek_primary_selection (E_SOURCE_SELECTOR_DIALOG (dialog)); if (selected_source) { diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index 4be26333a4..0db1be872a 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -30,10 +30,10 @@ /** * send_component_dialog: - * + * * Pops up a dialog box asking the user whether he wants to send a * iTip/iMip message - * + * * Return value: TRUE if the user clicked Yes, FALSE otherwise. **/ gboolean @@ -41,10 +41,10 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo { ECalComponentVType vtype; const char *id; - + if (e_cal_get_save_schedules (client)) return FALSE; - + vtype = e_cal_component_get_vtype (comp); switch (vtype) { @@ -68,7 +68,7 @@ send_component_dialog (GtkWindow *parent, ECal *client, ECalComponent *comp, gbo "Cannot handle object of type %d", vtype); return FALSE; } - + if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES) return TRUE; else @@ -80,7 +80,7 @@ send_component_prompt_subject (GtkWindow *parent, ECal *client, ECalComponent *c { ECalComponentVType vtype; const char *id; - + vtype = e_cal_component_get_vtype (comp); switch (vtype) { @@ -100,7 +100,7 @@ send_component_prompt_subject (GtkWindow *parent, ECal *client, ECalComponent *c "Cannot handle object of type %d", vtype); return FALSE; } - + if (e_error_run (parent, id, NULL) == GTK_RESPONSE_YES) return TRUE; else diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 572e2909d2..b9d5ace108 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -133,7 +133,7 @@ task_details_page_init (TaskDetailsPage *tdpage) priv->status = NULL; priv->priority = NULL; priv->percent_complete = NULL; - + priv->date_completed_label = NULL; priv->completed_date = NULL; @@ -264,12 +264,12 @@ sensitize_widgets (TaskDetailsPage *tdpage) { gboolean read_only; TaskDetailsPagePrivate *priv; - + priv = tdpage->priv; if (!e_cal_is_read_only (COMP_EDITOR_PAGE (tdpage)->client, &read_only, NULL)) read_only = TRUE; - + gtk_widget_set_sensitive (priv->status, !read_only); gtk_widget_set_sensitive (priv->priority, !read_only); gtk_widget_set_sensitive (priv->percent_complete, !read_only); @@ -294,10 +294,10 @@ task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) priv = tdpage->priv; priv->updating = TRUE; - + /* Clean the screen */ clear_widgets (tdpage); - + /* Percent Complete. */ e_cal_component_get_percent (comp, &percent); if (percent) { @@ -361,7 +361,7 @@ task_details_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) /* URL */ e_cal_component_get_url (comp, &url); e_dialog_editable_set (priv->url, url); - + priv->updating = FALSE; sensitize_widgets (tdpage); @@ -382,7 +382,7 @@ task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp) char *url; gboolean date_set; icaltimezone *zone = calendar_config_get_icaltimezone (); - + tdpage = TASK_DETAILS_PAGE (page); priv = tdpage->priv; @@ -426,7 +426,7 @@ task_details_page_fill_component (CompEditorPage *page, ECalComponent *comp) icaltimezone_convert_time (&icaltoday, zone, icaltimezone_get_utc_timezone()); - if (icaltime_compare_date_only (icalcomplete, icaltoday) > 0) { + if (icaltime_compare_date_only (icalcomplete, icaltoday) > 0) { comp_editor_page_display_validation_error (page, _("Completed date is wrong"), priv->completed_date); return FALSE; } @@ -513,7 +513,7 @@ get_widgets (TaskDetailsPage *tdpage) gtk_widget_show (priv->url_entry); priv->url = e_url_entry_get_entry (E_URL_ENTRY (priv->url_entry)); atk_object_set_name (gtk_widget_get_accessible (priv->url), _("Web Page")); - + #undef GW return (priv->status @@ -540,10 +540,10 @@ complete_date_changed (TaskDetailsPage *tdpage, time_t ctime, gboolean complete) dates.start = NULL; dates.end = NULL; - dates.due = NULL; + dates.due = NULL; if (complete) dates.complete = &completed_tt; - + /* Notify upstream */ comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tdpage), &dates); @@ -593,7 +593,7 @@ date_changed_cb (EDateEdit *dedit, gpointer data) } e_dialog_spin_set (priv->percent_complete, 100); } - + priv->updating = FALSE; /* Notify upstream */ @@ -607,7 +607,7 @@ status_changed (GtkMenu *menu, TaskDetailsPage *tdpage) TaskDetailsPagePrivate *priv; icalproperty_status status; time_t ctime = -1; - + priv = tdpage->priv; if (priv->updating) @@ -647,12 +647,12 @@ percent_complete_changed (GtkAdjustment *adj, TaskDetailsPage *tdpage) icalproperty_status status; gboolean complete; time_t ctime = -1; - + priv = tdpage->priv; if (priv->updating) return; - + priv->updating = TRUE; percent = e_dialog_spin_get_int (priv->percent_complete); @@ -684,7 +684,7 @@ field_changed_cb (GtkWidget *widget, gpointer data) { TaskDetailsPage *tdpage; TaskDetailsPagePrivate *priv; - + tdpage = TASK_DETAILS_PAGE (data); priv = tdpage->priv; @@ -748,10 +748,10 @@ client_changed_cb (CompEditorPage *page, ECal *client, gpointer user_data) /** * task_details_page_construct: * @tdpage: An task details page. - * + * * Constructs an task page by loading its Glade data. - * - * Return value: The same object as @tdpage, or NULL if the widgets could not + * + * Return value: The same object as @tdpage, or NULL if the widgets could not * be created. **/ TaskDetailsPage * @@ -790,9 +790,9 @@ task_details_page_construct (TaskDetailsPage *tdpage) /** * task_details_page_new: - * + * * Creates a new task details page. - * + * * Return value: A newly-created task details page, or NULL if the page could * not be created. **/ diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 84512eaba1..8c9ee465e6 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -44,13 +44,13 @@ struct _TaskEditorPrivate { TaskPage *task_page; TaskDetailsPage *task_details_page; - + GtkWidget *task_details_window; EMeetingStore *model; - + gboolean assignment_shown; gboolean is_assigned; - gboolean updating; + gboolean updating; }; @@ -111,11 +111,11 @@ menu_view_role_cb (BonoboUIComponent *component, gpointer user_data) { TaskEditor *te = (TaskEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - task_page_set_view_role (te->priv->task_page, atoi(state)); - calendar_config_set_show_role (atoi(state)); + task_page_set_view_role (te->priv->task_page, atoi(state)); + calendar_config_set_show_role (atoi(state)); } static void @@ -126,12 +126,12 @@ menu_view_status_cb (BonoboUIComponent *component, gpointer user_data) { TaskEditor *te = (TaskEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - + task_page_set_view_status (te->priv->task_page, atoi(state)); - calendar_config_set_show_status (atoi(state)); + calendar_config_set_show_status (atoi(state)); } static void @@ -142,11 +142,11 @@ menu_view_type_cb (BonoboUIComponent *component, gpointer user_data) { TaskEditor *te = (TaskEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - task_page_set_view_type (te->priv->task_page, atoi(state)); - calendar_config_set_show_type (atoi(state)); + task_page_set_view_type (te->priv->task_page, atoi(state)); + calendar_config_set_show_type (atoi(state)); } static void @@ -157,11 +157,11 @@ menu_view_rsvp_cb (BonoboUIComponent *component, gpointer user_data) { TaskEditor *te = (TaskEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - task_page_set_view_rsvp (te->priv->task_page, atoi(state)); - calendar_config_set_show_rsvp (atoi(state)); + task_page_set_view_rsvp (te->priv->task_page, atoi(state)); + calendar_config_set_show_rsvp (atoi(state)); } static void @@ -172,10 +172,10 @@ menu_show_time_zone_cb (BonoboUIComponent *component, gpointer user_data) { TaskEditor *te = (TaskEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - task_page_set_show_timezone (te->priv->task_page, atoi(state)); + task_page_set_show_timezone (te->priv->task_page, atoi(state)); calendar_config_set_show_timezone (atoi(state)); } @@ -187,11 +187,11 @@ menu_show_categories_cb (BonoboUIComponent *component, gpointer user_data) { TaskEditor *te = (TaskEditor *) user_data; - + if (type != Bonobo_UIComponent_STATE_CHANGED) return; - task_page_set_show_categories (te->priv->task_page, atoi(state)); + task_page_set_show_categories (te->priv->task_page, atoi(state)); calendar_config_set_show_categories (atoi(state)); } @@ -221,7 +221,7 @@ menu_class_private_cb (BonoboUIComponent *ui_component, TaskEditor *te = (TaskEditor *) user_data; if (state[0] == '0') return; - + comp_editor_page_notify_changed (COMP_EDITOR_PAGE (te->priv->task_page)); task_page_set_classification (te->priv->task_page, E_CAL_COMPONENT_CLASS_PRIVATE); } @@ -236,7 +236,7 @@ menu_class_confidential_cb (BonoboUIComponent *ui_component, TaskEditor *te = (TaskEditor *) user_data; if (state[0] == '0') return; - + comp_editor_page_notify_changed (COMP_EDITOR_PAGE (te->priv->task_page)); task_page_set_classification (te->priv->task_page, E_CAL_COMPONENT_CLASS_CONFIDENTIAL); } @@ -250,7 +250,7 @@ menu_option_status_cb (BonoboUIComponent *ui_component, gpointer user_data) { TaskEditor *te = (TaskEditor *) user_data; - + gtk_widget_show (te->priv->task_details_window); } @@ -260,7 +260,7 @@ menu_insert_send_options_cmd (BonoboUIComponent *uic, const char *path) { TaskEditor *te = (TaskEditor *) data; - + task_page_sendoptions_clicked_cb (te->priv->task_page); } @@ -270,8 +270,8 @@ menu_show_time_zone_cmd (BonoboUIComponent *uic, const char *path) { /* TODO implement it TaskEditor *te = (TaskEditor *) data; - - task_page_set_show_timezone (te->priv->task_page, atoi(state)); + + task_page_set_show_timezone (te->priv->task_page, atoi(state)); calendar_config_set_show_timezone (atoi(state)); */ } @@ -281,25 +281,25 @@ menu_option_status_cmd (BonoboUIComponent *uic, const char *path) { TaskEditor *te = (TaskEditor *) data; - + gtk_widget_show (te->priv->task_details_window); } static BonoboUIVerb verbs [] = { - BONOBO_UI_VERB ("ViewTimeZone", menu_show_time_zone_cmd), + BONOBO_UI_VERB ("ViewTimeZone", menu_show_time_zone_cmd), BONOBO_UI_VERB ("OptionStatus", menu_option_status_cmd), BONOBO_UI_VERB ("InsertSendOptions", menu_insert_send_options_cmd), BONOBO_UI_VERB_END }; static EPixmap pixmaps[] = { - E_PIXMAP ("/commands/OptionStatus", "stock_view-details", E_ICON_SIZE_MENU), + E_PIXMAP ("/commands/OptionStatus", "stock_view-details", E_ICON_SIZE_MENU), E_PIXMAP ("/commands/ViewTimeZone", "stock_timezone", E_ICON_SIZE_MENU), - E_PIXMAP ("/Toolbar/ViewTimeZone", "stock_timezone", E_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/OptionStatus", "stock_view-details", E_ICON_SIZE_LARGE_TOOLBAR), - + E_PIXMAP ("/Toolbar/ViewTimeZone", "stock_timezone", E_ICON_SIZE_LARGE_TOOLBAR), + E_PIXMAP ("/Toolbar/OptionStatus", "stock_view-details", E_ICON_SIZE_LARGE_TOOLBAR), + E_PIXMAP_END }; @@ -312,13 +312,13 @@ task_editor_init (TaskEditor *te) CompEditor *editor = COMP_EDITOR(te); gboolean status; char *xmlfile; - + priv = g_new0 (TaskEditorPrivate, 1); te->priv = priv; priv->model = E_MEETING_STORE (e_meeting_store_new ()); priv->assignment_shown = TRUE; - priv->updating = FALSE; + priv->updating = FALSE; priv->is_assigned = FALSE; bonobo_ui_component_freeze (editor->uic, NULL); @@ -341,7 +341,7 @@ task_editor_init (TaskEditor *te) bonobo_ui_component_add_listener ( editor->uic, "ViewStatus", menu_view_status_cb, editor); - + /* Show hide the type fields */ status = calendar_config_get_show_type (); bonobo_ui_component_set_prop ( @@ -399,14 +399,14 @@ task_editor_init (TaskEditor *te) menu_class_confidential_cb, editor); bonobo_ui_component_add_listener ( - editor->uic, "OptionStatus", + editor->uic, "OptionStatus", menu_option_status_cb, editor); - + e_pixmaps_update (editor->uic, pixmaps); - bonobo_ui_component_thaw (editor->uic, NULL); + bonobo_ui_component_thaw (editor->uic, NULL); + - comp_editor_set_help_section (COMP_EDITOR (te), "usage-calendar-todo"); } @@ -416,12 +416,12 @@ task_editor_construct (TaskEditor *te, ECal *client) TaskEditorPrivate *priv; gboolean read_only = FALSE; CompEditor *editor = COMP_EDITOR (te); - + priv = te->priv; priv->task_page = task_page_new (priv->model, client, editor->uic); g_object_ref_sink (priv->task_page); - comp_editor_append_page (COMP_EDITOR (te), + comp_editor_append_page (COMP_EDITOR (te), COMP_EDITOR_PAGE (priv->task_page), _("_Task"), TRUE); g_signal_connect (G_OBJECT (priv->task_page), "client_changed", @@ -433,27 +433,27 @@ task_editor_construct (TaskEditor *te, ECal *client) NULL); g_signal_connect (priv->task_details_window, "response", G_CALLBACK(gtk_widget_hide), NULL); g_signal_connect (priv->task_details_window, "delete-event", G_CALLBACK(gtk_widget_hide), NULL); - + priv->task_details_page = task_details_page_new (); g_object_ref_sink (priv->task_details_page); - gtk_container_add ((GtkContainer *) GTK_DIALOG(priv->task_details_window)->vbox, + gtk_container_add ((GtkContainer *) GTK_DIALOG(priv->task_details_window)->vbox, comp_editor_page_get_widget ((CompEditorPage *)priv->task_details_page)); gtk_widget_show_all (gtk_bin_get_child (GTK_BIN (priv->task_details_window) ) ); /* gtk_widget_hide (priv->task_details_window); */ comp_editor_append_page (editor, COMP_EDITOR_PAGE (priv->task_details_page), NULL, FALSE); - + if (!e_cal_is_read_only (client, &read_only, NULL)) read_only = TRUE; if (priv->is_assigned) { if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS)) task_page_show_options (priv->task_page); - + task_page_set_assignment (priv->task_page, TRUE); comp_editor_set_group_item (COMP_EDITOR (te), TRUE); } else { task_page_set_assignment (priv->task_page, FALSE); - + bonobo_ui_component_set_prop (editor->uic, "/commands/InsertSendOptions", "hidden", "1", NULL); bonobo_ui_component_set_prop (editor->uic, "/commands/ViewRole", "hidden", "1", NULL); bonobo_ui_component_set_prop (editor->uic, "/commands/ViewRSVP", "hidden", "1", NULL); @@ -492,7 +492,7 @@ task_editor_edit_comp (CompEditor *editor, ECalComponent *comp) ECalComponentOrganizer organizer; ECal *client; GSList *attendees = NULL; - + te = TASK_EDITOR (editor); priv = te->priv; @@ -506,12 +506,12 @@ task_editor_edit_comp (CompEditor *editor, ECalComponent *comp) /* Get meeting related stuff */ e_cal_component_get_organizer (comp, &organizer); e_cal_component_get_attendee_list (comp, &attendees); - + if (attendees != NULL) { GSList *l; int row; - - task_page_hide_options (priv->task_page); + + task_page_hide_options (priv->task_page); task_page_set_assignment (priv->task_page, TRUE); for (l = attendees; l != NULL; l = l->next) { @@ -522,7 +522,7 @@ task_editor_edit_comp (CompEditor *editor, ECalComponent *comp) /* If we aren't the organizer or the attendee is just delegating, don't allow editing */ if (!comp_editor_get_user_org (editor) || e_meeting_attendee_is_set_delto (ia)) e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE); - e_meeting_store_add_attendee (priv->model, ia); + e_meeting_store_add_attendee (priv->model, ia); g_object_unref(ia); } @@ -551,10 +551,10 @@ task_editor_edit_comp (CompEditor *editor, ECalComponent *comp) if (ia != NULL) e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE); } - - + + comp_editor_set_group_item (COMP_EDITOR (te), TRUE); - priv->assignment_shown = TRUE; + priv->assignment_shown = TRUE; } e_cal_component_free_attendee_list (attendees); @@ -576,12 +576,12 @@ task_editor_send_comp (CompEditor *editor, ECalComponentItipMethod method) if (method == E_CAL_COMPONENT_METHOD_PUBLISH || method == E_CAL_COMPONENT_METHOD_CANCEL) goto parent; - + comp = task_page_get_cancel_comp (priv->task_page); if (comp != NULL) { ECal *client; gboolean result; - + client = e_meeting_store_get_e_cal (priv->model); result = itip_send_comp (E_CAL_COMPONENT_METHOD_CANCEL, comp, client, NULL, NULL, NULL); @@ -620,12 +620,12 @@ task_editor_finalize (GObject *object) g_object_unref (priv->task_details_page); priv->task_details_page = NULL; } - + if (priv->model) { g_object_unref (priv->model); priv->model = NULL; } - + g_free (priv); if (G_OBJECT_CLASS (task_editor_parent_class)->finalize) @@ -685,7 +685,7 @@ model_changed (TaskEditor *te) if (!te->priv->updating) { comp_editor_set_changed (COMP_EDITOR (te), TRUE); comp_editor_set_needs_send (COMP_EDITOR (te), TRUE); - } + } } static void diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index e6db2e932e..c929d32ea3 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -63,13 +63,13 @@ struct _TaskPagePrivate { /* Bonobo Controller for the menu/toolbar */ BonoboUIComponent *uic; - + /* Widgets from the Glade file */ GtkWidget *main; EAccountList *accounts; GList *address_strings; - EMeetingAttendee *ia; + EMeetingAttendee *ia; char *default_address; char *user_add; ECalComponent *comp; @@ -81,7 +81,7 @@ struct _TaskPagePrivate { /* Lists of attendees */ GPtrArray *deleted_attendees; - + /* Generic informative messages placeholder */ GtkWidget *info_hbox; GtkWidget *info_icon; @@ -94,7 +94,7 @@ struct _TaskPagePrivate { GtkWidget *start_date; GtkWidget *timezone; GtkWidget *timezone_label; - + GtkWidget *description; ECalComponentClassification classification; @@ -123,7 +123,7 @@ struct _TaskPagePrivate { /* For handling who the organizer is */ gboolean user_org; gboolean existing; - + gboolean updating; gboolean sendoptions_shown; gboolean is_assignment; @@ -207,7 +207,7 @@ task_page_init (TaskPage *tpage) priv->updating = FALSE; priv->sendoptions_shown = FALSE; priv->is_assignment = FALSE; - + priv->deleted_attendees = g_ptr_array_new (); priv->comp = NULL; @@ -217,16 +217,16 @@ task_page_init (TaskPage *tpage) priv->ia = NULL; priv->default_address = NULL; priv->invite = NULL; - + priv->model = NULL; - priv->list_view = NULL; + priv->list_view = NULL; } static void cleanup_attendees (GPtrArray *attendees) { int i; - + for (i = 0; i < attendees->len; i++) g_object_unref (g_ptr_array_index (attendees, i)); } @@ -256,7 +256,7 @@ task_page_finalize (GObject *object) g_object_unref (priv->xml); priv->xml = NULL; } - + if (priv->sod) { g_object_unref (priv->sod); priv->sod = NULL; @@ -264,7 +264,7 @@ task_page_finalize (GObject *object) if (priv->comp != NULL) g_object_unref (priv->comp); - + cleanup_attendees (priv->deleted_attendees); g_ptr_array_free (priv->deleted_attendees, TRUE); @@ -383,7 +383,7 @@ task_page_set_view_rsvp (TaskPage *page, gboolean state) e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", state); } -void +void task_page_set_classification (TaskPage *page, ECalComponentClassification class) { page->priv->classification = class; @@ -394,19 +394,19 @@ sensitize_widgets (TaskPage *tpage) { gboolean read_only, sens = TRUE, sensitize; TaskPagePrivate *priv; - + priv = tpage->priv; if (!e_cal_is_read_only (COMP_EDITOR_PAGE (tpage)->client, &read_only, NULL)) read_only = TRUE; - + if (COMP_EDITOR_PAGE (tpage)->flags & COMP_EDITOR_IS_ASSIGNED) sens = COMP_EDITOR_PAGE (tpage)->flags & COMP_EDITOR_PAGE_USER_ORG; sensitize = (!read_only && sens); - /* The list of organizers is set to be non-editable. Otherwise any - * change in the displayed list causes an 'Account not found' error. + /* The list of organizers is set to be non-editable. Otherwise any + * change in the displayed list causes an 'Account not found' error. */ gtk_editable_set_editable (GTK_EDITABLE (GTK_COMBO (priv->organizer)->entry), FALSE); @@ -424,7 +424,7 @@ sensitize_widgets (TaskPage *tpage) e_meeting_list_view_set_editable (priv->list_view, (!read_only && sens)); gtk_widget_set_sensitive (priv->remove, (!read_only && sens)); gtk_widget_set_sensitive (priv->invite, (!read_only && sens)); - gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only); + gtk_widget_set_sensitive (GTK_WIDGET (priv->list_view), !read_only); bonobo_ui_component_set_prop (priv->uic, "/commands/InsertAttachments", "sensitive", sensitize ? "1" : "0" , NULL); @@ -443,7 +443,7 @@ sensitize_widgets (TaskPage *tpage) bonobo_ui_component_set_prop (priv->uic, "/commands/OptionStatus", "sensitive", sensitize ? "1" : "0" , NULL); - + if (!priv->is_assignment) { gtk_widget_hide (priv->calendar_label); gtk_widget_hide (priv->list_box); @@ -452,12 +452,12 @@ sensitize_widgets (TaskPage *tpage) gtk_widget_hide (priv->invite); gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("_Group:")); } else { - gtk_widget_show (priv->invite); + gtk_widget_show (priv->invite); gtk_widget_show (priv->calendar_label); gtk_widget_show (priv->list_box); gtk_widget_show (priv->attendee_box); gtk_widget_show (priv->organizer); - gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("Or_ganizer:")); + gtk_label_set_text_with_mnemonic ((GtkLabel *) priv->org_cal_label, _("Or_ganizer:")); } } void @@ -468,13 +468,13 @@ task_page_hide_options (TaskPage *page) bonobo_ui_component_set_prop (page->priv->uic, "/commands/InsertSendOptions", "hidden", "1", NULL); page->priv->sendoptions_shown = FALSE; - + } void task_page_show_options (TaskPage *page) { g_return_if_fail (IS_TASK_PAGE (page)); - + bonobo_ui_component_set_prop (page->priv->uic, "/commands/InsertSendOptions", "hidden", "0", NULL); page->priv->sendoptions_shown = TRUE; } @@ -490,17 +490,17 @@ task_page_set_assignment (TaskPage *page, gboolean set) static EAccount * get_current_account (TaskPage *page) -{ +{ TaskPagePrivate *priv; EIterator *it; const char *str; - + priv = page->priv; str = gtk_entry_get_text (GTK_ENTRY (GTK_COMBO (priv->organizer)->entry)); if (!str) return NULL; - + for (it = e_list_get_iterator((EList *)priv->accounts); e_iterator_is_valid(it); e_iterator_next(it)) { EAccount *a = (EAccount *)e_iterator_get(it); char *full = g_strdup_printf("%s <%s>", a->id->name, a->id->address); @@ -511,12 +511,12 @@ get_current_account (TaskPage *page) return a; } - + g_free (full); } g_object_unref (it); - - return NULL; + + return NULL; } /* fill_widgets handler for the task page */ @@ -543,10 +543,10 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (priv->comp != NULL) g_object_unref (priv->comp); priv->comp = NULL; - + cleanup_attendees (priv->deleted_attendees); g_ptr_array_set_size (priv->deleted_attendees, 0); - + /* Component for cancellation */ priv->comp = e_cal_component_clone (comp); @@ -554,7 +554,7 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) clear_widgets (tpage); priv->user_add = itip_get_comp_attendee (comp, page->client); - + /* Summary, description(s) */ e_cal_component_get_summary (comp, &text); e_dialog_editable_set (priv->summary, text.value); @@ -562,7 +562,7 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) e_cal_component_get_description_list (comp, &l); if (l && l->data) { ECalComponentText *dtext; - + dtext = l->data; gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), dtext->value ? dtext->value : "", -1); @@ -608,14 +608,14 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) g_warning ("Couldn't get timezone from server: %s", d.tzid ? d.tzid : ""); } - + e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->timezone), zone ? zone : default_zone); task_page_set_show_timezone (tpage, calendar_config_get_show_timezone()); if (!(COMP_EDITOR_PAGE (tpage)->flags & COMP_EDITOR_PAGE_NEW_ITEM) && !zone) { task_page_set_show_timezone (tpage, FALSE); - bonobo_ui_component_set_prop (priv->uic, "/commands/ViewTimeZone", + bonobo_ui_component_set_prop (priv->uic, "/commands/ViewTimeZone", "state", "0", NULL); } @@ -684,9 +684,9 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) set_subscriber_info_string (tpage, backend_addr); if (priv->is_assignment) { - ECalComponentOrganizer organizer; - - priv->user_add = itip_get_comp_attendee (comp, COMP_EDITOR_PAGE (tpage)->client); + ECalComponentOrganizer organizer; + + priv->user_add = itip_get_comp_attendee (comp, COMP_EDITOR_PAGE (tpage)->client); /* Organizer strings */ task_page_select_organizer (tpage, backend_addr); @@ -737,7 +737,7 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) if (!(backend_addr && *backend_addr) || !g_ascii_strcasecmp (backend_addr, a->id->address)) { e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address)); e_meeting_attendee_set_cn (priv->ia, g_strdup (a->id->name)); - } else { + } else { e_meeting_attendee_set_address (priv->ia, g_strdup_printf ("MAILTO:%s", backend_addr)); e_meeting_attendee_set_sentby (priv->ia, g_strdup_printf ("MAILTO:%s", a->id->address)); } @@ -751,7 +751,7 @@ task_page_fill_widgets (CompEditorPage *page, ECalComponent *comp) } } - if (backend_addr) + if (backend_addr) g_free (backend_addr); priv->updating = FALSE; @@ -766,22 +766,22 @@ set_attendees (ECalComponent *comp, const GPtrArray *attendees) { GSList *comp_attendees = NULL, *l; int i; - + for (i = 0; i < attendees->len; i++) { EMeetingAttendee *ia = g_ptr_array_index (attendees, i); ECalComponentAttendee *ca; - + ca = e_meeting_attendee_as_e_cal_component_attendee (ia); - + comp_attendees = g_slist_prepend (comp_attendees, ca); - + } comp_attendees = g_slist_reverse (comp_attendees); - + e_cal_component_set_attendee_list (comp, comp_attendees); - + for (l = comp_attendees; l != NULL; l = l->next) - g_free (l->data); + g_free (l->data); g_slist_free (comp_attendees); } @@ -906,12 +906,12 @@ task_page_fill_component (CompEditorPage *page, ECalComponent *comp) } else { e_cal_component_set_dtstart (comp, NULL); } - + /* Classification. */ e_cal_component_set_classification (comp, priv->classification); - + /* send options */ - if (priv->sendoptions_shown && priv->sod) + if (priv->sendoptions_shown && priv->sod) e_sendoptions_utils_fill_component (priv->sod, comp); /* Categories */ @@ -941,14 +941,14 @@ task_page_fill_component (CompEditorPage *page, ECalComponent *comp) if (a == NULL) { e_notice (page, GTK_MESSAGE_ERROR, _("The organizer selected no longer has an account.")); - return FALSE; + return FALSE; } if (a->id->address == NULL || strlen (a->id->address) == 0) { e_notice (page, GTK_MESSAGE_ERROR, _("An organizer is required.")); return FALSE; - } + } if (!(backend_addr && *backend_addr) || !g_ascii_strcasecmp (backend_addr, a->id->address)) { org_addr = g_strdup_printf ("MAILTO:%s", a->id->address); @@ -1004,7 +1004,7 @@ task_page_fill_component (CompEditorPage *page, ECalComponent *comp) } e_cal_component_set_attendee_list (comp, attendee_list); e_cal_component_free_attendee_list (attendee_list); - } else + } else set_attendees (comp, e_meeting_store_get_attendees (priv->model)); } @@ -1043,16 +1043,16 @@ static void edit_clicked_cb (GtkButton *btn, TaskPage *tpage) static gboolean -existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) +existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) { GSList *attendees, *l; const gchar *ia_address; const gchar *ia_sentby = NULL; - + ia_address = itip_strip_mailto (e_meeting_attendee_get_address (ia)); if (!ia_address) return FALSE; - + if (e_meeting_attendee_is_set_sentby (ia)) ia_sentby = itip_strip_mailto (e_meeting_attendee_get_sentby (ia)); @@ -1062,7 +1062,7 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) ECalComponentAttendee *attendee = l->data; const char *address; const char *sentby = NULL; - + address = itip_strip_mailto (attendee->value); if (attendee->sentby) sentby = itip_strip_mailto (attendee->sentby); @@ -1072,19 +1072,19 @@ existing_attendee (EMeetingAttendee *ia, ECalComponent *comp) return TRUE; } } - + e_cal_component_free_attendee_list (attendees); - + return FALSE; } static void -remove_attendee (TaskPage *page, EMeetingAttendee *ia) +remove_attendee (TaskPage *page, EMeetingAttendee *ia) { TaskPagePrivate *priv; int pos = 0; gboolean delegate = (COMP_EDITOR_PAGE (page)->flags & COMP_EDITOR_PAGE_DELEGATE); - + priv = page->priv; /* If the user deletes the organizer attendee explicitly, @@ -1092,22 +1092,22 @@ remove_attendee (TaskPage *page, EMeetingAttendee *ia) if (ia == priv->ia) { g_object_unref (priv->ia); priv->ia = NULL; - } - + } + /* If this was a delegatee, no longer delegate */ if (e_meeting_attendee_is_set_delfrom (ia)) { EMeetingAttendee *ib; - + ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delfrom (ia), &pos); if (ib != NULL) { e_meeting_attendee_set_delto (ib, NULL); - - if (!delegate) + + if (!delegate) e_meeting_attendee_set_edit_level (ib, E_MEETING_ATTENDEE_EDIT_FULL); - } + } } - - /* Handle deleting all attendees in the delegation chain */ + + /* Handle deleting all attendees in the delegation chain */ while (ia != NULL) { EMeetingAttendee *ib = NULL; @@ -1115,14 +1115,14 @@ remove_attendee (TaskPage *page, EMeetingAttendee *ia) g_object_ref (ia); g_ptr_array_add (priv->deleted_attendees, ia); } - + if (e_meeting_attendee_get_delto (ia) != NULL) ib = e_meeting_store_find_attendee (priv->model, e_meeting_attendee_get_delto (ia), NULL); e_meeting_store_remove_attendee (priv->model, ia); ia = ib; } - + sensitize_widgets (page); } @@ -1138,7 +1138,7 @@ remove_clicked_cb (GtkButton *btn, TaskPage *page) GtkTreeModel *model = NULL; gboolean valid_iter; char *address; - + priv = page->priv; selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); @@ -1148,10 +1148,10 @@ remove_clicked_cb (GtkButton *btn, TaskPage *page) return; } paths = g_list_reverse (paths); - + for (tmp = paths; tmp; tmp=tmp->next) { path = tmp->data; - + gtk_tree_model_get_iter (GTK_TREE_MODEL(priv->model), &iter, path); gtk_tree_model_get (GTK_TREE_MODEL (priv->model), &iter, E_MEETING_STORE_ADDRESS_COL, &address, -1); @@ -1161,35 +1161,35 @@ remove_clicked_cb (GtkButton *btn, TaskPage *page) g_warning ("Cannot delete attendee\n"); continue; } else if (e_meeting_attendee_get_edit_level (ia) != E_MEETING_ATTENDEE_EDIT_FULL) { - g_warning("Not enough rights to delete attendee: %s\n", e_meeting_attendee_get_address(ia)); + g_warning("Not enough rights to delete attendee: %s\n", e_meeting_attendee_get_address(ia)); continue; } - + remove_attendee (page, ia); } - + /* Select closest item after removal */ valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path); if (!valid_iter) { gtk_tree_path_prev (path); valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path); } - + if (valid_iter) { gtk_tree_selection_unselect_all (selection); gtk_tree_selection_select_iter (selection, &iter); } - + g_list_foreach (paths, (GFunc) gtk_tree_path_free, NULL); g_list_free (paths); } static void -invite_cb (GtkWidget *widget, gpointer data) +invite_cb (GtkWidget *widget, gpointer data) { TaskPage *page; TaskPagePrivate *priv; - + page = TASK_PAGE (data); priv = page->priv; @@ -1199,7 +1199,7 @@ invite_cb (GtkWidget *widget, gpointer data) static void attendee_added_cb (EMeetingListView *emlv, EMeetingAttendee *ia, gpointer user_data) { - TaskPage *page = TASK_PAGE (user_data); + TaskPage *page = TASK_PAGE (user_data); TaskPagePrivate *priv; gboolean delegate = (COMP_EDITOR_PAGE (page)->flags & COMP_EDITOR_PAGE_DELEGATE); @@ -1209,13 +1209,13 @@ attendee_added_cb (EMeetingListView *emlv, EMeetingAttendee *ia, gpointer user_d if (existing_attendee (ia, priv->comp)) e_meeting_store_remove_attendee (priv->model, ia); else { - if (!e_cal_get_static_capability (COMP_EDITOR_PAGE(page)->client, + if (!e_cal_get_static_capability (COMP_EDITOR_PAGE(page)->client, CAL_STATIC_CAPABILITY_DELEGATE_TO_MANY)) { const char *delegator_id = e_meeting_attendee_get_delfrom (ia); EMeetingAttendee *delegator; delegator = e_meeting_store_find_attendee (priv->model, delegator_id, NULL); - e_meeting_attendee_set_delto (delegator, + e_meeting_attendee_set_delto (delegator, g_strdup (e_meeting_attendee_get_address (ia))); gtk_widget_set_sensitive (priv->invite, FALSE); @@ -1253,7 +1253,7 @@ enum { static EPopupItem context_menu_items[] = { { E_POPUP_ITEM, "10.delete", N_("_Remove"), popup_delete_cb, NULL, GTK_STOCK_REMOVE, ATTENDEE_CAN_DELETE }, - { E_POPUP_ITEM, "15.add", N_("_Add "), popup_add_cb, NULL, GTK_STOCK_ADD, ATTENDEE_CAN_ADD }, + { E_POPUP_ITEM, "15.add", N_("_Add "), popup_add_cb, NULL, GTK_STOCK_ADD, ATTENDEE_CAN_ADD }, }; static void @@ -1287,7 +1287,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, TaskPage *page) GtkTreeSelection *selection; if (gtk_tree_model_get_iter (GTK_TREE_MODEL (priv->model), &iter, path)) { - + gtk_tree_model_get (GTK_TREE_MODEL (priv->model), &iter, E_MEETING_STORE_ADDRESS_COL, &address, -1); ia = e_meeting_store_find_attendee (priv->model, address, &priv->row); g_free (address); @@ -1296,7 +1296,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, TaskPage *page) selection = gtk_tree_view_get_selection ((GtkTreeView *) priv->list_view); gtk_tree_selection_unselect_all (selection); gtk_tree_selection_select_path (selection, path); - + if (e_meeting_attendee_get_edit_level (ia) == E_MEETING_ATTENDEE_EDIT_FULL) disable_mask &= ~ATTENDEE_CAN_DELETE; } @@ -1312,7 +1312,7 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, TaskPage *page) for (i=0;i<sizeof(context_menu_items)/sizeof(context_menu_items[0]);i++) menus = g_slist_prepend(menus, &context_menu_items[i]); - + e_popup_add_items((EPopup *)ep, menus, NULL, context_popup_free, page); menu = e_popup_create_menu_once((EPopup *)ep, NULL, disable_mask); gtk_menu_popup (menu, NULL, NULL, NULL, NULL, event->button, event->time); @@ -1322,9 +1322,9 @@ button_press_event (GtkWidget *widget, GdkEventButton *event, TaskPage *page) static gboolean list_view_event (EMeetingListView *list_view, GdkEvent *event, TaskPage *page) { - + TaskPagePrivate *priv= page->priv; - + if (event->type == GDK_2BUTTON_PRESS && COMP_EDITOR_PAGE (page)->flags & COMP_EDITOR_PAGE_USER_ORG) { EMeetingAttendee *attendee; @@ -1338,7 +1338,7 @@ list_view_event (EMeetingListView *list_view, GdkEvent *event, TaskPage *page) { return TRUE; } - return FALSE; + return FALSE; } @@ -1346,7 +1346,7 @@ static gboolean list_key_press (EMeetingListView *list_view, GdkEventKey *event, TaskPage *page) { if (event->keyval == GDK_Delete) { - + remove_clicked_cb (NULL, page); return TRUE; @@ -1359,17 +1359,17 @@ list_key_press (EMeetingListView *list_view, GdkEventKey *event, TaskPage *page) return FALSE; } -void +void task_page_set_show_timezone (TaskPage *page, gboolean state) { if (state) { gtk_widget_show_all (page->priv->timezone); - gtk_widget_show (page->priv->timezone_label); + gtk_widget_show (page->priv->timezone_label); } else { gtk_widget_hide (page->priv->timezone); gtk_widget_hide (page->priv->timezone_label); } - + } void @@ -1377,7 +1377,7 @@ task_page_set_show_categories (TaskPage *page, gboolean state) { if (state) { gtk_widget_show (page->priv->categories_btn); - gtk_widget_show (page->priv->categories); + gtk_widget_show (page->priv->categories); } else { gtk_widget_hide (page->priv->categories_btn); gtk_widget_hide (page->priv->categories); @@ -1406,7 +1406,7 @@ task_page_fill_timezones (CompEditorPage *page, GHashTable *timezones) } /*If the msg has some value set, the icon should always be set */ -void +void task_page_set_info_string (TaskPage *tpage, const gchar *icon, const gchar *msg) { TaskPagePrivate *priv; @@ -1417,9 +1417,9 @@ task_page_set_info_string (TaskPage *tpage, const gchar *icon, const gchar *msg) gtk_label_set_text (GTK_LABEL(priv->info_string), msg); if (msg && icon) - gtk_widget_show (priv->info_hbox); + gtk_widget_show (priv->info_hbox); else - gtk_widget_hide (priv->info_hbox); + gtk_widget_hide (priv->info_hbox); } /* set_summary handler for the task page */ @@ -1503,7 +1503,7 @@ get_widgets (TaskPage *tpage) priv->org_cal_label = GW ("org-task-label"); priv->list_view = e_meeting_list_view_new (priv->model); - + selection = gtk_tree_view_get_selection ((GtkTreeView *) priv->list_view); gtk_tree_selection_set_mode (selection, GTK_SELECTION_MULTIPLE); gtk_widget_show (GTK_WIDGET (priv->list_view)); @@ -1516,7 +1516,7 @@ get_widgets (TaskPage *tpage) gtk_box_pack_start (GTK_BOX (priv->list_box), sw, TRUE, TRUE, 0); priv->source_selector = GW ("source"); - + #undef GW return (priv->summary @@ -1537,21 +1537,21 @@ summary_changed_cb (GtkEditable *editable, gpointer data) TaskPage *tpage; TaskPagePrivate *priv; gchar *summary; - + tpage = TASK_PAGE (data); priv = tpage->priv; - + if (priv->updating) return; - + summary = e_dialog_editable_get (GTK_WIDGET (editable)); - comp_editor_page_notify_summary_changed (COMP_EDITOR_PAGE (tpage), + comp_editor_page_notify_summary_changed (COMP_EDITOR_PAGE (tpage), summary); g_free (summary); } /* Callback used when the start or due date widgets change. We notify the - * other pages in the task editor, so they can update any labels. + * other pages in the task editor, so they can update any labels. */ static void date_changed_cb (EDateEdit *dedit, gpointer data) @@ -1616,7 +1616,7 @@ date_changed_cb (EDateEdit *dedit, gpointer data) due_dt.value = &due_tt; dates.due = &due_dt; dates.complete = NULL; - + /* Notify upstream */ comp_editor_page_notify_dates_changed (COMP_EDITOR_PAGE (tpage), &dates); @@ -1627,7 +1627,7 @@ timezone_changed_cb (EDateEdit *dedit, gpointer data) { TaskPage *tpage; TaskPagePrivate *priv; - + tpage = TASK_PAGE (data); priv = tpage->priv; @@ -1652,7 +1652,7 @@ categories_clicked_cb (GtkWidget *button, gpointer data) e_categories_config_open_dialog_for_entry (GTK_ENTRY (entry)); } /* sets the current focused widget */ -static gboolean +static gboolean widget_focus_in_cb (GtkWidget *widget, GdkEventFocus *event, gpointer data) { TaskPage *tpage; @@ -1679,10 +1679,10 @@ field_changed_cb (GtkWidget *widget, gpointer data) { TaskPage *tpage; TaskPagePrivate *priv; - + tpage = TASK_PAGE (data); priv = tpage->priv; - + if (!priv->updating) comp_editor_page_notify_changed (COMP_EDITOR_PAGE (tpage)); } @@ -1746,7 +1746,7 @@ times_updated (TaskPage *tpage, gboolean adjust_end_time) gboolean date_set; gboolean set_start_date = FALSE, set_end_date = FALSE, adjust_by_hour; icaltimezone *zone; - + priv = tpage->priv; if (priv->updating) @@ -1851,11 +1851,11 @@ source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) client = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); if (client) { icaltimezone *zone; - + zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (client, zone, NULL); } - + if (!client || !e_cal_open (client, FALSE, NULL)) { GtkWidget *dialog; @@ -1886,7 +1886,7 @@ source_changed_cb (ESourceComboBox *source_combo_box, TaskPage *tpage) gchar *backend_addr = NULL; e_cal_get_cal_address(client, &backend_addr, NULL); - + if (priv->is_assignment) task_page_select_organizer (tpage, backend_addr); @@ -1904,13 +1904,13 @@ set_subscriber_info_string (TaskPage *tpage, const char *backend_address) { ECal *client = COMP_EDITOR_PAGE (tpage)->client; ESource *source; - + source = e_cal_get_source (client); - + if (e_source_get_property (source, "subscriber")) - /* Translators: This string is used when we are creating a Task + /* Translators: This string is used when we are creating a Task on behalf of some other user */ - task_page_set_info_string (tpage, GTK_STOCK_DIALOG_INFO, + task_page_set_info_string (tpage, GTK_STOCK_DIALOG_INFO, g_strdup_printf(_("You are acting on behalf of %s"), backend_address)); else task_page_set_info_string (tpage, NULL, NULL); @@ -1924,7 +1924,7 @@ task_page_sendoptions_clicked_cb (TaskPage *tpage) ESource *source; priv = tpage->priv; - + if (!priv->sod) { priv->sod = e_sendoptions_dialog_new (); priv->sod->data->initialized = TRUE; @@ -1932,12 +1932,12 @@ task_page_sendoptions_clicked_cb (TaskPage *tpage) E_SOURCE_COMBO_BOX (priv->source_selector)); e_sendoptions_utils_set_default_data (priv->sod, source, "task"); } - - if (e_cal_get_static_capability (COMP_EDITOR_PAGE (tpage)->client, + + if (e_cal_get_static_capability (COMP_EDITOR_PAGE (tpage)->client, CAL_STATIC_CAPABILITY_NO_GEN_OPTIONS)) { e_sendoptions_set_need_general_options (priv->sod, FALSE); } - + toplevel = gtk_widget_get_toplevel (priv->main); e_sendoptions_dialog_run (priv->sod, toplevel, E_ITEM_TASK); } @@ -1960,7 +1960,7 @@ init_widgets (TaskPage *tpage) e_date_edit_set_get_time_callback (E_DATE_EDIT (priv->due_date), (EDateEditGetTimeCallback) comp_editor_get_current_time, tpage, NULL); - + /* Generic informative messages */ gtk_widget_hide (priv->info_hbox); @@ -1985,7 +1985,7 @@ init_widgets (TaskPage *tpage) /* Categories button */ g_signal_connect((priv->categories_btn), "clicked", G_CALLBACK (categories_clicked_cb), tpage); - + /* Source selector */ g_signal_connect (priv->source_selector, "changed", G_CALLBACK (source_changed_cb), tpage); @@ -2020,8 +2020,8 @@ init_widgets (TaskPage *tpage) G_CALLBACK (field_changed_cb), tpage); g_signal_connect (G_OBJECT (priv->list_view), "button_press_event", G_CALLBACK (button_press_event), tpage); g_signal_connect (G_OBJECT (priv->list_view), "event", G_CALLBACK (list_view_event), tpage); - g_signal_connect (priv->list_view, "key_press_event", G_CALLBACK (list_key_press), tpage); - + g_signal_connect (priv->list_view, "key_press_event", G_CALLBACK (list_key_press), tpage); + /* Add attendee button */ g_signal_connect (priv->add, "clicked", G_CALLBACK (add_clicked_cb), tpage); @@ -2032,24 +2032,24 @@ init_widgets (TaskPage *tpage) g_signal_connect (priv->remove, "clicked", G_CALLBACK (remove_clicked_cb), tpage); /* Contacts button */ - g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), tpage); + g_signal_connect(priv->invite, "clicked", G_CALLBACK (invite_cb), tpage); /* Meeting List View */ - g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), tpage); - + g_signal_connect (priv->list_view, "attendee_added", G_CALLBACK (attendee_added_cb), tpage); + /* Set the default timezone, so the timezone entry may be hidden. */ zone = calendar_config_get_icaltimezone (); e_timezone_entry_set_default_timezone (E_TIMEZONE_ENTRY (priv->timezone), zone); - + task_page_set_show_timezone (tpage, calendar_config_get_show_timezone()); - e_meeting_list_view_column_set_visible (priv->list_view, "Attendee ", + e_meeting_list_view_column_set_visible (priv->list_view, "Attendee ", TRUE); e_meeting_list_view_column_set_visible (priv->list_view, "Role", calendar_config_get_show_role()); e_meeting_list_view_column_set_visible (priv->list_view, "RSVP", calendar_config_get_show_rsvp()); e_meeting_list_view_column_set_visible (priv->list_view, "Status", calendar_config_get_show_status()); e_meeting_list_view_column_set_visible (priv->list_view, "Type", calendar_config_get_show_type()); - + task_page_set_show_categories (tpage, calendar_config_get_show_categories()); return TRUE; @@ -2080,7 +2080,7 @@ task_page_select_organizer (TaskPage *tpage, const char *backend_address) if (user_addr) subscribed_cal = TRUE; - else + else user_addr = (backend_address && *backend_address) ? backend_address : NULL; priv->default_address = NULL; @@ -2107,9 +2107,9 @@ task_page_select_organizer (TaskPage *tpage, const char *backend_address) /** * task_page_construct: * @tpage: An task page. - * + * * Constructs an task page by loading its Glade data. - * + * * Return value: The same object as @tpage, or NULL if the widgets could not be * created. **/ @@ -2120,7 +2120,7 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client) EIterator *it; EAccount *a; char *gladefile; - + priv = tpage->priv; g_object_ref (model); priv->model = model; @@ -2149,7 +2149,7 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client) e_iterator_is_valid(it); e_iterator_next(it)) { gchar *full = NULL; - + a = (EAccount *)e_iterator_get(it); if (!a->enabled) @@ -2159,7 +2159,7 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client) priv->address_strings = g_list_append(priv->address_strings, full); } - + g_object_unref(it); if (priv->address_strings) @@ -2168,7 +2168,7 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client) g_warning ("No potential organizers!"); if (!init_widgets (tpage)) { - g_message ("task_page_construct(): " + g_message ("task_page_construct(): " "Could not initialize the widgets!"); return NULL; } @@ -2178,9 +2178,9 @@ task_page_construct (TaskPage *tpage, EMeetingStore *model, ECal *client) /** * task_page_new: - * + * * Creates a new task page. - * + * * Return value: A newly-created task page, or NULL if the page could * not be created. **/ @@ -2194,7 +2194,7 @@ task_page_new (EMeetingStore *model, ECal *client, BonoboUIComponent *uic) g_object_unref (tpage); return NULL; } - + tpage->priv->uic = uic; return tpage; @@ -2212,9 +2212,9 @@ task_page_get_cancel_comp (TaskPage *page) if (priv->deleted_attendees->len == 0) return NULL; - + set_attendees (priv->comp, priv->deleted_attendees); - + return e_cal_component_clone (priv->comp); } diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c index e3d9ece911..1a3dd3dc08 100644 --- a/calendar/gui/e-alarm-list.c +++ b/calendar/gui/e-alarm-list.c @@ -229,7 +229,7 @@ e_alarm_list_finalize (GObject *object) } /* Fulfill the GtkTreeModel requirements */ -static GtkTreeModelFlags +static GtkTreeModelFlags e_alarm_list_get_flags (GtkTreeModel *tree_model) { g_return_val_if_fail (E_IS_ALARM_LIST (tree_model), 0); @@ -473,20 +473,20 @@ get_alarm_string (ECalComponentAlarm *alarm) if (dur) { if (trigger.u.rel_duration.is_neg) - /*Translator: The first %s refers to the base, which would be actions like + /*Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes"*/ str = g_strdup_printf (_("%s %s before the start of the appointment"), base, dur); else - /*Translator: The first %s refers to the base, which would be actions like + /*Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes"*/ str = g_strdup_printf (_("%s %s after the start of the appointment"), base, dur); g_free (dur); } else - /*Translator: The %s refers to the base, which would be actions like - * "Play a sound" */ + /*Translator: The %s refers to the base, which would be actions like + * "Play a sound" */ str = g_strdup_printf (_("%s at the start of the appointment"), base); break; @@ -496,20 +496,20 @@ get_alarm_string (ECalComponentAlarm *alarm) if (dur) { if (trigger.u.rel_duration.is_neg) - /* Translator: The first %s refers to the base, which would be actions like + /* Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes" */ str = g_strdup_printf (_("%s %s before the end of the appointment"), base, dur); else - /* Translator: The first %s refers to the base, which would be actions like + /* Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s refers to the duration string e.g:"15 minutes" */ str = g_strdup_printf (_("%s %s after the end of the appointment"), base, dur); g_free (dur); } else - /* Translator: The %s refers to the base, which would be actions like - * "Play a sound" */ + /* Translator: The %s refers to the base, which would be actions like + * "Play a sound" */ str = g_strdup_printf (_("%s at the end of the appointment"), base); break; @@ -532,7 +532,7 @@ get_alarm_string (ECalComponentAlarm *alarm) e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (), FALSE, FALSE, buf, sizeof (buf)); - /* Translator: The first %s refers to the base, which would be actions like + /* Translator: The first %s refers to the base, which would be actions like * "Play a Sound". Second %s is an absolute time, e.g. "10:00AM" */ str = g_strdup_printf (_("%s at %s"), base, buf); @@ -540,7 +540,7 @@ get_alarm_string (ECalComponentAlarm *alarm) case E_CAL_COMPONENT_ALARM_TRIGGER_NONE: default: - /* Translator: The %s refers to the base, which would be actions like + /* Translator: The %s refers to the base, which would be actions like * "Play a sound". "Trigger types" are absolute or relative dates */ str = g_strdup_printf (_("%s for an unknown trigger type"), base); break; diff --git a/calendar/gui/e-cal-component-memo-preview.c b/calendar/gui/e-cal-component-memo-preview.c index 7469a37070..90a96f0c9e 100644 --- a/calendar/gui/e-cal-component-memo-preview.c +++ b/calendar/gui/e-cal-component-memo-preview.c @@ -112,7 +112,7 @@ timet_to_str_with_zone (ECalComponentDateTime *dt, ECal *ecal, icaltimezone *def struct icaltimetype itt; icaltimezone *zone; struct tm tm; - char buf[256]; + char buf[256]; if (dt->tzid) { /* If we can't find the zone, we'll guess its "local" */ @@ -123,13 +123,13 @@ timet_to_str_with_zone (ECalComponentDateTime *dt, ECal *ecal, icaltimezone *def } else { zone = NULL; } - - + + itt = *dt->value; if (zone) icaltimezone_convert_time (&itt, zone, default_zone); tm = icaltimetype_to_tm (&itt); - + e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (), FALSE, FALSE, buf, sizeof (buf)); @@ -164,8 +164,8 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone if (l) { GSList *node; GString *string = g_string_new (NULL); - - + + gtk_html_stream_printf(stream, "<H3>%s: ", _("Categories")); for (node = l; node != NULL; node = node->next) { @@ -189,12 +189,12 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone } } } - + if (string->len > 0) gtk_html_stream_printf(stream, "%s", string->str); g_string_free (string, TRUE); - + gtk_html_stream_printf(stream, "</H3>"); e_cal_component_free_categories_list (l); @@ -202,7 +202,7 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone /* Start table */ gtk_html_stream_printf (stream, "<TABLE BORDER=\"0\" WIDTH=\"80%%\">" - "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\" WIDTH=\"15%%\"></TD></TR>"); + "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\" WIDTH=\"15%%\"></TD></TR>"); /* write start date */ e_cal_component_get_dtstart (comp, &dt); @@ -261,7 +261,7 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Web Page:")); gtk_html_stream_printf (stream, "<TD><A HREF=\"%s\">%s</A></TD></TR>", str, str); } - + gtk_html_stream_printf (stream, "</TABLE>"); /* close document */ @@ -273,7 +273,7 @@ e_cal_component_memo_preview_init (ECalComponentMemoPreview *preview) { ECalComponentMemoPreviewPrivate *priv; GtkWidget *scroll; - + priv = g_new0 (ECalComponentMemoPreviewPrivate, 1); preview->priv = priv; @@ -297,7 +297,7 @@ e_cal_component_memo_preview_init (ECalComponentMemoPreview *preview) gtk_container_add (GTK_CONTAINER (scroll), priv->html); gtk_container_add (GTK_CONTAINER (preview), scroll); gtk_widget_show_all (scroll); - + priv->zone = icaltimezone_get_utc_timezone (); } @@ -327,9 +327,9 @@ static void e_cal_component_memo_preview_class_init (ECalComponentMemoPreviewClass *klass) { GtkObjectClass *object_class; - + object_class = (GtkObjectClass *) klass; - + object_class->destroy = e_cal_component_memo_preview_destroy; } @@ -347,7 +347,7 @@ icaltimezone * e_cal_component_memo_preview_get_default_timezone (ECalComponentMemoPreview *preview) { ECalComponentMemoPreviewPrivate *priv; - + g_return_val_if_fail (preview != NULL, NULL); g_return_val_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (preview), NULL); @@ -360,13 +360,13 @@ void e_cal_component_memo_preview_set_default_timezone (ECalComponentMemoPreview *preview, icaltimezone *zone) { ECalComponentMemoPreviewPrivate *priv; - + g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (preview)); g_return_if_fail (zone != NULL); priv = preview->priv; - + priv->zone = zone; } @@ -382,7 +382,7 @@ e_cal_component_memo_preview_display (ECalComponentMemoPreview *preview, ECal *e g_return_if_fail (E_IS_CAL_COMPONENT (comp)); priv = preview->priv; - + stream = gtk_html_begin (GTK_HTML (priv->html)); write_html (stream, ecal, comp, priv->zone); gtk_html_stream_close (stream, GTK_HTML_STREAM_OK); @@ -395,9 +395,9 @@ e_cal_component_memo_preview_clear (ECalComponentMemoPreview *preview) g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_CAL_COMPONENT_MEMO_PREVIEW (preview)); - + priv = preview->priv; - + gtk_html_load_empty (GTK_HTML (priv->html)); } diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index f48d6198fb..b46069917c 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -110,7 +110,7 @@ timet_to_str_with_zone (ECalComponentDateTime *dt, ECal *ecal, icaltimezone *def struct icaltimetype itt; icaltimezone *zone; struct tm tm; - char buf[256]; + char buf[256]; if (dt->tzid) { /* If we can't find the zone, we'll guess its "local" */ @@ -121,13 +121,13 @@ timet_to_str_with_zone (ECalComponentDateTime *dt, ECal *ecal, icaltimezone *def } else { zone = NULL; } - - + + itt = *dt->value; if (zone) icaltimezone_convert_time (&itt, zone, default_zone); tm = icaltimetype_to_tm (&itt); - + e_time_format_date_and_time (&tm, calendar_config_get_24_hour_format (), FALSE, FALSE, buf, sizeof (buf)); @@ -184,7 +184,7 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone /* Start table */ gtk_html_stream_printf (stream, "<TABLE BORDER=\"0\" WIDTH=\"80%%\">" - "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\" WIDTH=\"15%%\"></TD></TR>"); + "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\" WIDTH=\"15%%\"></TD></TR>"); /* write location */ e_cal_component_get_location (comp, &location); @@ -213,7 +213,7 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone e_cal_component_free_datetime (&dt); g_free (str); } - + /* write Due Date */ e_cal_component_get_due (comp, &dt); if (dt.value != NULL) { @@ -224,7 +224,7 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone e_cal_component_free_datetime (&dt); g_free (str); } - + /* write status */ gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Status:")); e_cal_component_get_status (comp, &status); @@ -307,7 +307,7 @@ write_html (GtkHTMLStream *stream, ECal *ecal, ECalComponent *comp, icaltimezone gtk_html_stream_printf (stream, "<TR><TD VALIGN=\"TOP\" ALIGN=\"RIGHT\"><B>%s</B></TD>", _("Web Page:")); gtk_html_stream_printf (stream, "<TD><A HREF=\"%s\">%s</A></TD></TR>", str, str); } - + gtk_html_stream_printf (stream, "</TABLE>"); /* close document */ @@ -319,7 +319,7 @@ e_cal_component_preview_init (ECalComponentPreview *preview) { ECalComponentPreviewPrivate *priv; GtkWidget *scroll; - + priv = g_new0 (ECalComponentPreviewPrivate, 1); preview->priv = priv; @@ -343,7 +343,7 @@ e_cal_component_preview_init (ECalComponentPreview *preview) gtk_container_add (GTK_CONTAINER (scroll), priv->html); gtk_container_add (GTK_CONTAINER (preview), scroll); gtk_widget_show_all (scroll); - + priv->zone = icaltimezone_get_utc_timezone (); } @@ -373,9 +373,9 @@ static void e_cal_component_preview_class_init (ECalComponentPreviewClass *klass) { GtkObjectClass *object_class; - + object_class = (GtkObjectClass *) klass; - + object_class->destroy = e_cal_component_preview_destroy; } @@ -393,7 +393,7 @@ icaltimezone * e_cal_component_preview_get_default_timezone (ECalComponentPreview *preview) { ECalComponentPreviewPrivate *priv; - + g_return_val_if_fail (preview != NULL, NULL); g_return_val_if_fail (E_IS_CAL_COMPONENT_PREVIEW (preview), NULL); @@ -406,13 +406,13 @@ void e_cal_component_preview_set_default_timezone (ECalComponentPreview *preview, icaltimezone *zone) { ECalComponentPreviewPrivate *priv; - + g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_CAL_COMPONENT_PREVIEW (preview)); g_return_if_fail (zone != NULL); priv = preview->priv; - + priv->zone = zone; } @@ -428,8 +428,8 @@ e_cal_component_preview_display (ECalComponentPreview *preview, ECal *ecal, ECal g_return_if_fail (E_IS_CAL_COMPONENT (comp)); priv = preview->priv; - - stream = gtk_html_begin (GTK_HTML (priv->html)); + + stream = gtk_html_begin (GTK_HTML (priv->html)); write_html (stream, ecal, comp, priv->zone); gtk_html_stream_close (stream, GTK_HTML_STREAM_OK); } @@ -441,9 +441,9 @@ e_cal_component_preview_clear (ECalComponentPreview *preview) g_return_if_fail (preview != NULL); g_return_if_fail (E_IS_CAL_COMPONENT_PREVIEW (preview)); - + priv = preview->priv; - + gtk_html_load_empty (GTK_HTML (priv->html)); } diff --git a/calendar/gui/e-cal-list-view-config.c b/calendar/gui/e-cal-list-view-config.c index 13e9bf174c..be8128a14d 100644 --- a/calendar/gui/e-cal-list-view-config.c +++ b/calendar/gui/e-cal-list-view-config.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Rodrigo Moya <rodrigo@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -44,7 +44,7 @@ e_cal_list_view_config_set_property (GObject *object, guint property_id, const G ECalListViewConfig *view_config; view_config = E_CAL_LIST_VIEW_CONFIG (object); - + switch (property_id) { case PROP_VIEW: e_cal_list_view_config_set_view (view_config, g_value_get_object (value)); @@ -61,7 +61,7 @@ e_cal_list_view_config_get_property (GObject *object, guint property_id, GValue ECalListViewConfig *view_config; view_config = E_CAL_LIST_VIEW_CONFIG (object); - + switch (property_id) { case PROP_VIEW: g_value_set_object (value, e_cal_list_view_config_get_view (view_config)); @@ -76,9 +76,9 @@ static void e_cal_list_view_config_dispose (GObject *object) { ECalListViewConfig *view_config = E_CAL_LIST_VIEW_CONFIG (object); - + e_cal_list_view_config_set_view (view_config, NULL); - + if (G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->dispose) G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->dispose (object); } @@ -88,11 +88,11 @@ e_cal_list_view_config_finalize (GObject *object) { ECalListViewConfig *view_config = E_CAL_LIST_VIEW_CONFIG (object); ECalListViewConfigPrivate *priv; - + priv = view_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->finalize) G_OBJECT_CLASS (e_cal_list_view_config_parent_class)->finalize (object); } @@ -102,7 +102,7 @@ e_cal_list_view_config_class_init (ECalListViewConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - + /* Method override */ gobject_class->set_property = e_cal_list_view_config_set_property; gobject_class->get_property = e_cal_list_view_config_get_property; @@ -125,14 +125,14 @@ ECalListViewConfig * e_cal_list_view_config_new (ECalListView *list_view) { ECalListViewConfig *view_config; - + view_config = g_object_new (e_cal_list_view_config_get_type (), "view", list_view, NULL); return view_config; } ECalListView * -e_cal_list_view_config_get_view (ECalListViewConfig *view_config) +e_cal_list_view_config_get_view (ECalListViewConfig *view_config) { ECalListViewConfigPrivate *priv; @@ -140,16 +140,16 @@ e_cal_list_view_config_get_view (ECalListViewConfig *view_config) g_return_val_if_fail (E_IS_CAL_LIST_VIEW_CONFIG (view_config), NULL); priv = view_config->priv; - + return priv->view; } static void -set_timezone (ECalListView *list_view) +set_timezone (ECalListView *list_view) { icaltimezone *zone; - - zone = calendar_config_get_icaltimezone (); + + zone = calendar_config_get_icaltimezone (); e_calendar_view_set_timezone (E_CALENDAR_VIEW (list_view), zone); } @@ -158,14 +158,14 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer { ECalListViewConfig *view_config = data; ECalListViewConfigPrivate *priv; - + priv = view_config->priv; - + set_timezone (priv->view); } static void -set_twentyfour_hour (ECalListView *list_view) +set_twentyfour_hour (ECalListView *list_view) { gboolean use_24_hour; @@ -179,29 +179,29 @@ twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gp { ECalListViewConfig *view_config = data; ECalListViewConfigPrivate *priv; - + priv = view_config->priv; - + set_twentyfour_hour (priv->view); } void -e_cal_list_view_config_set_view (ECalListViewConfig *view_config, ECalListView *list_view) +e_cal_list_view_config_set_view (ECalListViewConfig *view_config, ECalListView *list_view) { ECalListViewConfigPrivate *priv; guint not; GList *l; - + g_return_if_fail (view_config != NULL); g_return_if_fail (E_IS_CAL_LIST_VIEW_CONFIG (view_config)); priv = view_config->priv; - + if (priv->view) { g_object_unref (priv->view); priv->view = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); @@ -211,17 +211,17 @@ e_cal_list_view_config_set_view (ECalListViewConfig *view_config, ECalListView * /* If the new view is NULL, return right now */ if (!list_view) return; - + priv->view = g_object_ref (list_view); /* Time zone */ set_timezone (list_view); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ - set_twentyfour_hour (list_view); + set_twentyfour_hour (list_view); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); diff --git a/calendar/gui/e-cal-list-view-config.h b/calendar/gui/e-cal-list-view-config.h index 2ecef1ebff..e3c7f54a2c 100644 --- a/calendar/gui/e-cal-list-view-config.h +++ b/calendar/gui/e-cal-list-view-config.h @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -30,7 +30,7 @@ G_BEGIN_DECLS #define E_CAL_LIST_VIEW_CONFIG(obj) GTK_CHECK_CAST (obj, e_cal_list_view_config_get_type (), ECalListViewConfig) #define E_CAL_LIST_VIEW_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cal_list_view_config_get_type (), ECalListViewConfigClass) #define E_IS_CAL_LIST_VIEW_CONFIG(obj) GTK_CHECK_TYPE (obj, e_cal_list_view_config_get_type ()) - + typedef struct _ECalListViewConfig ECalListViewConfig; typedef struct _ECalListViewConfigClass ECalListViewConfigClass; typedef struct _ECalListViewConfigPrivate ECalListViewConfigPrivate; diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index 7d67db489f..89ea2cd56a 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -293,7 +293,7 @@ setup_e_table (ECalListView *cal_list_view) "double_click", G_CALLBACK (e_cal_list_view_on_table_double_click), cal_list_view); g_signal_connect (e_table_scrolled_get_table (cal_list_view->table_scrolled), "right-click", G_CALLBACK (e_cal_list_view_on_table_right_click), cal_list_view); - g_signal_connect_after (e_table_scrolled_get_table (cal_list_view->table_scrolled), + g_signal_connect_after (e_table_scrolled_get_table (cal_list_view->table_scrolled), "cursor_change", G_CALLBACK (e_cal_list_view_cursor_change_cb), cal_list_view); /* Attach and show widget */ @@ -322,7 +322,7 @@ e_cal_list_view_new (void) { ECalListView *cal_list_view; ECalModel *model; - + model = E_CAL_MODEL (e_cal_model_calendar_new ()); e_cal_model_set_flags (model, E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES); @@ -388,16 +388,16 @@ e_cal_list_view_popup_menu (GtkWidget *widget) return TRUE; } -static gboolean -find_meeting (icalcomponent *icalcomp) +static gboolean +find_meeting (icalcomponent *icalcomp) { icalproperty *prop = NULL; prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); - + return prop ? TRUE: FALSE; } - + static gboolean e_cal_list_view_on_table_double_click (GtkWidget *table, gint row, gint col, GdkEvent *event, @@ -408,7 +408,7 @@ e_cal_list_view_on_table_double_click (GtkWidget *table, gint row, gint col, Gdk comp_data = e_cal_model_get_component_at (e_calendar_view_get_model (E_CALENDAR_VIEW (cal_list_view)), row); e_calendar_view_edit_appointment (E_CALENDAR_VIEW (cal_list_view), comp_data->client, - comp_data->icalcomp, find_meeting (comp_data->icalcomp)); + comp_data->icalcomp, find_meeting (comp_data->icalcomp)); return TRUE; } diff --git a/calendar/gui/e-cal-list-view.h b/calendar/gui/e-cal-list-view.h index d70271e24e..82af6480e9 100644 --- a/calendar/gui/e-cal-list-view.h +++ b/calendar/gui/e-cal-list-view.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors: +/* + * Authors: * Hans Petter Jansson <hpj@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-cal-menu.c b/calendar/gui/e-cal-menu.c index 554500a0a7..3fa178f569 100644 --- a/calendar/gui/e-cal-menu.c +++ b/calendar/gui/e-cal-menu.c @@ -109,12 +109,12 @@ ECalMenu *e_cal_menu_new(const char *menuid) /** * e_cal_menu_target_new_select: * @folder: The selection will ref this for the life of it. - * @folder_uri: + * @folder_uri: * @uids: The selection will free this when done with it. - * + * * Create a new selection popup target. - * - * Return value: + * + * Return value: **/ ECalMenuTargetSelect * e_cal_menu_target_new_select(ECalMenu *eabp, struct _ECalModel *model, GPtrArray *events) @@ -146,9 +146,9 @@ e_cal_menu_target_new_select(ECalMenu *eabp, struct _ECalModel *model, GPtrArray if (!e_cal_get_static_capability (comp_data->client, CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT) && !e_cal_get_static_capability (comp_data->client, CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK) - && !icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY)) + && !icalcomponent_get_first_property (comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY)) mask &= ~E_CAL_MENU_SELECT_ASSIGNABLE; - + if (!icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY)) mask &= ~ E_CAL_MENU_SELECT_NOTCOMPLETE; @@ -278,7 +278,7 @@ GType e_cal_menu_hook_get_type(void) { static GType type = 0; - + if (!type) { static const GTypeInfo info = { sizeof(ECalMenuHookClass), NULL, NULL, (GClassInitFunc) ecalph_class_init, NULL, NULL, @@ -288,6 +288,6 @@ e_cal_menu_hook_get_type(void) ecalph_parent_class = g_type_class_ref(e_menu_hook_get_type()); type = g_type_register_static(e_menu_hook_get_type(), "ECalMenuHook", &info, 0); } - + return type; } diff --git a/calendar/gui/e-cal-menu.h b/calendar/gui/e-cal-menu.h index d7298da5b1..b915ac3b19 100644 --- a/calendar/gui/e-cal-menu.h +++ b/calendar/gui/e-cal-menu.h @@ -43,7 +43,7 @@ enum _e_cal_menu_target_t { /** * enum _e_cal_menu_target_select_t - ECalPopupTargetSelect qualifiers. - * + * * @E_CAL_MENU_SELECT_ONE: Only one item is selected. * @E_CAL_MENU_SELECT_MANY: More than one item selected. * @E_CAL_MENU_SELECT_ANY: One or more items selected. diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index 19e257523a..0a91d29a16 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -137,7 +137,7 @@ get_dtend (ECalModelCalendar *model, ECalModelComponent *comp_data) if (model_zone) icaltimezone_convert_time (&tt_end, zone, model_zone); } else - tt_end = icaltime_from_timet_with_zone (comp_data->instance_end, tt_end.is_date, + tt_end = icaltime_from_timet_with_zone (comp_data->instance_end, tt_end.is_date, model_zone); } @@ -226,7 +226,7 @@ set_dtend (ECalModelComponent *comp_data, const void *value) icalproperty *prop; icalparameter *param; const char *tzid; - + prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTEND_PROPERTY); if (prop) param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); @@ -243,7 +243,7 @@ set_dtend (ECalModelComponent *comp_data, const void *value) return; } - + /* If the TZID is set to "UTC", we set the is_utc flag. */ tzid = dv->zone ? icaltimezone_get_tzid (dv->zone) : "UTC"; if (tzid && !strcmp (tzid, "UTC")) @@ -384,7 +384,7 @@ ecmc_set_value_at (ETableModel *etm, int col, int row, const void *value) comp_data->client, NULL, NULL, NULL); } else { g_warning (G_STRLOC ": Could not modify the object!"); - + /* FIXME Show error dialog */ } diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c index 877e3fb8ec..b5821823de 100644 --- a/calendar/gui/e-cal-model-memos.c +++ b/calendar/gui/e-cal-model-memos.c @@ -157,7 +157,7 @@ ecmm_set_value_at (ETableModel *etm, int col, int row, const void *value) /* TODO ask about mod type */ if (!e_cal_modify_object (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) { g_warning (G_STRLOC ": Could not modify the object!"); - + /* TODO Show error dialog */ } } diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 66e7c536d5..b74283e328 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -246,7 +246,7 @@ get_completed (ECalModelComponent *comp_data) comp_data->completed->tt = tt_completed; if (icaltime_get_tzid (tt_completed) - && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_completed), &zone, NULL)) + && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_completed), &zone, NULL)) comp_data->completed->zone = zone; else comp_data->completed->zone = NULL; @@ -276,7 +276,7 @@ get_due (ECalModelComponent *comp_data) comp_data->due->tt = tt_due; if (icaltime_get_tzid (tt_due) - && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_due), &zone, NULL)) + && e_cal_get_timezone (comp_data->client, icaltime_get_tzid (tt_due), &zone, NULL)) comp_data->due->zone = zone; else comp_data->due->zone = NULL; @@ -384,7 +384,7 @@ is_complete (ECalModelComponent *comp_data) prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY); if (prop && icalproperty_get_status (prop) == ICAL_STATUS_COMPLETED) return TRUE; - + return FALSE; } @@ -418,10 +418,10 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data) due_tt = icalproperty_get_due (prop); if (due_tt.is_date) { int cmp; - + now_tt = icaltime_current_time_with_zone (e_cal_model_get_timezone (E_CAL_MODEL (model))); cmp = icaltime_compare_date_only (due_tt, now_tt); - + if (cmp < 0) return E_CAL_MODEL_TASKS_DUE_OVERDUE; else if (cmp == 0) @@ -442,7 +442,7 @@ get_due_status (ECalModelTasks *model, ECalModelComponent *comp_data) now_tt = icaltime_current_time_with_zone (zone); - if (icaltime_compare (due_tt, now_tt) <= 0) + if (icaltime_compare (due_tt, now_tt) <= 0) return E_CAL_MODEL_TASKS_DUE_OVERDUE; else if (icaltime_compare_date_only (due_tt, now_tt) == 0) @@ -554,7 +554,7 @@ set_due (ECalModelComponent *comp_data, const void *value) icalproperty *prop; icalparameter *param; const char *tzid; - + prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DUE_PROPERTY); if (prop) param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); @@ -571,7 +571,7 @@ set_due (ECalModelComponent *comp_data, const void *value) return; } - + /* If the TZID is set to "UTC", we set the is_utc flag. */ tzid = dv->zone ? icaltimezone_get_tzid (dv->zone) : "UTC"; if (tzid && !strcmp (tzid, "UTC")) @@ -641,7 +641,7 @@ set_geo (ECalModelComponent *comp_data, const char *value) prop = icalproperty_new_geo (geo); icalcomponent_add_property (comp_data->icalcomp, prop); } - + } } @@ -691,7 +691,7 @@ set_status (ECalModelComponent *comp_data, const char *value) case ICAL_STATUS_COMPLETED: ensure_task_complete (comp_data, -1); - break; + break; default: break; } @@ -731,12 +731,12 @@ set_percent (ECalModelComponent *comp_data, const void *value) icalcomponent_remove_property (comp_data->icalcomp, prop); icalproperty_free (prop); } - + if (percent > 0) set_status (comp_data, _("In Progress")); } } - + } static void @@ -904,7 +904,7 @@ static void ecmt_free_value (ETableModel *etm, int col, void *value) { g_return_if_fail (col >= 0 && col < E_CAL_MODEL_TASKS_FIELD_LAST); - + if (col < E_CAL_MODEL_FIELD_LAST) { E_TABLE_MODEL_CLASS (e_cal_model_tasks_parent_class)->free_value (etm, col, value); return; @@ -1060,7 +1060,7 @@ ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, ETableModel *source_model, gint row) { void *value; - + g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); g_return_if_fail (comp_data != NULL); g_return_if_fail (E_IS_TABLE_MODEL (source_model)); @@ -1076,7 +1076,7 @@ ecmt_fill_component_from_model (ECalModel *model, ECalModelComponent *comp_data, if (GPOINTER_TO_INT (value) != 100 && GPOINTER_TO_INT (value) != 0) set_status (comp_data, e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_STATUS, row)); } - + set_due (comp_data, e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row)); set_geo (comp_data, @@ -1114,7 +1114,7 @@ void e_cal_model_tasks_mark_comp_complete (ECalModelTasks *model, ECalModelCompo ensure_task_complete (comp_data, -1); /*e_table_model_row_changed (E_TABLE_MODEL (model), model_row);*/ - + commit_component_changes (comp_data); } @@ -1131,15 +1131,15 @@ void e_cal_model_tasks_mark_comp_incomplete (ECalModelTasks *model, ECalModelCom g_return_if_fail (model != NULL); g_return_if_fail (comp_data != NULL); - + /* we will receive changes when committed, so don't do this */ /*e_table_model_pre_change (E_TABLE_MODEL (model));*/ /* Status */ - prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY); - if (prop) + prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_STATUS_PROPERTY); + if (prop) icalproperty_set_status (prop, ICAL_STATUS_NEEDSACTION); - else + else icalcomponent_add_property (comp_data->icalcomp, icalproperty_new_status (ICAL_STATUS_NEEDSACTION)); /*complete property*/ @@ -1198,7 +1198,7 @@ e_cal_model_tasks_update_due_tasks (ECalModelTasks *model) { comp_data = e_cal_model_get_component_at (E_CAL_MODEL (model), row); status = get_due_status (E_CAL_MODEL_TASKS (model), comp_data); - if((status == E_CAL_MODEL_TASKS_DUE_TODAY) || (status == E_CAL_MODEL_TASKS_DUE_OVERDUE)) + if((status == E_CAL_MODEL_TASKS_DUE_TODAY) || (status == E_CAL_MODEL_TASKS_DUE_OVERDUE)) { e_table_model_pre_change (E_TABLE_MODEL (model)); e_table_model_row_changed (E_TABLE_MODEL (model), row); diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 36466c1ac1..ec387e43eb 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -47,7 +47,7 @@ struct _ECalModelPrivate { /* The default client in the list */ ECal *default_client; - + /* Array for storing the objects. Each element is of type ECalModelComponent */ GPtrArray *objects; @@ -58,7 +58,7 @@ struct _ECalModelPrivate { /* The time range to display */ time_t start; time_t end; - + /* The search regular expression */ gchar *search_sexp; @@ -141,7 +141,7 @@ e_cal_model_class_init (ECalModelClass *klass) G_STRUCT_OFFSET (ECalModelClass, time_range_changed), NULL, NULL, e_calendar_marshal_VOID__LONG_LONG, - G_TYPE_NONE, 2, G_TYPE_LONG, G_TYPE_LONG); + G_TYPE_NONE, 2, G_TYPE_LONG, G_TYPE_LONG); signals[ROW_APPENDED] = g_signal_new ("row_appended", @@ -225,13 +225,13 @@ e_cal_model_dispose (GObject *object) if (priv->clients) { while (priv->clients != NULL) { ECalModelClient *client_data = (ECalModelClient *) priv->clients->data; - + g_signal_handlers_disconnect_matched (client_data->client, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model); if (client_data->query) g_signal_handlers_disconnect_matched (client_data->query, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, model); - + priv->clients = g_list_remove (priv->clients, client_data); @@ -349,7 +349,7 @@ get_description (ECalModelComponent *comp_data) g_string_free (str, TRUE); str = NULL; } - + prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DESCRIPTION_PROPERTY); if (prop) { str = g_string_new (NULL); @@ -475,7 +475,7 @@ ecm_value_at (ETableModel *etm, int col, int row) g_object_unref (comp); return GINT_TO_POINTER (retval); } - + if (e_cal_component_has_recurrences (comp)) retval = 1; else if (itip_organizer_is_user (comp, comp_data->client)) @@ -600,7 +600,7 @@ set_dtstart (ECalModel *model, ECalModelComponent *comp_data, const void *value) icalproperty *prop; icalparameter *param; const char *tzid; - + prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY); if (prop) param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); @@ -617,7 +617,7 @@ set_dtstart (ECalModel *model, ECalModelComponent *comp_data, const void *value) return; } - + /* If the TZID is set to "UTC", we set the is_utc flag. */ tzid = dv->zone ? icaltimezone_get_tzid (dv->zone) : "UTC"; if (tzid && !strcmp (tzid, "UTC")) @@ -705,7 +705,7 @@ ecm_set_value_at (ETableModel *etm, int col, int row, const void *value) /* FIXME ask about mod type */ if (!e_cal_modify_object (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) { g_warning (G_STRLOC ": Could not modify the object!"); - + /* FIXME Show error dialog */ } } @@ -723,7 +723,7 @@ e_cal_model_test_row_editable (ECalModel *model, int row) { gboolean readonly; ECal *cal = NULL; - + if (row != -1) { ECalModelComponent *comp_data; @@ -815,7 +815,7 @@ ecm_append_row (ETableModel *etm, ETableModel *source, int row) icalcomponent_free (comp_data.icalcomp); - g_signal_emit (G_OBJECT (model), signals[ROW_APPENDED], 0); + g_signal_emit (G_OBJECT (model), signals[ROW_APPENDED], 0); } static void * @@ -1012,7 +1012,7 @@ ecm_get_color_for_component (ECalModel *model, ECalModelComponent *comp_data) comp_data->color = g_strdup (color_spec); return comp_data->color; } - + for (i = 0; i < G_N_ELEMENTS (assigned_colors); i++) { GList *l; @@ -1111,7 +1111,7 @@ e_cal_model_set_timezone (ECalModel *model, icaltimezone *zone) { ECalModelPrivate *priv; GList *l; - + g_return_if_fail (E_IS_CAL_MODEL (model)); priv = model->priv; @@ -1121,7 +1121,7 @@ e_cal_model_set_timezone (ECalModel *model, icaltimezone *zone) for (l = priv->clients; l; l = l->next) e_cal_set_default_timezone (((ECalModelClient *)l->data)->client, priv->zone, NULL); - + /* the timezone affects the times shown for date fields, so we need to redisplay everything */ e_table_model_changed (E_TABLE_MODEL (model)); @@ -1180,7 +1180,7 @@ e_cal_model_get_default_client (ECalModel *model) g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL); - + priv = model->priv; /* FIXME Should we force the client to be open? */ @@ -1202,7 +1202,7 @@ e_cal_model_set_default_client (ECalModel *model, ECal *client) { ECalModelPrivate *priv; ECalModelClient *client_data; - + g_return_if_fail (model != NULL); g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (client != NULL); @@ -1219,12 +1219,12 @@ e_cal_model_set_default_client (ECalModel *model, ECal *client) remove_client (model, client_data); } } - + /* Make sure its in the model */ client_data = add_new_client (model, client, FALSE); - /* Store the default client */ - priv->default_client = client_data->client; + /* Store the default client */ + priv->default_client = client_data->client; } /** @@ -1274,7 +1274,7 @@ find_client_data (ECalModel *model, ECal *client) { ECalModelPrivate *priv; GList *l; - + priv = model->priv; for (l = priv->clients; l != NULL; l = l->next) { @@ -1282,7 +1282,7 @@ find_client_data (ECalModel *model, ECal *client) if (client_data->client == client) return client_data; - } + } return NULL; } @@ -1305,7 +1305,7 @@ search_by_id_and_client (ECalModelPrivate *priv, ECal *client, const ECalCompone if (uid && *uid) { if ((!client || comp_data->client == client) && !strcmp (id->uid, uid)) { if (has_rid) { - if (!(rid && *rid && !strcmp (rid, id->rid))) + if (!(rid && *rid && !strcmp (rid, id->rid))) continue; } return comp_data; @@ -1316,7 +1316,7 @@ search_by_id_and_client (ECalModelPrivate *priv, ECal *client, const ECalCompone return NULL; } - + typedef struct { ECal *client; ECalView *query; @@ -1345,15 +1345,15 @@ add_instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end e_cal_get_timezone (rdata->client, datetime.tzid, &zone, NULL); time = icaltime_from_timet_with_zone (instance_start, FALSE, zone ? zone : priv->zone); to_set.value = &time; - to_set.tzid = datetime.tzid; + to_set.tzid = datetime.tzid; e_cal_component_set_dtstart (comp, &to_set); - + /* set the right instance end date to component*/ e_cal_component_get_dtend (comp, &datetime); e_cal_get_timezone (rdata->client, datetime.tzid, &zone, NULL); time = icaltime_from_timet_with_zone (instance_end, FALSE, zone ? zone : priv->zone); to_set.value = &time; - to_set.tzid = datetime.tzid; + to_set.tzid = datetime.tzid; e_cal_component_set_dtend (comp, &to_set); comp_data = g_new0 (ECalModelComponent, 1); @@ -1476,16 +1476,16 @@ e_cal_view_objects_removed_cb (ECalView *query, GList *ids, gpointer user_data) ECalModelPrivate *priv; ECalModel *model = (ECalModel *) user_data; GList *l; - + priv = model->priv; - + for (l = ids; l; l = l->next) { ECalModelComponent *comp_data = NULL; ECalComponentId *id = l->data; int pos; e_table_model_pre_change (E_TABLE_MODEL (model)); - + /* make sure we remove all objects with this UID */ while ((comp_data = search_by_id_and_client (priv, e_cal_view_get_client (query), id))) { pos = get_position_in_array (priv->objects, comp_data); @@ -1505,7 +1505,7 @@ e_cal_view_progress_cb (ECalView *query, const char *message, int percent, gpoin g_return_if_fail (E_IS_CAL_MODEL (model)); - g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_PROGRESS], 0, message, + g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_PROGRESS], 0, message, percent, e_cal_get_source_type (client)); } @@ -1532,7 +1532,7 @@ update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data) /* Skip if this client has not finished loading yet */ if (e_cal_get_load_state (client_data->client) != E_CAL_LOAD_LOADED) return; - + /* free the previous query, if any */ if (client_data->query) { g_signal_handlers_disconnect_matched (client_data->query, G_SIGNAL_MATCH_DATA, @@ -1547,12 +1547,12 @@ update_e_cal_view_for_client (ECalModel *model, ECalModelClient *client_data) /* Don't create the new query if we won't use it */ if (!client_data->do_query) return; - + if (!e_cal_get_query (client_data->client, priv->full_sexp, &client_data->query, NULL)) { g_warning (G_STRLOC ": Unable to get query"); return; - } + } g_signal_connect (client_data->query, "objects_added", G_CALLBACK (e_cal_view_objects_added_cb), model); g_signal_connect (client_data->query, "objects_modified", G_CALLBACK (e_cal_view_objects_modified_cb), model); @@ -1583,19 +1583,19 @@ cal_opened_cb (ECal *client, ECalendarStatus status, gpointer user_data) e_cal_open_async (client, FALSE); return; } - + if (status != E_CALENDAR_STATUS_OK) { e_cal_model_remove_client (model, client); return; } - + /* Stop listening for this calendar to be opened */ g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, cal_opened_cb, model); client_data = find_client_data (model, client); g_return_if_fail (client_data); - + update_e_cal_view_for_client (model, client_data); } @@ -1605,20 +1605,20 @@ add_new_client (ECalModel *model, ECal *client, gboolean do_query) { ECalModelPrivate *priv; ECalModelClient *client_data; - + priv = model->priv; /* Look to see if we already have this client */ - client_data = find_client_data (model, client); + client_data = find_client_data (model, client); if (client_data) { if (client_data->do_query) return client_data; else client_data->do_query = do_query; - + goto load; } - + client_data = g_new0 (ECalModelClient, 1); client_data->client = g_object_ref (client); client_data->query = NULL; @@ -1651,14 +1651,14 @@ e_cal_model_add_client (ECalModel *model, ECal *client) g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (E_IS_CAL (client)); /* Check this return value or drop the assignment? */ - client_data = add_new_client (model, client, TRUE); + client_data = add_new_client (model, client, TRUE); } static void remove_client_objects (ECalModel *model, ECalModelClient *client_data) { int i; - + /* remove all objects belonging to this client */ for (i = model->priv->objects->len; i > 0; i--) { ECalModelComponent *comp_data = (ECalModelComponent *) g_ptr_array_index (model->priv->objects, i - 1); @@ -1689,7 +1689,7 @@ remove_client (ECalModel *model, ECalModelClient *client_data) * was also a source), keep it around but don't query it */ if (model->priv->default_client == client_data->client && client_data->do_query) { client_data->do_query = FALSE; - + return; } @@ -1710,7 +1710,7 @@ void e_cal_model_remove_client (ECalModel *model, ECal *client) { ECalModelClient *client_data; - + g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (E_IS_CAL (client)); @@ -1743,7 +1743,7 @@ redo_queries (ECalModel *model) char *iso_start, *iso_end; GList *l; int len; - + priv = model->priv; if (priv->full_sexp) @@ -1752,28 +1752,28 @@ redo_queries (ECalModel *model) if (priv->start != -1 && priv->end != -1) { iso_start = isodate_from_time_t (priv->start); iso_end = isodate_from_time_t (priv->end); - + priv->full_sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\")" " (make-time \"%s\"))" " %s)", - iso_start, iso_end, + iso_start, iso_end, priv->search_sexp ? priv->search_sexp : ""); } else if (priv->search_sexp) { priv->full_sexp = g_strdup (priv->search_sexp); } else { priv->full_sexp = g_strdup ("#f"); - } - + } + /* clean up the current contents */ e_table_model_pre_change (E_TABLE_MODEL (model)); len = priv->objects->len; e_table_model_rows_deleted (E_TABLE_MODEL (model), 0, len); clear_objects_array (priv); - + /* update the query for all clients */ for (l = priv->clients; l != NULL; l = l->next) { ECalModelClient *client_data; - + client_data = (ECalModelClient *) l->data; update_e_cal_view_for_client (model, client_data); } @@ -1783,15 +1783,15 @@ void e_cal_model_get_time_range (ECalModel *model, time_t *start, time_t *end) { ECalModelPrivate *priv; - + g_return_if_fail (model != NULL); g_return_if_fail (E_IS_CAL_MODEL (model)); priv = model->priv; - + if (start) *start = priv->start; - + if (end) *end = priv->end; } @@ -1800,7 +1800,7 @@ void e_cal_model_set_time_range (ECalModel *model, time_t start, time_t end) { ECalModelPrivate *priv; - + g_return_if_fail (model != NULL); g_return_if_fail (E_IS_CAL_MODEL (model)); g_return_if_fail (start >= 0 && end >= 0); @@ -1810,7 +1810,7 @@ e_cal_model_set_time_range (ECalModel *model, time_t start, time_t end) if (priv->start == start && priv->end == end) return; - + priv->start = start; priv->end = end; @@ -1822,12 +1822,12 @@ const char * e_cal_model_get_search_query (ECalModel *model) { ECalModelPrivate *priv; - + g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_CAL_MODEL (model), NULL); priv = model->priv; - + return priv->search_sexp; } @@ -1874,7 +1874,7 @@ e_cal_model_set_search_query_with_time_range (ECalModel *model, const char *sexp priv->search_sexp = g_strdup (sexp); do_query = TRUE; } - + if (!(priv->start == start && priv->end == end)) { priv->start = start; priv->end = end; @@ -2013,7 +2013,7 @@ e_cal_model_get_component_for_uid (ECalModel *model, const ECalComponentId *id) priv = model->priv; return search_by_id_and_client (priv, NULL, id); -} +} /** * e_cal_model_date_value_to_string @@ -2059,7 +2059,7 @@ static ECellDateEditValue * copy_ecdv (ECellDateEditValue *ecdv) { ECellDateEditValue *new_ecdv; - + new_ecdv = g_new0 (ECellDateEditValue, 1); new_ecdv->tt = ecdv ? ecdv->tt : icaltime_null_time (); new_ecdv->zone = ecdv ? ecdv->zone : NULL; @@ -2207,7 +2207,7 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezon else { icalparameter *param = NULL; icalproperty *prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY); - + if (prop) { param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); @@ -2223,7 +2223,7 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezon } } } - + comp_data->instance_start = icaltime_as_timet_with_zone (start_time, zone); if (end_time.zone) @@ -2231,7 +2231,7 @@ e_cal_model_set_instance_times (ECalModelComponent *comp_data, const icaltimezon else { icalparameter *param = NULL; icalproperty *prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_DTSTART_PROPERTY); - + if (prop) { param = icalproperty_get_first_parameter (prop, ICAL_TZID_PARAMETER); diff --git a/calendar/gui/e-cal-popup.c b/calendar/gui/e-cal-popup.c index 983f922958..caa69f015a 100644 --- a/calendar/gui/e-cal-popup.c +++ b/calendar/gui/e-cal-popup.c @@ -129,7 +129,7 @@ temp_save_part(CamelMimePart *part, char *path, gboolean file) g_free (utf8_mfilename); filename = (const char *) mfilename; } - + path = g_build_filename(tmpdir, filename, NULL); g_free(mfilename); } @@ -173,12 +173,12 @@ ecalp_part_popup_saveas(EPopup *ep, EPopupItem *item, void *data) mfilename = g_strdup(filename); e_filename_make_safe(mfilename); filename = mfilename; - } + } file = e_file_dialog_save (_("Save As..."), filename); - + if (file) temp_save_part (part, file, TRUE); - + g_free (file); g_free (mfilename); } @@ -189,10 +189,10 @@ ecalp_part_popup_save_selected(EPopup *ep, EPopupItem *item, void *data) GSList *parts; EPopupTarget *t = ep->target; char *dir, *path; - + dir = e_file_dialog_save_folder (_("Select folder to save selected attachments...")); parts = ((ECalPopupTargetAttachments *) t)->attachments; - + for (;parts; parts=parts->next) { path = temp_save_part (((EAttachment *)parts->data)->body, dir, FALSE); /* Probably we 'll do some reporting in next release, like listing the saved files and locations */ @@ -215,7 +215,7 @@ ecalp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) return; filename = g_strdup(camel_mime_part_get_filename(part)); - + /* if filename is blank, create a default filename based on MIME type */ if (!filename || !filename[0]) { CamelContentType *ct; @@ -226,13 +226,13 @@ ecalp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) } e_filename_make_safe(filename); - + path = g_build_filename(g_get_home_dir(), ".gnome2", "wallpapers", filename, NULL); - + extension = strrchr(filename, '.'); if (extension) *extension++ = 0; - + /* if file exists, stick a (number) on the end */ while (g_file_test(path, G_FILE_TEST_EXISTS)) { char *name; @@ -241,35 +241,35 @@ ecalp_part_popup_set_background(EPopup *ep, EPopupItem *item, void *data) path = g_build_filename(g_get_home_dir(), ".gnome2", "wallpapers", name, NULL); g_free(name); } - + g_free(filename); - + if (temp_save_part(part, path, TRUE)) { gconf = gconf_client_get_default(); - - /* if the filename hasn't changed, blank the filename before + + /* if the filename hasn't changed, blank the filename before * setting it so that gconf detects a change and updates it */ - if ((str = gconf_client_get_string(gconf, "/desktop/gnome/background/picture_filename", NULL)) != NULL + if ((str = gconf_client_get_string(gconf, "/desktop/gnome/background/picture_filename", NULL)) != NULL && strcmp (str, path) == 0) { gconf_client_set_string(gconf, "/desktop/gnome/background/picture_filename", "", NULL); } - + g_free (str); gconf_client_set_string(gconf, "/desktop/gnome/background/picture_filename", path, NULL); - + /* if GNOME currently doesn't display a picture, set to "wallpaper" * display mode, otherwise leave it alone */ - if ((str = gconf_client_get_string(gconf, "/desktop/gnome/background/picture_options", NULL)) == NULL + if ((str = gconf_client_get_string(gconf, "/desktop/gnome/background/picture_options", NULL)) == NULL || strcmp(str, "none") == 0) { gconf_client_set_string(gconf, "/desktop/gnome/background/picture_options", "wallpaper", NULL); } - + gconf_client_suggest_sync(gconf, NULL); - + g_free(str); g_object_unref(gconf); } - + g_free(path); } @@ -296,7 +296,7 @@ ecalp_apps_open_in(EPopup *ep, EPopupItem *item, void *data) GnomeVFSMimeApplication *app = item->user_data; char *uri; GList *uris = NULL; - + uri = gnome_vfs_get_uri_from_local_path(path); uris = g_list_append(uris, uri); @@ -330,7 +330,7 @@ ecalp_standard_items_free(EPopup *ep, GSList *items, void *data) g_slist_free(items); } -static void +static void ecalp_standard_menu_factory (EPopup *ecalp, void *data) { int i, len; @@ -359,18 +359,18 @@ ecalp_standard_menu_factory (EPopup *ecalp, void *data) filename = camel_mime_part_get_filename(attachment->body); - break; } + break; } default: items = NULL; - len = 0; + len = 0; } if (mime_type) { apps = gnome_vfs_mime_get_all_applications(mime_type); - + if (apps == NULL && strcmp(mime_type, "application/octet-stream") == 0) { const char *name_type; - + if (filename) { /* GNOME-VFS will misidentify TNEF attachments as MPEG */ if (!strcmp (filename, "winmail.dat")) @@ -464,12 +464,12 @@ ECalPopup *e_cal_popup_new(const char *menuid) static icalproperty * get_attendee_prop (icalcomponent *icalcomp, const char *address) { - + icalproperty *prop; if (!(address && *address)) return NULL; - + for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); prop; prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) { @@ -481,14 +481,14 @@ get_attendee_prop (icalcomponent *icalcomp, const char *address) } return NULL; } - -static gboolean + +static gboolean is_delegated (icalcomponent *icalcomp, char *user_email) { icalproperty *prop; icalparameter *param; const char *delto = NULL; - + prop = get_attendee_prop (icalcomp, user_email); if (prop) { @@ -496,8 +496,8 @@ is_delegated (icalcomponent *icalcomp, char *user_email) delto = icalparameter_get_delegatedto (param); } else return FALSE; - - prop = get_attendee_prop (icalcomp, itip_strip_mailto (delto)); + + prop = get_attendee_prop (icalcomp, itip_strip_mailto (delto)); if (prop) { const char *delfrom; @@ -512,20 +512,20 @@ is_delegated (icalcomponent *icalcomp, char *user_email) return TRUE; } - return FALSE; + return FALSE; } static gboolean -needs_to_accept (icalcomponent *icalcomp, char *user_email) +needs_to_accept (icalcomponent *icalcomp, char *user_email) { icalproperty *prop; icalparameter *param; icalparameter_partstat status; - + prop = get_attendee_prop (icalcomp, user_email); /* It might be a mailing list */ - if (!prop) + if (!prop) return TRUE; param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); status = icalparameter_get_partstat (param); @@ -543,10 +543,10 @@ needs_to_accept (icalcomponent *icalcomp, char *user_email) * @events: An array of pointers to ECalModelComponent items. These * items must be copied. They, and the @events array will be freed by * the popup menu automatically. - * + * * Create a new selection popup target. - * - * Return value: + * + * Return value: **/ ECalPopupTargetSelect * e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArray *events) @@ -555,13 +555,13 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr guint32 mask = ~0; ECal *client; gboolean read_only, user_org = FALSE; - + /* FIXME: This is duplicated in e-cal-menu */ t->model = model; g_object_ref(t->model); t->events = events; - + if (t->events->len == 0) { client = e_cal_model_get_default_client(t->model); } else { @@ -583,7 +583,7 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr /* Now check for any incomplete tasks and set the flags*/ for (; i < t->events->len; i++) { ECalModelComponent *comp_data = (ECalModelComponent *)t->events->pdata[i]; - if (!icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY)) + if (!icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY)) mask &= ~E_CAL_POPUP_SELECT_NOTCOMPLETE; else mask &= ~E_CAL_POPUP_SELECT_COMPLETE; @@ -640,7 +640,7 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr if (icalcomponent_get_first_property (comp_data->icalcomp, ICAL_COMPLETED_PROPERTY)) mask &= ~E_CAL_POPUP_SELECT_COMPLETE; - + g_object_unref (comp); g_free (user_email); } @@ -649,8 +649,8 @@ e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArr if (!read_only) mask &= ~E_CAL_POPUP_SELECT_EDITABLE; - - + + if (!e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_TASK_ASSIGNMENT) && !e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_CONV_TO_ASSIGN_TASK)) mask &= ~E_CAL_POPUP_SELECT_ASSIGNABLE; @@ -697,7 +697,7 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector) /* check for e_target_selector's offline_status property here */ offline = e_source_get_property (source, "offline"); - if (offline && strcmp (offline,"1") == 0) { + if (offline && strcmp (offline,"1") == 0) { /* set the menu item to Mark Offline - */ mask &= ~E_CAL_POPUP_SOURCE_NO_OFFLINE; } else { @@ -708,7 +708,7 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector) mask |= E_CAL_POPUP_SOURCE_OFFLINE; } g_free (uri); - + source = e_source_selector_peek_primary_selection (selector); /*check for delete_status property here*/ delete = e_source_get_property (source, "delete"); @@ -729,13 +729,13 @@ e_cal_popup_target_new_source(ECalPopup *eabp, ESourceSelector *selector) /** * e_cal_popup_target_new_attachments: - * @ecp: + * @ecp: * @attachments: A list of CalAttachment objects, reffed for * the list. Will be unreff'd once finished with. - * + * * Owns the list @attachments and their items after they're passed in. - * - * Return value: + * + * Return value: **/ ECalPopupTargetAttachments * e_cal_popup_target_new_attachments(ECalPopup *ecp, CompEditor *editor, GSList *attachments) @@ -752,10 +752,10 @@ e_cal_popup_target_new_attachments(ECalPopup *ecp, CompEditor *editor, GSList *a if (error->code != E_CALENDAR_STATUS_BUSY) read_only = TRUE; g_error_free (error); - } + } - if (!read_only && (!(flags & COMP_EDITOR_MEETING) || - (flags & COMP_EDITOR_NEW_ITEM) || + if (!read_only && (!(flags & COMP_EDITOR_MEETING) || + (flags & COMP_EDITOR_NEW_ITEM) || (flags & COMP_EDITOR_USER_ORG))) mask &= ~ E_CAL_POPUP_ATTACHMENTS_MODIFY; @@ -771,7 +771,7 @@ e_cal_popup_target_new_attachments(ECalPopup *ecp, CompEditor *editor, GSList *a if (len > 1) mask &= ~ E_CAL_POPUP_ATTACHMENTS_MULTIPLE; - + t->target.mask = mask; return t; @@ -820,7 +820,7 @@ static const EPopupHookTargetMask ecalph_select_masks[] = { { "meeting", E_CAL_POPUP_SELECT_MEETING }, { "assignable", E_CAL_POPUP_SELECT_ASSIGNABLE }, { "hasurl", E_CAL_POPUP_SELECT_HASURL }, - { "delegate", E_CAL_POPUP_SELECT_DELEGATABLE }, + { "delegate", E_CAL_POPUP_SELECT_DELEGATABLE }, { "accept", E_CAL_POPUP_SELECT_ACCEPTABLE }, { "not-complete", E_CAL_POPUP_SELECT_NOTCOMPLETE }, { "no-save-schedules", E_CAL_POPUP_SELECT_NOSAVESCHEDULES }, @@ -833,9 +833,9 @@ static const EPopupHookTargetMask ecalph_source_masks[] = { { "system", E_CAL_POPUP_SOURCE_SYSTEM }, { "user", E_CAL_POPUP_SOURCE_USER }, { "offline", E_CAL_POPUP_SOURCE_OFFLINE}, - { "no-offline", E_CAL_POPUP_SOURCE_NO_OFFLINE}, + { "no-offline", E_CAL_POPUP_SOURCE_NO_OFFLINE}, { "delete", E_CAL_POPUP_SOURCE_DELETE}, - { "no-delete", E_CAL_POPUP_SOURCE_NO_DELETE}, + { "no-delete", E_CAL_POPUP_SOURCE_NO_DELETE}, { NULL } }; @@ -882,7 +882,7 @@ GType e_cal_popup_hook_get_type(void) { static GType type = 0; - + if (!type) { static const GTypeInfo info = { sizeof(ECalPopupHookClass), NULL, NULL, (GClassInitFunc) ecalph_class_init, NULL, NULL, @@ -892,6 +892,6 @@ e_cal_popup_hook_get_type(void) ecalph_parent_class = g_type_class_ref(e_popup_hook_get_type()); type = g_type_register_static(e_popup_hook_get_type(), "ECalPopupHook", &info, 0); } - + return type; } diff --git a/calendar/gui/e-cal-popup.h b/calendar/gui/e-cal-popup.h index 70e61fefa6..ee3e94413f 100644 --- a/calendar/gui/e-cal-popup.h +++ b/calendar/gui/e-cal-popup.h @@ -39,7 +39,7 @@ struct _ECalendarView; /** * enum _e_cal_popup_target_t - A list of mail popup target types. - * + * * @E_CAL_POPUP_TARGET_SELECT: A selection of cards * @E_CAL_POPUP_TARGET_SOURCE: A source selection. * @@ -53,7 +53,7 @@ enum _e_cal_popup_target_t { /** * enum _e_cal_popup_target_select_t - ECalPopupTargetSelect qualifiers. - * + * * @E_CAL_POPUP_SELECT_ONE: Only one item is selected. * @E_CAL_POPUP_SELECT_MANY: More than one item selected. * @E_CAL_POPUP_SELECT_ANY: One ore more items are selected. @@ -92,10 +92,10 @@ enum _e_cal_popup_target_select_t { /** * enum _e_cal_popup_target_source_t - ECalPopupTargetSource qualifiers. - * + * * @E_CAL_POPUP_SOURCE_PRIMARY: Has a primary selection. * @E_CAL_POPUP_SOURCE_SYSTEM: Is a 'system' folder. - * + * **/ enum _e_cal_popup_target_source_t { E_CAL_POPUP_SOURCE_PRIMARY = 1<<0, @@ -109,10 +109,10 @@ enum _e_cal_popup_target_source_t { /** * enum _e_cal_popup_target_attachments_t - ECalPopupTargetAttachments qualifiers. - * + * * @E_CAL_POPUP_ATTACHMENTS_ONE: There is one and only one attachment selected. * @E_CAL_POPUP_ATTACHMENTS_MANY: There is one or more attachments selected. - * + * **/ enum _e_cal_popup_target_attachments_t { E_CAL_POPUP_ATTACHMENTS_ONE = 1<<0, /* only 1 selected */ @@ -128,7 +128,7 @@ typedef struct _ECalPopupTargetAttachments ECalPopupTargetAttachments; /** * struct _ECalPopupTargetSelect - A list of address cards. - * + * * @target: Superclass. target.widget is an ECalendarView. * @model: The ECalModel. * @events: The selected events. These are ECalModelComponent's. @@ -148,7 +148,7 @@ struct _ECalPopupTargetSelect { /** * struct _ECalPopupTargetSource - A source target. - * + * * @target: Superclass. * @selector: Selector holding the source selection. * @@ -162,7 +162,7 @@ struct _ECalPopupTargetSource { /** * struct _ECalPopupTargetAttachments - A list of calendar attachments. - * + * * @target: Superclass. * @attachments: A GSList list of CalAttachments. * @@ -193,7 +193,7 @@ ECalPopup *e_cal_popup_new(const char *menuid); ECalPopupTargetSelect *e_cal_popup_target_new_select(ECalPopup *eabp, struct _ECalModel *model, GPtrArray *events); ECalPopupTargetSource *e_cal_popup_target_new_source(ECalPopup *eabp, struct _ESourceSelector *selector); -ECalPopupTargetAttachments * e_cal_popup_target_new_attachments (ECalPopup *ecp, +ECalPopupTargetAttachments * e_cal_popup_target_new_attachments (ECalPopup *ecp, CompEditor *editor, GSList *attachments); /* ********************************************************************** */ diff --git a/calendar/gui/e-calendar-table-config.c b/calendar/gui/e-calendar-table-config.c index 588098950b..5750ceb8c9 100644 --- a/calendar/gui/e-calendar-table-config.c +++ b/calendar/gui/e-calendar-table-config.c @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -28,7 +28,7 @@ struct _ECalendarTableConfigPrivate { ECalendarTable *table; ECellDateEditConfig *cell_config; - + GList *notifications; }; @@ -46,7 +46,7 @@ e_calendar_table_config_set_property (GObject *object, guint property_id, const ECalendarTableConfig *table_config; table_config = E_CALENDAR_TABLE_CONFIG (object); - + switch (property_id) { case PROP_TABLE: e_calendar_table_config_set_table (table_config, g_value_get_object (value)); @@ -63,7 +63,7 @@ e_calendar_table_config_get_property (GObject *object, guint property_id, GValue ECalendarTableConfig *table_config; table_config = E_CALENDAR_TABLE_CONFIG (object); - + switch (property_id) { case PROP_TABLE: g_value_set_object (value, e_calendar_table_config_get_table (table_config)); @@ -78,9 +78,9 @@ static void e_calendar_table_config_dispose (GObject *object) { ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object); - + e_calendar_table_config_set_table (table_config, NULL); - + if (G_OBJECT_CLASS (e_calendar_table_config_parent_class)->dispose) G_OBJECT_CLASS (e_calendar_table_config_parent_class)->dispose (object); } @@ -90,11 +90,11 @@ e_calendar_table_config_finalize (GObject *object) { ECalendarTableConfig *table_config = E_CALENDAR_TABLE_CONFIG (object); ECalendarTableConfigPrivate *priv; - + priv = table_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_calendar_table_config_parent_class)->finalize) G_OBJECT_CLASS (e_calendar_table_config_parent_class)->finalize (object); } @@ -104,7 +104,7 @@ e_calendar_table_config_class_init (ECalendarTableConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - + /* Method override */ gobject_class->set_property = e_calendar_table_config_set_property; gobject_class->get_property = e_calendar_table_config_get_property; @@ -127,14 +127,14 @@ ECalendarTableConfig * e_calendar_table_config_new (ECalendarTable *table) { ECalendarTableConfig *table_config; - + table_config = g_object_new (e_calendar_table_config_get_type (), "table", table, NULL); return table_config; } ECalendarTable * -e_calendar_table_config_get_table (ECalendarTableConfig *table_config) +e_calendar_table_config_get_table (ECalendarTableConfig *table_config) { ECalendarTableConfigPrivate *priv; @@ -142,17 +142,17 @@ e_calendar_table_config_get_table (ECalendarTableConfig *table_config) g_return_val_if_fail (E_IS_CALENDAR_TABLE_CONFIG (table_config), NULL); priv = table_config->priv; - + return priv->table; } static void -set_timezone (ECalendarTable *table) +set_timezone (ECalendarTable *table) { ECalModel *model; icaltimezone *zone; - - zone = calendar_config_get_icaltimezone (); + + zone = calendar_config_get_icaltimezone (); model = e_calendar_table_get_model (table); if (model) e_cal_model_set_timezone (model, zone); @@ -163,14 +163,14 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer { ECalendarTableConfig *table_config = data; ECalendarTableConfigPrivate *priv; - + priv = table_config->priv; - + set_timezone (priv->table); } static void -set_twentyfour_hour (ECalendarTable *table) +set_twentyfour_hour (ECalendarTable *table) { ECalModel *model; gboolean use_24_hour; @@ -187,24 +187,24 @@ twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gp { ECalendarTableConfig *table_config = data; ECalendarTableConfigPrivate *priv; - + priv = table_config->priv; - + set_twentyfour_hour (priv->table); } void -e_calendar_table_config_set_table (ECalendarTableConfig *table_config, ECalendarTable *table) +e_calendar_table_config_set_table (ECalendarTableConfig *table_config, ECalendarTable *table) { ECalendarTableConfigPrivate *priv; guint not; GList *l; - + g_return_if_fail (table_config != NULL); g_return_if_fail (E_IS_CALENDAR_TABLE_CONFIG (table_config)); priv = table_config->priv; - + if (priv->table) { g_object_unref (priv->table); priv->table = NULL; @@ -214,7 +214,7 @@ e_calendar_table_config_set_table (ECalendarTableConfig *table_config, ECalendar g_object_unref (priv->cell_config); priv->cell_config = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); @@ -224,17 +224,17 @@ e_calendar_table_config_set_table (ECalendarTableConfig *table_config, ECalendar /* If the new view is NULL, return right now */ if (!table) return; - + priv->table = g_object_ref (table); /* Time zone */ set_timezone (table); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, table_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ - set_twentyfour_hour (table); + set_twentyfour_hour (table); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, table_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); diff --git a/calendar/gui/e-calendar-table-config.h b/calendar/gui/e-calendar-table-config.h index c11f3a0681..93b1dadf9b 100644 --- a/calendar/gui/e-calendar-table-config.h +++ b/calendar/gui/e-calendar-table-config.h @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -30,7 +30,7 @@ G_BEGIN_DECLS #define E_CALENDAR_TABLE_CONFIG(obj) GTK_CHECK_CAST (obj, e_calendar_table_config_get_type (), ECalendarTableConfig) #define E_CALENDAR_TABLE_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_calendar_table_config_get_type (), ECalendarTableConfigClass) #define E_IS_CALENDAR_TABLE_CONFIG(obj) GTK_CHECK_TYPE (obj, e_calendar_table_config_get_type ()) - + typedef struct _ECalendarTableConfig ECalendarTableConfig; typedef struct _ECalendarTableConfigClass ECalendarTableConfigClass; typedef struct _ECalendarTableConfigPrivate ECalendarTableConfigPrivate; diff --git a/calendar/gui/e-calendar-table.c b/calendar/gui/e-calendar-table.c index 1d8d48ab13..60d4dba6e4 100644 --- a/calendar/gui/e-calendar-table.c +++ b/calendar/gui/e-calendar-table.c @@ -221,7 +221,7 @@ priority_compare_cb (gconstpointer a, gconstpointer b) } static void -row_appended_cb (ECalModel *model, ECalendarTable *cal_table) +row_appended_cb (ECalModel *model, ECalendarTable *cal_table) { g_signal_emit (cal_table, signals[USER_CREATED], 0); } @@ -481,9 +481,9 @@ e_calendar_table_new (void) /** * e_calendar_table_get_model: * @cal_table: A calendar table. - * + * * Queries the calendar data model that a calendar table is using. - * + * * Return value: A calendar model. **/ ECalModel * @@ -514,9 +514,9 @@ e_calendar_table_destroy (GtkObject *object) /** * e_calendar_table_get_table: * @cal_table: A calendar table. - * + * * Queries the #ETable widget that the calendar table is using. - * + * * Return value: The #ETable widget that the calendar table uses to display its * data. **/ @@ -544,7 +544,7 @@ e_calendar_table_open_selected (ECalendarTable *cal_table) /** * e_calendar_table_complete_selected: * @cal_table: A calendar table - * + * * Marks the selected items as completed **/ void @@ -637,8 +637,8 @@ delete_selected_components (ECalendarTable *cal_table) for (l = objs; l; l = l->next) { ECalModelComponent *comp_data = (ECalModelComponent *) l->data; GError *error = NULL; - - e_cal_remove_object (comp_data->client, + + e_cal_remove_object (comp_data->client, icalcomponent_get_uid (comp_data->icalcomp), &error); delete_error_dialog (error, E_CAL_COMPONENT_TODO); g_clear_error (&error); @@ -663,7 +663,7 @@ add_retract_data (ECalComponent *comp, const char *retract_comment) icalcomponent_add_property (icalcomp, icalprop); } -static gboolean +static gboolean check_for_retract (ECalComponent *comp, ECal *client) { ECalComponentOrganizer org; @@ -671,13 +671,13 @@ check_for_retract (ECalComponent *comp, ECal *client) const char *strip = NULL; gboolean ret_val = FALSE; - if (!(e_cal_component_has_attendees (comp) && + if (!(e_cal_component_has_attendees (comp) && e_cal_get_save_schedules (client))) return ret_val; e_cal_component_get_organizer (comp, &org); strip = itip_strip_mailto (org.value); - + if (e_cal_get_cal_address (client, &email, NULL) && !g_ascii_strcasecmp (email, strip)) { ret_val = TRUE; } @@ -692,7 +692,7 @@ check_for_retract (ECalComponent *comp, ECal *client) /** * e_calendar_table_delete_selected: * @cal_table: A calendar table. - * + * * Deletes the selected components in the table; asks the user first. **/ void @@ -725,7 +725,7 @@ e_calendar_table_delete_selected (ECalendarTable *cal_table) comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); } - + if ((n_selected == 1) && comp && check_for_retract (comp, comp_data->client)) { char *retract_comment = NULL; gboolean retract = FALSE; @@ -739,7 +739,7 @@ e_calendar_table_delete_selected (ECalendarTable *cal_table) add_retract_data (comp, retract_comment); icalcomp = e_cal_component_get_icalcomponent (comp); icalcomponent_set_method (icalcomp, ICAL_METHOD_CANCEL); - if (!e_cal_send_objects (comp_data->client, icalcomp, &users, + if (!e_cal_send_objects (comp_data->client, icalcomp, &users, &mod_comp, &error)) { delete_error_dialog (error, E_CAL_COMPONENT_TODO); g_clear_error (&error); @@ -770,10 +770,10 @@ e_calendar_table_delete_selected (ECalendarTable *cal_table) /** * e_calendar_table_get_selected: - * @cal_table: - * + * @cal_table: + * * Get the currently selected ECalModelComponent's on the table. - * + * * Return value: A GSList of the components, which should be * g_slist_free'd when finished with. **/ @@ -860,7 +860,7 @@ e_calendar_table_copy_clipboard (ECalendarTable *cal_table) ETable *etable; GtkClipboard *clipboard; char *comp_str; - + g_return_if_fail (E_IS_CALENDAR_TABLE (cal_table)); /* create temporary VCALENDAR object */ @@ -877,7 +877,7 @@ e_calendar_table_copy_clipboard (ECalendarTable *cal_table) } else { gtk_clipboard_set_can_store (clipboard, target_types + 1, n_target_types - 1); } - + /* free memory */ icalcomponent_free (cal_table->tmp_vcal); cal_table->tmp_vcal = NULL; @@ -911,7 +911,7 @@ clipboard_get_calendar_data (ECalendarTable *cal_table, const gchar *text) } client = e_cal_model_get_default_client (cal_table->model); - + e_calendar_table_set_status_message (cal_table, _("Updating objects"), -1); if (kind == ICAL_VCALENDAR_COMPONENT) { @@ -965,7 +965,7 @@ clipboard_paste_received_cb (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) { - ECalendarTable *cal_table = E_CALENDAR_TABLE (data); + ECalendarTable *cal_table = E_CALENDAR_TABLE (data); ETable *e_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (cal_table->etable)); GnomeCanvas *canvas = e_table->table_canvas; GnomeCanvasItem *item = GNOME_CANVAS (canvas)->focused_item; @@ -1018,7 +1018,7 @@ e_calendar_table_open_task (ECalendarTable *cal_table, ECal *client, icalcompone CompEditor *tedit; const char *uid; guint32 flags = 0; - + uid = icalcomponent_get_uid (icalcomp); tedit = e_comp_editor_registry_find (comp_editor_registry, uid); @@ -1031,17 +1031,17 @@ e_calendar_table_open_task (ECalendarTable *cal_table, ECal *client, icalcompone if (assign) { flags |= COMP_EDITOR_IS_ASSIGNED; - if (itip_organizer_is_user (comp, client) || + if (itip_organizer_is_user (comp, client) || !e_cal_component_has_attendees (comp)) flags |= COMP_EDITOR_USER_ORG; } tedit = COMP_EDITOR (task_editor_new (client, flags)); comp_editor_edit_comp (tedit, comp); - + if (flags & COMP_EDITOR_IS_ASSIGNED) task_editor_show_assignment (TASK_EDITOR (tedit)); - + e_comp_editor_registry_add (comp_editor_registry, tedit, FALSE); } comp_editor_focus (tedit); @@ -1061,7 +1061,7 @@ open_task_by_row (ECalendarTable *cal_table, int row) static void e_calendar_table_on_double_click (ETable *table, - gint row, + gint row, gint col, GdkEvent *event, ECalendarTable *cal_table) @@ -1091,15 +1091,15 @@ e_calendar_table_on_save_as (EPopup *ep, EPopupItem *pitem, void *data) ECalModelComponent *comp_data; char *filename; char *ical_string; - + comp_data = e_calendar_table_get_selected_comp (cal_table); if (comp_data == NULL) return; - + filename = e_file_dialog_save (_("Save as..."), NULL); if (filename == NULL) return; - + ical_string = e_cal_get_component_as_string (comp_data->client, comp_data->icalcomp); if (ical_string == NULL) { g_warning ("Couldn't convert item to a string"); @@ -1107,7 +1107,7 @@ e_calendar_table_on_save_as (EPopup *ep, EPopupItem *pitem, void *data) } e_write_file_uri (filename, ical_string); - + g_free (ical_string); } @@ -1121,7 +1121,7 @@ e_calendar_table_on_print_task (EPopup *ep, EPopupItem *pitem, void *data) comp_data = e_calendar_table_get_selected_comp (cal_table); if (comp_data == NULL) return; - + comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); print_comp (comp, comp_data->client, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); @@ -1306,7 +1306,7 @@ on_new_task (EPopup *ep, EPopupItem *pitem, void *data) return; e_tasks_new_task (tasks); - + } /* Callback for the "delete tasks" menu item */ @@ -1321,14 +1321,14 @@ delete_cb (EPopup *ep, EPopupItem *pitem, void *data) static EPopupItem tasks_popup_items [] = { { E_POPUP_ITEM, "00.newtask", N_("New _Task"), on_new_task, NULL, "stock_task", 0, 0}, { E_POPUP_BAR, "01.bar" }, - + { E_POPUP_ITEM, "03.open", N_("_Open"), e_calendar_table_on_open_task, NULL, GTK_STOCK_OPEN, E_CAL_POPUP_SELECT_ONE }, { E_POPUP_ITEM, "05.openweb", N_("Open _Web Page"), open_url_cb, NULL, NULL, E_CAL_POPUP_SELECT_ONE, E_CAL_POPUP_SELECT_HASURL }, { E_POPUP_ITEM, "10.saveas", N_("_Save As..."), e_calendar_table_on_save_as, NULL, GTK_STOCK_SAVE_AS, E_CAL_POPUP_SELECT_ONE }, { E_POPUP_ITEM, "20.print", N_("_Print..."), e_calendar_table_on_print_task, NULL, GTK_STOCK_PRINT, E_CAL_POPUP_SELECT_ONE }, { E_POPUP_BAR, "30.bar" }, - + { E_POPUP_ITEM, "40.cut", N_("C_ut"), e_calendar_table_on_cut, NULL, GTK_STOCK_CUT, 0, E_CAL_POPUP_SELECT_EDITABLE }, { E_POPUP_ITEM, "50.copy", N_("_Copy"), e_calendar_table_on_copy, NULL, GTK_STOCK_COPY, 0, 0 }, { E_POPUP_ITEM, "60.paste", N_("_Paste"), e_calendar_table_on_paste, NULL, GTK_STOCK_PASTE, 0, E_CAL_POPUP_SELECT_EDITABLE }, @@ -1432,7 +1432,7 @@ e_calendar_table_on_key_press (ETable *table, } else if ((event->keyval == GDK_o) &&(event->state & GDK_CONTROL_MASK)) { open_task_by_row (cal_table, row); - return TRUE; + return TRUE; } return FALSE; @@ -1514,7 +1514,7 @@ show_completed_rows (ECalModel *model, GList *clients_list, char *show_sexp, GPt g_ptr_array_add (comp_objects, comp_data); e_table_model_row_inserted (E_TABLE_MODEL (model), comp_objects->len - 1); - } + } e_cal_component_free_id (id); g_object_unref (comp); } @@ -1603,7 +1603,7 @@ e_calendar_table_set_status_message (ECalendarTable *cal_table, const gchar *mes if (!cal_table->activity_handler) return; - + if (!message || !*message) { if (cal_table->activity_id != 0) { e_activity_handler_operation_finished (cal_table->activity_handler, cal_table->activity_id); @@ -1611,7 +1611,7 @@ e_calendar_table_set_status_message (ECalendarTable *cal_table, const gchar *mes } } else if (cal_table->activity_id == 0) { char *client_id = g_strdup_printf ("%p", cal_table); - + if (progress_icon == NULL) progress_icon = e_icon_factory_get_icon (EVOLUTION_TASKS_PROGRESS_IMAGE, E_ICON_SIZE_STATUS); @@ -1620,9 +1620,9 @@ e_calendar_table_set_status_message (ECalendarTable *cal_table, const gchar *mes g_free (client_id); } else { - + double progress; - + if (percent < 0) progress = -1.0; else { @@ -1653,7 +1653,7 @@ e_calendar_table_process_completed_tasks (ECalendarTable *table, GList *clients_ g_mutex_lock (mutex); - model = e_calendar_table_get_model (table); + model = e_calendar_table_get_model (table); comp_objects = e_cal_model_get_object_array (model); hide_sexp = calendar_config_get_hide_completed_tasks_sexp (TRUE); diff --git a/calendar/gui/e-calendar-table.h b/calendar/gui/e-calendar-table.h index a769cf54dd..b9ebf872a2 100644 --- a/calendar/gui/e-calendar-table.h +++ b/calendar/gui/e-calendar-table.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 2000, Ximian, Inc. * Copyright 2000, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -108,7 +108,7 @@ void e_calendar_table_set_activity_handler (ECalendarTable *cal_table, void e_calendar_table_set_status_message (ECalendarTable *cal_table, const gchar *message, int percent); -void e_calendar_table_open_task (ECalendarTable *cal_table, +void e_calendar_table_open_task (ECalendarTable *cal_table, ECal *client, icalcomponent *icalcomp, gboolean assign); diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index 7f84d6e540..c4f4117bba 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Rodrigo Moya <rodrigo@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -124,7 +124,7 @@ e_calendar_view_set_property (GObject *object, guint property_id, const GValue * ECalendarView *cal_view; cal_view = E_CALENDAR_VIEW (object); - + switch (property_id) { case PROP_MODEL: e_calendar_view_set_model (cal_view, E_CAL_MODEL (g_value_get_object (value))); @@ -178,7 +178,7 @@ e_calendar_view_class_init (ECalendarViewClass *klass) klass->update_query = NULL; klass->open_event = e_calendar_view_open_event; - g_object_class_install_property (gobject_class, PROP_MODEL, + g_object_class_install_property (gobject_class, PROP_MODEL, g_param_spec_object ("model", NULL, NULL, E_TYPE_CAL_MODEL, G_PARAM_READABLE | G_PARAM_WRITABLE)); @@ -260,15 +260,15 @@ e_calendar_view_class_init (ECalendarViewClass *klass) gtk_binding_entry_add_signal (binding_set, GDK_o, GDK_CONTROL_MASK, "open_event", 0); - + /* init the accessibility support for e_day_view */ e_cal_view_a11y_init (); } void -e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart, - icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas) +e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart, + icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas) { ECalComponent *comp; struct icaltimetype itime, old_dtstart, old_dtend; @@ -305,7 +305,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart case GNOME_CAL_WORK_WEEK_VIEW: if (start_offset == 0 && end_offset == 0 && in_top_canvas) all_day_event = TRUE; - + if (all_day_event) { ic_dur = ic_oneday; } else if (icaldurationtype_as_int (ic_dur) >= 60*60*24 @@ -341,7 +341,7 @@ e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart default: g_return_if_reached (); } - + itime = icaltime_from_timet_with_zone (new_dtstart, FALSE, default_zone); if (all_day_event) @@ -554,7 +554,7 @@ void e_calendar_view_set_activity_handler (ECalendarView *cal_view, EActivityHandler *activity_handler) { ECalendarViewPrivate *priv; - + g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view)); priv = cal_view->priv; @@ -566,14 +566,14 @@ void e_calendar_view_set_status_message (ECalendarView *cal_view, const gchar *message, int percent) { ECalendarViewPrivate *priv; - + g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view)); priv = cal_view->priv; if (!priv->activity_handler) return; - + if (!message || !*message) { if (priv->activity_id != 0) { e_activity_handler_operation_finished (priv->activity_handler, priv->activity_id); @@ -590,7 +590,7 @@ e_calendar_view_set_status_message (ECalendarView *cal_view, const gchar *messag g_free (client_id); } else { double progress; - + if (percent < 0) progress = -1.0; else { @@ -678,7 +678,7 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view) ECalComponent *comp; ECalendarViewEvent *event = (ECalendarViewEvent *) l->data; GError *error = NULL; - + if (!event) continue; @@ -704,14 +704,14 @@ e_calendar_view_cut_clipboard (ECalendarView *cal_view) &error); icalcomponent_free (icalcomp); } else - e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL, + e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL, CALOBJ_MOD_ALL, &error); } else e_cal_remove_object (event->comp_data->client, uid, &error); delete_error_dialog (error, E_CAL_COMPONENT_EVENT); g_clear_error (&error); - + g_object_unref (comp); } @@ -819,11 +819,11 @@ clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView if (e_cal_util_component_has_recurrences (subcomp)) { icalproperty *icalprop = icalcomponent_get_first_property (subcomp, ICAL_RRULE_PROPERTY); - if (icalprop) + if (icalprop) icalproperty_remove_parameter_by_name (icalprop, "X-EVOLUTION-ENDDATE"); } - - e_calendar_view_add_event (cal_view, client, selected_time_start, + + e_calendar_view_add_event (cal_view, client, selected_time_start, default_zone, subcomp, in_top_canvas); } else if (child_kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; @@ -831,10 +831,10 @@ clipboard_get_text_cb (GtkClipboard *clipboard, const gchar *text, ECalendarView zone = icaltimezone_new (); icaltimezone_set_component (zone, subcomp); e_cal_add_timezone (client, zone, NULL); - + icaltimezone_free (zone, 1); } - + subcomp = icalcomponent_get_next_component ( icalcomp, ICAL_ANY_COMPONENT); } @@ -871,7 +871,7 @@ add_retract_data (ECalComponent *comp, const char *retract_comment, CalObjModTyp icalproperty_set_x_name (icalprop, "X-EVOLUTION-RETRACT-COMMENT"); icalcomponent_add_property (icalcomp, icalprop); - if (mod == CALOBJ_MOD_ALL) + if (mod == CALOBJ_MOD_ALL) icalprop = icalproperty_new_x ("All"); else icalprop = icalproperty_new_x ("This"); @@ -879,7 +879,7 @@ add_retract_data (ECalComponent *comp, const char *retract_comment, CalObjModTyp icalcomponent_add_property (icalcomp, icalprop); } -static gboolean +static gboolean check_for_retract (ECalComponent *comp, ECal *client) { ECalComponentOrganizer org; @@ -887,13 +887,13 @@ check_for_retract (ECalComponent *comp, ECal *client) const char *strip = NULL; gboolean ret_val = FALSE; - if (!(e_cal_component_has_attendees (comp) && + if (!(e_cal_component_has_attendees (comp) && e_cal_get_save_schedules (client))) return ret_val; e_cal_component_get_organizer (comp, &org); strip = itip_strip_mailto (org.value); - + if (e_cal_get_cal_address (client, &email, NULL) && !g_ascii_strcasecmp (email, strip)) { ret_val = TRUE; } @@ -916,8 +916,8 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event) comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); vtype = e_cal_component_get_vtype (comp); - - /*FIXME remove it once the we dont set the recurrence id for all the generated instances */ + + /*FIXME remove it once the we dont set the recurrence id for all the generated instances */ if (!e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_RECURRENCES_NO_MASTER)) e_cal_component_set_recurid (comp, NULL); @@ -933,7 +933,7 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event) add_retract_data (comp, retract_comment, CALOBJ_MOD_ALL); icalcomp = e_cal_component_get_icalcomponent (comp); icalcomponent_set_method (icalcomp, ICAL_METHOD_CANCEL); - if (!e_cal_send_objects (event->comp_data->client, icalcomp, &users, + if (!e_cal_send_objects (event->comp_data->client, icalcomp, &users, &mod_comp, &error)) { delete_error_dialog (error, E_CAL_COMPONENT_EVENT); g_clear_error (&error); @@ -949,12 +949,12 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event) } } } - } else + } else delete = delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view)); if (delete) { const char *uid; - + if ((itip_organizer_is_user (comp, event->comp_data->client) || itip_sentby_is_user (comp)) && cancel_component_dialog ((GtkWindow *) gtk_widget_get_toplevel (GTK_WIDGET (cal_view)), event->comp_data->client, @@ -967,9 +967,9 @@ delete_event (ECalendarView *cal_view, ECalendarViewEvent *event) g_object_unref (comp); return; } - + if (e_cal_util_component_is_instance (event->comp_data->icalcomp) || e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) - e_cal_remove_object_with_mod (event->comp_data->client, uid, + e_cal_remove_object_with_mod (event->comp_data->client, uid, e_cal_component_get_recurid_as_string (comp), CALOBJ_MOD_ALL, &error); else e_cal_remove_object (event->comp_data->client, uid, &error); @@ -1026,7 +1026,7 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) ECalComponentVType vtype; gboolean delete = FALSE; GError *error = NULL; - + selected = e_calendar_view_get_selected_events (cal_view); if (!selected) return; @@ -1047,7 +1047,7 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) add_retract_data (comp, retract_comment, CALOBJ_MOD_THIS); icalcomp = e_cal_component_get_icalcomponent (comp); icalcomponent_set_method (icalcomp, ICAL_METHOD_CANCEL); - if (!e_cal_send_objects (event->comp_data->client, icalcomp, &users, + if (!e_cal_send_objects (event->comp_data->client, icalcomp, &users, &mod_comp, &error)) { delete_error_dialog (error, E_CAL_COMPONENT_EVENT); g_clear_error (&error); @@ -1061,7 +1061,7 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) } } } - } else + } else delete = delete_component_dialog (comp, FALSE, 1, vtype, GTK_WIDGET (cal_view)); if (delete) { @@ -1079,14 +1079,14 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) e_cal_get_timezone (event->comp_data->client, dt.tzid, &zone, &error); if (error) { - zone = e_calendar_view_get_timezone (cal_view); + zone = e_calendar_view_get_timezone (cal_view); g_clear_error(&error); } - } else + } else zone = e_calendar_view_get_timezone (cal_view); - if (is_instance) + if (is_instance) rid = e_cal_component_get_recurid_as_string (comp); e_cal_component_free_datetime (&dt); @@ -1115,13 +1115,13 @@ e_calendar_view_delete_selected_occurrence (ECalendarView *cal_view) else { struct icaltimetype instance_rid; - instance_rid = icaltime_from_timet_with_zone (event->comp_data->instance_start, + instance_rid = icaltime_from_timet_with_zone (event->comp_data->instance_start, TRUE, zone ? zone : icaltimezone_get_utc_timezone ()); e_cal_util_remove_instances (event->comp_data->icalcomp, instance_rid, CALOBJ_MOD_THIS); e_cal_modify_object (event->comp_data->client, event->comp_data->icalcomp, CALOBJ_MOD_THIS, &error); } - + delete_error_dialog (error, E_CAL_COMPONENT_EVENT); g_clear_error (&error); } @@ -1193,7 +1193,7 @@ on_edit_appointment (EPopup *ep, EPopupItem *pitem, void *data) if (event) e_calendar_view_edit_appointment (cal_view, event->comp_data->client, - event->comp_data->icalcomp, + event->comp_data->icalcomp, icalcomponent_get_first_property(event->comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY) != NULL); g_list_free (selected); @@ -1216,7 +1216,7 @@ on_save_as (EPopup *ep, EPopupItem *pitem, void *data) char *filename; char *ical_string; ECalendarViewEvent *event; - + selected = e_calendar_view_get_selected_events (cal_view); if (!selected) return; @@ -1224,7 +1224,7 @@ on_save_as (EPopup *ep, EPopupItem *pitem, void *data) filename = e_file_dialog_save (_("Save as..."), NULL); if (filename == NULL) return; - + event = (ECalendarViewEvent *) selected->data; ical_string = e_cal_get_component_as_string (event->comp_data->client, event->comp_data->icalcomp); if (ical_string == NULL) { @@ -1267,19 +1267,19 @@ transfer_item_to (ECalendarViewEvent *event, ECal *dest_client, gboolean remove_ char *new_uid; icalcomponent *orig_icalcomp; icalproperty *icalprop; - + uid = icalcomponent_get_uid (event->comp_data->icalcomp); /* put the new object into the destination calendar */ if (e_cal_get_object (dest_client, uid, NULL, &orig_icalcomp, NULL)) { icalcomponent_free (orig_icalcomp); - - - if (!e_cal_modify_object (dest_client, event->comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) + + + if (!e_cal_modify_object (dest_client, event->comp_data->icalcomp, CALOBJ_MOD_ALL, NULL)) return; } else { orig_icalcomp = icalcomponent_new_clone (event->comp_data->icalcomp); - + icalprop = icalproperty_new_x ("1"); icalproperty_set_x_name (icalprop, "X-EVOLUTION-MOVE-CALENDAR"); icalcomponent_add_property (orig_icalcomp, icalprop); @@ -1306,7 +1306,7 @@ transfer_item_to (ECalendarViewEvent *event, ECal *dest_client, gboolean remove_ /* remove the item from the source calendar */ if (remove_item) { if (e_cal_util_component_is_instance (event->comp_data->icalcomp) || e_cal_util_component_is_instance (event->comp_data->icalcomp)) - e_cal_remove_object_with_mod (event->comp_data->client, uid, + e_cal_remove_object_with_mod (event->comp_data->client, uid, NULL, CALOBJ_MOD_ALL, NULL); else e_cal_remove_object (event->comp_data->client, uid, NULL); @@ -1389,7 +1389,7 @@ on_meeting (EPopup *ep, EPopupItem *pitem, void *data) static void set_attendee_status_for_delegate (icalcomponent *icalcomp, ECal *client) { - icalproperty *prop; + icalproperty *prop; icalparameter *param; char *address = NULL; ECalComponent *comp; @@ -1397,9 +1397,9 @@ set_attendee_status_for_delegate (icalcomponent *icalcomp, ECal *client) comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (icalcomp)); - - address = itip_get_comp_attendee (comp, client); - + + address = itip_get_comp_attendee (comp, client); + for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); prop; @@ -1412,17 +1412,17 @@ set_attendee_status_for_delegate (icalcomponent *icalcomp, ECal *client) param = icalparameter_new_partstat (ICAL_PARTSTAT_DELEGATED); icalproperty_set_parameter (prop, param); - + found = TRUE; break; - } + } } /* We couldn find the attendee in the component, so add a new attendee */ if (!found) { char *temp = g_strdup_printf ("MAILTO:%s", address); - + prop = icalproperty_new_attendee ((const char *) temp); icalcomponent_add_property (icalcomp, prop); @@ -1457,7 +1457,7 @@ on_delegate (EPopup *ep, EPopupItem *pitem, void *data) selected = e_calendar_view_get_selected_events (cal_view); if (selected) { ECalendarViewEvent *event = (ECalendarViewEvent *) selected->data; - + clone = icalcomponent_new_clone (event->comp_data->icalcomp); set_attendee_status_for_delegate (clone, event->comp_data->client); @@ -1552,7 +1552,7 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data) ECal *client; char *new_uid; ECalComponentId *id = NULL; - + selected = e_calendar_view_get_selected_events (cal_view); if (!selected) return; @@ -1570,13 +1570,13 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data) e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); id = e_cal_component_get_id (comp); - + /* For the unrecurred instance we duplicate the original object, create a new uid for it, get rid of the recurrence rules, and set the start & end times to the instances times. */ new_comp = e_cal_component_new (); e_cal_component_set_icalcomponent (new_comp, icalcomponent_new_clone (event->comp_data->icalcomp)); - + new_uid = e_cal_component_gen_uid (); e_cal_component_set_uid (new_comp, new_uid); g_free (new_uid); @@ -1600,7 +1600,7 @@ on_unrecur_appointment (EPopup *ep, EPopupItem *pitem, void *data) /* Now update both ECalComponents. Note that we do this last since at * present the updates happen synchronously so our event may disappear. */ - + if (!e_cal_remove_object_with_mod (client, id->uid, id->rid, CALOBJ_MOD_THIS, NULL)) g_message ("on_unrecur_appointment(): Could not remove the old object!"); @@ -1665,7 +1665,7 @@ static EPopupItem ecv_main_items [] = { { E_POPUP_BAR, "60." }, /* FIXME: hook in this somehow */ { E_POPUP_SUBMENU, "60.view", N_("_Current View") }, - + { E_POPUP_ITEM, "61.today", N_("Select T_oday"), on_goto_today, NULL, "go-today" }, { E_POPUP_ITEM, "62.todate", N_("_Select Date..."), on_goto_date, NULL, GTK_STOCK_JUMP_TO }, }; @@ -1762,7 +1762,7 @@ e_calendar_view_create_popup_menu (ECalendarView *cal_view) return e_popup_create_menu_once((EPopup *)ep, (EPopupTarget *)t, 0); } -void +void e_calendar_view_open_event (ECalendarView *cal_view) { GList *selected; @@ -1815,18 +1815,18 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view, g_warning ("Default client not loaded \n"); return; } - + if (e_cal_is_read_only (default_client, &readonly, NULL) && readonly) { GtkWidget *widget; - + widget = e_error_new (NULL, "calendar:prompt-read-only-cal", NULL); - - g_signal_connect ((GtkDialog *)widget, "response", G_CALLBACK (gtk_widget_destroy), + + g_signal_connect ((GtkDialog *)widget, "response", G_CALLBACK (gtk_widget_destroy), widget); gtk_widget_show (widget); return; } - + dt.value = &itt; if (all_day) dt.tzid = NULL; @@ -1873,7 +1873,7 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view, flags |= COMP_EDITOR_MEETING; flags |= COMP_EDITOR_USER_ORG; } - + open_event_with_flags (cal_view, default_client, icalcomp, flags); @@ -2011,7 +2011,7 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view, gboolean meeting) { guint32 flags = 0; - + g_return_if_fail (E_IS_CALENDAR_VIEW (cal_view)); g_return_if_fail (E_IS_CAL (client)); g_return_if_fail (icalcomp != NULL); @@ -2025,7 +2025,7 @@ e_calendar_view_edit_appointment (ECalendarView *cal_view, g_object_unref (comp); } - + open_event_with_flags (cal_view, client, icalcomp, flags); } @@ -2056,7 +2056,7 @@ tooltip_grab (GtkWidget *tooltip, GdkEventKey *event, ECalendarView *view) gdk_keyboard_ungrab(GDK_CURRENT_TIME); gtk_widget_destroy (widget); g_object_set_data (G_OBJECT (view), "tooltip-window", NULL); - + return FALSE; } @@ -2075,7 +2075,7 @@ get_label (struct icaltimetype *tt, icaltimezone *f_zone, icaltimezone *t_zone) return g_strdup (buffer); } -void +void e_calendar_view_move_tip (GtkWidget *widget, int x, int y) { GtkRequisition requisition; @@ -2083,7 +2083,7 @@ e_calendar_view_move_tip (GtkWidget *widget, int x, int y) GdkScreen *screen; GdkScreen *pointer_screen; gint monitor_num, px, py; - GdkRectangle monitor; + GdkRectangle monitor; screen = gtk_widget_get_screen (widget); @@ -2093,7 +2093,7 @@ e_calendar_view_move_tip (GtkWidget *widget, int x, int y) gdk_display_get_pointer (gdk_screen_get_display (screen), &pointer_screen, &px, &py, NULL); - if (pointer_screen != screen) + if (pointer_screen != screen) { px = x; py = y; @@ -2110,10 +2110,10 @@ e_calendar_view_move_tip (GtkWidget *widget, int x, int y) y = y - h - 36; gtk_window_move (GTK_WINDOW (widget), x, y); - gtk_widget_show (widget); + gtk_widget_show (widget); } -/* +/* * It is expected to show the tooltips in this below format * * <B>SUBJECT OF THE MEETING</B> @@ -2128,7 +2128,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) GtkWidget *label, *box, *hbox, *ebox, *frame; const char *str; char *tmp, *tmp1, *tmp2; - ECalComponentOrganizer organiser; + ECalComponentOrganizer organiser; ECalComponentDateTime dtstart, dtend; icalcomponent *clone_comp; time_t t_start, t_end; @@ -2136,7 +2136,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) GtkStyle *style = gtk_widget_get_default_style (); GtkWidget *widget = (GtkWidget *) g_object_get_data (G_OBJECT (data->cal_view), "tooltip-window"); ECalComponent *newcomp = e_cal_component_new (); - icaltimezone *zone, *default_zone; + icaltimezone *zone, *default_zone; ECal *client = NULL; gboolean free_text = FALSE; @@ -2181,21 +2181,21 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) gtk_container_add ((GtkContainer *)ebox, hbox); gtk_widget_modify_bg (ebox, GTK_STATE_NORMAL, &(style->bg[GTK_STATE_SELECTED])); gtk_widget_modify_fg (label, GTK_STATE_NORMAL, &(style->text[GTK_STATE_SELECTED])); - + gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0); g_free (tmp); - + e_cal_component_get_organizer (newcomp, &organiser); if (organiser.cn) { - char *ptr ; + char *ptr ; ptr = strchr(organiser.value, ':'); - + if (ptr) { ptr++; /* To Translators: It will display "Organiser: NameOfTheUser <email@ofuser.com>" */ tmp = g_strdup_printf (_("Organizer: %s <%s>"), organiser.cn, ptr); } - else + else /* With SunOne accouts, there may be no ':' in organiser.value*/ tmp = g_strdup_printf (_("Organizer: %s"), organiser.cn); @@ -2208,7 +2208,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) g_free (tmp); } - + e_cal_component_get_location (newcomp, &str); if (str) { @@ -2225,24 +2225,24 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) } e_cal_component_get_dtstart (newcomp, &dtstart); e_cal_component_get_dtend (newcomp, &dtend); - + if (dtstart.tzid) { zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (newcomp), dtstart.tzid); - if (!zone) + if (!zone) e_cal_get_timezone (client, dtstart.tzid, &zone, NULL); if (!zone) zone = default_zone; - + } else { zone = NULL; } t_start = icaltime_as_timet_with_zone (*dtstart.value, zone); t_end = icaltime_as_timet_with_zone (*dtend.value, zone); - + tmp1 = get_label(dtstart.value, zone, default_zone); tmp = calculate_time (t_start, t_end); - + /* To Translators: It will display "Time: ActualStartDateAndTime (DurationOfTheMeeting)"*/ tmp2 = g_strdup_printf(_("Time: %s %s"), tmp1, tmp); hbox = gtk_hbox_new (FALSE, 0); @@ -2250,7 +2250,7 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) ebox = gtk_event_box_new (); gtk_container_add ((GtkContainer *)ebox, hbox); gtk_box_pack_start ((GtkBox *)box, ebox, FALSE, FALSE, 0); - + g_free (tmp); g_free (tmp2); g_free (tmp1); @@ -2258,12 +2258,12 @@ e_calendar_view_get_tooltips (ECalendarViewEventData *data) pevent->tooltip = gtk_window_new (GTK_WINDOW_POPUP); frame = gtk_frame_new (NULL); gtk_frame_set_shadow_type ((GtkFrame *)frame, GTK_SHADOW_IN); - + gtk_window_move ((GtkWindow *)pevent->tooltip, pevent->x +16, pevent->y+16); gtk_container_add ((GtkContainer *)frame, box); gtk_container_add ((GtkContainer *)pevent->tooltip, frame); - - gtk_widget_show_all (pevent->tooltip); + + gtk_widget_show_all (pevent->tooltip); e_calendar_view_move_tip (pevent->tooltip, pevent->x +16, pevent->y+16); @@ -2320,7 +2320,7 @@ e_calendar_view_get_icalcomponent_summary (ECal *ecal, icalcomponent *icalcomp, struct icaltimetype dtstart, dtnow; icalcomponent *item_icalcomp = NULL; - if (e_cal_get_object (ecal, + if (e_cal_get_object (ecal, icalcomponent_get_uid (icalcomp), icalcomponent_get_relcalid (icalcomp), &item_icalcomp, @@ -2345,8 +2345,8 @@ draw_curved_rectangle (cairo_t *cr, double x0, double y0, double radius) { double x1, y1; - - x1 = x0 + rect_width; + + x1 = x0 + rect_width; y1 = y0 + rect_height; if (!rect_width || !rect_height) diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h index eb887b1ce5..f25366d392 100644 --- a/calendar/gui/e-calendar-view.h +++ b/calendar/gui/e-calendar-view.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Rodrigo Moya <rodrigo@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -56,7 +56,7 @@ typedef enum { E_CAL_VIEW_MOVE_LEFT, E_CAL_VIEW_MOVE_RIGHT, E_CAL_VIEW_MOVE_PAGE_UP, - E_CAL_VIEW_MOVE_PAGE_DOWN + E_CAL_VIEW_MOVE_PAGE_DOWN } ECalViewMoveDirection; #define E_CALENDAR_VIEW_EVENT_FIELDS \ @@ -70,12 +70,12 @@ typedef enum { GtkWidget *tooltip; \ gint timeout; \ GdkColor *color; \ - gint x,y; + gint x,y; typedef struct { E_CALENDAR_VIEW_EVENT_FIELDS } ECalendarViewEvent; - + typedef struct _ECalendarView ECalendarView; typedef struct _ECalendarViewClass ECalendarViewClass; typedef struct _ECalendarViewPrivate ECalendarViewPrivate; @@ -143,7 +143,7 @@ void e_calendar_view_delete_selected_occurrence (ECalendarView *cal_vi GtkMenu *e_calendar_view_create_popup_menu (ECalendarView *cal_view); -void e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart, +void e_calendar_view_add_event (ECalendarView *cal_view, ECal *client, time_t dtstart, icaltimezone *default_zone, icalcomponent *icalcomp, gboolean in_top_canvas); void e_calendar_view_new_appointment_for (ECalendarView *cal_view, time_t dtstart, diff --git a/calendar/gui/e-cell-date-edit-config.c b/calendar/gui/e-cell-date-edit-config.c index f894da0e2b..ddccce408e 100644 --- a/calendar/gui/e-cell-date-edit-config.c +++ b/calendar/gui/e-cell-date-edit-config.c @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -28,7 +28,7 @@ struct _ECellDateEditConfigPrivate { ECellDateEdit *cell; EMiniCalendarConfig *mini_config; - + GList *notifications; }; @@ -46,7 +46,7 @@ e_cell_date_edit_config_set_property (GObject *object, guint property_id, const ECellDateEditConfig *view_config; view_config = E_CELL_DATE_EDIT_CONFIG (object); - + switch (property_id) { case PROP_CELL: e_cell_date_edit_config_set_cell (view_config, g_value_get_object (value)); @@ -63,7 +63,7 @@ e_cell_date_edit_config_get_property (GObject *object, guint property_id, GValue ECellDateEditConfig *view_config; view_config = E_CELL_DATE_EDIT_CONFIG (object); - + switch (property_id) { case PROP_CELL: g_value_set_object (value, e_cell_date_edit_config_get_cell (view_config)); @@ -78,9 +78,9 @@ static void e_cell_date_edit_config_dispose (GObject *object) { ECellDateEditConfig *view_config = E_CELL_DATE_EDIT_CONFIG (object); - + e_cell_date_edit_config_set_cell (view_config, NULL); - + if (G_OBJECT_CLASS (e_cell_date_edit_config_parent_class)->dispose) G_OBJECT_CLASS (e_cell_date_edit_config_parent_class)->dispose (object); } @@ -90,11 +90,11 @@ e_cell_date_edit_config_finalize (GObject *object) { ECellDateEditConfig *view_config = E_CELL_DATE_EDIT_CONFIG (object); ECellDateEditConfigPrivate *priv; - + priv = view_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_cell_date_edit_config_parent_class)->finalize) G_OBJECT_CLASS (e_cell_date_edit_config_parent_class)->finalize (object); } @@ -104,7 +104,7 @@ e_cell_date_edit_config_class_init (ECellDateEditConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - + /* Method override */ gobject_class->set_property = e_cell_date_edit_config_set_property; gobject_class->get_property = e_cell_date_edit_config_get_property; @@ -127,14 +127,14 @@ ECellDateEditConfig * e_cell_date_edit_config_new (ECellDateEdit *cell) { ECellDateEditConfig *view_config; - + view_config = g_object_new (e_cell_date_edit_config_get_type (), "cell", cell, NULL); return view_config; } ECellDateEdit * -e_cell_date_edit_config_get_cell (ECellDateEditConfig *view_config) +e_cell_date_edit_config_get_cell (ECellDateEditConfig *view_config) { ECellDateEditConfigPrivate *priv; @@ -142,17 +142,17 @@ e_cell_date_edit_config_get_cell (ECellDateEditConfig *view_config) g_return_val_if_fail (E_IS_CELL_DATE_EDIT_CONFIG (view_config), NULL); priv = view_config->priv; - + return priv->cell; } static void -set_timezone (ECellDateEdit *cell) +set_timezone (ECellDateEdit *cell) { ECellDateEditText *cell_text; ECellPopup *cell_popup; icaltimezone *zone; - + zone = calendar_config_get_icaltimezone (); cell_popup = E_CELL_POPUP (cell); @@ -165,14 +165,14 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer { ECellDateEditConfig *view_config = data; ECellDateEditConfigPrivate *priv; - + priv = view_config->priv; - + set_timezone (priv->cell); } static void -set_twentyfour_hour (ECellDateEdit *cell) +set_twentyfour_hour (ECellDateEdit *cell) { ECellDateEditText *cell_text; ECellPopup *cell_popup; @@ -196,14 +196,14 @@ twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gp { ECellDateEditConfig *view_config = data; ECellDateEditConfigPrivate *priv; - + priv = view_config->priv; - + set_twentyfour_hour (priv->cell); } static void -set_range (ECellDateEdit *cell) +set_range (ECellDateEdit *cell) { int start_hour, end_hour; @@ -219,7 +219,7 @@ set_range (ECellDateEdit *cell) start_hour = end_hour; /* We use the default 0 - 24 now. */ -#if 0 +#if 0 g_object_set (G_OBJECT (cell), "lower_hour", start_hour, "upper_hour", end_hour, @@ -232,9 +232,9 @@ day_start_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo { ECellDateEditConfig *view_config = data; ECellDateEditConfigPrivate *priv; - + priv = view_config->priv; - + set_range (priv->cell); } @@ -243,9 +243,9 @@ day_end_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpoin { ECellDateEditConfig *view_config = data; ECellDateEditConfigPrivate *priv; - + priv = view_config->priv; - + set_range (priv->cell); } @@ -254,24 +254,24 @@ day_end_minute_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo { ECellDateEditConfig *view_config = data; ECellDateEditConfigPrivate *priv; - + priv = view_config->priv; - + set_range (priv->cell); } void -e_cell_date_edit_config_set_cell (ECellDateEditConfig *view_config, ECellDateEdit *cell) +e_cell_date_edit_config_set_cell (ECellDateEditConfig *view_config, ECellDateEdit *cell) { ECellDateEditConfigPrivate *priv; guint not; GList *l; - + g_return_if_fail (view_config != NULL); g_return_if_fail (E_IS_CELL_DATE_EDIT_CONFIG (view_config)); priv = view_config->priv; - + if (priv->cell) { g_object_unref (priv->cell); priv->cell = NULL; @@ -281,7 +281,7 @@ e_cell_date_edit_config_set_cell (ECellDateEditConfig *view_config, ECellDateEdi g_object_unref (priv->mini_config); priv->mini_config = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); @@ -291,17 +291,17 @@ e_cell_date_edit_config_set_cell (ECellDateEditConfig *view_config, ECellDateEdi /* If the new view is NULL, return right now */ if (!cell) return; - + priv->cell = g_object_ref (cell); /* Time zone */ set_timezone (cell); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ - set_twentyfour_hour (cell); + set_twentyfour_hour (cell); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); @@ -317,5 +317,5 @@ e_cell_date_edit_config_set_cell (ECellDateEditConfig *view_config, ECellDateEdi priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* The mini calendar */ - priv->mini_config = e_mini_calendar_config_new (E_CALENDAR (cell->calendar)); + priv->mini_config = e_mini_calendar_config_new (E_CALENDAR (cell->calendar)); } diff --git a/calendar/gui/e-cell-date-edit-config.h b/calendar/gui/e-cell-date-edit-config.h index 1391650396..c42260b956 100644 --- a/calendar/gui/e-cell-date-edit-config.h +++ b/calendar/gui/e-cell-date-edit-config.h @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -31,7 +31,7 @@ G_BEGIN_DECLS #define E_CELL_DATE_EDIT_CONFIG(obj) GTK_CHECK_CAST (obj, e_cell_date_edit_config_get_type (), ECellDateEditConfig) #define E_CELL_DATE_EDIT_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_cell_date_edit_config_get_type (), ECellDateEditConfigClass) #define E_IS_CELL_DATE_EDIT_CONFIG(obj) GTK_CHECK_TYPE (obj, e_cell_date_edit_config_get_type ()) - + typedef struct _ECellDateEditConfig ECellDateEditConfig; typedef struct _ECellDateEditConfigClass ECellDateEditConfigClass; typedef struct _ECellDateEditConfigPrivate ECellDateEditConfigPrivate; diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index b69b5915c2..9aedf58c42 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -35,7 +35,7 @@ #include <unistd.h> #include <string.h> #include <libgnomeui/gnome-messagebox.h> -#include <libgnomeui/gnome-stock-icons.h> +#include <libgnomeui/gnome-stock-icons.h> #include <glib/gi18n.h> #include <libedataserver/e-time-utils.h> #include <libedataserver/e-data-server-util.h> @@ -219,7 +219,7 @@ e_cell_date_edit_text_new (const char *fontname, ECellDateEditText *ecd = g_object_new (e_cell_date_edit_text_get_type (), NULL); e_cell_text_construct (E_CELL_TEXT (ecd), fontname, justify); - + return (ECell *) ecd; } diff --git a/calendar/gui/e-comp-editor-registry.c b/calendar/gui/e-comp-editor-registry.c index 19438d0301..609f254243 100644 --- a/calendar/gui/e-comp-editor-registry.c +++ b/calendar/gui/e-comp-editor-registry.c @@ -64,7 +64,7 @@ e_comp_editor_registry_dispose (GObject *obj) reg = E_COMP_EDITOR_REGISTRY (obj); priv = reg->priv; - + if (priv->editors) { g_hash_table_destroy (priv->editors); priv->editors = NULL; @@ -122,14 +122,14 @@ e_comp_editor_registry_add (ECompEditorRegistry *reg, CompEditor *editor, gboole ECompEditorRegistryData *rdata; ECalComponent *comp; const char *uid; - + g_return_if_fail (reg != NULL); g_return_if_fail (E_IS_COMP_EDITOR_REGISTRY (reg)); g_return_if_fail (editor != NULL); g_return_if_fail (IS_COMP_EDITOR (editor)); priv = reg->priv; - + comp = comp_editor_get_comp (editor); e_cal_component_get_uid (comp, &uid); @@ -150,7 +150,7 @@ e_comp_editor_registry_find (ECompEditorRegistry *reg, const char *uid) { ECompEditorRegistryPrivate *priv; ECompEditorRegistryData *rdata; - + g_return_val_if_fail (reg != NULL, NULL); g_return_val_if_fail (E_IS_COMP_EDITOR_REGISTRY (reg), NULL); g_return_val_if_fail (uid != NULL, NULL); @@ -160,7 +160,7 @@ e_comp_editor_registry_find (ECompEditorRegistry *reg, const char *uid) rdata = g_hash_table_lookup (priv->editors, uid); if (rdata != NULL) return rdata->editor; - + return NULL; } @@ -172,16 +172,16 @@ foreach_close_cb (gpointer key, gpointer value, gpointer data) rdata = value; g_signal_handlers_block_matched (rdata->editor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data); - + comp_editor_focus (rdata->editor); if (!comp_editor_close (rdata->editor)) { g_signal_handlers_unblock_matched (rdata->editor, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, data); return FALSE; } - + g_free (rdata->uid); g_free (rdata); - + return TRUE; } @@ -189,7 +189,7 @@ gboolean e_comp_editor_registry_close_all (ECompEditorRegistry *reg) { ECompEditorRegistryPrivate *priv; - + g_return_val_if_fail (reg != NULL, FALSE); g_return_val_if_fail (E_IS_COMP_EDITOR_REGISTRY (reg), FALSE); @@ -198,12 +198,12 @@ e_comp_editor_registry_close_all (ECompEditorRegistry *reg) g_hash_table_foreach_remove (priv->editors, foreach_close_cb, reg); if (g_hash_table_size (priv->editors) != 0) return FALSE; - + return TRUE; } static void -editor_destroy_cb (gpointer data, GObject *where_object_was) +editor_destroy_cb (gpointer data, GObject *where_object_was) { ECompEditorRegistryData *rdata = data; diff --git a/calendar/gui/e-date-edit-config.c b/calendar/gui/e-date-edit-config.c index f3c9895fe7..bc3752f3ca 100644 --- a/calendar/gui/e-date-edit-config.c +++ b/calendar/gui/e-date-edit-config.c @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -43,7 +43,7 @@ e_date_edit_config_set_property (GObject *object, guint property_id, const GValu EDateEditConfig *edit_config; edit_config = E_DATE_EDIT_CONFIG (object); - + switch (property_id) { case PROP_EDIT: e_date_edit_config_set_edit (edit_config, g_value_get_object (value)); @@ -60,7 +60,7 @@ e_date_edit_config_get_property (GObject *object, guint property_id, GValue *val EDateEditConfig *edit_config; edit_config = E_DATE_EDIT_CONFIG (object); - + switch (property_id) { case PROP_EDIT: g_value_set_object (value, e_date_edit_config_get_edit (edit_config)); @@ -75,9 +75,9 @@ static void e_date_edit_config_dispose (GObject *object) { EDateEditConfig *edit_config = E_DATE_EDIT_CONFIG (object); - + e_date_edit_config_set_edit (edit_config, NULL); - + if (G_OBJECT_CLASS (e_date_edit_config_parent_class)->dispose) G_OBJECT_CLASS (e_date_edit_config_parent_class)->dispose (object); } @@ -87,11 +87,11 @@ e_date_edit_config_finalize (GObject *object) { EDateEditConfig *edit_config = E_DATE_EDIT_CONFIG (object); EDateEditConfigPrivate *priv; - + priv = edit_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_date_edit_config_parent_class)->finalize) G_OBJECT_CLASS (e_date_edit_config_parent_class)->finalize (object); } @@ -101,7 +101,7 @@ e_date_edit_config_class_init (EDateEditConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - + /* Method override */ gobject_class->set_property = e_date_edit_config_set_property; gobject_class->get_property = e_date_edit_config_get_property; @@ -124,14 +124,14 @@ EDateEditConfig * e_date_edit_config_new (EDateEdit *date_edit) { EDateEditConfig *edit_config; - + edit_config = g_object_new (e_date_edit_config_get_type (), "edit", date_edit, NULL); return edit_config; } EDateEdit * -e_date_edit_config_get_edit (EDateEditConfig *edit_config) +e_date_edit_config_get_edit (EDateEditConfig *edit_config) { EDateEditConfigPrivate *priv; @@ -139,14 +139,14 @@ e_date_edit_config_get_edit (EDateEditConfig *edit_config) g_return_val_if_fail (E_IS_DATE_EDIT_CONFIG (edit_config), NULL); priv = edit_config->priv; - + return priv->edit; } static void -set_week_start (EDateEdit *date_edit) +set_week_start (EDateEdit *date_edit) { - int week_start_day; + int week_start_day; week_start_day = calendar_config_get_week_start_day (); @@ -161,14 +161,14 @@ week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointe { EDateEditConfig *edit_config = data; EDateEditConfigPrivate *priv; - + priv = edit_config->priv; - + set_week_start (priv->edit); } static void -set_twentyfour_hour (EDateEdit *date_edit) +set_twentyfour_hour (EDateEdit *date_edit) { gboolean use_24_hour; @@ -182,14 +182,14 @@ twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gp { EDateEditConfig *edit_config = data; EDateEditConfigPrivate *priv; - + priv = edit_config->priv; - + set_twentyfour_hour (priv->edit); } static void -set_dnav_show_week_no (EDateEdit *date_edit) +set_dnav_show_week_no (EDateEdit *date_edit) { gboolean show_week_no; @@ -203,28 +203,28 @@ dnav_show_week_no_changed_cb (GConfClient *client, guint id, GConfEntry *entry, { EDateEditConfig *edit_config = data; EDateEditConfigPrivate *priv; - + priv = edit_config->priv; - + set_dnav_show_week_no (priv->edit); } void -e_date_edit_config_set_edit (EDateEditConfig *edit_config, EDateEdit *date_edit) +e_date_edit_config_set_edit (EDateEditConfig *edit_config, EDateEdit *date_edit) { EDateEditConfigPrivate *priv; guint not; GList *l; - + g_return_if_fail (edit_config != NULL); g_return_if_fail (E_IS_DATE_EDIT_CONFIG (edit_config)); priv = edit_config->priv; - + if (priv->edit) { g_object_unref (priv->edit); priv->edit = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); @@ -234,17 +234,17 @@ e_date_edit_config_set_edit (EDateEditConfig *edit_config, EDateEdit *date_edit) /* If the new edit is NULL, return right now */ if (!date_edit) return; - + priv->edit = g_object_ref (date_edit); /* Week start */ - set_week_start (date_edit); + set_week_start (date_edit); not = calendar_config_add_notification_week_start_day (week_start_changed_cb, edit_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ - set_twentyfour_hour (date_edit); + set_twentyfour_hour (date_edit); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, edit_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); diff --git a/calendar/gui/e-date-edit-config.h b/calendar/gui/e-date-edit-config.h index 8b675ec772..1cff692461 100644 --- a/calendar/gui/e-date-edit-config.h +++ b/calendar/gui/e-date-edit-config.h @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -30,7 +30,7 @@ G_BEGIN_DECLS #define E_DATE_EDIT_CONFIG(obj) GTK_CHECK_CAST (obj, e_date_edit_config_get_type (), EDateEditConfig) #define E_DATE_EDIT_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_date_edit_config_get_type (), EDateEditConfigClass) #define E_IS_DATE_EDIT_CONFIG(obj) GTK_CHECK_TYPE (obj, e_date_edit_config_get_type ()) - + typedef struct _EDateEditConfig EDateEditConfig; typedef struct _EDateEditConfigClass EDateEditConfigClass; typedef struct _EDateEditConfigPrivate EDateEditConfigPrivate; diff --git a/calendar/gui/e-day-view-config.c b/calendar/gui/e-day-view-config.c index bad45b62a6..4d52f55ec6 100644 --- a/calendar/gui/e-day-view-config.c +++ b/calendar/gui/e-day-view-config.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Rodrigo Moya <rodrigo@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -44,7 +44,7 @@ e_day_view_config_set_property (GObject *object, guint property_id, const GValue EDayViewConfig *view_config; view_config = E_DAY_VIEW_CONFIG (object); - + switch (property_id) { case PROP_VIEW: e_day_view_config_set_view (view_config, g_value_get_object (value)); @@ -61,7 +61,7 @@ e_day_view_config_get_property (GObject *object, guint property_id, GValue *valu EDayViewConfig *view_config; view_config = E_DAY_VIEW_CONFIG (object); - + switch (property_id) { case PROP_VIEW: g_value_set_object (value, e_day_view_config_get_view (view_config)); @@ -78,7 +78,7 @@ e_day_view_config_dispose (GObject *object) EDayViewConfig *view_config = E_DAY_VIEW_CONFIG (object); e_day_view_config_set_view (view_config, NULL); - + if (G_OBJECT_CLASS (e_day_view_config_parent_class)->dispose) G_OBJECT_CLASS (e_day_view_config_parent_class)->dispose (object); } @@ -88,11 +88,11 @@ e_day_view_config_finalize (GObject *object) { EDayViewConfig *view_config = E_DAY_VIEW_CONFIG (object); EDayViewConfigPrivate *priv; - + priv = view_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_day_view_config_parent_class)->finalize) G_OBJECT_CLASS (e_day_view_config_parent_class)->finalize (object); } @@ -102,7 +102,7 @@ e_day_view_config_class_init (EDayViewConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - + /* Method override */ gobject_class->set_property = e_day_view_config_set_property; gobject_class->get_property = e_day_view_config_get_property; @@ -125,14 +125,14 @@ EDayViewConfig * e_day_view_config_new (EDayView *day_view) { EDayViewConfig *view_config; - + view_config = g_object_new (e_day_view_config_get_type (), "view", day_view, NULL); return view_config; } EDayView * -e_day_view_config_get_view (EDayViewConfig *view_config) +e_day_view_config_get_view (EDayViewConfig *view_config) { EDayViewConfigPrivate *priv; @@ -140,16 +140,16 @@ e_day_view_config_get_view (EDayViewConfig *view_config) g_return_val_if_fail (E_IS_DAY_VIEW_CONFIG (view_config), NULL); priv = view_config->priv; - + return priv->view; } static void -set_timezone (EDayView *day_view) +set_timezone (EDayView *day_view) { icaltimezone *zone; - - zone = calendar_config_get_icaltimezone (); + + zone = calendar_config_get_icaltimezone (); e_calendar_view_set_timezone (E_CALENDAR_VIEW (day_view), zone); } @@ -158,16 +158,16 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_timezone (priv->view); } static void -set_week_start (EDayView *day_view) +set_week_start (EDayView *day_view) { - int week_start_day; + int week_start_day; week_start_day = calendar_config_get_week_start_day (); @@ -182,14 +182,14 @@ week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointe { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_week_start (priv->view); } static void -set_twentyfour_hour (EDayView *day_view) +set_twentyfour_hour (EDayView *day_view) { gboolean use_24_hour; @@ -206,16 +206,16 @@ twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gp { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_twentyfour_hour (priv->view); } static void -set_working_days (EDayView *day_view) +set_working_days (EDayView *day_view) { - CalWeekdays working_days; + CalWeekdays working_days; working_days = calendar_config_get_working_days (); @@ -227,19 +227,19 @@ working_days_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpoin { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_working_days (priv->view); } static void -set_day_start_hour (EDayView *day_view) +set_day_start_hour (EDayView *day_view) { int start_hour, start_minute, end_hour, end_minute; e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute); - + start_hour = calendar_config_get_day_start_hour (); e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute); @@ -250,19 +250,19 @@ day_start_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_day_start_hour (priv->view); } static void -set_day_start_minute (EDayView *day_view) +set_day_start_minute (EDayView *day_view) { int start_hour, start_minute, end_hour, end_minute; e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute); - + start_minute = calendar_config_get_day_start_minute (); e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute); @@ -273,19 +273,19 @@ day_start_minute_changed_cb (GConfClient *client, guint id, GConfEntry *entry, g { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_day_start_minute (priv->view); } static void -set_day_end_hour (EDayView *day_view) +set_day_end_hour (EDayView *day_view) { int start_hour, start_minute, end_hour, end_minute; e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute); - + end_hour = calendar_config_get_day_end_hour (); e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute); @@ -296,20 +296,20 @@ day_end_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpoin { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_day_end_hour (priv->view); } static void -set_day_end_minute (EDayView *day_view) +set_day_end_minute (EDayView *day_view) { int start_hour, start_minute, end_hour, end_minute; e_day_view_get_working_day (day_view, &start_hour, &start_minute, &end_hour, &end_minute); - + end_minute = calendar_config_get_day_end_minute (); e_day_view_set_working_day (day_view, start_hour, start_minute, end_hour, end_minute); @@ -320,16 +320,16 @@ day_end_minute_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_day_end_minute (priv->view); } static void -set_time_divisions (EDayView *day_view) +set_time_divisions (EDayView *day_view) { - int time_divisions; + int time_divisions; time_divisions = calendar_config_get_time_divisions (); @@ -341,14 +341,14 @@ time_divisions_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_time_divisions (priv->view); } static void -set_marcus_bains (EDayView *day_view) +set_marcus_bains (EDayView *day_view) { gboolean show_marcus_bains_line; const char *dayview_color, *timebar_color; @@ -363,14 +363,14 @@ marcus_bains_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpoin { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_marcus_bains (priv->view); } static void -set_show_event_end (EDayView *day_view) +set_show_event_end (EDayView *day_view) { gboolean show_event_end; @@ -384,30 +384,30 @@ show_event_end_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo { EDayViewConfig *view_config = data; EDayViewConfigPrivate *priv; - + priv = view_config->priv; - + set_show_event_end (priv->view); } void -e_day_view_config_set_view (EDayViewConfig *view_config, EDayView *day_view) +e_day_view_config_set_view (EDayViewConfig *view_config, EDayView *day_view) { EDayViewConfigPrivate *priv; gint not_1, not_2, mbnot; guint not; GList *l; - + g_return_if_fail (view_config != NULL); g_return_if_fail (E_IS_DAY_VIEW_CONFIG (view_config)); priv = view_config->priv; - + if (priv->view) { g_object_unref (priv->view); priv->view = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); @@ -417,27 +417,27 @@ e_day_view_config_set_view (EDayViewConfig *view_config, EDayView *day_view) /* If the new view is NULL, return right now */ if (!day_view) return; - + priv->view = g_object_ref (day_view); /* Time zone */ set_timezone (day_view); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* Week start */ - set_week_start (day_view); + set_week_start (day_view); not = calendar_config_add_notification_week_start_day (week_start_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ - set_twentyfour_hour (day_view); + set_twentyfour_hour (day_view); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - + /* Working days */ set_working_days (day_view); diff --git a/calendar/gui/e-day-view-config.h b/calendar/gui/e-day-view-config.h index c75069bb2f..372d50262c 100644 --- a/calendar/gui/e-day-view-config.h +++ b/calendar/gui/e-day-view-config.h @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -30,7 +30,7 @@ G_BEGIN_DECLS #define E_DAY_VIEW_CONFIG(obj) GTK_CHECK_CAST (obj, e_day_view_config_get_type (), EDayViewConfig) #define E_DAY_VIEW_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_day_view_config_get_type (), EDayViewConfigClass) #define E_IS_DAY_VIEW_CONFIG(obj) GTK_CHECK_TYPE (obj, e_day_view_config_get_type ()) - + typedef struct _EDayViewConfig EDayViewConfig; typedef struct _EDayViewConfigClass EDayViewConfigClass; typedef struct _EDayViewConfigPrivate EDayViewConfigPrivate; diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c index 4536d67952..6bd9887b5b 100644 --- a/calendar/gui/e-day-view-layout.c +++ b/calendar/gui/e-day-view-layout.c @@ -89,7 +89,7 @@ static void e_day_view_layout_long_event (EDayViewEvent *event, guint8 *grid, gint days_shown, - time_t *day_starts, + time_t *day_starts, gint *rows_in_top_display) { gint start_day, end_day, free_row, day, row; @@ -318,7 +318,7 @@ e_day_view_expand_day_event (EDayViewEvent *event, gboolean e_day_view_find_long_event_days (EDayViewEvent *event, gint days_shown, - time_t *day_starts, + time_t *day_starts, gint *start_day_return, gint *end_day_return) { diff --git a/calendar/gui/e-day-view-layout.h b/calendar/gui/e-day-view-layout.h index d5aa51ab8a..b2fcec4aac 100644 --- a/calendar/gui/e-day-view-layout.h +++ b/calendar/gui/e-day-view-layout.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 2001, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 6b6ffef8a9..58212f0d8e 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -125,7 +125,7 @@ e_day_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) EDayViewMainItem *dvmitem; dvmitem = E_DAY_VIEW_MAIN_ITEM (o); - + switch (arg_id){ case ARG_DAY_VIEW: dvmitem->day_view = GTK_VALUE_POINTER (*arg); @@ -190,7 +190,7 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); weekday = icaltime_day_of_week (day_start_tt) - 1; - + work_day = day_view->working_days & (1 << weekday); day_x = day_view->day_offsets[day] - x; @@ -313,7 +313,7 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, if (day_view->marcus_bains_day_view_color && gdk_color_parse (day_view->marcus_bains_day_view_color, &mb_color)) { GdkColormap *colormap; - + colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); if (gdk_colormap_alloc_color (colormap, &mb_color, TRUE, TRUE)) { gdk_gc_set_foreground (gc, &mb_color); @@ -322,7 +322,7 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)); time_now = icaltime_current_time_with_zone (zone); - + for (day = 0; day < day_view->days_shown; day++) { day_start = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, zone); @@ -804,7 +804,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_x += icon_x_inc; icon_y += icon_y_inc; } - + gdk_gc_set_clip_mask (gc, NULL); } @@ -854,7 +854,7 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); weekday = icaltime_day_of_week (day_start_tt) - 1; - + work_day = day_view->working_days & (1 << weekday); day_x = day_view->day_offsets[day] - x; @@ -863,24 +863,24 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, if (work_day) { cairo_save (cr); gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING]); - - cairo_rectangle (cr, day_x, 0 - y, day_w, + + cairo_rectangle (cr, day_x, 0 - y, day_w, work_day_start_y - (0 - y)); cairo_fill (cr); cairo_restore (cr); cairo_save (cr); gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_WORKING]); - - cairo_rectangle (cr, day_x, work_day_start_y, day_w, + + cairo_rectangle (cr, day_x, work_day_start_y, day_w, work_day_end_y - work_day_start_y); cairo_fill (cr); cairo_restore (cr); cairo_save (cr); gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_NOT_WORKING]); - - cairo_rectangle (cr, day_x, work_day_end_y, day_w, + + cairo_rectangle (cr, day_x, work_day_end_y, day_w, height - work_day_end_y); cairo_fill (cr); cairo_restore (cr); @@ -918,17 +918,17 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, if (GTK_WIDGET_HAS_FOCUS(day_view)) { cairo_save (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED]); - cairo_rectangle (cr, rect_x, rect_y, rect_width, + cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height); cairo_fill (cr); cairo_restore (cr); } else { cairo_save (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_SELECTED_UNFOCUSSED]); - cairo_rectangle (cr, rect_x, rect_y, rect_width, + cairo_rectangle (cr, rect_x, rect_y, rect_width, rect_height); cairo_fill (cr); cairo_restore (cr); @@ -941,9 +941,9 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, grid_x2 = day_view->day_offsets[day_view->days_shown] - x; cairo_save(cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); - + for (row = 0, row_y = 0 - y; row < day_view->rows && row_y < height; row++, row_y += day_view->row_height) { @@ -967,26 +967,26 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, continue; cairo_save (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); cairo_move_to (cr, grid_x1, grid_y1); cairo_line_to (cr, grid_x1, grid_y2); cairo_stroke (cr); - - gdk_cairo_set_source_color (cr, + + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); cairo_move_to (cr, grid_x1 + E_DAY_VIEW_BAR_WIDTH - 1, grid_y1); cairo_line_to (cr, grid_x1 + E_DAY_VIEW_BAR_WIDTH - 1, grid_y2); cairo_stroke (cr); - + cairo_set_source_rgb (cr, 1, 1, 1); cairo_rectangle (cr, grid_x1 + 1, grid_y1, E_DAY_VIEW_BAR_WIDTH - 2, grid_y2 - grid_y1); - + cairo_fill (cr); - + cairo_restore (cr); /* Fill in the bars when the user is busy. */ @@ -1017,19 +1017,19 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, GdkColor mb_color; cairo_save (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); if (day_view->marcus_bains_day_view_color && gdk_color_parse (day_view->marcus_bains_day_view_color, &mb_color)) { GdkColormap *colormap; - + colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); if (gdk_colormap_alloc_color (colormap, &mb_color, TRUE, TRUE)) gdk_cairo_set_source_color (cr, &mb_color); } zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)); time_now = icaltime_current_time_with_zone (zone); - + for (day = 0; day < day_view->days_shown; day++) { day_start = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, zone); @@ -1048,7 +1048,7 @@ e_day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkDrawable *drawable, } cairo_restore (cr); } - cairo_destroy (cr); + cairo_destroy (cr); } @@ -1069,8 +1069,8 @@ e_day_view_main_item_draw_events_in_vbars (EDayViewMainItem *dvmitem, cr = gdk_cairo_create (drawable); cairo_save (cr); - - gdk_cairo_set_source_color (cr, + + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND]); grid_x = day_view->day_offsets[day] + 1 - x; @@ -1088,7 +1088,7 @@ e_day_view_main_item_draw_events_in_vbars (EDayViewMainItem *dvmitem, colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE)) { - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &bg_color); } } @@ -1117,7 +1117,7 @@ e_day_view_main_item_draw_events_in_vbars (EDayViewMainItem *dvmitem, cairo_rectangle (cr, grid_x, bar_y, E_DAY_VIEW_BAR_WIDTH - 2, bar_h); - + cairo_fill (cr); g_object_unref (comp); @@ -1145,7 +1145,7 @@ e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem, cr = gdk_cairo_create (drawable); cairo_save (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND]); for (event_num = 0; event_num < day_view->long_events->len; @@ -1201,7 +1201,7 @@ e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem, if (bar_y1 < height && bar_y2 > 0 && bar_y2 > bar_y1) { cairo_rectangle (cr, grid_x, bar_y1, E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1); - + cairo_fill (cr); } } @@ -1273,7 +1273,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, day_view = dvmitem->day_view; cr = gdk_cairo_create (drawable); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); gc = day_view->main_gc; @@ -1299,7 +1299,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, return; /* Get the position of the event. If it is not shown skip it.*/ - if (!e_day_view_get_event_position (day_view, day, event_num, + if (!e_day_view_get_event_position (day_view, day, event_num, &item_x, &item_y, &item_w, &item_h)) return; @@ -1353,7 +1353,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_fill (cr); cairo_pattern_destroy (pat); - /* Arc at the right */ + /* Arc at the right */ pat = cairo_pattern_create_radial (item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 3, item_y + 13.5, 5.0, item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 5, item_y + 13.5, 12.0); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); @@ -1422,40 +1422,40 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_move_to (cr, item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 9, item_y + item_h - 6); cairo_line_to (cr, item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 10, item_y + item_h - 6); cairo_stroke (cr); - + cairo_restore (cr); - + /* Black border */ cairo_save (cr); - x0 = item_x + E_DAY_VIEW_BAR_WIDTH + 9; + x0 = item_x + E_DAY_VIEW_BAR_WIDTH + 9; y0 = item_y + 10; rect_width = MAX (item_w - E_DAY_VIEW_BAR_WIDTH - 7, 0); rect_height = item_h - 7; - radius = 20; + radius = 20; draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); cairo_set_source_rgb (cr, 0, 0, 0); cairo_fill (cr); cairo_restore (cr); - + /* Extra Grid lines when clicked */ cairo_save (cr); - x0 = item_x + E_DAY_VIEW_BAR_WIDTH + 1; + x0 = item_x + E_DAY_VIEW_BAR_WIDTH + 1; y0 = item_y + 2; rect_width = MAX (item_w - E_DAY_VIEW_BAR_WIDTH - 3, 0); rect_height = item_h - 4.; - radius = 16; + radius = 16; draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); cairo_set_source_rgb (cr, 1, 1, 1); cairo_fill (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); for (row_y = y0; @@ -1469,18 +1469,18 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, } } cairo_restore (cr); - } + } } /* Draw the background of the event with white to play with transparency */ cairo_save (cr); - x0 = item_x + E_DAY_VIEW_BAR_WIDTH + 1; + x0 = item_x + E_DAY_VIEW_BAR_WIDTH + 1; y0 = item_y + 2; rect_width = MAX (item_w - E_DAY_VIEW_BAR_WIDTH - 3, 0); rect_height = item_h - 4.; - radius = 16; + radius = 16; draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); @@ -1492,12 +1492,12 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, /* Here we draw the border in event color */ cairo_save (cr); - x0 = item_x + E_DAY_VIEW_BAR_WIDTH; + x0 = item_x + E_DAY_VIEW_BAR_WIDTH; y0 = item_y + 1.; rect_width = MAX (item_w - E_DAY_VIEW_BAR_WIDTH - 1., 0); rect_height = item_h - 2.; - radius = 16; + radius = 16; draw_curved_rectangle (cr, x0, y0, rect_width,rect_height, radius); cairo_set_line_width (cr, 2.); @@ -1514,24 +1514,24 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, rect_width = item_w - E_DAY_VIEW_BAR_WIDTH - 4.5; rect_height = item_h - 5.5; - radius = 14; - + radius = 14; + draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); date_fraction = rect_height / day_view->row_height; interval = event->end_minute - event->start_minute; - if ((interval/day_view->mins_per_row) >= 2) + if ((interval/day_view->mins_per_row) >= 2) short_event = FALSE; else if ((interval%day_view->mins_per_row)==0) { if (((event->end_minute%day_view->mins_per_row) == 0) || ((event->start_minute%day_view->mins_per_row) == 0)) - short_event = TRUE; + short_event = TRUE; } else short_event = FALSE; if (day_view->editing_event_day == day - && day_view->editing_event_num == event_num) + && day_view->editing_event_num == event_num) short_event = TRUE; if (gradient) { @@ -1558,10 +1558,10 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_set_line_width (cr, 0.5); cairo_stroke (cr); cairo_restore (cr); - + /* Draw the right edge of the vertical bar. */ cairo_save (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); cairo_set_line_width (cr, 0.7); cairo_move_to (cr, item_x + E_DAY_VIEW_BAR_WIDTH - 1, item_y + 1); @@ -1569,7 +1569,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_stroke (cr); cairo_restore (cr); - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the vertical colored bar showing when the appointment @@ -1583,7 +1583,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE && day_view->resize_event_day == day && day_view->resize_event_num == event_num) { - resize_flag = TRUE; + resize_flag = TRUE; if (day_view->resize_drag_pos == E_CALENDAR_VIEW_POS_TOP_EDGE) bar_y1 = item_y + 1; @@ -1592,7 +1592,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, bar_y2 = item_y + item_h - 1; end_minute = event->end_minute; - + end_hour = end_minute / 60; end_minute = end_minute % 60; @@ -1600,7 +1600,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, &end_display_hour, &end_resize_suffix, &end_suffix_width); - + cairo_save (cr); cairo_rectangle (cr, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 2.75, item_w - E_DAY_VIEW_BAR_WIDTH - 4.5, @@ -1612,7 +1612,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_translate (cr, item_x + item_w - E_DAY_VIEW_BAR_WIDTH - 32, item_y + item_h - 8); end_resize_time = g_strdup_printf ("%2i:%02i", end_display_hour, end_minute); - + } else { cairo_translate (cr, item_x + item_w - E_DAY_VIEW_BAR_WIDTH - 48, item_y + item_h - 8); end_resize_time = g_strdup_printf ("%2i:%02i%s", @@ -1633,7 +1633,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, if (bar_y2 > scroll_flag) event->end_minute += day_view->mins_per_row; - else if (bar_y2 < scroll_flag) + else if (bar_y2 < scroll_flag) event->end_minute -= day_view->mins_per_row; if (!short_event) @@ -1673,7 +1673,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, text = g_strdup_printf ("%2i:%02i-%2i:%02i", start_display_hour, start_minute, - end_display_hour, end_minute); + end_display_hour, end_minute); } else { if (format_time) { /* 24 hour format without end time. */ @@ -1687,7 +1687,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, /* 12 hour format with end time. */ text = g_strdup_printf ("%2i:%02i%s-%2i:%02i%s", - start_display_hour, start_minute, + start_display_hour, start_minute, start_suffix, end_display_hour, end_minute, end_suffix); } else { @@ -1754,7 +1754,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, } } - gdk_cairo_set_source_color (cr, + gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the reminder & recurrence icons, if needed. */ @@ -1823,17 +1823,17 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_paint (cr); cairo_close_path (cr); cairo_restore (cr); - + icon_x += icon_x_inc; icon_y += icon_y_inc; - } + } if (draw_recurrence_icon) { max_icon_w = item_x + item_w - icon_x - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y - E_DAY_VIEW_EVENT_BORDER_HEIGHT; - + cairo_save (cr); cairo_rectangle (cr, icon_x, icon_y, max_icon_w, max_icon_h); cairo_clip (cr); @@ -1842,7 +1842,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_paint (cr); cairo_close_path (cr); cairo_restore (cr); - + icon_x += icon_x_inc; icon_y += icon_y_inc; } @@ -1877,7 +1877,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, cairo_paint (cr); cairo_close_path (cr); cairo_restore (cr); - + icon_x += icon_x_inc; icon_y += icon_y_inc; } @@ -1893,7 +1893,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, gdk_cairo_set_source_pixbuf (cr, day_view->meeting_icon, icon_x, icon_y); cairo_paint (cr); cairo_restore (cr); - + icon_x += icon_x_inc; icon_y += icon_y_inc; } @@ -1912,7 +1912,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, - E_DAY_VIEW_EVENT_BORDER_WIDTH; max_icon_h = item_y + item_h - icon_y - E_DAY_VIEW_EVENT_BORDER_HEIGHT; - + gdk_gc_set_clip_origin (gc, icon_x, icon_y); if (mask != NULL) gdk_gc_set_clip_mask (gc, mask); @@ -1931,7 +1931,7 @@ e_day_view_main_item_draw_day_event (EDayViewMainItem *dvmitem, icon_x += icon_x_inc; icon_y += icon_y_inc; } - + gdk_gc_set_clip_mask (gc, NULL); } diff --git a/calendar/gui/e-day-view-main-item.h b/calendar/gui/e-day-view-main-item.h index 1162926480..7e64cb5927 100644 --- a/calendar/gui/e-day-view-main-item.h +++ b/calendar/gui/e-day-view-main-item.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index 56642db245..5c06fe6ea7 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -141,7 +141,7 @@ e_day_view_time_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) EDayViewTimeItem *dvtmitem; dvtmitem = E_DAY_VIEW_TIME_ITEM (o); - + switch (arg_id){ case ARG_DAY_VIEW: dvtmitem->day_view = GTK_VALUE_POINTER (*arg); @@ -333,12 +333,12 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, struct icaltimetype time_now; int marcus_bains_y; GdkColor mb_color; - + gdk_gc_set_foreground (gc, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); if (day_view->marcus_bains_time_bar_color && gdk_color_parse (day_view->marcus_bains_time_bar_color, &mb_color)) { GdkColormap *colormap; - + colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); if (gdk_colormap_alloc_color (colormap, &mb_color, TRUE, TRUE)) { gdk_gc_set_foreground (gc, &mb_color); @@ -557,13 +557,13 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, struct icaltimetype time_now; int marcus_bains_y; GdkColor mb_color; - + cairo_save (cr); gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); if (day_view->marcus_bains_time_bar_color && gdk_color_parse (day_view->marcus_bains_time_bar_color, &mb_color)) { GdkColormap *colormap; - + colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); if (gdk_colormap_alloc_color (colormap, &mb_color, TRUE, TRUE)) { gdk_cairo_set_source_color (cr, &mb_color); @@ -625,7 +625,7 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, layout = pango_cairo_create_layout (cr); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &minute_width, NULL); - cairo_translate (cr, minute_x2 - minute_width, row_y + small_font_y_offset); + cairo_translate (cr, minute_x2 - minute_width, row_y + small_font_y_offset); pango_cairo_update_layout (cr, layout); pango_cairo_show_layout (cr, layout); cairo_restore (cr); @@ -800,7 +800,7 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *dvtmitem, for (i = 0; i < num_divisions; i++) { g_snprintf (buffer, sizeof (buffer), - /* TO TRANSLATORS: %02i is the number of minutes; this is a context menu entry + /* TO TRANSLATORS: %02i is the number of minutes; this is a context menu entry * to change the length of the time division in the calendar day view, e.g. * a day is displayed in 24 "60 minute divisions" or 48 "30 minute divisions" */ diff --git a/calendar/gui/e-day-view-time-item.h b/calendar/gui/e-day-view-time-item.h index c587db68d3..b897eb26f0 100644 --- a/calendar/gui/e-day-view-time-item.h +++ b/calendar/gui/e-day-view-time-item.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index e348e8cc50..e04c3e2345 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -124,7 +124,7 @@ e_day_view_top_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) EDayViewTopItem *dvtitem; dvtitem = E_DAY_VIEW_TOP_ITEM (o); - + switch (arg_id){ case ARG_DAY_VIEW: dvtitem->day_view = GTK_VALUE_POINTER (*arg); @@ -798,7 +798,7 @@ e_day_view_top_item_draw (GnomeCanvasItem *canvas_item, clip_rect.y = 2 - y; clip_rect.width = day_view->day_widths[day]; clip_rect.height = item_height - 2; - + gdk_gc_set_clip_rectangle (fg_gc, &clip_rect); layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer); @@ -952,7 +952,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, /* Fill the background with white to play with transparency */ cairo_save (cr); - x0 = item_x - x + 4; + x0 = item_x - x + 4; y0 = item_y + 1 - y; rect_width = item_w - 8; rect_height = item_h - 2; @@ -969,7 +969,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, /* Draw the border around the event */ cairo_save (cr); - x0 = item_x - x + 4; + x0 = item_x - x + 4; y0 = item_y + 1 - y; rect_width = item_w - 8; rect_height = item_h - 2; @@ -987,15 +987,15 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, cairo_save (cr); - x0 = item_x - x + 5.5; + x0 = item_x - x + 5.5; y0 = item_y + 2.5 - y; rect_width = item_w - 11; rect_height = item_h - 5; - radius = 10; + radius = 10; draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); - + if (gradient){ pat = cairo_pattern_create_linear (item_x - x + 5.5, item_y + 2.5 - y, item_x - x + 5, item_y - y + item_h + 7.5); @@ -1155,7 +1155,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, gdk_cairo_set_source_pixbuf (cr, day_view->recurrence_icon, icon_x, icon_y); cairo_paint (cr); cairo_restore (cr); - + icon_x -= icon_x_inc; } @@ -1164,7 +1164,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, gdk_cairo_set_source_pixbuf (cr, day_view->attach_icon, icon_x, icon_y); cairo_paint (cr); cairo_restore (cr); - + icon_x -= icon_x_inc; } if (icon_x <= max_icon_x && e_cal_component_has_alarms (comp)) { @@ -1172,7 +1172,7 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, gdk_cairo_set_source_pixbuf (cr, day_view->reminder_icon, icon_x, icon_y); cairo_paint (cr); cairo_restore (cr); - + icon_x -= icon_x_inc; } @@ -1181,11 +1181,11 @@ e_day_view_top_item_draw_long_event (EDayViewTopItem *dvtitem, gdk_cairo_set_source_pixbuf (cr, day_view->meeting_icon, icon_x, icon_y); cairo_paint (cr); cairo_restore (cr); - + icon_x -= icon_x_inc; } - /* draw categories icons */ + /* draw categories icons */ e_cal_component_get_categories_list (comp, &categories_list); for (elem = categories_list; elem; elem = elem->next) { char *category; @@ -1273,7 +1273,7 @@ e_day_view_top_item_draw_triangle (EDayViewTopItem *dvtitem, gdk_cairo_set_source_color (cr, &bg_color); } else { gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND]); - } + } } else { gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_LONG_EVENT_BACKGROUND]); } diff --git a/calendar/gui/e-day-view-top-item.h b/calendar/gui/e-day-view-top-item.h index f267a98d55..2d21a42f35 100644 --- a/calendar/gui/e-day-view-top-item.h +++ b/calendar/gui/e-day-view-top-item.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index 0eccaa3922..598404b673 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -500,7 +500,7 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo } else { lower = e_day_view_find_work_week_start (day_view, start_time); } - + /* See if we need to change the days shown. */ if (lower != day_view->lower) e_day_view_recalc_day_starts (day_view, lower); @@ -614,9 +614,9 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data) { EDayView *day_view = E_DAY_VIEW (user_data); int i; - + e_day_view_stop_editing_event (day_view); - + for (i = row + count; i > row; i--) { gint day, event_num; const char *uid, *rid = NULL; @@ -638,7 +638,7 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data) if (e_day_view_find_event_from_uid (day_view, comp_data->client, uid, rid, &day, &event_num)) e_day_view_remove_event_cb (day_view, day, event_num, NULL); } - + gtk_widget_queue_draw (day_view->top_canvas); gtk_widget_queue_draw (day_view->main_canvas); e_day_view_queue_layout (day_view); @@ -676,7 +676,7 @@ e_day_view_init (EDayView *day_view) gint day; GnomeCanvasGroup *canvas_group; ECalModel *model; - + GTK_WIDGET_SET_FLAGS (day_view, GTK_CAN_FOCUS); day_view->long_events = g_array_new (FALSE, FALSE, @@ -920,7 +920,7 @@ e_day_view_init (EDayView *day_view) day_view->drag_rect_item = gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), + gnome_canvas_rect_get_type (), "width_pixels", 1, NULL); gnome_canvas_item_hide (day_view->drag_rect_item); @@ -1027,7 +1027,7 @@ e_day_view_init (EDayView *day_view) GnomeCanvasGroup *canvas_group; ECalModel *model; GtkWidget *w; - + GTK_WIDGET_SET_FLAGS (day_view, GTK_CAN_FOCUS); day_view->long_events = g_array_new (FALSE, FALSE, @@ -1093,7 +1093,7 @@ e_day_view_init (EDayView *day_view) day_view->last_edited_comp_string = NULL; - + day_view->selection_start_row = -1; day_view->selection_start_day = -1; day_view->selection_end_row = -1; @@ -1129,7 +1129,7 @@ e_day_view_init (EDayView *day_view) * Top Canvas */ w = gtk_vbox_new (FALSE, 0); - + day_view->top_dates_canvas = e_canvas_new (); gtk_box_pack_start (GTK_BOX (w), day_view->top_dates_canvas, TRUE, TRUE, 0); day_view->top_canvas = e_canvas_new (); @@ -1255,7 +1255,7 @@ e_day_view_init (EDayView *day_view) day_view->drag_rect_item = gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), + gnome_canvas_rect_get_type (), "width_pixels", 1, NULL); gnome_canvas_item_hide (day_view->drag_rect_item); @@ -1379,7 +1379,7 @@ e_day_view_new (void) day_view = g_object_new (e_day_view_get_type (), NULL); e_cal_model_set_flags (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES); - + return GTK_WIDGET (day_view); } @@ -1427,7 +1427,7 @@ e_day_view_destroy (GtkObject *object) g_array_free (day_view->long_events, TRUE); day_view->long_events = NULL; } - + for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) { if (day_view->events[day]) { g_array_free (day_view->events[day], TRUE); @@ -1454,9 +1454,9 @@ e_day_view_realize (GtkWidget *widget) colormap = gtk_widget_get_colormap (widget); /* Allocate the colors. */ - + e_day_view_set_colors(day_view, widget); - + gdk_gc_set_colormap (day_view->main_gc, colormap); /* Create the pixmaps. */ @@ -1464,7 +1464,7 @@ e_day_view_realize (GtkWidget *widget) day_view->recurrence_icon = e_icon_factory_get_icon ("view-refresh", E_ICON_SIZE_MENU); day_view->timezone_icon = e_icon_factory_get_icon ("stock_timezone", E_ICON_SIZE_MENU); day_view->meeting_icon = e_icon_factory_get_icon ("stock_people", E_ICON_SIZE_MENU); - day_view->attach_icon = e_icon_factory_get_icon ("mail-attachment", E_ICON_SIZE_MENU); + day_view->attach_icon = e_icon_factory_get_icon ("mail-attachment", E_ICON_SIZE_MENU); /* Set the canvas item colors. */ @@ -1528,9 +1528,9 @@ e_day_view_realize (GtkWidget *widget) colormap = gtk_widget_get_colormap (widget); /* Allocate the colors. */ - + e_day_view_set_colors(day_view, widget); - + gdk_gc_set_colormap (day_view->main_gc, colormap); /* Create the pixmaps. */ @@ -1538,7 +1538,7 @@ e_day_view_realize (GtkWidget *widget) day_view->recurrence_icon = e_icon_factory_get_icon ("view-refresh", E_ICON_SIZE_MENU); day_view->timezone_icon = e_icon_factory_get_icon ("stock_timezone", E_ICON_SIZE_MENU); day_view->meeting_icon = e_icon_factory_get_icon ("stock_people", E_ICON_SIZE_MENU); - day_view->attach_icon = e_icon_factory_get_icon ("mail-attachment", E_ICON_SIZE_MENU); + day_view->attach_icon = e_icon_factory_get_icon ("mail-attachment", E_ICON_SIZE_MENU); /* Set the canvas item colors. */ @@ -1611,9 +1611,9 @@ static GdkColor e_day_view_get_text_color (EDayView *day_view, EDayViewEvent *event, GtkWidget *widget) { GdkColor color, bg_color; - guint16 red, green, blue; + guint16 red, green, blue; gdouble cc = 65535.0; - + red = day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].red; green = day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].green; blue = day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND].blue; @@ -1741,13 +1741,13 @@ e_day_view_style_set (GtkWidget *widget, layout = pango_layout_new (pango_context); /* Create the large font. */ - if (day_view->large_font_desc != NULL) + if (day_view->large_font_desc != NULL) pango_font_description_free (day_view->large_font_desc); day_view->large_font_desc = pango_font_description_copy (font_desc); pango_font_description_set_size (day_view->large_font_desc, E_DAY_VIEW_LARGE_FONT_PTSIZE * PANGO_SCALE); - + /* Create the small fonts. */ if (day_view->small_font_desc != NULL) pango_font_description_free (day_view->small_font_desc); @@ -1934,13 +1934,13 @@ e_day_view_style_set (GtkWidget *widget, layout = pango_layout_new (pango_context); /* Create the large font. */ - if (day_view->large_font_desc != NULL) + if (day_view->large_font_desc != NULL) pango_font_description_free (day_view->large_font_desc); day_view->large_font_desc = pango_font_description_copy (font_desc); pango_font_description_set_size (day_view->large_font_desc, E_DAY_VIEW_LARGE_FONT_PTSIZE * PANGO_SCALE); - + /* Create the small fonts. */ if (day_view->small_font_desc != NULL) pango_font_description_free (day_view->small_font_desc); @@ -2391,23 +2391,23 @@ e_day_view_remove_event_cb (EDayView *day_view, static void set_text_as_bold (EDayViewEvent *event) { - ECalComponent *comp; + ECalComponent *comp; char *address; GSList *attendees, *l; ECalComponentAttendee *at = NULL; comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); - address = itip_get_comp_attendee (comp, event->comp_data->client); + address = itip_get_comp_attendee (comp, event->comp_data->client); e_cal_component_get_attendee_list (comp, &attendees); for (l = attendees; l; l = l->next) { ECalComponentAttendee *attendee = l->data; if (g_str_equal (itip_strip_mailto (attendee->value), address)) { - at = attendee; + at = attendee; break; - } + } } /* The attendee has not yet accepted the meeting, display the summary as bolded . @@ -2519,8 +2519,8 @@ e_day_view_update_event_label (EDayView *day_view, "text", text, NULL); -/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) - && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) +/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) + && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) set_text_as_bold (event); */ if (free_text) @@ -2555,11 +2555,11 @@ e_day_view_update_event_label (EDayView *day_view, interval = event->end_minute - event->start_minute; - if ((interval/day_view->mins_per_row) >= 2) + if ((interval/day_view->mins_per_row) >= 2) short_event = FALSE; else if ((interval%day_view->mins_per_row)==0) { if (((event->end_minute%day_view->mins_per_row)==0) || ((event->start_minute%day_view->mins_per_row)==0)){ - short_event = TRUE; + short_event = TRUE; } } else short_event = FALSE; @@ -2575,8 +2575,8 @@ e_day_view_update_event_label (EDayView *day_view, "text", text, NULL); -/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) - && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) +/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) + && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) set_text_as_bold (event); */ if (free_text) @@ -2608,8 +2608,8 @@ e_day_view_update_long_event_label (EDayView *day_view, if (free_text) g_free ((gchar*)summary); -/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) - && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) +/* if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) + && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) set_text_as_bold (event); */ } @@ -3251,15 +3251,15 @@ e_day_view_set_marcus_bains (EDayView *day_view, (day_view->marcus_bains_day_view_color != dayview_color) | (day_view->marcus_bains_time_bar_color != timebar_color)) { - if (day_view->marcus_bains_day_view_color) + if (day_view->marcus_bains_day_view_color) g_free (day_view->marcus_bains_day_view_color); - if (day_view->marcus_bains_time_bar_color) + if (day_view->marcus_bains_time_bar_color) g_free (day_view->marcus_bains_time_bar_color); - + day_view->show_marcus_bains_line = show_line; - if (dayview_color) + if (dayview_color) day_view->marcus_bains_day_view_color = g_strdup (dayview_color); - else + else day_view->marcus_bains_day_view_color = NULL; if (timebar_color) @@ -3339,7 +3339,7 @@ e_day_view_set_week_start_day (EDayView *day_view, static void e_day_view_recalc_work_week (EDayView *day_view) -{ +{ time_t lower; /* If we aren't showing the work week, just return. */ @@ -3347,7 +3347,7 @@ e_day_view_recalc_work_week (EDayView *day_view) return; e_day_view_recalc_work_week_days_shown (day_view); - + /* If the date isn't set, just return. */ if (day_view->lower == 0 && day_view->upper == 0) return; @@ -3463,7 +3463,7 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, if (day_view->drag_event_num != -1) day_view->drag_event_num = -1; - + /* Convert the coords to the main canvas window, or return if the window is not found. */ if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) event, @@ -3523,7 +3523,7 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, e_day_view_start_selection (day_view, day, -1); e_day_view_finish_selection (day_view); } - + e_day_view_on_event_right_click (day_view, event, -1, -1); } @@ -3602,7 +3602,7 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, if (day_view->drag_event_num != -1) day_view->drag_event_num = -1; - + /* Convert the coords to the main canvas window, or return if the window is not found. */ if (!e_day_view_convert_event_coords (day_view, (GdkEvent*) event, @@ -3660,14 +3660,14 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, if (!GTK_WIDGET_HAS_FOCUS (day_view)) gtk_widget_grab_focus (GTK_WIDGET (day_view)); - + if ((day < day_view->selection_start_day || day > day_view->selection_end_day) || (day == day_view->selection_start_day && row < day_view->selection_start_row) || (day == day_view->selection_end_day && row > day_view->selection_end_row)) { e_day_view_start_selection (day_view, day, row); e_day_view_finish_selection (day_view); } - + e_day_view_on_event_right_click (day_view, event, -1, -1); } @@ -3723,7 +3723,7 @@ e_day_view_on_time_canvas_scroll (GtkWidget *widget, gtk_widget_destroy (tool_window); g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL); } - + switch (scroll->direction) { case GDK_SCROLL_UP: e_day_view_scroll (day_view, E_DAY_VIEW_WHEEL_MOUSE_STEP_SIZE); @@ -3765,7 +3765,7 @@ e_day_view_on_long_event_button_press (EDayView *day_view, e = &g_array_index (day_view->long_events, EDayViewEvent, event_num); e_day_view_set_selected_time_range_in_top_visible (day_view, e->start, e->end); - + e_day_view_on_event_right_click (day_view, event, E_DAY_VIEW_LONG_EVENT, event_num); @@ -3805,7 +3805,7 @@ e_day_view_on_event_button_press (EDayView *day_view, e = &g_array_index (day_view->events[day], EDayViewEvent, event_num); e_day_view_set_selected_time_range_visible (day_view, e->start, e->end); - + e_day_view_on_event_right_click (day_view, event, day, event_num); @@ -4178,14 +4178,14 @@ e_day_view_on_event_double_click (EDayView *day_view, if (day == -1) event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); - else + else event = &g_array_index (day_view->events[day], EDayViewEvent, event_num); attendee_prop = icalcomponent_get_first_property (event->comp_data->icalcomp, ICAL_ATTENDEE_PROPERTY); e_calendar_view_edit_appointment ((ECalendarView *)day_view, - event->comp_data->client, + event->comp_data->client, event->comp_data->icalcomp, attendee_prop ? TRUE:FALSE); } @@ -4195,9 +4195,9 @@ popup_destroyed_cb (gpointer data, GObject *where_object_was) EDayView *day_view = data; day_view->popup_event_day = -1; - day_view->popup_event_num = -1; + day_view->popup_event_num = -1; } - + static void e_day_view_show_popup_menu (EDayView *day_view, GdkEvent *gdk_event, @@ -4976,7 +4976,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; int is_date; - + event_num = day_view->resize_event_num; event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); @@ -5017,7 +5017,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtend (comp, &date); } - + e_cal_component_commit_sequence (comp); if (e_cal_component_is_instance (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { @@ -5047,13 +5047,13 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_cal_component_commit_sequence (comp); } } - + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); - + out: gnome_canvas_item_hide (day_view->resize_long_event_rect_item); - + day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; g_object_unref (comp); @@ -5157,12 +5157,12 @@ e_day_view_finish_resize (EDayView *day_view) e_cal_component_set_exrule_list (comp, NULL); } } - + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_cal_component_commit_sequence (comp); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); - out: + out: g_object_unref (comp); } @@ -5216,7 +5216,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; int is_date; - + event_num = day_view->resize_event_num; event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); @@ -5257,7 +5257,7 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtend (comp, &date); } - + e_cal_component_commit_sequence (comp); if (e_cal_component_is_instance (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { @@ -5287,10 +5287,10 @@ e_day_view_finish_long_event_resize (EDayView *day_view) e_cal_component_commit_sequence (comp); } } - + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); - + out: day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; @@ -5391,12 +5391,12 @@ e_day_view_finish_resize (EDayView *day_view) e_cal_component_set_exrule_list (comp, NULL); } } - + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_cal_component_commit_sequence (comp); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); - out: + out: g_object_unref (comp); } @@ -6106,14 +6106,14 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) const char *uid; AddEventData add_event_data; gboolean read_only = TRUE; - + g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (E_IS_DAY_VIEW (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); day_view = E_DAY_VIEW (widget); keyval = event->keyval; - + /* The Escape key aborts a resize operation. */ if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) { if (keyval == GDK_Escape) { @@ -6122,7 +6122,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } return FALSE; } - + /* Alt + Arrow Keys to move a selected event through time lines */ if (((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) @@ -6137,7 +6137,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return e_day_view_event_move ((ECalendarView *) day_view, E_CAL_VIEW_MOVE_RIGHT); } - /*Go to the start/end of a work day*/ + /*Go to the start/end of a work day*/ if ((keyval == GDK_Home) &&((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) @@ -6152,8 +6152,8 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) e_day_view_goto_end_of_work_day (day_view); return TRUE; } - - /* In DayView, Shift+Home/End, Change the duration to the time that begins/ends the current work day */ + + /* In DayView, Shift+Home/End, Change the duration to the time that begins/ends the current work day */ if ((keyval == GDK_Home) &&((event->state & GDK_SHIFT_MASK) == GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) @@ -6169,7 +6169,7 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) return TRUE; } - + /* Handle the cursor keys for moving & extending the selection. */ stop_emission = TRUE; if (event->state & GDK_SHIFT_MASK) { @@ -6244,9 +6244,9 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) || (event->length == 0) || (keyval == GDK_Tab))) { return FALSE; - } + } - /* Add a new event covering the selected range */ + /* Add a new event covering the selected range */ icalcomp = e_cal_model_create_component_with_defaults (model); if (!icalcomp) return FALSE; @@ -6267,12 +6267,12 @@ e_day_view_do_key_press (GtkWidget *widget, GdkEventKey *event) start_dt.tzid = NULL; start_tt.is_date = 1; end_tt.is_date = 1; - + /* Editor default in day/work-week view - top canvas */ e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_TRANSPARENT); } else { start_dt.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - + /* Editor default in day/work-week view - main canvas */ e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE); } @@ -6322,23 +6322,23 @@ e_day_view_key_press (GtkWidget *widget, GdkEventKey *event) static void e_day_view_goto_start_of_work_day (EDayView *day_view) { - g_return_if_fail(day_view!=NULL); + g_return_if_fail(day_view!=NULL); if (day_view->selection_in_top_canvas) return; - else - day_view->selection_start_row = - e_day_view_convert_time_to_row (day_view, - day_view->work_day_start_hour, + else + day_view->selection_start_row = + e_day_view_convert_time_to_row (day_view, + day_view->work_day_start_hour, day_view->work_day_start_minute); day_view->selection_end_row = day_view->selection_start_row; e_day_view_ensure_rows_visible (day_view, day_view->selection_start_row, day_view->selection_end_row); - + e_day_view_update_calendar_selection_time (day_view); - + gtk_widget_queue_draw (day_view->top_canvas); gtk_widget_queue_draw (day_view->top_dates_canvas); gtk_widget_queue_draw (day_view->main_canvas); @@ -6353,11 +6353,11 @@ e_day_view_goto_end_of_work_day (EDayView *day_view) return; else day_view->selection_start_row = - e_day_view_convert_time_to_row (day_view, - day_view->work_day_end_hour-1, + e_day_view_convert_time_to_row (day_view, + day_view->work_day_end_hour-1, day_view->work_day_end_minute+30); day_view->selection_end_row = day_view->selection_start_row; - + e_day_view_ensure_rows_visible (day_view, day_view->selection_start_row, day_view->selection_end_row); @@ -6374,20 +6374,20 @@ static void e_day_view_change_duration_to_start_of_work_day (EDayView *day_view) { g_return_if_fail(day_view != NULL); - + if (day_view->selection_in_top_canvas) return; else { /* These are never used after being set? */ gint work_start_row,work_end_row,selection_start_row,selection_end_row; - + work_start_row = - e_day_view_convert_time_to_row (day_view, - day_view->work_day_start_hour, + e_day_view_convert_time_to_row (day_view, + day_view->work_day_start_hour, day_view->work_day_start_minute); work_end_row = - e_day_view_convert_time_to_row (day_view, - day_view->work_day_end_hour - 1, + e_day_view_convert_time_to_row (day_view, + day_view->work_day_end_hour - 1, day_view->work_day_end_minute + 30); selection_start_row = day_view->selection_start_row; selection_end_row = day_view->selection_end_row; @@ -6395,7 +6395,7 @@ e_day_view_change_duration_to_start_of_work_day (EDayView *day_view) day_view->selection_end_row = work_start_row - 1; else day_view->selection_start_row = work_start_row; } - + e_day_view_ensure_rows_visible (day_view, day_view->selection_start_row, day_view->selection_end_row); @@ -6412,17 +6412,17 @@ static void e_day_view_change_duration_to_end_of_work_day (EDayView *day_view) { g_return_if_fail(day_view != NULL); - + if (day_view->selection_in_top_canvas) return; - else { - gint work_start_row,work_end_row,selection_start_row,selection_end_row; + else { + gint work_start_row,work_end_row,selection_start_row,selection_end_row; work_start_row = - e_day_view_convert_time_to_row (day_view, - day_view->work_day_start_hour, + e_day_view_convert_time_to_row (day_view, + day_view->work_day_start_hour, day_view->work_day_start_minute); - work_end_row = e_day_view_convert_time_to_row (day_view, - day_view->work_day_end_hour-1, + work_end_row = e_day_view_convert_time_to_row (day_view, + day_view->work_day_end_hour-1, day_view->work_day_end_minute+30); selection_start_row = day_view->selection_start_row; selection_end_row = day_view->selection_end_row; @@ -6437,9 +6437,9 @@ e_day_view_change_duration_to_end_of_work_day (EDayView *day_view) e_day_view_ensure_rows_visible (day_view, day_view->selection_start_row, day_view->selection_end_row); - + e_day_view_update_calendar_selection_time (day_view); - + gtk_widget_queue_draw (day_view->top_canvas); gtk_widget_queue_draw (day_view->top_dates_canvas); gtk_widget_queue_draw (day_view->main_canvas); @@ -6604,7 +6604,7 @@ e_day_view_get_extreme_long_event (EDayView *day_view, gboolean first, * @event_num_out: out value, event number of the event found. * -1 for no event found. * - * Decide on which event the focus should go next. + * Decide on which event the focus should go next. * if ((day_out == -1) && (event_num_out == -1)) is true, focus should go * to day_view widget itself. * @@ -7046,7 +7046,7 @@ e_day_view_start_editing_event (EDayView *day_view, "text", initial_text, NULL); if (initial_text) - g_free (initial_text); + g_free (initial_text); } } @@ -7121,7 +7121,7 @@ tooltip_get_view_event (EDayView *day_view, int day, int event_num) } else { pevent = &g_array_index (day_view->events[day], EDayViewEvent, event_num); - } + } return pevent; } @@ -7145,7 +7145,7 @@ tooltip_destroy (EDayView *day_view, GnomeCanvasItem *item) pevent->timeout = -1; } - g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL); + g_object_set_data (G_OBJECT (day_view), "tooltip-window", NULL); } } @@ -7202,7 +7202,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, if (day_view->drag_event_num != -1) day_view->drag_event_num = -1; - + case GDK_BUTTON_PRESS: tooltip_destroy (day_view, item); /* Only let the EText handle the event while editing. */ @@ -7245,7 +7245,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, &event_num); } else { int tmp; - + pos = e_day_view_convert_position_in_top_canvas (day_view, event_x, event_y, &tmp, &event_num); @@ -7263,7 +7263,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, if (day_view->drag_event_num != -1) break; - + pevent = tooltip_get_view_event (day_view, day, event_num); g_object_set_data (G_OBJECT (item), "event-num", GINT_TO_POINTER (event_num)); g_object_set_data (G_OBJECT (item), "event-day", GINT_TO_POINTER (day)); @@ -7278,7 +7278,7 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, data->event_num = event_num; data->get_view_event = (ECalendarViewEvent * (*)(ECalendarView *, int, int)) tooltip_get_view_event; pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, data); - + return TRUE; } case GDK_LEAVE_NOTIFY: @@ -7291,11 +7291,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, int day = GPOINTER_TO_INT(g_object_get_data ((GObject *)item, "event-day")); pevent = tooltip_get_view_event (day_view, day, event_num); - + pevent->x = ((GdkEventMotion *)event)->x_root; pevent->y = ((GdkEventMotion *)event)->y_root; pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (day_view), "tooltip-window"); - + if (pevent->tooltip) { e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); } @@ -7305,11 +7305,11 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, default: break; } - + return FALSE; } -static gboolean +static gboolean e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) { EDayViewEvent *event; @@ -7335,7 +7335,7 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) resize_end_row = (event->end_minute - 1) / day_view->mins_per_row; if (resize_end_row < resize_start_row) resize_end_row = resize_start_row; - + switch (direction) { case E_CAL_VIEW_MOVE_UP: if (resize_start_row <= 0) @@ -7343,7 +7343,7 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) resize_start_row--; resize_end_row--; start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row); - end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1); + end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1); break; case E_CAL_VIEW_MOVE_DOWN: if (resize_end_row >= day_view->rows - 1) @@ -7351,17 +7351,17 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) resize_start_row++; resize_end_row++; start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row); - end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1); + end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1); break; case E_CAL_VIEW_MOVE_LEFT: - if (day <= 0) + if (day <= 0) return TRUE; start_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_start_row); end_dt = e_day_view_convert_grid_position_to_time (day_view, day, resize_end_row + 1); start_time = icaltime_from_timet (start_dt, 0); end_time = icaltime_from_timet (end_dt, 0); icaltime_adjust (&start_time ,-1,0,0,0); - icaltime_adjust (&end_time ,-1,0,0,0); + icaltime_adjust (&end_time ,-1,0,0,0); start_dt = icaltime_as_timet (start_time); end_dt = icaltime_as_timet (end_time); break; @@ -7373,14 +7373,14 @@ e_day_view_event_move (ECalendarView *cal_view, ECalViewMoveDirection direction) start_time = icaltime_from_timet (start_dt, 0); end_time = icaltime_from_timet (end_dt, 0); icaltime_adjust (&start_time ,1,0,0,0); - icaltime_adjust (&end_time ,1,0,0,0); + icaltime_adjust (&end_time ,1,0,0,0); start_dt = icaltime_as_timet (start_time); end_dt = icaltime_as_timet (end_time); - break; + break; default: return FALSE; } - + e_day_view_change_event_time (day_view, start_dt, end_dt); e_day_view_ensure_rows_visible (day_view, resize_start_row, resize_end_row); @@ -7421,7 +7421,7 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt /* FIXME: Should probably keep the timezone of the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - + *date.value = icaltime_from_timet_with_zone (start_dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtstart (comp, &date); @@ -7430,12 +7430,12 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt e_cal_component_set_dtend (comp, &date); e_cal_component_commit_sequence (comp); - + if (day_view->last_edited_comp_string != NULL) { g_free (day_view->last_edited_comp_string); day_view->last_edited_comp_string = NULL; } - + day_view->last_edited_comp_string = e_cal_component_get_as_string (comp); gnome_canvas_item_hide (day_view->resize_rect_item); @@ -7456,13 +7456,13 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt e_cal_component_set_exrule_list (comp, NULL); } } - + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_cal_component_commit_sequence (comp); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); -out: +out: g_object_unref (comp); } #endif @@ -7501,7 +7501,7 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt /* FIXME: Should probably keep the timezone of the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - + *date.value = icaltime_from_timet_with_zone (start_dt, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); e_cal_component_set_dtstart (comp, &date); @@ -7510,12 +7510,12 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt e_cal_component_set_dtend (comp, &date); e_cal_component_commit_sequence (comp); - + if (day_view->last_edited_comp_string != NULL) { g_free (day_view->last_edited_comp_string); day_view->last_edited_comp_string = NULL; } - + day_view->last_edited_comp_string = e_cal_component_get_as_string (comp); day_view->resize_drag_pos = E_CALENDAR_VIEW_POS_NONE; @@ -7533,18 +7533,18 @@ e_day_view_change_event_time (EDayView *day_view, time_t start_dt, time_t end_dt e_cal_component_set_exrule_list (comp, NULL); } } - + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_cal_component_commit_sequence (comp); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); -out: +out: g_object_unref (comp); } #endif -static void +static void e_day_view_change_event_end_time_up (EDayView *day_view) { EDayViewEvent *event; @@ -7575,12 +7575,12 @@ e_day_view_change_event_end_time_up (EDayView *day_view) } -static void +static void e_day_view_change_event_end_time_down (EDayView *day_view) { EDayViewEvent *event; gint day, event_num, resize_start_row, resize_end_row; - + day = day_view->editing_event_day; event_num = day_view->editing_event_num; if ((day == -1) || (day == E_DAY_VIEW_LONG_EVENT)) @@ -7665,7 +7665,7 @@ e_day_view_on_editing_stopped (EDayView *day_view, ECalComponent *comp; ECal *client; gboolean on_server; - + /* Note: the item we are passed here isn't reliable, so we just stop the edit of whatever item was being edited. We also receive this event twice for some reason. */ @@ -7711,12 +7711,12 @@ e_day_view_on_editing_stopped (EDayView *day_view, client = event->comp_data->client; on_server = cal_comp_is_on_server (comp, client); - + if (string_is_empty (text) && !on_server) { const char *uid; - + e_cal_component_get_uid (comp, &uid); - + e_day_view_foreach_event_with_uid (day_view, uid, e_day_view_remove_event_cb, NULL); e_day_view_check_layout (day_view); @@ -7796,12 +7796,12 @@ e_day_view_on_editing_stopped (EDayView *day_view, e_cal_component_commit_sequence (comp); } } - + /* FIXME When sending here, what exactly should we send? */ toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); } - + } out: @@ -7825,7 +7825,7 @@ e_day_view_on_editing_stopped (EDayView *day_view, ECalComponent *comp; ECal *client; gboolean on_server; - + /* Note: the item we are passed here isn't reliable, so we just stop the edit of whatever item was being edited. We also receive this event twice for some reason. */ @@ -7868,12 +7868,12 @@ e_day_view_on_editing_stopped (EDayView *day_view, client = event->comp_data->client; on_server = cal_comp_is_on_server (comp, client); - + if (string_is_empty (text) && !on_server) { const char *uid; - + e_cal_component_get_uid (comp, &uid); - + e_day_view_foreach_event_with_uid (day_view, uid, e_day_view_remove_event_cb, NULL); e_day_view_check_layout (day_view); @@ -7953,12 +7953,12 @@ e_day_view_on_editing_stopped (EDayView *day_view, e_cal_component_commit_sequence (comp); } } - + /* FIXME When sending here, what exactly should we send? */ toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); } - + } gtk_widget_queue_draw (day_view->main_canvas); @@ -9095,14 +9095,14 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (day_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); - + g_object_unref (comp); return; } } - if ((data->length >= 0) && (data->format == 8) + if ((data->length >= 0) && (data->format == 8) && !drag_from_same_window) { /* We are dragging between different window */ @@ -9115,7 +9115,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, pos = e_day_view_convert_position_in_top_canvas (day_view, x, y, &day, NULL); - if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) + if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) goto error; comp_str = (char *) data->data; @@ -9140,7 +9140,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, while (subcomp) { child_kind = icalcomponent_isa (subcomp); if (child_kind == ICAL_VEVENT_COMPONENT) - e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, + e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, default_zone, subcomp, TRUE); else if (child_kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; @@ -9148,10 +9148,10 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, zone = icaltimezone_new (); icaltimezone_set_component (zone, subcomp); e_cal_add_timezone (client, zone, NULL); - + icaltimezone_free (zone, 1); } - + subcomp = icalcomponent_get_next_component ( icalcomp, ICAL_ANY_COMPONENT); } @@ -9161,7 +9161,7 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, } else { e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, default_zone, icalcomp, TRUE); } - + gtk_drag_finish (context, TRUE, TRUE, time); return; } @@ -9194,7 +9194,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, if (day_view->drag_event_day != -1) drag_from_same_window = TRUE; - else + else drag_from_same_window = FALSE; client = e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view))); @@ -9256,7 +9256,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, g_object_unref (comp); return; } - + date.value = &itt; date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); @@ -9304,7 +9304,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, } } - if ((data->length >= 0) && (data->format == 8) + if ((data->length >= 0) && (data->format == 8) && !drag_from_same_window) { /* We are dragging between different window */ @@ -9317,7 +9317,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, pos = e_day_view_convert_position_in_main_canvas (day_view, x, y, &day, &row, NULL); - if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) + if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) goto error; comp_str = (char *) data->data; @@ -9342,7 +9342,7 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, while (subcomp) { child_kind = icalcomponent_isa (subcomp); if (child_kind == ICAL_VEVENT_COMPONENT) - e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, + e_calendar_view_add_event (E_CALENDAR_VIEW (day_view), client, dtstart, default_zone, subcomp, FALSE); else if (child_kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; @@ -9350,10 +9350,10 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, zone = icaltimezone_new (); icaltimezone_set_component (zone, subcomp); e_cal_add_timezone (client, zone, NULL); - + icaltimezone_free (zone, 1); } - + subcomp = icalcomponent_get_next_component ( icalcomp, ICAL_ANY_COMPONENT); } diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h index 7ee92005ba..b7fed463ca 100644 --- a/calendar/gui/e-day-view.h +++ b/calendar/gui/e-day-view.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -379,7 +379,7 @@ struct _EDayView /* The event for which a popup menu is being displayed, as above. */ gint popup_event_day; gint popup_event_num; - + /* The currently selected region. If selection_start_day is -1 there is no current selection. If start_row or end_row is -1 then the selection is in the top canvas. */ diff --git a/calendar/gui/e-itip-control.c b/calendar/gui/e-itip-control.c index 3ba297b893..0142968b8a 100644 --- a/calendar/gui/e-itip-control.c +++ b/calendar/gui/e-itip-control.c @@ -64,7 +64,7 @@ struct _EItipControlPrivate { GtkWidget *html; ESourceList *source_lists[E_CAL_SOURCE_TYPE_LAST]; - GHashTable *ecals[E_CAL_SOURCE_TYPE_LAST]; + GHashTable *ecals[E_CAL_SOURCE_TYPE_LAST]; ECal *current_ecal; ECalSourceType type; @@ -85,7 +85,7 @@ struct _EItipControlPrivate { GtkWidget *widget; gpointer pointer; } vbox; - + char *vcalendar; ECalComponent *comp; icalcomponent *main_comp; @@ -129,9 +129,9 @@ static void e_itip_control_class_init (EItipControlClass *klass) { GtkObjectClass *gtkobject_class; - + gtkobject_class = GTK_OBJECT_CLASS (klass); - + gtkobject_class->destroy = e_itip_control_destroy; } @@ -140,15 +140,15 @@ set_ok_sens (EItipControl *itip) { EItipControlPrivate *priv; gboolean read_only = TRUE; - + priv = itip->priv; if (!priv->ok.widget) return; - + if (priv->current_ecal) e_cal_is_read_only (priv->current_ecal, &read_only, NULL); - + gtk_widget_set_sensitive (priv->ok.widget, priv->current_ecal != NULL && !read_only); } @@ -164,7 +164,7 @@ cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) source_type = e_cal_get_source_type (ecal); source = e_cal_get_source (ecal); - + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, cal_opened_cb, NULL); if (status != E_CALENDAR_STATUS_OK) { @@ -187,23 +187,23 @@ start_calendar_server (EItipControl *itip, ESource *source, ECalSourceType type, icaltimezone *zone; priv = itip->priv; - + ecal = g_hash_table_lookup (priv->ecals[type], e_source_peek_uid (source)); if (ecal) { priv->current_ecal = ecal; set_ok_sens (itip); - return ecal; + return ecal; } - + ecal = auth_new_cal_from_source (source, type); - + zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (ecal, zone, NULL); - + g_signal_connect (G_OBJECT (ecal), "cal_opened", G_CALLBACK (func), data); g_hash_table_insert (priv->ecals[type], g_strdup (e_source_peek_uid (source)), ecal); - + e_cal_open_async (ecal, TRUE); return ecal; @@ -214,7 +214,7 @@ start_calendar_server_by_uid (EItipControl *itip, const char *uid, ECalSourceTyp { EItipControlPrivate *priv; int i; - + priv = itip->priv; for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) { @@ -224,12 +224,12 @@ start_calendar_server_by_uid (EItipControl *itip, const char *uid, ECalSourceTyp if (source) return start_calendar_server (itip, source, type, cal_opened_cb, itip); } - + return NULL; } typedef struct { - EItipControl *itip; + EItipControl *itip; char *uid; int count; gboolean show_selector; @@ -242,7 +242,7 @@ source_changed_cb (ESourceComboBox *escb, EItipControl *itip) ESource *source; source = e_source_combo_box_get_active (escb); - + if (priv->ok.widget) gtk_widget_set_sensitive (priv->ok.widget, FALSE); @@ -262,9 +262,9 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) source = e_cal_get_source (ecal); priv = fd->itip->priv; - + fd->count--; - + g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, find_cal_opened_cb, NULL); if (status != E_CALENDAR_STATUS_OK) { @@ -275,7 +275,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) if (e_cal_get_object (ecal, fd->uid, NULL, &icalcomp, NULL)) { icalcomponent_free (icalcomp); - + priv->current_ecal = ecal; set_ok_sens (fd->itip); } @@ -296,8 +296,8 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) default: uid = NULL; g_return_if_reached (); - } - + } + if (uid) { source = e_source_list_peek_source_by_uid (priv->source_lists[priv->type], uid); g_free (uid); @@ -321,7 +321,7 @@ find_cal_opened_cb (ECal *ecal, ECalendarStatus status, gpointer data) } else { /* FIXME Display error message to user */ } - + g_free (fd->uid); g_free (fd); } @@ -336,23 +336,23 @@ find_server (EItipControl *itip, ECalComponent *comp, gboolean show_selector) const char *uid; priv = itip->priv; - + e_cal_component_get_uid (comp, &uid); groups = e_source_list_peek_groups (priv->source_lists[priv->type]); for (l = groups; l; l = l->next) { ESourceGroup *group; GSList *sources, *m; - + group = l->data; sources = e_source_group_peek_sources (group); for (m = sources; m; m = m->next) { ESource *source; ECal *ecal; - + source = m->data; - + if (!fd) { fd = g_new0 (EItipControlFindData, 1); fd->itip = itip; @@ -361,8 +361,8 @@ find_server (EItipControl *itip, ECalComponent *comp, gboolean show_selector) } fd->count++; /* Check this return too? */ - ecal = start_calendar_server (itip, source, priv->type, find_cal_opened_cb, fd); - } + ecal = start_calendar_server (itip, source, priv->type, find_cal_opened_cb, fd); + } } } @@ -374,7 +374,7 @@ cleanup_ecal (void *data) /* Clean up any signals */ g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, cal_opened_cb, NULL); g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, find_cal_opened_cb, NULL); - + g_object_unref (ecal); } @@ -383,9 +383,9 @@ html_destroyed (gpointer data) { EItipControl *itip = data; EItipControlPrivate *priv; - + priv = itip->priv; - + priv->html = NULL; } @@ -408,7 +408,7 @@ e_itip_control_init (EItipControl *itip) priv->source_lists[E_CAL_SOURCE_TYPE_EVENT] = e_source_list_new_for_gconf_default ("/apps/evolution/calendar/sources"); priv->source_lists[E_CAL_SOURCE_TYPE_TODO] = e_source_list_new_for_gconf_default ("/apps/evolution/tasks/sources"); - + /* Initialize the ecal hashes */ for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) priv->ecals[i] = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, cleanup_ecal); @@ -421,10 +421,10 @@ e_itip_control_init (EItipControl *itip) priv->delegator_name = NULL; priv->my_address = NULL; priv->view_only = 0; - + /* Html Widget */ priv->html = gtk_html_new (); - gtk_html_set_default_content_type (GTK_HTML (priv->html), + gtk_html_set_default_content_type (GTK_HTML (priv->html), "text/html; charset=utf-8"); gtk_html_load_from_string (GTK_HTML (priv->html), " ", 1); gtk_widget_show (priv->html); @@ -494,32 +494,32 @@ e_itip_control_destroy (GtkObject *obj) { EItipControl *itip = E_ITIP_CONTROL (obj); EItipControlPrivate *priv; - + priv = itip->priv; if (priv) { int i; clean_up (itip); - + priv->accounts = NULL; - + for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) { if (priv->ecals[i]) { g_hash_table_destroy (priv->ecals[i]); priv->ecals[i] = NULL; } } - + if (priv->html) { g_signal_handlers_disconnect_matched (priv->html, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, itip); g_object_weak_unref (G_OBJECT (priv->html), (GWeakNotify)html_destroyed, itip); } - + g_free (priv); itip->priv = NULL; } - + (* GTK_OBJECT_CLASS (e_itip_control_parent_class)->destroy) (obj); } @@ -535,9 +535,9 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp, icalparameter_par EItipControlPrivate *priv; icalproperty *prop; char *my_alt_address = NULL; - + priv = itip->priv; - + for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY); prop != NULL; prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) { @@ -556,7 +556,7 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp, icalparameter_par attendee = NULL; attendee_clean = NULL; } - + param = icalproperty_get_first_parameter (prop, ICAL_CN_PARAMETER); if (param != NULL) { name = icalparameter_get_cn (param); @@ -569,10 +569,10 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp, icalparameter_par if (priv->delegator_address) { char *delegator_clean; - + delegator_clean = g_strdup (itip_strip_mailto (attendee)); delegator_clean = g_strstrip (delegator_clean); - + /* If the mailer told us the address to use, use that */ if (delegator_clean != NULL && !g_ascii_strcasecmp (attendee_clean, delegator_clean)) { @@ -590,7 +590,7 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp, icalparameter_par it = e_list_get_iterator((EList *)priv->accounts); while (e_iterator_is_valid(it)) { const EAccount *account = e_iterator_get(it); - + /* Check for a matching address */ if (attendee_clean != NULL && !g_ascii_strcasecmp (account->id->address, attendee_clean)) { @@ -605,17 +605,17 @@ find_my_address (EItipControl *itip, icalcomponent *ical_comp, icalparameter_par g_object_unref(it); return; } - + /* Check for a matching cname to fall back on */ - if (name_clean != NULL + if (name_clean != NULL && !g_ascii_strcasecmp (account->id->name, name_clean)) my_alt_address = g_strdup (attendee_clean); - + e_iterator_next(it); } g_object_unref(it); } - + g_free (attendee_clean); g_free (name_clean); } @@ -654,7 +654,7 @@ find_attendee (icalcomponent *ical_comp, const char *address) } g_free (text); } - + return prop; } @@ -789,7 +789,7 @@ write_recurrence_piece (EItipControl *itip, ECalComponent *comp, if (r->by_day[0] == ICAL_RECURRENCE_ARRAY_MAX) { /* For Translators: In this can also be translated as "With the period of %d week/weeks", where %d is a number. The entire sentence is of the form "Recurring: - Every %d week/weeks" */ + Every %d week/weeks" */ /* For Translators : 'Every week' is event Recurring every week */ /* For Translators : 'Every %d weeks' is event Recurring every %d weeks. %d is a digit */ sprintf (buffer, ngettext("Every week", "Every %d weeks", r->interval), r->interval); @@ -837,7 +837,7 @@ write_recurrence_piece (EItipControl *itip, ECalComponent *comp, size -= len; /* For Translators: In this can also be translated as "With the period of %d month/months", where %d is a number. The entire sentence is of the form "Recurring: - Every %d month/months" */ + Every %d month/months" */ /* For Translators : 'every month' is part of the sentence 'event recurring on the (nth) day of every month.' */ /* For Translators : 'every %d months' is part of the sentence 'event recurring on the (nth) day of every %d months.' %d is a digit */ @@ -847,7 +847,7 @@ write_recurrence_piece (EItipControl *itip, ECalComponent *comp, case ICAL_YEARLY_RECURRENCE: /* For Translators: In this can also be translated as "With the period of %d year/years", where %d is a number. The entire sentence is of the form "Recurring: - Every %d year/years" */ + Every %d year/years" */ /* For Translators : 'Every year' is event Recurring every year */ /* For Translators : 'Every %d years' is event Recurring every %d years. %d is a digit */ sprintf (buffer, ngettext("Every year", "Every %d years", r->interval), r->interval); @@ -1035,7 +1035,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, if (priv->html == NULL) return; - + /* Html widget */ html_stream = gtk_html_begin (GTK_HTML (priv->html)); gtk_html_stream_printf (html_stream, @@ -1101,9 +1101,9 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, else html = g_strdup_printf (itip_desc, _("An unknown person")); } - + break; - + case ICAL_METHOD_PUBLISH: case ICAL_METHOD_ADD: case ICAL_METHOD_CANCEL: @@ -1146,28 +1146,28 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, g_free (str); if (text.value) g_free (html); - + /* Location */ e_cal_component_get_location (priv->comp, &string); if (string != NULL) { html = e_text_to_html_full (string, E_TEXT_TO_HTML_CONVERT_NL, 0); - gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>", + gtk_html_stream_printf (html_stream, "<b>%s</b><br>%s<br><br>", _("Location:"), html); g_free (html); } - + /* Status */ if (priv->method == ICAL_METHOD_REPLY) { GSList *alist; e_cal_component_get_attendee_list (priv->comp, &alist); - + if (alist != NULL) { ECalComponentAttendee *a = alist->data; gtk_html_stream_printf (html_stream, "<b>%s</b><br>", _("Status:")); - + switch (a->status) { case ICAL_PARTSTAT_ACCEPTED: gtk_html_stream_printf (html_stream, "%s<br><br>", @@ -1186,10 +1186,10 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, _("Unknown")); } } - + e_cal_component_free_attendee_list (alist); } - + /* Description */ e_cal_component_get_description_list (priv->comp, &l); if (l) @@ -1214,7 +1214,7 @@ write_html (EItipControl *itip, const gchar *itip_desc, const gchar *itip_title, gtk_html_write (GTK_HTML (priv->html), html_stream, options, strlen (options)); } } - + const_html = "</td></tr></table>"; gtk_html_write (GTK_HTML (priv->html), html_stream, const_html, strlen(const_html)); @@ -1259,7 +1259,7 @@ get_refresh_options (void) static char* get_cancel_options (gboolean found, icalcomponent_kind kind) -{ +{ if (!found) { switch (kind) { case ICAL_VEVENT_COMPONENT: @@ -1268,7 +1268,7 @@ get_cancel_options (gboolean found, icalcomponent_kind kind) return g_strdup_printf ("<i>%s</i>", _("The task has been canceled, however it could not be found in your task lists")); default: g_return_val_if_reached (NULL); - } + } } return g_strdup_printf ("<object classid=\"itip:cancel_options\"></object>"); @@ -1276,14 +1276,14 @@ get_cancel_options (gboolean found, icalcomponent_kind kind) static ECalComponent * -get_real_item (EItipControl *itip) +get_real_item (EItipControl *itip) { EItipControlPrivate *priv; ECalComponent *comp; icalcomponent *icalcomp; gboolean found = FALSE; const char *uid; - + priv = itip->priv; e_cal_component_get_uid (priv->comp, &uid); @@ -1306,13 +1306,13 @@ static void adjust_item (EItipControl *itip, ECalComponent *comp) { ECalComponent *real_comp; - + real_comp = get_real_item (itip); if (real_comp != NULL) { ECalComponentText text; const char *string; GSList *l; - + e_cal_component_get_summary (real_comp, &text); e_cal_component_set_summary (comp, &text); e_cal_component_get_location (real_comp, &string); @@ -1320,11 +1320,11 @@ adjust_item (EItipControl *itip, ECalComponent *comp) e_cal_component_get_description_list (real_comp, &l); e_cal_component_set_description_list (comp, l); e_cal_component_free_text_list (l); - + g_object_unref (real_comp); } else { ECalComponentText text = {_("Unknown"), NULL}; - + e_cal_component_set_summary (comp, &text); } } @@ -1336,7 +1336,7 @@ show_current_event (EItipControl *itip) const gchar *itip_title, *itip_desc; char *options; gboolean show_selector = FALSE; - + priv = itip->priv; priv->type = E_CAL_SOURCE_TYPE_EVENT; @@ -1401,7 +1401,7 @@ show_current_event (EItipControl *itip) if (priv->calendar_uid) priv->current_ecal = start_calendar_server_by_uid (itip, priv->calendar_uid, priv->type); - else + else find_server (itip, priv->comp, show_selector); } @@ -1412,7 +1412,7 @@ show_current_todo (EItipControl *itip) const gchar *itip_title, *itip_desc; char *options; gboolean show_selector = FALSE; - + priv = itip->priv; priv->type = E_CAL_SOURCE_TYPE_TODO; @@ -1478,7 +1478,7 @@ show_current_todo (EItipControl *itip) if (priv->calendar_uid) priv->current_ecal = start_calendar_server_by_uid (itip, priv->calendar_uid, priv->type); - else + else find_server (itip, priv->comp, show_selector); } @@ -1529,7 +1529,7 @@ get_next (icalcompiter *iter) if (ret == NULL) break; kind = icalcomponent_isa (ret); - } while (ret != NULL + } while (ret != NULL && kind != ICAL_VEVENT_COMPONENT && kind != ICAL_VTODO_COMPONENT && kind != ICAL_VFREEBUSY_COMPONENT); @@ -1549,7 +1549,7 @@ show_current (EItipControl *itip) priv = itip->priv; g_object_ref (itip); - + if (priv->comp) g_object_unref (priv->comp); priv->current_ecal = NULL; @@ -1573,7 +1573,7 @@ show_current (EItipControl *itip) prop = icalcomponent_get_next_property (priv->ical_comp, ICAL_X_PROPERTY); } - + /* Strip out alarms for security purposes */ alarm_iter = icalcomponent_begin_component (priv->ical_comp, ICAL_VALARM_COMPONENT); while ((alarm_comp = icalcompiter_deref (&alarm_iter)) != NULL) { @@ -1615,10 +1615,10 @@ show_current (EItipControl *itip) case CAL_MINUTES: trigger.u.rel_duration.minutes = interval; break; - case CAL_HOURS: + case CAL_HOURS: trigger.u.rel_duration.hours = interval; break; - case CAL_DAYS: + case CAL_DAYS: trigger.u.rel_duration.days = interval; break; default: @@ -1671,7 +1671,7 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text) gtk_html_load_from_string (GTK_HTML (priv->html), " ", 1); return; } - + priv->vcalendar = g_strdup (text); priv->top_level = e_cal_util_new_top_level (); @@ -1709,7 +1709,7 @@ e_itip_control_set_data (EItipControl *itip, const gchar *text) } if (priv->ical_comp == NULL) { - write_error_html (itip, _("The attachment has no viewable calendar items")); + write_error_html (itip, _("The attachment has no viewable calendar items")); return; } @@ -1877,7 +1877,7 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part icalproperty_add_parameter (prop, param); } else { icalparameter *param; - + if (address != NULL) { prop = icalproperty_new_attendee (address); icalcomponent_add_property (ical_comp, prop); @@ -1891,16 +1891,16 @@ change_status (icalcomponent *ical_comp, const char *address, icalparameter_part EAccount *a; a = itip_addresses_get_default (); - + prop = icalproperty_new_attendee (a->id->address); icalcomponent_add_property (ical_comp, prop); - + param = icalparameter_new_cn (a->id->name); - icalproperty_add_parameter (prop, param); + icalproperty_add_parameter (prop, param); param = icalparameter_new_role (ICAL_ROLE_REQPARTICIPANT); icalproperty_add_parameter (prop, param); - + param = icalparameter_new_partstat (status); icalproperty_add_parameter (prop, param); } @@ -1969,9 +1969,9 @@ update_attendee_status (EItipControl *itip) const char *uid; GtkWidget *dialog; GError *error = NULL; - + priv = itip->priv; - + /* Obtain our version */ e_cal_component_get_uid (priv->comp, &uid); if (e_cal_get_object (priv->current_ecal, uid, NULL, &icalcomp, NULL)) { @@ -2027,7 +2027,7 @@ update_attendee_status (EItipControl *itip) change_status (icalcomp, itip_strip_mailto (a->value), a->status); - e_cal_component_rescan (comp); + e_cal_component_rescan (comp); } } } @@ -2074,7 +2074,7 @@ send_item (EItipControl *itip) priv = itip->priv; comp = get_real_item (itip); - + if (comp != NULL) { itip_send_comp (E_CAL_COMPONENT_METHOD_REQUEST, comp, priv->current_ecal, NULL, NULL, NULL); g_object_unref (comp); @@ -2181,32 +2181,32 @@ url_requested_cb (GtkHTML *html, const gchar *url, GtkHTMLStream *handle, gpoint static void option_activated_cb (GtkWidget *widget, gpointer data) { - EItipControl *itip = E_ITIP_CONTROL (data); + EItipControl *itip = E_ITIP_CONTROL (data); EItipControlPrivate *priv; - + priv = itip->priv; priv->action = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (widget), ACTION_DATA)); } static void -add_option (EItipControl *itip, GtkWidget *menu, const char *text, char action) +add_option (EItipControl *itip, GtkWidget *menu, const char *text, char action) { GtkWidget *item; - + item = gtk_menu_item_new_with_label (text); g_signal_connect (item, "activate", G_CALLBACK (option_activated_cb), itip); g_object_set_data (G_OBJECT (item), ACTION_DATA, GINT_TO_POINTER ((int)action)); gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); gtk_widget_show (item); - + } static void insert_boxes (GtkHTMLEmbedded *eb, EItipControl *itip) { EItipControlPrivate *priv; - + priv = itip->priv; priv->vbox.widget = gtk_vbox_new (FALSE, 12); @@ -2222,39 +2222,39 @@ insert_boxes (GtkHTMLEmbedded *eb, EItipControl *itip) } static void -insert_label (GtkWidget *hbox) +insert_label (GtkWidget *hbox) { GtkWidget *label; char *text; - + text = g_strdup_printf ("<b>%s</b>", _("Choose an action:")); label = gtk_label_new (NULL); gtk_label_set_markup (GTK_LABEL (label), text); g_free (text); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, TRUE, 0); - gtk_widget_show (label); + gtk_widget_show (label); } static void rsvp_clicked_cb (GtkWidget *widget, gpointer data) { - EItipControl *itip = E_ITIP_CONTROL (data); + EItipControl *itip = E_ITIP_CONTROL (data); EItipControlPrivate *priv; - + priv = itip->priv; priv->rsvp = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (widget)); } static void -insert_rsvp (GtkWidget *hbox, EItipControl *itip) +insert_rsvp (GtkWidget *hbox, EItipControl *itip) { EItipControlPrivate *priv; GtkWidget *btn; priv = itip->priv; - + /* To translators: RSVP means "please reply" */ btn = gtk_check_button_new_with_label ("RSVP"); gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (btn), TRUE); @@ -2263,15 +2263,15 @@ insert_rsvp (GtkWidget *hbox, EItipControl *itip) g_signal_connect (btn, "clicked", G_CALLBACK (rsvp_clicked_cb), itip); gtk_box_pack_start (GTK_BOX (hbox), btn, FALSE, TRUE, 0); - gtk_widget_show (btn); + gtk_widget_show (btn); } static void -insert_ok (GtkWidget *hbox, EItipControl *itip) +insert_ok (GtkWidget *hbox, EItipControl *itip) { EItipControlPrivate *priv; priv = itip->priv; - + priv->ok.widget = gtk_button_new_from_stock (GTK_STOCK_OK); g_object_add_weak_pointer (G_OBJECT (priv->ok.widget), &priv->ok.pointer); @@ -2280,7 +2280,7 @@ insert_ok (GtkWidget *hbox, EItipControl *itip) set_ok_sens (itip); gtk_box_pack_start (GTK_BOX (hbox), priv->ok.widget, FALSE, TRUE, 0); - gtk_widget_show (priv->ok.widget); + gtk_widget_show (priv->ok.widget); } static gboolean @@ -2288,19 +2288,19 @@ publish_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; GtkWidget *option, *menu; - + priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); option = gtk_option_menu_new (); - + menu = gtk_menu_new (); add_option (itip, menu, _("Update"), 'U'); priv->action = 'U'; - + gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); gtk_box_pack_start (GTK_BOX (priv->hbox.widget), option, FALSE, TRUE, 0); @@ -2316,21 +2316,21 @@ request_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; GtkWidget *option, *menu; - + priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); - + option = gtk_option_menu_new (); - + menu = gtk_menu_new (); add_option (itip, menu, _("Accept"), 'A'); add_option (itip, menu, _("Tentatively accept"), 'T'); add_option (itip, menu, _("Decline"), 'D'); priv->action = 'A'; - + gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); gtk_box_pack_start (GTK_BOX (priv->hbox.widget), option, FALSE, TRUE, 0); @@ -2347,19 +2347,19 @@ freebusy_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; GtkWidget *option, *menu; - + priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); option = gtk_option_menu_new (); - + menu = gtk_menu_new (); add_option (itip, menu, _("Send Free/Busy Information"), 'F'); priv->action = 'F'; - + gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); @@ -2375,19 +2375,19 @@ reply_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; GtkWidget *option, *menu; - + priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); option = gtk_option_menu_new (); - + menu = gtk_menu_new (); add_option (itip, menu, _("Update respondent status"), 'R'); priv->action = 'R'; - + gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); @@ -2403,19 +2403,19 @@ refresh_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; GtkWidget *option, *menu; - + priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); option = gtk_option_menu_new (); - + menu = gtk_menu_new (); add_option (itip, menu, _("Send Latest Information"), 'S'); priv->action = 'R'; - + gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); @@ -2431,19 +2431,19 @@ cancel_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) { EItipControlPrivate *priv; GtkWidget *option, *menu; - + priv = itip->priv; insert_boxes (eb, itip); insert_label (priv->hbox.widget); option = gtk_option_menu_new (); - + menu = gtk_menu_new (); add_option (itip, menu, _("Cancel"), 'C'); priv->action = 'C'; - + gtk_option_menu_set_menu (GTK_OPTION_MENU (option), menu); gtk_container_add (GTK_CONTAINER (priv->hbox.widget), option); @@ -2455,7 +2455,7 @@ cancel_options_object (EItipControl *itip, GtkHTML *html, GtkHTMLEmbedded *eb) } static gboolean -object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data) +object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data) { EItipControl *itip = E_ITIP_CONTROL (data); @@ -2471,7 +2471,7 @@ object_requested_cb (GtkHTML *html, GtkHTMLEmbedded *eb, gpointer data) return refresh_options_object (itip, html, eb); else if (!strcmp (eb->classid, "itip:cancel_options")) return cancel_options_object (itip, html, eb); - + return FALSE; } @@ -2492,7 +2492,7 @@ ok_clicked_cb (GtkWidget *widget, gpointer data) update_item (itip); break; case 'A': - status = change_status (priv->ical_comp, priv->my_address, + status = change_status (priv->ical_comp, priv->my_address, ICAL_PARTSTAT_ACCEPTED); if (status) { e_cal_component_rescan (priv->comp); @@ -2539,43 +2539,43 @@ ok_clicked_cb (GtkWidget *widget, gpointer data) icalvalue *value; const char *attendee; GSList *l, *list = NULL; - + comp = e_cal_component_clone (priv->comp); if (comp == NULL) return; - + if (priv->my_address == NULL) find_my_address (itip, priv->ical_comp, NULL); g_return_if_fail (priv->my_address != NULL); - + ical_comp = e_cal_component_get_icalcomponent (comp); - + for (prop = icalcomponent_get_first_property (ical_comp, ICAL_ATTENDEE_PROPERTY); prop != NULL; prop = icalcomponent_get_next_property (ical_comp, ICAL_ATTENDEE_PROPERTY)) { char *text; - + value = icalproperty_get_value (prop); if (!value) continue; - + attendee = icalvalue_get_string (value); - + text = g_strdup (itip_strip_mailto (attendee)); text = g_strstrip (text); if (g_ascii_strcasecmp (priv->my_address, text)) list = g_slist_prepend (list, prop); g_free (text); } - + for (l = list; l; l = l->next) { prop = l->data; icalcomponent_remove_property (ical_comp, prop); icalproperty_free (prop); } g_slist_free (list); - + e_cal_component_rescan (comp); itip_send_comp (E_CAL_COMPONENT_METHOD_REPLY, comp, priv->current_ecal, priv->top_level, NULL, NULL); diff --git a/calendar/gui/e-itip-control.h b/calendar/gui/e-itip-control.h index faab0cc8cd..82cc42376c 100644 --- a/calendar/gui/e-itip-control.h +++ b/calendar/gui/e-itip-control.h @@ -59,7 +59,7 @@ gint e_itip_control_get_data_size (EItipControl *itip); void e_itip_control_set_from_address (EItipControl *itip, const gchar *address); const gchar *e_itip_control_get_from_address (EItipControl *itip); -void e_itip_control_set_view_only (EItipControl *itip, +void e_itip_control_set_view_only (EItipControl *itip, gboolean view_only); gboolean e_itip_control_get_view_only (EItipControl *itip); void e_itip_control_set_delegator_address (EItipControl *itip, diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index 269fdf298e..2239ee1b46 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -42,7 +42,7 @@ struct _EMeetingAttendeePrivate { gchar *delfrom; icalparameter_partstat status; - + gchar *sentby; gchar *cn; gchar *language; @@ -58,7 +58,7 @@ struct _EMeetingAttendeePrivate { EMeetingTime busy_periods_end; gboolean start_busy_range_set; gboolean end_busy_range_set; - + gint longest_period_in_days; }; @@ -98,16 +98,16 @@ string_test (gchar *string) } static gboolean -string_is_set (gchar *string) +string_is_set (gchar *string) { if (string != NULL && *string != '\0') return TRUE; - + return FALSE; } static void -notify_changed (EMeetingAttendee *ia) +notify_changed (EMeetingAttendee *ia) { g_signal_emit_by_name (G_OBJECT (ia), "changed"); } @@ -131,16 +131,16 @@ e_meeting_attendee_init (EMeetingAttendee *ia) priv->delto = string_test (NULL); priv->delfrom = string_test (NULL); - + priv->status = ICAL_PARTSTAT_NONE; - + priv->sentby = string_test (NULL); priv->cn = string_test (NULL); priv->language = string_test (NULL); priv->edit_level = E_MEETING_ATTENDEE_EDIT_FULL; priv->has_calendar_info = FALSE; - + priv->busy_periods = g_array_new (FALSE, FALSE, sizeof (EMeetingFreeBusyPeriod)); priv->busy_periods_sorted = FALSE; @@ -154,7 +154,7 @@ e_meeting_attendee_init (EMeetingAttendee *ia) priv->start_busy_range_set = FALSE; priv->end_busy_range_set = FALSE; - + priv->longest_period_in_days = 0; } @@ -177,9 +177,9 @@ e_meeting_attendee_finalize (GObject *obj) g_free (priv->sentby); g_free (priv->cn); g_free (priv->language); - + g_array_free (priv->busy_periods, TRUE); - + g_free (priv); if (G_OBJECT_CLASS (e_meeting_attendee_parent_class)->finalize) @@ -196,7 +196,7 @@ GObject * e_meeting_attendee_new_from_e_cal_component_attendee (ECalComponentAttendee *ca) { EMeetingAttendee *ia; - + ia = E_MEETING_ATTENDEE (g_object_new (E_TYPE_MEETING_ATTENDEE, NULL)); e_meeting_attendee_set_address (ia, g_strdup (ca->value)); @@ -210,7 +210,7 @@ e_meeting_attendee_new_from_e_cal_component_attendee (ECalComponentAttendee *ca) e_meeting_attendee_set_sentby (ia, g_strdup (ca->sentby)); e_meeting_attendee_set_cn (ia, g_strdup (ca->cn)); e_meeting_attendee_set_language (ia, g_strdup (ca->language)); - + return G_OBJECT (ia); } @@ -221,7 +221,7 @@ e_meeting_attendee_as_e_cal_component_attendee (EMeetingAttendee *ia) ECalComponentAttendee *ca; priv = ia->priv; - + ca = g_new0 (ECalComponentAttendee, 1); ca->value = priv->address; @@ -243,9 +243,9 @@ const gchar * e_meeting_attendee_get_fburi (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->fburi; } @@ -253,12 +253,12 @@ void e_meeting_attendee_set_fburi (EMeetingAttendee *ia, gchar *fburi) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->fburi != NULL) g_free (priv->fburi); - + priv->fburi = string_test (fburi); notify_changed (ia); @@ -268,9 +268,9 @@ const gchar * e_meeting_attendee_get_address (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->address; } @@ -278,12 +278,12 @@ void e_meeting_attendee_set_address (EMeetingAttendee *ia, gchar *address) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->address != NULL) g_free (priv->address); - + priv->address = string_test (address); notify_changed (ia); @@ -293,9 +293,9 @@ gboolean e_meeting_attendee_is_set_address (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return string_is_set (priv->address); } @@ -303,9 +303,9 @@ const gchar * e_meeting_attendee_get_member (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->member; } @@ -313,12 +313,12 @@ void e_meeting_attendee_set_member (EMeetingAttendee *ia, gchar *member) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->member != NULL) g_free (priv->member); - + priv->member = string_test (member); notify_changed (ia); @@ -328,7 +328,7 @@ gboolean e_meeting_attendee_is_set_member (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return string_is_set (priv->member); @@ -338,19 +338,19 @@ icalparameter_cutype e_meeting_attendee_get_cutype (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->cutype; } -void +void e_meeting_attendee_set_cutype (EMeetingAttendee *ia, icalparameter_cutype cutype) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + priv->cutype = cutype; notify_changed (ia); @@ -360,9 +360,9 @@ icalparameter_role e_meeting_attendee_get_role (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->role; } @@ -370,21 +370,21 @@ void e_meeting_attendee_set_role (EMeetingAttendee *ia, icalparameter_role role) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + priv->role = role; notify_changed (ia); } -gboolean +gboolean e_meeting_attendee_get_rsvp (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->rsvp; } @@ -392,9 +392,9 @@ void e_meeting_attendee_set_rsvp (EMeetingAttendee *ia, gboolean rsvp) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + priv->rsvp = rsvp; notify_changed (ia); @@ -404,9 +404,9 @@ const gchar * e_meeting_attendee_get_delto (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->delto; } @@ -414,12 +414,12 @@ void e_meeting_attendee_set_delto (EMeetingAttendee *ia, gchar *delto) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->delto != NULL) g_free (priv->delto); - + priv->delto = string_test (delto); notify_changed (ia); @@ -429,7 +429,7 @@ gboolean e_meeting_attendee_is_set_delto (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return string_is_set (priv->delto); @@ -439,9 +439,9 @@ const gchar * e_meeting_attendee_get_delfrom (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->delfrom; } @@ -449,12 +449,12 @@ void e_meeting_attendee_set_delfrom (EMeetingAttendee *ia, gchar *delfrom) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->delfrom != NULL) g_free (priv->delfrom); - + priv->delfrom = string_test (delfrom); notify_changed (ia); @@ -464,7 +464,7 @@ gboolean e_meeting_attendee_is_set_delfrom (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return string_is_set (priv->delfrom); @@ -474,9 +474,9 @@ icalparameter_partstat e_meeting_attendee_get_status (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->status; } @@ -484,9 +484,9 @@ void e_meeting_attendee_set_status (EMeetingAttendee *ia, icalparameter_partstat status) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + priv->status = status; notify_changed (ia); @@ -496,9 +496,9 @@ const gchar * e_meeting_attendee_get_sentby (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->sentby; } @@ -506,12 +506,12 @@ void e_meeting_attendee_set_sentby (EMeetingAttendee *ia, gchar *sentby) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->sentby != NULL) g_free (priv->sentby); - + priv->sentby = string_test (sentby); notify_changed (ia); @@ -521,7 +521,7 @@ gboolean e_meeting_attendee_is_set_sentby (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return string_is_set (priv->sentby); @@ -531,9 +531,9 @@ const gchar * e_meeting_attendee_get_cn (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->cn; } @@ -541,12 +541,12 @@ void e_meeting_attendee_set_cn (EMeetingAttendee *ia, gchar *cn) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->cn != NULL) g_free (priv->cn); - + priv->cn = string_test (cn); notify_changed (ia); @@ -556,7 +556,7 @@ gboolean e_meeting_attendee_is_set_cn (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return string_is_set (priv->cn); @@ -566,9 +566,9 @@ const gchar * e_meeting_attendee_get_language (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->language; } @@ -576,12 +576,12 @@ void e_meeting_attendee_set_language (EMeetingAttendee *ia, gchar *language) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + if (priv->language != NULL) g_free (priv->language); - + priv->language = string_test (language); notify_changed (ia); @@ -591,7 +591,7 @@ gboolean e_meeting_attendee_is_set_language (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return string_is_set (priv->language); @@ -601,7 +601,7 @@ EMeetingAttendeeType e_meeting_attendee_get_atype (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; if (priv->cutype == ICAL_CUTYPE_ROOM @@ -611,7 +611,7 @@ e_meeting_attendee_get_atype (EMeetingAttendee *ia) if (priv->role == ICAL_ROLE_CHAIR || priv->role == ICAL_ROLE_REQPARTICIPANT) return E_MEETING_ATTENDEE_REQUIRED_PERSON; - + return E_MEETING_ATTENDEE_OPTIONAL_PERSON; } @@ -620,7 +620,7 @@ EMeetingAttendeeEditLevel e_meeting_attendee_get_edit_level (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + g_return_val_if_fail (ia != NULL, E_MEETING_ATTENDEE_EDIT_NONE); g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), E_MEETING_ATTENDEE_EDIT_NONE); @@ -629,11 +629,11 @@ e_meeting_attendee_get_edit_level (EMeetingAttendee *ia) return priv->edit_level; } -void +void e_meeting_attendee_set_edit_level (EMeetingAttendee *ia, EMeetingAttendeeEditLevel level) { EMeetingAttendeePrivate *priv; - + g_return_if_fail (ia != NULL); g_return_if_fail (E_IS_MEETING_ATTENDEE (ia)); @@ -684,7 +684,7 @@ static void ensure_periods_sorted (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; if (priv->busy_periods_sorted) @@ -701,7 +701,7 @@ gboolean e_meeting_attendee_get_has_calendar_info (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return priv->has_calendar_info; @@ -711,7 +711,7 @@ void e_meeting_attendee_set_has_calendar_info (EMeetingAttendee *ia, gboolean has_calendar_info) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; priv->has_calendar_info = has_calendar_info; @@ -721,12 +721,12 @@ const GArray * e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; ensure_periods_sorted (ia); - - return priv->busy_periods; + + return priv->busy_periods; } gint @@ -738,7 +738,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) GDate tmp_date; priv = ia->priv; - + /* Make sure the busy periods have been sorted. */ ensure_periods_sorted (ia); @@ -756,12 +756,12 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) while (lower < upper) { middle = (lower + upper) >> 1; - + period = &g_array_index (priv->busy_periods, EMeetingFreeBusyPeriod, middle); cmp = g_date_compare (&tmp_date, &period->start.date); - + if (cmp == 0) break; else if (cmp < 0) @@ -793,7 +793,7 @@ e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date) } gboolean -e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, +e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, gint start_year, gint start_month, gint start_day, @@ -816,7 +816,7 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, g_return_val_if_fail (busy_type < E_MEETING_FREE_BUSY_LAST, FALSE); priv = ia->priv; - + /* Check the dates are valid. */ if (!g_date_valid_dmy (start_day, start_month, start_year)) return FALSE; @@ -850,13 +850,13 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, if (!g_date_valid (&priv->busy_periods_start.date)) { priv->busy_periods_start.date = period.start.date; priv->busy_periods_start.hour = period.start.hour; - priv->busy_periods_start.minute = period.start.minute; + priv->busy_periods_start.minute = period.start.minute; } else { switch (g_date_compare (&period.start.date, &priv->busy_periods_start.date)) { case -1: priv->busy_periods_start.date = period.start.date; priv->busy_periods_start.hour = period.start.hour; - priv->busy_periods_start.minute = period.start.minute; + priv->busy_periods_start.minute = period.start.minute; break; case 0: if (period.start.hour < priv->busy_periods_start.hour @@ -864,7 +864,7 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, && period.start.minute < priv->busy_periods_start.minute)) { priv->busy_periods_start.date = period.start.date; priv->busy_periods_start.hour = period.start.hour; - priv->busy_periods_start.minute = period.start.minute; + priv->busy_periods_start.minute = period.start.minute; break; } break; @@ -875,7 +875,7 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, if (!g_date_valid (&priv->busy_periods_end.date)) { priv->busy_periods_end.date = period.end.date; priv->busy_periods_end.hour = period.end.hour; - priv->busy_periods_end.minute = period.end.minute; + priv->busy_periods_end.minute = period.end.minute; } else { switch (g_date_compare (&period.end.date, &priv->busy_periods_end.date)) { case 0: @@ -884,19 +884,19 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, && period.end.minute > priv->busy_periods_end.minute)) { priv->busy_periods_end.date = period.end.date; priv->busy_periods_end.hour = period.end.hour; - priv->busy_periods_end.minute = period.end.minute; + priv->busy_periods_end.minute = period.end.minute; break; } break; case 1: priv->busy_periods_end.date = period.end.date; priv->busy_periods_end.hour = period.end.hour; - priv->busy_periods_end.minute = period.end.minute; + priv->busy_periods_end.minute = period.end.minute; break; } } } - + g_array_append_val (priv->busy_periods, period); priv->has_calendar_info = TRUE; priv->busy_periods_sorted = FALSE; @@ -911,7 +911,7 @@ EMeetingTime e_meeting_attendee_get_start_busy_range (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; return priv->busy_periods_start; @@ -921,9 +921,9 @@ EMeetingTime e_meeting_attendee_get_end_busy_range (EMeetingAttendee *ia) { EMeetingAttendeePrivate *priv; - + priv = ia->priv; - + return priv->busy_periods_end; } @@ -936,11 +936,11 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, gint start_minute) { EMeetingAttendeePrivate *priv; - + g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE); priv = ia->priv; - + /* Check the dates are valid. */ if (!g_date_valid_dmy (start_day, start_month, start_year)) return FALSE; @@ -956,7 +956,7 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, priv->busy_periods_start.minute = start_minute; priv->start_busy_range_set = TRUE; - + return TRUE; } @@ -969,11 +969,11 @@ e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia, gint end_minute) { EMeetingAttendeePrivate *priv; - + g_return_val_if_fail (E_IS_MEETING_ATTENDEE (ia), FALSE); priv = ia->priv; - + /* Check the dates are valid. */ if (!g_date_valid_dmy (end_day, end_month, end_year)) return FALSE; @@ -989,7 +989,7 @@ e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia, priv->busy_periods_end.minute = end_minute; priv->end_busy_range_set = TRUE; - + return TRUE; } @@ -1002,7 +1002,7 @@ e_meeting_attendee_clear_busy_periods (EMeetingAttendee *ia) g_return_if_fail (E_IS_MEETING_ATTENDEE (ia)); priv = ia->priv; - + g_array_set_size (priv->busy_periods, 0); priv->busy_periods_sorted = TRUE; diff --git a/calendar/gui/e-meeting-attendee.h b/calendar/gui/e-meeting-attendee.h index 56f66123e5..5c8dc98e81 100644 --- a/calendar/gui/e-meeting-attendee.h +++ b/calendar/gui/e-meeting-attendee.h @@ -137,7 +137,7 @@ void e_meeting_attendee_set_fburi (EMeetingAttendee *ia, gchar *fburi); const GArray *e_meeting_attendee_get_busy_periods (EMeetingAttendee *ia); gint e_meeting_attendee_find_first_busy_period (EMeetingAttendee *ia, GDate *date); -gboolean e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, +gboolean e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, gint start_year, gint start_month, gint start_day, diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 235e988907..8d1a97208d 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -1,4 +1,4 @@ -/* +/* * e-meeting-list-view.c * * Authors: Mike Kestner <mkestner@ximian.com> @@ -67,9 +67,9 @@ static guint e_meeting_list_view_signals[LAST_SIGNAL] = { 0 }; static void name_selector_dialog_close_cb (ENameSelectorDialog *dialog, gint response, gpointer data); -static char *sections[] = {N_("Chair Persons"), - N_("Required Participants"), - N_("Optional Participants"), +static char *sections[] = {N_("Chair Persons"), + N_("Required Participants"), + N_("Optional Participants"), N_("Resources"), NULL}; static icalparameter_role roles[] = {ICAL_ROLE_CHAIR, @@ -111,14 +111,14 @@ e_meeting_list_view_class_init (EMeetingListViewClass *klass) object_class->finalize = e_meeting_list_view_finalize; - e_meeting_list_view_signals [ATTENDEE_ADDED] = - g_signal_new ("attendee_added", + e_meeting_list_view_signals [ATTENDEE_ADDED] = + g_signal_new ("attendee_added", G_TYPE_FROM_CLASS (klass), G_SIGNAL_RUN_LAST, G_STRUCT_OFFSET (EMeetingListViewClass, attendee_added), NULL, NULL, g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, + G_TYPE_NONE, 1, G_TYPE_POINTER); } @@ -142,7 +142,7 @@ e_meeting_list_view_init (EMeetingListView *view) priv = g_new0 (EMeetingListViewPrivate, 1); view->priv = priv; - + priv->renderers = g_hash_table_new (g_direct_hash, g_int_equal); priv->name_selector = e_name_selector_new (); @@ -216,12 +216,12 @@ value_edited (GtkTreeView *view, gint col, const gchar *path, const gchar *text) EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *treepath = gtk_tree_path_new_from_string (path); int row = gtk_tree_path_get_indices (treepath)[0]; - + e_meeting_store_set_value (model, row, col, text); gtk_tree_path_free (treepath); } -static guint +static guint get_index_from_role (icalparameter_role role) { switch (role) { @@ -238,7 +238,7 @@ get_index_from_role (icalparameter_role role) } } -void +void e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, EMeetingAttendee *ma) { EDestinationStore *destination_store; @@ -260,7 +260,7 @@ e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, EMeet g_object_unref (des); } -void +void e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, EMeetingAttendee *ma) { GList *destinations, *l; @@ -269,18 +269,18 @@ e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, const char *madd = NULL; EMeetingListViewPrivate *priv; guint i = 1; - + priv = view->priv; - + name_selector_model = e_name_selector_peek_model (priv->name_selector); i = get_index_from_role (e_meeting_attendee_get_role (ma)); e_name_selector_model_peek_section (name_selector_model, sections [i], NULL, &destination_store); destinations = e_destination_store_list_destinations (destination_store); madd = itip_strip_mailto (e_meeting_attendee_get_address (ma)); - + for (l = destinations; l; l = g_list_next (l)) { - const char *attendee = NULL; + const char *attendee = NULL; EDestination *des = l->data; @@ -299,14 +299,14 @@ e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, } } else { attendee = e_destination_get_email (des); - + if (madd && attendee && g_str_equal (madd, attendee)) { attendee = e_destination_get_email (des); e_destination_store_remove_destination (destination_store, des); } } } - + g_list_free (destinations); } @@ -327,13 +327,13 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address for (l = addresses, m = names; l && m; l = l->next, m = m->next) { char *name = m->data, *email = l->data; - - if (!((name && *name) || (email && *email))) + + if (!((name && *name) || (email && *email))) continue; - + if (e_meeting_store_find_attendee (model, email, NULL) != NULL) continue; - + attendee = e_meeting_store_add_attendee_with_defaults (model); e_meeting_attendee_set_address (attendee, g_strdup_printf ("MAILTO:%s", (char *)l->data)); e_meeting_attendee_set_cn (attendee, g_strdup (m->data)); @@ -354,7 +354,7 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address existing_attendee); e_meeting_store_remove_attendee (model, existing_attendee); } - + } else if (g_list_length (addresses) == 1) { char *name = names->data, *email = addresses->data; int existing_row; @@ -385,7 +385,7 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address } else { if (existing_attendee) { const char *address = e_meeting_attendee_get_address (existing_attendee); - + if (address && *address) return; @@ -398,12 +398,12 @@ attendee_edited_cb (GtkCellRenderer *renderer, const gchar *path, GList *address gtk_tree_path_free (treepath); - if (!removed) - g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) existing_attendee); + if (!removed) + g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) existing_attendee); } static void -attendee_editing_canceled_cb (GtkCellRenderer *renderer, GtkTreeView *view) +attendee_editing_canceled_cb (GtkCellRenderer *renderer, GtkTreeView *view) { EMeetingStore *model = E_MEETING_STORE (gtk_tree_view_get_model (view)); GtkTreePath *path; @@ -414,14 +414,14 @@ attendee_editing_canceled_cb (GtkCellRenderer *renderer, GtkTreeView *view) gtk_tree_view_get_cursor (view, &path, NULL); if (!path) return; - + row = gtk_tree_path_get_indices (path)[0]; existing_attendee = e_meeting_store_find_attendee_at_row (model, row); if (existing_attendee) { if (!e_meeting_attendee_is_set_cn (existing_attendee) && !e_meeting_attendee_is_set_address (existing_attendee)) e_meeting_store_remove_attendee (model, existing_attendee); } - + gtk_tree_path_free (path); } @@ -472,7 +472,7 @@ build_table (EMeetingListView *lview) GHashTable *edit_table; GtkTreeViewColumn *col; int pos; - + priv = lview->priv; edit_table = priv->renderers; gtk_tree_view_set_headers_visible (view, TRUE); @@ -493,8 +493,8 @@ build_table (EMeetingListView *lview) g_object_set (col, "min-width", 50, NULL); g_signal_connect (renderer, "cell_edited", G_CALLBACK (attendee_edited_cb), view); g_signal_connect (renderer, "editing-canceled", G_CALLBACK (attendee_editing_canceled_cb), view); - g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL), renderer); - + g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL), renderer); + renderer = e_cell_renderer_combo_new (); g_object_set (G_OBJECT (renderer), "list", get_type_strings (), "editable", TRUE, NULL); pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Type"), renderer, @@ -504,8 +504,8 @@ build_table (EMeetingListView *lview) gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable(col, TRUE); g_signal_connect (renderer, "edited", G_CALLBACK (type_edited_cb), view); - g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL), renderer); - + g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL), renderer); + renderer = e_cell_renderer_combo_new (); g_object_set (G_OBJECT (renderer), "list", get_role_strings (), "editable", TRUE, NULL); pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Role"), renderer, @@ -539,7 +539,7 @@ build_table (EMeetingListView *lview) gtk_tree_view_column_set_reorderable(col, TRUE); g_signal_connect (renderer, "edited", G_CALLBACK (status_edited_cb), view); g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_STATUS_COL), renderer); - + priv->renderers = edit_table; } @@ -568,11 +568,11 @@ change_edit_cols_for_user (gpointer key, gpointer value, gpointer user_data) } } -static void +static void change_edit_cols_for_organizer (gpointer key, gpointer value, gpointer user_data) { GtkCellRenderer *renderer = (GtkCellRenderer *) value; - guint edit_level = GPOINTER_TO_INT (user_data); + guint edit_level = GPOINTER_TO_INT (user_data); g_object_set (G_OBJECT (renderer), "editable", GINT_TO_POINTER (edit_level), NULL); } @@ -584,45 +584,45 @@ row_activated_cb (GtkTreeSelection *selection, EMeetingListView *view) int row; EMeetingAttendeeEditLevel el; gint edit_level; - GtkTreeModel *model; + GtkTreeModel *model; GtkTreePath *path = NULL; GList *paths=NULL; priv = view->priv; - - if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) + + if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) return; if (g_list_length (paths) > 1) return; path = g_list_nth_data (paths, 0); if (!path) return; - + row = gtk_tree_path_get_indices (path)[0]; existing_attendee = e_meeting_store_find_attendee_at_row (priv->store, row); el = e_meeting_attendee_get_edit_level (existing_attendee); - + switch (el) { case E_MEETING_ATTENDEE_EDIT_NONE: edit_level = FALSE; g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); break; - + case E_MEETING_ATTENDEE_EDIT_FULL: edit_level = TRUE; g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); break; - + case E_MEETING_ATTENDEE_EDIT_STATUS: edit_level = FALSE; g_hash_table_foreach (priv->renderers, change_edit_cols_for_user, GINT_TO_POINTER (edit_level)); break; } - + } - + EMeetingListView * e_meeting_list_view_new (EMeetingStore *store) @@ -664,7 +664,7 @@ e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *attendee) EMeetingListViewPrivate *priv; GtkTreePath *path; GtkTreeViewColumn *focus_col; - + priv = emlv->priv; g_return_if_fail (emlv != NULL); @@ -672,13 +672,13 @@ e_meeting_list_view_edit (EMeetingListView *emlv, EMeetingAttendee *attendee) g_return_if_fail (attendee != NULL); path = e_meeting_store_find_attendee_path (priv->store, attendee); - focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (emlv), 0); - + focus_col = gtk_tree_view_get_column (GTK_TREE_VIEW (emlv), 0); + if (path) { gtk_tree_view_set_cursor (GTK_TREE_VIEW (emlv), path, focus_col, TRUE); gtk_tree_path_free (path); - } + } } static void @@ -717,16 +717,16 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role break; } } - + if (book) { GList *contacts; EContact *n_con = NULL; char *qu; EBookQuery *query; - qu = g_strdup_printf ("(is \"full_name\" \"%s\")", + qu = g_strdup_printf ("(is \"full_name\" \"%s\")", (char *) e_contact_get (contact, E_CONTACT_FULL_NAME)); - query = e_book_query_from_string (qu); + query = e_book_query_from_string (qu); if (!e_book_get_contacts (book, query, &contacts, NULL)) { g_warning ("Could not get contact from the book \n"); @@ -738,7 +738,7 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role e_destination_set_contact (des, n_con, 0); list_dests = e_destination_list_get_dests (des); - g_list_foreach (contacts, (GFunc) g_object_unref, NULL); + g_list_foreach (contacts, (GFunc) g_object_unref, NULL); g_list_free (contacts); } @@ -752,14 +752,14 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role card_dest.data = destination; list_dests = &card_dest; } - } - + } + for (l = list_dests; l; l = l->next) { EDestination *dest = l->data; EContact *contact; const char *name, *attendee = NULL; char *attr = NULL, *fburi = NULL; - + name = e_destination_get_name (dest); /* Get the field as attendee from the backend */ @@ -786,12 +786,12 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role if (attendee == NULL || *attendee == '\0') continue; - + contact = e_destination_get_contact (dest); - if (contact) + if (contact) fburi = e_contact_get (contact, E_CONTACT_FREEBUSY_URL); - - + + if (e_meeting_store_find_attendee (priv->store, attendee, NULL) == NULL) { EMeetingAttendee *ia = e_meeting_store_add_attendee_with_defaults (priv->store); @@ -800,7 +800,7 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role if (role == ICAL_ROLE_NONPARTICIPANT) e_meeting_attendee_set_cutype (ia, ICAL_CUTYPE_RESOURCE); e_meeting_attendee_set_cn (ia, g_strdup (name)); - + if (fburi) e_meeting_attendee_set_fburi (ia, fburi); } else { @@ -816,7 +816,7 @@ process_section (EMeetingListView *view, GList *destinations, icalparameter_role g_object_unref (des); des = NULL; } - + } } @@ -841,10 +841,10 @@ name_selector_dialog_close_cb (ENameSelectorDialog *dialog, gint response, gpoin name_selector_model = e_name_selector_peek_model (view->priv->name_selector); store = E_MEETING_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (view))); attendees = e_meeting_store_get_attendees (store); - + /* get all the email ids of the attendees */ g_ptr_array_foreach ((GPtrArray *)attendees, (GFunc) add_to_list, &la); - + for (i = 0; sections[i] != NULL; i++) { EDestinationStore *destination_store; GList *destinations; @@ -886,7 +886,7 @@ e_meeting_list_view_invite_others_dialog (EMeetingListView *view) gtk_widget_show (GTK_WIDGET (dialog)); } -void +void e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set) { EMeetingListViewPrivate *priv = lview->priv; @@ -896,24 +896,24 @@ e_meeting_list_view_set_editable (EMeetingListView *lview, gboolean set) g_hash_table_foreach (priv->renderers, change_edit_cols_for_organizer, GINT_TO_POINTER (edit_level)); } -ENameSelector * -e_meeting_list_view_get_name_selector (EMeetingListView *lview) +ENameSelector * +e_meeting_list_view_get_name_selector (EMeetingListView *lview) { EMeetingListViewPrivate *priv; - + g_return_val_if_fail (lview != NULL, NULL); g_return_val_if_fail (E_IS_MEETING_LIST_VIEW (lview), NULL); priv = lview->priv; - return priv->name_selector; + return priv->name_selector; } void e_meeting_list_view_set_name_selector (EMeetingListView *lview, ENameSelector *name_selector) { EMeetingListViewPrivate *priv; - + g_return_if_fail (lview != NULL); g_return_if_fail (E_IS_MEETING_LIST_VIEW (lview)); @@ -923,7 +923,7 @@ e_meeting_list_view_set_name_selector (EMeetingListView *lview, ENameSelector *n g_object_unref (priv->name_selector); priv->name_selector = NULL; } - + priv->name_selector = g_object_ref (name_selector); } diff --git a/calendar/gui/e-meeting-list-view.h b/calendar/gui/e-meeting-list-view.h index fc49fe6014..f565381382 100644 --- a/calendar/gui/e-meeting-list-view.h +++ b/calendar/gui/e-meeting-list-view.h @@ -1,4 +1,4 @@ -/* +/* * e-meeting-list-view.h * * Author: Mike Kestner <mkestner@ximian.com> diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 65a4930d57..2703836049 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -1,4 +1,4 @@ -/* +/* * e-meeting-store.c * * Copyright (C) 2001-2003 Ximian, Inc. @@ -47,7 +47,7 @@ struct _EMeetingStorePrivate { ECal *client; icaltimezone *zone; - + char *fb_uri; GPtrArray *refresh_queue; @@ -67,13 +67,13 @@ struct _EMeetingStoreQueueData { EMeetingAttendee *attendee; gboolean refreshing; - + EMeetingTime start; EMeetingTime end; char buffer[BUF_SIZE]; GString *string; - + GPtrArray *call_backs; GPtrArray *data; }; @@ -134,7 +134,7 @@ text_to_role (const char *role) } static char * -role_to_text (icalparameter_role role) +role_to_text (icalparameter_role role) { switch (role) { case ICAL_ROLE_CHAIR: @@ -160,7 +160,7 @@ text_to_boolean (const char *role) } static char * -boolean_to_text (gboolean b) +boolean_to_text (gboolean b) { if (b) return _("Yes"); @@ -190,7 +190,7 @@ text_to_partstat (const char *partstat) } static char * -partstat_to_text (icalparameter_partstat partstat) +partstat_to_text (icalparameter_partstat partstat) { switch (partstat) { case ICAL_PARTSTAT_NEEDSACTION: @@ -290,7 +290,7 @@ get_path (GtkTreeModel *model, GtkTreeIter *iter) gtk_tree_path_append_index (result, row); return result; } - + static void get_value (GtkTreeModel *model, GtkTreeIter *iter, int col, GValue *value) { @@ -303,13 +303,13 @@ get_value (GtkTreeModel *model, GtkTreeIter *iter, int col, GValue *value) g_return_if_fail (col >= 0 && col < E_MEETING_STORE_COLUMN_COUNT); row = GPOINTER_TO_INT (iter->user_data); - store = E_MEETING_STORE (model); + store = E_MEETING_STORE (model); g_return_if_fail (iter->stamp == store->priv->stamp); g_return_if_fail (ROW_VALID (E_MEETING_STORE (model), row)); attendee = g_ptr_array_index (store->priv->attendees, row); - + switch (col) { case E_MEETING_STORE_ADDRESS_COL: g_value_init (value, G_TYPE_STRING); @@ -387,14 +387,14 @@ iter_children (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent) g_return_val_if_fail (E_IS_MEETING_STORE (model), FALSE); - store = E_MEETING_STORE (model); + store = E_MEETING_STORE (model); if (parent || store->priv->attendees->len <= 0) return FALSE; iter->stamp = store->priv->stamp; iter->user_data = GINT_TO_POINTER (0); - + return TRUE; } @@ -408,7 +408,7 @@ static int iter_n_children (GtkTreeModel *model, GtkTreeIter *iter) { g_return_val_if_fail (E_IS_MEETING_STORE (model), -1); - + if (!iter) return E_MEETING_STORE (model)->priv->attendees->len; @@ -424,7 +424,7 @@ iter_nth_child (GtkTreeModel *model, GtkTreeIter *iter, GtkTreeIter *parent, int g_return_val_if_fail (E_IS_MEETING_STORE (model), FALSE); - store = E_MEETING_STORE (model); + store = E_MEETING_STORE (model); if (parent || !ROW_VALID (store, n)) return FALSE; @@ -477,7 +477,7 @@ e_meeting_store_set_value (EMeetingStore *store, int row, int col, const gchar * e_meeting_attendee_set_cutype (attendee, text_to_type (val)); if (type == ICAL_CUTYPE_RESOURCE) { e_meeting_attendee_set_role (attendee, ICAL_ROLE_NONPARTICIPANT); - } + } break; case E_MEETING_STORE_ROLE_COL: e_meeting_attendee_set_role (attendee, text_to_role (val)); @@ -504,13 +504,13 @@ e_meeting_store_set_value (EMeetingStore *store, int row, int col, const gchar * } static void -refresh_queue_remove (EMeetingStore *store, EMeetingAttendee *attendee) +refresh_queue_remove (EMeetingStore *store, EMeetingAttendee *attendee) { EMeetingStorePrivate *priv; EMeetingStoreQueueData *qdata; - + priv = store->priv; - + /* Free the queue data */ qdata = g_hash_table_lookup (priv->refresh_data, itip_strip_mailto (e_meeting_attendee_get_address (attendee))); if (qdata) { @@ -533,12 +533,12 @@ ems_finalize (GObject *obj) EMeetingStore *store = E_MEETING_STORE (obj); EMeetingStorePrivate *priv; int i; - + priv = store->priv; for (i = 0; i < priv->attendees->len; i++) g_object_unref (g_ptr_array_index (priv->attendees, i)); - g_ptr_array_free (priv->attendees, TRUE); + g_ptr_array_free (priv->attendees, TRUE); if (priv->client != NULL) g_object_unref (priv->client); @@ -547,7 +547,7 @@ ems_finalize (GObject *obj) refresh_queue_remove (store, g_ptr_array_index (priv->refresh_queue, 0)); g_ptr_array_free (priv->refresh_queue, TRUE); g_hash_table_destroy (priv->refresh_data); - + if (priv->refresh_idle_id) g_source_remove (priv->refresh_idle_id); @@ -580,11 +580,11 @@ ems_init (EMeetingStore *store) store->priv = priv; priv->attendees = g_ptr_array_new (); - + priv->zone = calendar_config_get_icaltimezone (); priv->fb_uri = calendar_config_get_free_busy_template (); - + priv->refresh_queue = g_ptr_array_new (); priv->refresh_data = g_hash_table_new (g_str_hash, g_str_equal); @@ -609,18 +609,18 @@ e_meeting_store_get_type (void) sizeof (EMeetingStore), 0, (GInstanceInitFunc) ems_init }; - + static const GInterfaceInfo tree_model_info = { (GInterfaceInitFunc) ems_tree_model_init, NULL, NULL }; - - ems_type = g_type_register_static (GTK_TYPE_LIST_STORE, + + ems_type = g_type_register_static (GTK_TYPE_LIST_STORE, "EMeetingStore", &ems_info, 0); - - g_type_add_interface_static (ems_type, - GTK_TYPE_TREE_MODEL, + + g_type_add_interface_static (ems_type, + GTK_TYPE_TREE_MODEL, &tree_model_info); } @@ -645,7 +645,7 @@ e_meeting_store_set_e_cal (EMeetingStore *store, ECal *client) { if (store->priv->client != NULL) g_object_unref (store->priv->client); - + if (client != NULL) g_object_ref (client); store->priv->client = client; @@ -668,14 +668,14 @@ e_meeting_store_set_zone (EMeetingStore *store, icaltimezone *zone) } gchar * -e_meeting_store_get_fb_uri (EMeetingStore *store) +e_meeting_store_get_fb_uri (EMeetingStore *store) { g_return_val_if_fail (E_IS_MEETING_STORE (store), NULL); return g_strdup (store->priv->fb_uri); } -void +void e_meeting_store_set_fb_uri (EMeetingStore *store, const gchar *fb_uri) { g_return_if_fail (E_IS_MEETING_STORE (store)); @@ -691,14 +691,14 @@ attendee_changed_cb (EMeetingAttendee *attendee, gpointer data) GtkTreePath *path; GtkTreeIter iter; gint row = -1, i; - + for (i = 0; i < store->priv->attendees->len; i++) { if (attendee == g_ptr_array_index (store->priv->attendees, i)) { row = i; break; } } - + if (row == -1) return; @@ -734,7 +734,7 @@ e_meeting_store_add_attendee_with_defaults (EMeetingStore *store) { EMeetingAttendee *attendee; char *str; - + attendee = E_MEETING_ATTENDEE (e_meeting_attendee_new ()); e_meeting_attendee_set_address (attendee, g_strdup ("")); @@ -745,11 +745,11 @@ e_meeting_store_add_attendee_with_defaults (EMeetingStore *store) g_free (str); str = g_strdup (_("Required Participant")); e_meeting_attendee_set_role (attendee, text_to_role (str)); - g_free (str); + g_free (str); str = g_strdup (_("Yes")); e_meeting_attendee_set_rsvp (attendee, text_to_boolean (str)); g_free (str); - + e_meeting_attendee_set_delto (attendee, g_strdup ("")); e_meeting_attendee_set_delfrom (attendee, g_strdup ("")); @@ -776,11 +776,11 @@ e_meeting_store_remove_attendee (EMeetingStore *store, EMeetingAttendee *attende row = i; break; } - } - + } + if (row != -1) { - g_ptr_array_remove_index (store->priv->attendees, row); + g_ptr_array_remove_index (store->priv->attendees, row); g_object_unref (attendee); path = gtk_tree_path_new (); @@ -815,15 +815,15 @@ e_meeting_store_find_attendee (EMeetingStore *store, const gchar *address, gint { EMeetingAttendee *attendee; int i; - + if (address == NULL) return NULL; - + for (i = 0; i < store->priv->attendees->len; i++) { const gchar *attendee_address; - + attendee = g_ptr_array_index (store->priv->attendees, i); - + attendee_address = e_meeting_attendee_get_address (attendee); if (attendee_address && !g_ascii_strcasecmp (itip_strip_mailto (attendee_address), itip_strip_mailto (address))) { if (row != NULL) @@ -850,29 +850,29 @@ e_meeting_store_find_attendee_path (EMeetingStore *store, EMeetingAttendee *atte { GtkTreePath *path; gint row = -1, i; - + for (i = 0; i < store->priv->attendees->len; i++) { if (attendee == g_ptr_array_index (store->priv->attendees, i)) { row = i; break; } } - + if (row == -1) return NULL; path = gtk_tree_path_new (); gtk_tree_path_append_index (path, row); - return path; + return path; } -gint +gint e_meeting_store_count_actual_attendees (EMeetingStore *store) { g_return_val_if_fail (E_IS_MEETING_STORE (store), 0); - return store->priv->attendees->len; + return store->priv->attendees->len; } const GPtrArray * @@ -893,7 +893,7 @@ find_zone (icalproperty *ip, icalcomponent *tz_top_level) if (tz_top_level == NULL) return NULL; - + param = icalproperty_get_first_parameter (ip, ICAL_TZID_PARAMETER); if (param == NULL) return NULL; @@ -913,10 +913,10 @@ find_zone (icalproperty *ip, icalcomponent *tz_top_level) zone = icaltimezone_new (); clone = icalcomponent_new_clone (sub_comp); icaltimezone_set_component (zone, clone); - + return zone; } - + icalcompiter_next (&iter); } @@ -924,7 +924,7 @@ find_zone (icalproperty *ip, icalcomponent *tz_top_level) } static void -process_callbacks (EMeetingStoreQueueData *qdata) +process_callbacks (EMeetingStoreQueueData *qdata) { EMeetingStore *store; int i; @@ -937,7 +937,7 @@ process_callbacks (EMeetingStoreQueueData *qdata) call_back = g_ptr_array_index (qdata->call_backs, i); data = g_ptr_array_index (qdata->data, i); - + g_idle_add ((GSourceFunc) call_back, data); } @@ -956,12 +956,12 @@ process_free_busy_comp (EMeetingAttendee *attendee, icalcomponent *tz_top_level) { icalproperty *ip; - + ip = icalcomponent_get_first_property (fb_comp, ICAL_DTSTART_PROPERTY); if (ip != NULL) { struct icaltimetype dtstart; icaltimezone *ds_zone; - + dtstart = icalproperty_get_dtstart (ip); if (!dtstart.is_utc) ds_zone = find_zone (ip, tz_top_level); @@ -975,12 +975,12 @@ process_free_busy_comp (EMeetingAttendee *attendee, dtstart.hour, dtstart.minute); } - + ip = icalcomponent_get_first_property (fb_comp, ICAL_DTEND_PROPERTY); if (ip != NULL) { struct icaltimetype dtend; icaltimezone *de_zone; - + dtend = icalproperty_get_dtend (ip); if (!dtend.is_utc) de_zone = find_zone (ip, tz_top_level); @@ -994,19 +994,19 @@ process_free_busy_comp (EMeetingAttendee *attendee, dtend.hour, dtend.minute); } - + ip = icalcomponent_get_first_property (fb_comp, ICAL_FREEBUSY_PROPERTY); while (ip != NULL) { icalparameter *param; struct icalperiodtype fb; EMeetingFreeBusyType busy_type = E_MEETING_FREE_BUSY_LAST; icalparameter_fbtype fbtype = ICAL_FBTYPE_BUSY; - + fb = icalproperty_get_freebusy (ip); param = icalproperty_get_first_parameter (ip, ICAL_FBTYPE_PARAMETER); if (param != NULL) fbtype = icalparameter_get_fbtype (param); - + switch (fbtype) { case ICAL_FBTYPE_BUSY: busy_type = E_MEETING_FREE_BUSY_BUSY; @@ -1023,7 +1023,7 @@ process_free_busy_comp (EMeetingAttendee *attendee, default: break; } - + if (busy_type != E_MEETING_FREE_BUSY_LAST) { icaltimezone *utc_zone = icaltimezone_get_utc_timezone (); @@ -1042,7 +1042,7 @@ process_free_busy_comp (EMeetingAttendee *attendee, fb.end.minute, busy_type); } - + ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY); } } @@ -1065,19 +1065,19 @@ process_free_busy (EMeetingStoreQueueData *qdata, char *text) } kind = icalcomponent_isa (main_comp); - if (kind == ICAL_VCALENDAR_COMPONENT) { + if (kind == ICAL_VCALENDAR_COMPONENT) { icalcompiter iter; icalcomponent *tz_top_level, *sub_comp; tz_top_level = e_cal_util_new_top_level (); - + iter = icalcomponent_begin_component (main_comp, ICAL_VTIMEZONE_COMPONENT); while ((sub_comp = icalcompiter_deref (&iter)) != NULL) { icalcomponent *clone; - + clone = icalcomponent_new_clone (sub_comp); icalcomponent_add_component (tz_top_level, clone); - + icalcompiter_next (&iter); } @@ -1091,15 +1091,15 @@ process_free_busy (EMeetingStoreQueueData *qdata, char *text) } else if (kind == ICAL_VFREEBUSY_COMPONENT) { process_free_busy_comp (attendee, main_comp, priv->zone, NULL); } - + icalcomponent_free (main_comp); process_callbacks (qdata); } -/* - * Replace all instances of from_value in string with to_value - * In the returned newly allocated string. +/* + * Replace all instances of from_value in string with to_value + * In the returned newly allocated string. */ static gchar * replace_string (gchar *string, gchar *from_value, gchar *to_value) @@ -1142,13 +1142,13 @@ freebusy_async (gpointer data) GnomeVFSAsyncHandle *handle; if (fbd->client) { - /* FIXME this a work around for getting all th free busy information for the users + /* FIXME this a work around for getting all th free busy information for the users we should be able to get free busy asynchronously */ - g_static_mutex_lock (&mutex); + g_static_mutex_lock (&mutex); priv->num_queries++; e_cal_get_free_busy (fbd->client, fbd->users, fbd->startt, fbd->endt, &(fbd->fb_data), NULL); priv->num_queries--; - g_static_mutex_unlock (&mutex); + g_static_mutex_unlock (&mutex); g_list_foreach (fbd->users, (GFunc)g_free, NULL); g_list_free (fbd->users); @@ -1156,7 +1156,7 @@ freebusy_async (gpointer data) if (fbd->fb_data != NULL) { ECalComponent *comp = fbd->fb_data->data; char *comp_str; - + comp_str = e_cal_component_get_as_string (comp); process_free_busy (fbd->qdata, comp_str); g_free (comp_str); @@ -1177,14 +1177,14 @@ freebusy_async (gpointer data) if (fburi) { priv->num_queries++; - gnome_vfs_async_open (&handle, fburi, GNOME_VFS_OPEN_READ, - GNOME_VFS_PRIORITY_DEFAULT, start_async_read, + gnome_vfs_async_open (&handle, fburi, GNOME_VFS_OPEN_READ, + GNOME_VFS_PRIORITY_DEFAULT, start_async_read, fbd->qdata); g_free (fburi); } else if (default_fb_uri != NULL && !g_str_equal (default_fb_uri, "")) { gchar *tmp_fb_uri; gchar **split_email; - + split_email = g_strsplit (fbd->email, "@", 2); tmp_fb_uri = replace_string (default_fb_uri, USER_SUB, split_email[0]); @@ -1192,10 +1192,10 @@ freebusy_async (gpointer data) default_fb_uri = replace_string (tmp_fb_uri, DOMAIN_SUB, split_email[1]); priv->num_queries++; - gnome_vfs_async_open (&handle, default_fb_uri, GNOME_VFS_OPEN_READ, - GNOME_VFS_PRIORITY_DEFAULT, start_async_read, + gnome_vfs_async_open (&handle, default_fb_uri, GNOME_VFS_OPEN_READ, + GNOME_VFS_PRIORITY_DEFAULT, start_async_read, fbd->qdata); - + g_free (tmp_fb_uri); g_strfreev (split_email); g_free (default_fb_uri); @@ -1212,7 +1212,7 @@ freebusy_async (gpointer data) static gboolean refresh_busy_periods (gpointer data) -{ +{ EMeetingStore *store = E_MEETING_STORE (data); EMeetingStorePrivate *priv; EMeetingAttendee *attendee = NULL; @@ -1221,7 +1221,7 @@ refresh_busy_periods (gpointer data) GThread *thread; GError *error = NULL; FreeBusyAsyncData *fbd; - + priv = store->priv; /* Check to see if there are any remaining attendees in the queue */ @@ -1242,27 +1242,27 @@ refresh_busy_periods (gpointer data) priv->refresh_idle_id = 0; return FALSE; } - + /* Indicate we are trying to refresh it */ qdata->refreshing = TRUE; /* We take a ref in case we get destroyed in the gui during a callback */ g_object_ref (qdata->store); - + fbd = g_new0 (FreeBusyAsyncData, 1); fbd->client = priv->client; fbd->attendee = attendee; fbd->users = NULL; - fbd->fb_data = NULL; + fbd->fb_data = NULL; fbd->qdata = qdata; fbd->fb_uri = priv->fb_uri; fbd->store = store; fbd->email = g_strdup (itip_strip_mailto (e_meeting_attendee_get_address (attendee))); - /* Check the server for free busy data */ + /* Check the server for free busy data */ if (priv->client) { struct icaltimetype itt; - + itt = icaltime_null_time (); itt.year = g_date_get_year (&qdata->start.date); itt.month = g_date_get_month (&qdata->start.date); @@ -1308,13 +1308,13 @@ refresh_busy_periods (gpointer data) return TRUE; } - + static void refresh_queue_add (EMeetingStore *store, int row, EMeetingTime *start, EMeetingTime *end, EMeetingStoreRefreshCallback call_back, - gpointer data) + gpointer data) { EMeetingStorePrivate *priv; EMeetingAttendee *attendee; @@ -1330,7 +1330,7 @@ refresh_queue_add (EMeetingStore *store, int row, /* check the queue if the attendee is already in there*/ for (i = 0; i < priv->refresh_queue->len; i++) { if (attendee == g_ptr_array_index (priv->refresh_queue, i)) - return; + return; if (!strcmp (e_meeting_attendee_get_address (attendee), e_meeting_attendee_get_address (g_ptr_array_index (priv->refresh_queue, i)))) return; @@ -1399,16 +1399,16 @@ async_read (GnomeVFSAsyncHandle *handle, gnome_vfs_async_close (handle, async_close, qdata); return; } - + ((char *)buffer)[read] = '\0'; qdata->string = g_string_append (qdata->string, buffer); - + if (result == GNOME_VFS_ERROR_EOF) { gnome_vfs_async_close (handle, async_close, qdata); return; } - gnome_vfs_async_read (handle, qdata->buffer, buf_size, async_read, qdata); + gnome_vfs_async_read (handle, qdata->buffer, buf_size, async_read, qdata); } static void @@ -1438,14 +1438,14 @@ e_meeting_store_refresh_all_busy_periods (EMeetingStore *store, gpointer data) { int i; - + g_return_if_fail (E_IS_MEETING_STORE (store)); - + for (i = 0; i < store->priv->attendees->len; i++) refresh_queue_add (store, i, start, end, call_back, data); } -void +void e_meeting_store_refresh_busy_periods (EMeetingStore *store, int row, EMeetingTime *start, diff --git a/calendar/gui/e-meeting-store.h b/calendar/gui/e-meeting-store.h index d3998b033b..7f111f4676 100644 --- a/calendar/gui/e-meeting-store.h +++ b/calendar/gui/e-meeting-store.h @@ -1,4 +1,4 @@ -/* +/* * e-meeting-store.h * * Copyright (C) 2003 Ximian, Inc. diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index e1de77024d..211d4c71bd 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@gtk.org> * * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -132,7 +132,7 @@ static void e_meeting_time_selector_item_init (EMeetingTimeSelectorItem *mts_item) { GnomeCanvasItem *item = GNOME_CANVAS_ITEM (mts_item); - + mts_item->mts = NULL; mts_item->main_gc = NULL; @@ -182,7 +182,7 @@ e_meeting_time_selector_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) EMeetingTimeSelectorItem *mts_item; mts_item = E_MEETING_TIME_SELECTOR_ITEM (o); - + switch (arg_id){ case ARG_MEETING_TIME_SELECTOR: mts_item->mts = GTK_VALUE_POINTER (*arg); @@ -281,7 +281,7 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gdk_cairo_set_source_color (cr, &mts->all_attendees_bg_color); cairo_rectangle (cr, 0, mts->row_height * 2 - y, width, mts->row_height); - cairo_fill (cr); + cairo_fill (cr); } else { gdk_cairo_set_source_color (cr, &mts->bg_color); cairo_rectangle (cr, 0, 0, width, height); @@ -300,11 +300,11 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, GdkDrawable *drawable, gdk_cairo_set_source_color (cr, &mts->meeting_time_bg_color); if (is_display_top){ cairo_rectangle (cr, meeting_start_x + 1 - x, mts->row_height * 2 - y, - meeting_end_x - meeting_start_x - 2, mts->row_height); + meeting_end_x - meeting_start_x - 2, mts->row_height); cairo_fill (cr); } else { cairo_rectangle (cr, meeting_start_x + 1 - x, 0, - meeting_end_x - meeting_start_x - 2, height); + meeting_end_x - meeting_start_x - 2, height); cairo_fill (cr); } cairo_restore (cr); @@ -671,7 +671,7 @@ e_meeting_time_selector_item_paint_busy_periods (EMeetingTimeSelectorItem *mts_i gdk_gc_set_foreground (gc, &mts->busy_colors[busy_type]); red = mts->busy_colors[busy_type].red; green = mts->busy_colors[busy_type].green; - blue = mts->busy_colors[busy_type].blue; + blue = mts->busy_colors[busy_type].blue; cairo_set_source_rgba (cr, red/cc, green/cc, blue/cc, 0.8); e_meeting_time_selector_item_paint_attendee_busy_periods (mts_item, drawable, x, y, width, row, first_period, busy_type, cr); } @@ -920,7 +920,7 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, end_time = start_time; g_date_add_days (&end_time.date, 1); } - + /* Fix any overflows. */ e_meeting_time_selector_fix_time_overflows (&end_time); @@ -1047,11 +1047,11 @@ e_meeting_time_selector_item_calculate_busy_range (EMeetingTimeSelector *mts, EMeetingAttendee *ia; EMeetingTime busy_periods_start; EMeetingTime busy_periods_end; - + ia = e_meeting_store_find_attendee_at_row (mts->model, row); busy_periods_start = e_meeting_attendee_get_start_busy_range (ia); busy_periods_end = e_meeting_attendee_get_end_busy_range (ia); - + *start_x = -1; *end_x = -1; @@ -1066,7 +1066,7 @@ e_meeting_time_selector_item_calculate_busy_range (EMeetingTimeSelector *mts, return TRUE; } -void +void e_meeting_time_selector_item_set_normal_cursor (EMeetingTimeSelectorItem *mts_item) { g_return_if_fail (IS_E_MEETING_TIME_SELECTOR_ITEM (mts_item)); diff --git a/calendar/gui/e-meeting-time-sel-item.h b/calendar/gui/e-meeting-time-sel-item.h index e4cf050f80..1ef96699d2 100644 --- a/calendar/gui/e-meeting-time-sel-item.h +++ b/calendar/gui/e-meeting-time-sel-item.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@gtk.org> * * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index 035ddaaa4e..cadb1d3c9a 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -1,15 +1,15 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Authors : +/* + * Authors : * Damon Chaplin <damon@gtk.org> * Rodrigo Moya <rodrigo@novell.com> * * Copyright 1999, Ximian, Inc. * Copyright 2004, Novell, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -69,22 +69,22 @@ /* An array of hour strings for 24 hour time, "0:00" .. "23:00". */ const gchar *EMeetingTimeSelectorHours[24] = { - "0:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", - "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", + "0:00", "1:00", "2:00", "3:00", "4:00", "5:00", "6:00", "7:00", + "8:00", "9:00", "10:00", "11:00", "12:00", "13:00", "14:00", "15:00", "16:00", "17:00", "18:00", "19:00", "20:00", "21:00", "22:00", "23:00" }; /* An array of hour strings for 12 hour time, "12:00am" .. "11:00pm". */ const gchar *EMeetingTimeSelectorHours12[24] = { - "12:00am", "1:00am", "2:00am", "3:00am", "4:00am", "5:00am", "6:00am", - "7:00am", "8:00am", "9:00am", "10:00am", "11:00am", "12:00pm", + "12:00am", "1:00am", "2:00am", "3:00am", "4:00am", "5:00am", "6:00am", + "7:00am", "8:00am", "9:00am", "10:00am", "11:00am", "12:00pm", "1:00pm", "2:00pm", "3:00pm", "4:00pm", "5:00pm", "6:00pm", "7:00pm", "8:00pm", "9:00pm", "10:00pm", "11:00pm" }; /* The number of days shown in the entire canvas. */ -#define E_MEETING_TIME_SELECTOR_DAYS_SHOWN 35 -#define E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE 7 +#define E_MEETING_TIME_SELECTOR_DAYS_SHOWN 35 +#define E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE 7 #define E_MEETING_TIME_SELECTOR_FB_DAYS_BEFORE 7 #define E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER 28 @@ -222,10 +222,10 @@ e_meeting_time_selector_class_init (EMeetingTimeSelectorClass * klass) object_class = (GtkObjectClass *) klass; widget_class = (GtkWidgetClass *) klass; - mts_signals [CHANGED] = + mts_signals [CHANGED] = gtk_signal_new ("changed", GTK_RUN_FIRST, G_TYPE_FROM_CLASS (object_class), - GTK_SIGNAL_OFFSET (EMeetingTimeSelectorClass, + GTK_SIGNAL_OFFSET (EMeetingTimeSelectorClass, changed), gtk_signal_default_marshaller, GTK_TYPE_NONE, 0); @@ -257,7 +257,7 @@ e_meeting_time_selector_init (EMeetingTimeSelector * mts) mts->list_view = NULL; - mts->fb_uri_not = + mts->fb_uri_not = calendar_config_add_notification_free_busy_template ((GConfClientNotifyFunc) free_busy_template_changed_cb, mts); @@ -310,7 +310,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em mts->attendees_vbox_spacer = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), mts->attendees_vbox_spacer, FALSE, FALSE, 0); gtk_widget_show (mts->attendees_vbox_spacer); - + mts->attendees_vbox = gtk_vbox_new (FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), mts->attendees_vbox, TRUE, TRUE, 0); gtk_widget_show (mts->attendees_vbox); @@ -331,10 +331,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em e_meeting_list_view_column_set_visible (mts->list_view, "RSVP", FALSE); e_meeting_list_view_column_set_visible (mts->list_view, "Status", FALSE); e_meeting_list_view_column_set_visible (mts->list_view, "Type", FALSE); - + gtk_widget_show (GTK_WIDGET (mts->list_view)); - + sw = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (sw), GTK_POLICY_NEVER, GTK_POLICY_AUTOMATIC); gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (sw), GTK_SHADOW_IN); @@ -609,7 +609,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit), TRUE); e_date_edit_set_use_24_hour_format (E_DATE_EDIT (mts->start_date_edit), calendar_config_get_24_hour_format ()); - + gtk_table_attach (GTK_TABLE (table), mts->start_date_edit, 1, 2, 0, 1, GTK_FILL, 0, 0, 0); gtk_widget_show (mts->start_date_edit); @@ -683,7 +683,7 @@ e_meeting_time_selector_construct (EMeetingTimeSelector * mts, EMeetingStore *em e_meeting_time_selector_recalc_grid (mts); e_meeting_time_selector_ensure_meeting_time_shown (mts); e_meeting_time_selector_update_start_date_edit (mts); - e_meeting_time_selector_update_end_date_edit (mts); + e_meeting_time_selector_update_end_date_edit (mts); e_meeting_time_selector_update_date_popup_menus (mts); gtk_signal_emit (GTK_OBJECT (mts), mts_signals [CHANGED]); @@ -759,7 +759,7 @@ e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector * mts, const char *name, GdkColor *c) { GdkColormap *colormap; - + g_return_if_fail (name != NULL); g_return_if_fail (c != NULL); @@ -810,7 +810,7 @@ e_meeting_time_selector_new (EMeetingStore *ems) mts = GTK_WIDGET (g_object_new (e_meeting_time_selector_get_type (), NULL)); e_meeting_time_selector_construct (E_MEETING_TIME_SELECTOR (mts), ems); - + return mts; } @@ -823,17 +823,17 @@ e_meeting_time_selector_destroy (GtkObject *object) mts = E_MEETING_TIME_SELECTOR (object); e_meeting_time_selector_remove_timeout (mts); - + if (mts->stipple) { g_object_unref (mts->stipple); mts->stipple = NULL; } - + if (mts->model) { g_object_unref (mts->model); mts->model = NULL; } - + mts->display_top = NULL; mts->display_main = NULL; @@ -842,7 +842,7 @@ e_meeting_time_selector_destroy (GtkObject *object) if (mts->fb_refresh_not != 0) { g_source_remove (mts->fb_refresh_not); } - + if (GTK_OBJECT_CLASS (e_meeting_time_selector_parent_class)->destroy) (*GTK_OBJECT_CLASS (e_meeting_time_selector_parent_class)->destroy)(object); } @@ -886,7 +886,7 @@ get_cell_height (GtkTreeView *tree) gtk_tree_view_column_cell_get_size (column, NULL, NULL, NULL, NULL, &height); - + return height; } @@ -914,7 +914,7 @@ e_meeting_time_selector_style_set (GtkWidget *widget, font_metrics = pango_context_get_metrics (pango_context, font_desc, pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); - + /* Calculate the widths of the hour strings in the style's font. */ max_hour_width = 0; for (hour = 0; hour < 24; hour++) { @@ -926,16 +926,16 @@ e_meeting_time_selector_style_set (GtkWidget *widget, pango_layout_get_pixel_size (layout, &mts->hour_widths [hour], NULL); max_hour_width = MAX (max_hour_width, mts->hour_widths[hour]); } - + mts->row_height = get_cell_height (GTK_TREE_VIEW (mts->list_view)); mts->col_width = max_hour_width + 6; e_meeting_time_selector_save_position (mts, &saved_time); e_meeting_time_selector_recalc_grid (mts); e_meeting_time_selector_restore_position (mts, &saved_time); - + gtk_widget_set_size_request (mts->display_top, -1, mts->row_height * 3 + 4); - + /* * FIXME: I can't find a way to get the treeview header heights * other than the below but it isn't nice to realize that widget here @@ -946,7 +946,7 @@ e_meeting_time_selector_style_set (GtkWidget *widget, NULL, &maxheight); gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 3 - maxheight); - */ + */ gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 2 - 6); @@ -1102,7 +1102,7 @@ e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, EMeetingTime saved_time; mts->all_day = all_day; - + e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit), !all_day); e_date_edit_set_show_time (E_DATE_EDIT (mts->end_date_edit), @@ -1169,7 +1169,7 @@ e_meeting_time_selector_set_working_hours (EMeetingTimeSelector *mts, mts->day_end_hour = day_start_hour + 1; mts->day_end_minute = day_start_minute; } - + e_meeting_time_selector_save_position (mts, &saved_time); e_meeting_time_selector_recalc_grid (mts); e_meeting_time_selector_restore_position (mts, &saved_time); @@ -1201,8 +1201,8 @@ e_meeting_time_selector_set_zoomed_out (EMeetingTimeSelector *mts, gtk_widget_queue_draw (mts->display_main); } -static gboolean -e_meeting_time_selector_refresh_cb (gpointer data) +static gboolean +e_meeting_time_selector_refresh_cb (gpointer data) { EMeetingTimeSelector *mts = data; @@ -1211,7 +1211,7 @@ e_meeting_time_selector_refresh_cb (gpointer data) mts->last_cursor_set = GDK_LEFT_PTR; e_meeting_time_selector_item_set_normal_cursor (E_MEETING_TIME_SELECTOR_ITEM (mts->item_top)); e_meeting_time_selector_item_set_normal_cursor (E_MEETING_TIME_SELECTOR_ITEM (mts->item_main)); - } + } if (mts->display_top != NULL) gtk_widget_queue_draw (mts->display_top); @@ -1227,7 +1227,7 @@ void e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, int row, gboolean all) { EMeetingTime start, end; - + start = mts->meeting_start_time; g_date_subtract_days (&start.date, E_MEETING_TIME_SELECTOR_FB_DAYS_BEFORE); start.hour = 0; @@ -1235,7 +1235,7 @@ e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, int row, g end = mts->meeting_end_time; g_date_add_days (&end.date, E_MEETING_TIME_SELECTOR_FB_DAYS_AFTER); end.hour = 0; - end.minute = 0; + end.minute = 0; /* set the cursor to Busy, We need to reset it to normal once the free busy queries are complete */ @@ -1249,18 +1249,18 @@ e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, int row, g * notification */ if (all) { int i; - + for (i = 0; i < e_meeting_store_count_actual_attendees (mts->model); i++) gtk_object_ref (GTK_OBJECT (mts)); } else { gtk_object_ref (GTK_OBJECT (mts)); } - + if (all) - e_meeting_store_refresh_all_busy_periods (mts->model, &start, &end, + e_meeting_store_refresh_all_busy_periods (mts->model, &start, &end, e_meeting_time_selector_refresh_cb, mts); else - e_meeting_store_refresh_busy_periods (mts->model, row, &start, &end, + e_meeting_store_refresh_busy_periods (mts->model, row, &start, &end, e_meeting_time_selector_refresh_cb, mts); } @@ -1554,7 +1554,7 @@ e_meeting_time_selector_autopick (EMeetingTimeSelector *mts, /* Get the current meeting duration in days + hours + minutes. */ e_meeting_time_selector_calculate_time_difference (&mts->meeting_start_time, &mts->meeting_end_time, &duration_days, &duration_hours, &duration_minutes); - + /* Find the first appropriate start time. */ start_time = mts->meeting_start_time; if (forward) @@ -1706,10 +1706,10 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, } else { g_date_add_days (&start_time->date, 1); start_time->hour = 0; - start_time->minute = 0; + start_time->minute = 0; } e_meeting_time_selector_fix_time_overflows (start_time); - + *end_time = *start_time; e_meeting_time_selector_adjust_time (end_time, days, hours, mins); @@ -1752,7 +1752,7 @@ e_meeting_time_selector_find_nearest_interval (EMeetingTimeSelector *mts, start_time->minute += 29; start_time->minute -= start_time->minute % 30; } - + e_meeting_time_selector_fix_time_overflows (start_time); *end_time = *start_time; @@ -1795,7 +1795,7 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt } else { g_date_subtract_days (&start_time->date, 1); start_time->hour = 0; - start_time->minute = 0; + start_time->minute = 0; } *end_time = *start_time; @@ -1839,7 +1839,7 @@ e_meeting_time_selector_find_nearest_interval_backward (EMeetingTimeSelector *mt } else { start_time->minute -= start_time->minute % 30; } - + *end_time = *start_time; e_meeting_time_selector_adjust_time (end_time, days, hours, mins); } @@ -2408,7 +2408,7 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, if (drag_time.hour > 12) g_date_add_days (&drag_time.date, 1); drag_time.hour = 0; - drag_time.minute = 0; + drag_time.minute = 0; } e_meeting_time_selector_fix_time_overflows (&drag_time); @@ -2437,7 +2437,7 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, && mts->dragging_position == E_MEETING_TIME_SELECTOR_POS_END && e_meeting_time_compare_times (&mts->meeting_start_time, &drag_time) == 0) return; - + *time_to_set = drag_time; /* Check if the start time and end time need to be switched. */ @@ -2454,7 +2454,7 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, set_both_times = TRUE; } - + /* Mark the calculated positions as invalid. */ mts->meeting_positions_valid = FALSE; @@ -2661,7 +2661,7 @@ static void e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts) { GDate date; - + date = mts->meeting_end_time.date; if (mts->all_day) g_date_subtract_days (&date, 1); @@ -2702,7 +2702,7 @@ e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts) time.minute = 0; start_x = e_meeting_time_selector_calculate_time_position (mts, &time); } - + gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), &scroll_x, &scroll_y); canvas_width = mts->display_main->allocation.width; @@ -2905,18 +2905,18 @@ static gboolean free_busy_timeout_refresh (gpointer data) { char *fb_uri; - + EMeetingTimeSelector *mts = E_MEETING_TIME_SELECTOR (data); fb_uri = calendar_config_get_free_busy_template (); e_meeting_store_set_fb_uri (mts->model, fb_uri); g_free (fb_uri); - + /* Update all free/busy info, so we use the new template uri */ e_meeting_time_selector_refresh_free_busy (mts, 0, TRUE); mts->fb_refresh_not = 0; - + return FALSE; } @@ -2930,10 +2930,10 @@ free_busy_template_changed_cb (GConfClient *client, /* Wait REFRESH_PAUSE before refreshing, using the latest uri value */ if (mts->fb_refresh_not != 0) { - g_source_remove (mts->fb_refresh_not); + g_source_remove (mts->fb_refresh_not); } - mts->fb_refresh_not = g_timeout_add (REFRESH_PAUSE, - free_busy_timeout_refresh, + mts->fb_refresh_not = g_timeout_add (REFRESH_PAUSE, + free_busy_timeout_refresh, data); } diff --git a/calendar/gui/e-meeting-time-sel.h b/calendar/gui/e-meeting-time-sel.h index e071df37fe..9b95c7d767 100644 --- a/calendar/gui/e-meeting-time-sel.h +++ b/calendar/gui/e-meeting-time-sel.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@gtk.org> * * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -118,11 +118,11 @@ struct _EMeetingTimeSelector with PACK_START if necessary. */ GtkWidget *attendees_vbox; GtkWidget *attendees_vbox_spacer; - + /* The etable and model */ EMeetingStore *model; EMeetingListView *list_view; - + /* The canvas displaying the dates, times, and the summary 'All Attendees' free/busy display. */ GtkWidget *display_top; @@ -190,7 +190,7 @@ struct _EMeetingTimeSelector /* True if we are selecting all day events */ gboolean all_day; - + /* If this is TRUE we only show hours between day_start_hour and day_end_hour, defaults to TRUE (9am-6pm). */ gboolean working_hours_only; diff --git a/calendar/gui/e-memo-table-config.c b/calendar/gui/e-memo-table-config.c index 15e19eb392..8f3729c61e 100644 --- a/calendar/gui/e-memo-table-config.c +++ b/calendar/gui/e-memo-table-config.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * Nathan Owens <pianocomp81@yahoo.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -29,7 +29,7 @@ struct _EMemoTableConfigPrivate { EMemoTable *table; ECellDateEditConfig *cell_config; - + GList *notifications; }; @@ -47,7 +47,7 @@ e_memo_table_config_set_property (GObject *object, guint property_id, const GVal EMemoTableConfig *table_config; table_config = E_MEMO_TABLE_CONFIG (object); - + switch (property_id) { case PROP_TABLE: e_memo_table_config_set_table (table_config, g_value_get_object (value)); @@ -64,7 +64,7 @@ e_memo_table_config_get_property (GObject *object, guint property_id, GValue *va EMemoTableConfig *table_config; table_config = E_MEMO_TABLE_CONFIG (object); - + switch (property_id) { case PROP_TABLE: g_value_set_object (value, e_memo_table_config_get_table (table_config)); @@ -81,7 +81,7 @@ e_memo_table_config_dispose (GObject *object) EMemoTableConfig *table_config = E_MEMO_TABLE_CONFIG (object); e_memo_table_config_set_table (table_config, NULL); - + if (G_OBJECT_CLASS (e_memo_table_config_parent_class)->dispose) G_OBJECT_CLASS (e_memo_table_config_parent_class)->dispose (object); } @@ -91,11 +91,11 @@ e_memo_table_config_finalize (GObject *object) { EMemoTableConfig *table_config = E_MEMO_TABLE_CONFIG (object); EMemoTableConfigPrivate *priv; - + priv = table_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_memo_table_config_parent_class)->finalize) G_OBJECT_CLASS (e_memo_table_config_parent_class)->finalize (object); } @@ -128,14 +128,14 @@ EMemoTableConfig * e_memo_table_config_new (EMemoTable *table) { EMemoTableConfig *table_config; - + table_config = g_object_new (e_memo_table_config_get_type (), "table", table, NULL); return table_config; } EMemoTable * -e_memo_table_config_get_table (EMemoTableConfig *table_config) +e_memo_table_config_get_table (EMemoTableConfig *table_config) { EMemoTableConfigPrivate *priv; @@ -143,16 +143,16 @@ e_memo_table_config_get_table (EMemoTableConfig *table_config) g_return_val_if_fail (E_IS_MEMO_TABLE_CONFIG (table_config), NULL); priv = table_config->priv; - + return priv->table; } static void -set_timezone (EMemoTable *table) +set_timezone (EMemoTable *table) { ECalModel *model; icaltimezone *zone; - + zone = calendar_config_get_icaltimezone (); model = e_memo_table_get_model (table); if (model) @@ -164,14 +164,14 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer { EMemoTableConfig *table_config = data; EMemoTableConfigPrivate *priv; - + priv = table_config->priv; - + set_timezone (priv->table); } static void -set_twentyfour_hour (EMemoTable *table) +set_twentyfour_hour (EMemoTable *table) { ECalModel *model; gboolean use_24_hour; @@ -188,29 +188,29 @@ twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gp { EMemoTableConfig *table_config = data; EMemoTableConfigPrivate *priv; - + priv = table_config->priv; - + set_twentyfour_hour (priv->table); } void -e_memo_table_config_set_table (EMemoTableConfig *table_config, EMemoTable *table) +e_memo_table_config_set_table (EMemoTableConfig *table_config, EMemoTable *table) { EMemoTableConfigPrivate *priv; guint not; GList *l; - + g_return_if_fail (table_config != NULL); g_return_if_fail (E_IS_MEMO_TABLE_CONFIG (table_config)); priv = table_config->priv; - + if (priv->table) { g_object_unref (priv->table); priv->table = NULL; } - + if (priv->cell_config) { g_object_unref (priv->cell_config); priv->cell_config = NULL; @@ -225,17 +225,17 @@ e_memo_table_config_set_table (EMemoTableConfig *table_config, EMemoTable *table /* If the new view is NULL, return right now */ if (!table) return; - + priv->table = g_object_ref (table); /* Time zone */ set_timezone (table); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, table_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ - set_twentyfour_hour (table); + set_twentyfour_hour (table); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, table_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); diff --git a/calendar/gui/e-memo-table-config.h b/calendar/gui/e-memo-table-config.h index 15e9a06d3a..ce4006df48 100644 --- a/calendar/gui/e-memo-table-config.h +++ b/calendar/gui/e-memo-table-config.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * Nathan Owens <pianocomp81@yahoo.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -31,7 +31,7 @@ G_BEGIN_DECLS #define E_MEMO_TABLE_CONFIG(obj) GTK_CHECK_CAST (obj, e_memo_table_config_get_type (), EMemoTableConfig) #define E_MEMO_TABLE_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_memo_table_config_get_type (), EMemoTableConfigClass) #define E_IS_MEMO_TABLE_CONFIG(obj) GTK_CHECK_TYPE (obj, e_memo_table_config_get_type ()) - + typedef struct _EMemoTableConfig EMemoTableConfig; typedef struct _EMemoTableConfigClass EMemoTableConfigClass; typedef struct _EMemoTableConfigPrivate EMemoTableConfigPrivate; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 4ac8147fdf..aaf451244c 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -178,7 +178,7 @@ date_compare_cb (gconstpointer a, gconstpointer b) } static void -row_appended_cb (ECalModel *model, EMemoTable *memo_table) +row_appended_cb (ECalModel *model, EMemoTable *memo_table) { g_signal_emit (memo_table, signals[USER_CREATED], 0); } @@ -236,7 +236,7 @@ e_memo_table_init (EMemoTable *memo_table) /* Sorting */ e_table_extras_add_compare (extras, "date-compare", date_compare_cb); - + /* Create pixmaps */ if (!icon_pixbufs[0]) @@ -274,7 +274,7 @@ e_memo_table_init (EMemoTable *memo_table) g_signal_connect (e_table, "right_click", G_CALLBACK (e_memo_table_on_right_click), memo_table); g_signal_connect (e_table, "key_press", G_CALLBACK (e_memo_table_on_key_press), memo_table); g_signal_connect (e_table, "popup_menu", G_CALLBACK (e_memo_table_on_popup_menu), memo_table); - + a11y = gtk_widget_get_accessible (GTK_WIDGET(e_table)); if (a11y) atk_object_set_name (a11y, _("Memos")); @@ -301,9 +301,9 @@ e_memo_table_new (void) /** * e_memo_table_get_model: * @memo_table: A calendar table. - * + * * Queries the calendar data model that a calendar table is using. - * + * * Return value: A memo model. **/ ECalModel * @@ -334,9 +334,9 @@ e_memo_table_destroy (GtkObject *object) /** * e_memo_table_get_table: * @memo_table: A calendar table. - * + * * Queries the #ETable widget that the calendar table is using. - * + * * Return value: The #ETable widget that the calendar table uses to display its * data. **/ @@ -371,7 +371,7 @@ get_selected_row_cb (int model_row, gpointer data) *row = model_row; } -/* +/* * Returns the component that is selected in the table; only works if there is * one and only one selected row. */ @@ -441,8 +441,8 @@ delete_selected_components (EMemoTable *memo_table) for (l = objs; l; l = l->next) { ECalModelComponent *comp_data = (ECalModelComponent *) l->data; GError *error = NULL; - - e_cal_remove_object (comp_data->client, + + e_cal_remove_object (comp_data->client, icalcomponent_get_uid (comp_data->icalcomp), &error); delete_error_dialog (error, E_CAL_COMPONENT_JOURNAL); g_clear_error (&error); @@ -455,10 +455,10 @@ delete_selected_components (EMemoTable *memo_table) /** * e_memo_table_get_selected: - * @memo_table: - * + * @memo_table: + * * Get the currently selected ECalModelComponent's on the table. - * + * * Return value: A GSList of the components, which should be * g_slist_free'd when finished with. **/ @@ -471,7 +471,7 @@ e_memo_table_get_selected (EMemoTable *memo_table) /** * e_memo_table_delete_selected: * @memo_table: A memo table. - * + * * Deletes the selected components in the table; asks the user first. **/ void @@ -502,7 +502,7 @@ e_memo_table_delete_selected (EMemoTable *memo_table) comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); } - + if (delete_component_dialog (comp, FALSE, n_selected, E_CAL_COMPONENT_JOURNAL, GTK_WIDGET (memo_table))) delete_selected_components (memo_table); @@ -589,7 +589,7 @@ e_memo_table_copy_clipboard (EMemoTable *memo_table) ETable *etable; GtkClipboard *clipboard; char *comp_str; - + g_return_if_fail (E_IS_MEMO_TABLE (memo_table)); /* create temporary VCALENDAR object */ @@ -606,7 +606,7 @@ e_memo_table_copy_clipboard (EMemoTable *memo_table) } else { gtk_clipboard_set_can_store (clipboard, target_types + 1, n_target_types - 1); } - + /* free memory */ icalcomponent_free (memo_table->tmp_vcal); memo_table->tmp_vcal = NULL; @@ -638,7 +638,7 @@ clipboard_get_calendar_data (EMemoTable *memo_table, const gchar *text) } client = e_cal_model_get_default_client (memo_table->model); - + e_memo_table_set_status_message (memo_table, _("Updating objects")); if (kind == ICAL_VCALENDAR_COMPONENT) { @@ -690,7 +690,7 @@ clipboard_paste_received_cb (GtkClipboard *clipboard, GtkSelectionData *selection_data, gpointer data) { - EMemoTable *memo_table = E_MEMO_TABLE (data); + EMemoTable *memo_table = E_MEMO_TABLE (data); ETable *e_table = e_table_scrolled_get_table (E_TABLE_SCROLLED (memo_table->etable)); GnomeCanvas *canvas = e_table->table_canvas; GnomeCanvasItem *item = GNOME_CANVAS (canvas)->focused_item; @@ -743,7 +743,7 @@ open_memo (EMemoTable *memo_table, ECalModelComponent *comp_data) { CompEditor *medit; const char *uid; - + uid = icalcomponent_get_uid (comp_data->icalcomp); medit = e_comp_editor_registry_find (comp_editor_registry, uid); @@ -763,10 +763,10 @@ open_memo (EMemoTable *memo_table, ECalModelComponent *comp_data) medit = COMP_EDITOR (memo_editor_new (comp_data->client, flags)); comp_editor_edit_comp (medit, comp); - + e_comp_editor_registry_add (comp_editor_registry, medit, FALSE); } - + comp_editor_focus (medit); } @@ -782,7 +782,7 @@ open_memo_by_row (EMemoTable *memo_table, int row) static void e_memo_table_on_double_click (ETable *table, - gint row, + gint row, gint col, GdkEvent *event, EMemoTable *memo_table) @@ -809,22 +809,22 @@ e_memo_table_on_save_as (EPopup *ep, EPopupItem *pitem, void *data) ECalModelComponent *comp_data; char *filename; char *ical_string; - + comp_data = get_selected_comp (memo_table); if (comp_data == NULL) return; - + filename = e_file_dialog_save (_("Save as..."), NULL); if (filename == NULL) return; - + ical_string = e_cal_get_component_as_string (comp_data->client, comp_data->icalcomp); if (ical_string == NULL) { g_warning ("Couldn't convert item to a string"); return; } - e_write_file_uri (filename, ical_string); + e_write_file_uri (filename, ical_string); g_free (ical_string); } @@ -838,7 +838,7 @@ e_memo_table_on_print_memo (EPopup *ep, EPopupItem *pitem, void *data) comp_data = get_selected_comp (memo_table); if (comp_data == NULL) return; - + comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); print_comp (comp, comp_data->client, GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); @@ -866,7 +866,7 @@ static void e_memo_table_on_paste (EPopup *ep, EPopupItem *pitem, void *data) { EMemoTable *memo_table = E_MEMO_TABLE (data); - + e_memo_table_paste_clipboard (memo_table); } @@ -923,7 +923,7 @@ static EPopupItem memos_popup_items [] = { { E_POPUP_ITEM, "20.print", N_("_Print..."), e_memo_table_on_print_memo, NULL, GTK_STOCK_PRINT, E_CAL_POPUP_SELECT_ONE }, { E_POPUP_BAR, "30.bar" }, - + { E_POPUP_ITEM, "40.cut", N_("C_ut"), e_memo_table_on_cut, NULL, GTK_STOCK_CUT, 0, E_CAL_POPUP_SELECT_EDITABLE }, { E_POPUP_ITEM, "50.copy", N_("_Copy"), e_memo_table_on_copy, NULL, GTK_STOCK_COPY, 0, 0 }, { E_POPUP_ITEM, "60.paste", N_("_Paste"), e_memo_table_on_paste, NULL, GTK_STOCK_PASTE, 0, E_CAL_POPUP_SELECT_EDITABLE }, @@ -1022,7 +1022,7 @@ e_memo_table_on_key_press (ETable *table, } else if ((event->keyval == GDK_o) &&(event->state & GDK_CONTROL_MASK)) { open_memo_by_row (memo_table, row); - return TRUE; + return TRUE; } return FALSE; @@ -1110,7 +1110,7 @@ e_memo_table_set_status_message (EMemoTable *memo_table, const gchar *message) if (!memo_table->activity_handler) return; - + if (!message || !*message) { if (memo_table->activity_id != 0) { e_activity_handler_operation_finished (memo_table->activity_handler, memo_table->activity_id); @@ -1118,7 +1118,7 @@ e_memo_table_set_status_message (EMemoTable *memo_table, const gchar *message) } } else if (memo_table->activity_id == 0) { char *client_id = g_strdup_printf ("%p", memo_table); - + if (progress_icon == NULL) progress_icon = e_icon_factory_get_icon (EVOLUTION_MEMOS_PROGRESS_IMAGE, E_ICON_SIZE_STATUS); diff --git a/calendar/gui/e-memo-table.h b/calendar/gui/e-memo-table.h index 5168735c58..5ce2f03cbc 100644 --- a/calendar/gui/e-memo-table.h +++ b/calendar/gui/e-memo-table.h @@ -1,15 +1,15 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * Nathan Owens <pianocomp81@yahoo.com> * * Copyright 2000, Ximian, Inc. * Copyright 2000, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-memos.c b/calendar/gui/e-memos.c index a028f5e47b..6d5120787d 100644 --- a/calendar/gui/e-memos.c +++ b/calendar/gui/e-memos.c @@ -68,13 +68,13 @@ struct _EMemosPrivate { ECal *default_client; ECalView *query; - + EConfigListener *config_listener; - + /* The EMemoTable showing the memos. */ GtkWidget *memos_view; EMemoTableConfig *memos_view_config; - + /* Calendar search bar for memos */ GtkWidget *search_bar; @@ -83,11 +83,11 @@ struct _EMemosPrivate { /* The preview */ GtkWidget *preview; - + gchar *current_uid; char *sexp; guint update_timeout; - + /* View instance and the view menus handler */ GalViewInstance *view_instance; GalViewMenus *view_menus; @@ -141,27 +141,27 @@ table_cursor_change_cb (ETable *etable, int row, gpointer data) priv = memos->priv; n_selected = e_table_selected_count (etable); - + /* update the HTML widget */ if (n_selected != 1) { e_cal_component_memo_preview_clear (E_CAL_COMPONENT_MEMO_PREVIEW (priv->preview)); return; } - + model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view)); - + comp_data = e_cal_model_get_component_at (model, e_table_get_cursor_row (etable)); comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); e_cal_component_memo_preview_display (E_CAL_COMPONENT_MEMO_PREVIEW (priv->preview), comp_data->client, comp); - + e_cal_component_get_uid (comp, &uid); if (priv->current_uid) g_free (priv->current_uid); priv->current_uid = g_strdup (uid); - + g_object_unref (comp); } @@ -182,10 +182,10 @@ table_selection_change_cb (ETable *etable, gpointer data) static void user_created_cb (GtkWidget *view, EMemos *memos) { - EMemosPrivate *priv; + EMemosPrivate *priv; EMemoTable *memo_table; ECal *ecal; - + priv = memos->priv; memo_table = E_MEMO_TABLE (priv->memos_view); @@ -213,9 +213,9 @@ search_bar_sexp_changed_cb (CalSearchBar *cal_search, const char *sexp, gpointer if (priv->sexp) g_free (priv->sexp); - + priv->sexp = g_strdup (sexp); - + update_view (memos); } @@ -243,14 +243,14 @@ vpaned_resized_cb (GtkWidget *widget, GdkEventButton *event, EMemos *memos) } static void -set_timezone (EMemos *memos) +set_timezone (EMemos *memos) { EMemosPrivate *priv; icaltimezone *zone; GList *l; - + priv = memos->priv; - + zone = calendar_config_get_icaltimezone (); for (l = priv->clients_list; l != NULL; l = l->next) { ECal *client = l->data; @@ -272,7 +272,7 @@ static void timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { EMemos *memos = data; - + set_timezone (memos); } @@ -281,19 +281,19 @@ update_view (EMemos *memos) { EMemosPrivate *priv; ECalModel *model; - + priv = memos->priv; model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view)); - + e_cal_model_set_search_query (model, priv->sexp); - + e_cal_component_memo_preview_clear (E_CAL_COMPONENT_MEMO_PREVIEW (priv->preview)); } static gboolean update_view_cb (EMemos *memos) -{ +{ update_view (memos); return TRUE; @@ -333,10 +333,10 @@ setup_config (EMemos *memos) guint not; priv = memos->priv; - + /* Timezone */ set_timezone (memos); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, memos); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); } @@ -458,7 +458,7 @@ table_drag_data_get (ETable *table, } } -static void +static void table_drag_data_delete (ETable *table, int row, int col, @@ -501,7 +501,7 @@ setup_widgets (EMemos *memos) G_CALLBACK (search_bar_sexp_changed_cb), memos); g_signal_connect (priv->search_bar, "category_changed", G_CALLBACK (search_bar_category_changed_cb), memos); - + /* TODO Why doesn't this work?? */ config_categories_changed_cb (priv->config_listener, "/apps/evolution/general/category_master_list", memos); @@ -522,13 +522,13 @@ setup_widgets (EMemos *memos) /* create the memo list */ priv->memos_view = e_memo_table_new (); priv->memos_view_config = e_memo_table_config_new (E_MEMO_TABLE (priv->memos_view)); - + g_signal_connect (priv->memos_view, "user_created", G_CALLBACK (user_created_cb), memos); etable = e_table_scrolled_get_table ( E_TABLE_SCROLLED (E_MEMO_TABLE (priv->memos_view)->etable)); e_table_set_state (etable, E_MEMOS_TABLE_DEFAULT_STATE); - + gtk_paned_add1 (GTK_PANED (priv->paned), priv->memos_view); gtk_widget_show (priv->memos_view); @@ -536,7 +536,7 @@ setup_widgets (EMemos *memos) e_table_drag_source_set (etable, GDK_BUTTON1_MASK, list_drag_types, num_list_drag_types, GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_ASK); - + g_signal_connect (etable, "table_drag_data_get", G_CALLBACK(table_drag_data_get), memos); g_signal_connect (etable, "table_drag_data_delete", @@ -570,7 +570,7 @@ e_memos_class_init (EMemosClass *klass) e_memos_signals[SELECTION_CHANGED] = gtk_signal_new ("selection_changed", GTK_RUN_LAST, - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (object_class), GTK_SIGNAL_OFFSET (EMemosClass, selection_changed), g_cclosure_marshal_VOID__INT, GTK_TYPE_NONE, 1, @@ -634,17 +634,17 @@ static void e_memos_init (EMemos *memos) { EMemosPrivate *priv; - + priv = g_new0 (EMemosPrivate, 1); memos->priv = priv; setup_config (memos); setup_widgets (memos); - + priv->config_listener = e_config_listener_new (); g_signal_connect (priv->config_listener, "key_changed", G_CALLBACK (config_categories_changed_cb), memos); - priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); priv->query = NULL; priv->view_instance = NULL; priv->view_menus = NULL; @@ -716,7 +716,7 @@ e_memos_destroy (GtkObject *object) g_object_unref (priv->config_listener); priv->config_listener = NULL; } - + /* disconnect from signals on all the clients */ for (l = priv->clients_list; l != NULL; l = l->next) { g_signal_handlers_disconnect_matched (l->data, G_SIGNAL_MATCH_DATA, @@ -734,7 +734,7 @@ e_memos_destroy (GtkObject *object) g_free (priv->current_uid); priv->current_uid = NULL; } - + if (priv->sexp) { g_free (priv->sexp); priv->sexp = NULL; @@ -744,12 +744,12 @@ e_memos_destroy (GtkObject *object) g_source_remove (priv->update_timeout); priv->update_timeout = 0; } - + if (priv->memos_view_config) { g_object_unref (priv->memos_view_config); priv->memos_view_config = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); priv->notifications = NULL; @@ -777,7 +777,7 @@ set_status_message (EMemos *memos, const char *message, ...) } priv = memos->priv; - + e_memo_table_set_status_message (E_MEMO_TABLE (priv->memos_view), msg_string); } @@ -812,7 +812,7 @@ backend_died_cb (ECal *client, gpointer data) EMemos *memos; EMemosPrivate *priv; ESource *source; - + memos = E_MEMOS (data); priv = memos->priv; @@ -824,10 +824,10 @@ backend_died_cb (ECal *client, gpointer data) gtk_signal_emit (GTK_OBJECT (memos), e_memos_signals[SOURCE_REMOVED], source); e_memo_table_set_status_message (E_MEMO_TABLE (e_memos_get_calendar_table (memos)), NULL); - + e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (memos))), "calendar:memos-crashed", NULL); - + g_object_unref (source); } @@ -894,7 +894,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, EMemos *memos) case E_CALENDAR_STATUS_OK : g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL); model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view)); - + set_timezone (memos); e_cal_model_set_default_client (model, ecal); set_status_message (memos, NULL); @@ -940,7 +940,7 @@ void e_memos_open_memo (EMemos *memos) { EMemoTable *cal_table; - + cal_table = e_memos_get_calendar_table (memos); e_memo_table_open_selected (cal_table); } @@ -972,10 +972,10 @@ e_memos_add_memo_source (EMemos *memos, ESource *source) return TRUE; } else { ESource *default_source; - + if (priv->default_client) { default_source = e_cal_get_source (priv->default_client); - + /* We don't have it but the default client is it */ if (!strcmp (e_source_peek_uid (default_source), uid)) client = g_object_ref (priv->default_client); @@ -993,7 +993,7 @@ e_memos_add_memo_source (EMemos *memos, ESource *source) /* g_signal_connect (G_OBJECT (client), "categories_changed", G_CALLBACK (client_categories_changed_cb), memos); */ g_signal_connect (G_OBJECT (client), "backend_died", G_CALLBACK (backend_died_cb), memos); - /* add the client to internal structure */ + /* add the client to internal structure */ g_hash_table_insert (priv->clients, g_strdup (uid) , client); priv->clients_list = g_list_prepend (priv->clients_list, client); @@ -1020,19 +1020,19 @@ e_memos_remove_memo_source (EMemos *memos, ESource *source) uid = e_source_peek_uid (source); client = g_hash_table_lookup (priv->clients, uid); - if (!client) + if (!client) return TRUE; - + priv->clients_list = g_list_remove (priv->clients_list, client); g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, memos); + 0, 0, NULL, NULL, memos); model = e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view)); e_cal_model_remove_client (model, client); g_hash_table_remove (priv->clients, uid); - + gtk_signal_emit (GTK_OBJECT (memos), e_memos_signals[SOURCE_REMOVED], source); @@ -1044,7 +1044,7 @@ e_memos_set_default_source (EMemos *memos, ESource *source) { EMemosPrivate *priv; ECal *ecal; - + g_return_val_if_fail (memos != NULL, FALSE); g_return_val_if_fail (E_IS_MEMOS (memos), FALSE); g_return_val_if_fail (E_IS_SOURCE (source), FALSE); @@ -1073,20 +1073,20 @@ ECal * e_memos_get_default_client (EMemos *memos) { EMemosPrivate *priv; - + g_return_val_if_fail (memos != NULL, NULL); g_return_val_if_fail (E_IS_MEMOS (memos), NULL); priv = memos->priv; - return e_cal_model_get_default_client (e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view))); + return e_cal_model_get_default_client (e_memo_table_get_model (E_MEMO_TABLE (priv->memos_view))); } /** * e_memos_delete_selected: * @memos: A memos control widget. - * + * * Deletes the selected memos in the memo list. **/ void @@ -1128,7 +1128,7 @@ display_view_cb (GalViewInstance *instance, GalView *view, gpointer data) * e_memos_setup_view_menus: * @memos: A memos widget. * @uic: UI controller to use for the menus. - * + * * Sets up the #GalView menus for a memos control. This function should be * called from the Bonobo control activation callback for this memos control. * Also, the menus should be discarded using e_memos_discard_view_menus(). @@ -1164,7 +1164,7 @@ e_memos_setup_view_menus (EMemos *memos, BonoboUIComponent *uic) dir0 = g_build_filename (EVOLUTION_GALVIEWSDIR, "memos", NULL); - dir1 = g_build_filename (memos_component_peek_base_directory (memos_component_peek ()), + dir1 = g_build_filename (memos_component_peek_base_directory (memos_component_peek ()), "memos", "views", NULL); gal_view_collection_set_storage_directories (collection, dir0, @@ -1204,7 +1204,7 @@ e_memos_setup_view_menus (EMemos *memos, BonoboUIComponent *uic) /** * e_memos_discard_view_menus: * @memos: A memos widget. - * + * * Discards the #GalView menus used by a memos control. This function should be * called from the Bonobo control deactivation callback for this memos control. * The menus should have been set up with e_memos_setup_view_menus(). @@ -1234,9 +1234,9 @@ e_memos_discard_view_menus (EMemos *memos) /** * e_memos_get_calendar_table: * @memos: A memos widget. - * + * * Queries the #EMemoTable contained in a memos widget. - * + * * Return value: The #EMemoTable that the memos widget uses to display its * information. **/ diff --git a/calendar/gui/e-mini-calendar-config.c b/calendar/gui/e-mini-calendar-config.c index 9325d60cd9..7165811a2f 100644 --- a/calendar/gui/e-mini-calendar-config.c +++ b/calendar/gui/e-mini-calendar-config.c @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -43,7 +43,7 @@ e_mini_calendar_config_set_property (GObject *object, guint property_id, const G EMiniCalendarConfig *mini_config; mini_config = E_MINI_CALENDAR_CONFIG (object); - + switch (property_id) { case PROP_CALENDAR: e_mini_calendar_config_set_calendar (mini_config, g_value_get_object (value)); @@ -60,7 +60,7 @@ e_mini_calendar_config_get_property (GObject *object, guint property_id, GValue EMiniCalendarConfig *mini_config; mini_config = E_MINI_CALENDAR_CONFIG (object); - + switch (property_id) { case PROP_CALENDAR: g_value_set_object (value, e_mini_calendar_config_get_calendar (mini_config)); @@ -75,9 +75,9 @@ static void e_mini_calendar_config_dispose (GObject *object) { EMiniCalendarConfig *mini_config = E_MINI_CALENDAR_CONFIG (object); - + e_mini_calendar_config_set_calendar (mini_config, NULL); - + if (G_OBJECT_CLASS (e_mini_calendar_config_parent_class)->dispose) G_OBJECT_CLASS (e_mini_calendar_config_parent_class)->dispose (object); } @@ -87,11 +87,11 @@ e_mini_calendar_config_finalize (GObject *object) { EMiniCalendarConfig *mini_config = E_MINI_CALENDAR_CONFIG (object); EMiniCalendarConfigPrivate *priv; - + priv = mini_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_mini_calendar_config_parent_class)->finalize) G_OBJECT_CLASS (e_mini_calendar_config_parent_class)->finalize (object); } @@ -101,7 +101,7 @@ e_mini_calendar_config_class_init (EMiniCalendarConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - + /* Method override */ gobject_class->set_property = e_mini_calendar_config_set_property; gobject_class->get_property = e_mini_calendar_config_get_property; @@ -124,14 +124,14 @@ EMiniCalendarConfig * e_mini_calendar_config_new (ECalendar *mini_cal) { EMiniCalendarConfig *mini_config; - + mini_config = g_object_new (e_mini_calendar_config_get_type (), "calendar", mini_cal, NULL); return mini_config; } ECalendar * -e_mini_calendar_config_get_calendar (EMiniCalendarConfig *mini_config) +e_mini_calendar_config_get_calendar (EMiniCalendarConfig *mini_config) { EMiniCalendarConfigPrivate *priv; @@ -139,14 +139,14 @@ e_mini_calendar_config_get_calendar (EMiniCalendarConfig *mini_config) g_return_val_if_fail (E_IS_MINI_CALENDAR_CONFIG (mini_config), NULL); priv = mini_config->priv; - + return priv->mini_cal; } static void -set_week_start (ECalendar *mini_cal) +set_week_start (ECalendar *mini_cal) { - int week_start_day; + int week_start_day; week_start_day = calendar_config_get_week_start_day (); @@ -163,14 +163,14 @@ week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointe { EMiniCalendarConfig *mini_config = data; EMiniCalendarConfigPrivate *priv; - + priv = mini_config->priv; - + set_week_start (priv->mini_cal); } static void -set_dnav_show_week_no (ECalendar *mini_cal) +set_dnav_show_week_no (ECalendar *mini_cal) { gboolean show_week_no; @@ -186,29 +186,29 @@ dnav_show_week_no_changed_cb (GConfClient *client, guint id, GConfEntry *entry, { EMiniCalendarConfig *mini_config = data; EMiniCalendarConfigPrivate *priv; - + priv = mini_config->priv; - + set_dnav_show_week_no (priv->mini_cal); } void -e_mini_calendar_config_set_calendar (EMiniCalendarConfig *mini_config, ECalendar *mini_cal) +e_mini_calendar_config_set_calendar (EMiniCalendarConfig *mini_config, ECalendar *mini_cal) { EMiniCalendarConfigPrivate *priv; guint not; GList *l; - + g_return_if_fail (mini_config != NULL); g_return_if_fail (E_IS_MINI_CALENDAR_CONFIG (mini_config)); priv = mini_config->priv; - + if (priv->mini_cal) { g_object_unref (priv->mini_cal); priv->mini_cal = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); @@ -218,7 +218,7 @@ e_mini_calendar_config_set_calendar (EMiniCalendarConfig *mini_config, ECalendar /* If the new view is NULL, return right now */ if (!mini_cal) return; - + priv->mini_cal = g_object_ref (mini_cal); /* Week start */ diff --git a/calendar/gui/e-mini-calendar-config.h b/calendar/gui/e-mini-calendar-config.h index a8ece07fbf..de252cdf25 100644 --- a/calendar/gui/e-mini-calendar-config.h +++ b/calendar/gui/e-mini-calendar-config.h @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -30,7 +30,7 @@ G_BEGIN_DECLS #define E_MINI_CALENDAR_CONFIG(obj) GTK_CHECK_CAST (obj, e_mini_calendar_config_get_type (), EMiniCalendarConfig) #define E_MINI_CALENDAR_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_mini_calendar_config_get_type (), EMiniCalendarConfigClass) #define E_IS_MINI_CALENDAR_CONFIG(obj) GTK_CHECK_TYPE (obj, e_mini_calendar_config_get_type ()) - + typedef struct _EMiniCalendarConfig EMiniCalendarConfig; typedef struct _EMiniCalendarConfigClass EMiniCalendarConfigClass; typedef struct _EMiniCalendarConfigPrivate EMiniCalendarConfigPrivate; diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index 74f4e16d50..c258c7f43c 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -6,7 +6,7 @@ * Copyright (C) 2003 Ximian Inc. * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -60,7 +60,7 @@ static void esne_class_init (GObjectClass *klass) { klass->finalize = esne_finalize; - + parent_class = E_NAME_SELECTOR_ENTRY_CLASS (g_type_class_peek_parent (klass)); } @@ -68,7 +68,7 @@ GType e_select_names_editable_get_type (void) { static GType esne_type = 0; - + if (!esne_type) { static const GTypeInfo esne_info = { sizeof (ESelectNamesEditableClass), @@ -84,15 +84,15 @@ e_select_names_editable_get_type (void) static const GInterfaceInfo cell_editable_info = { (GInterfaceInitFunc) esne_cell_editable_init, - NULL, - NULL + NULL, + NULL }; - + esne_type = g_type_register_static (E_TYPE_NAME_SELECTOR_ENTRY, "ESelectNamesEditable", &esne_info, 0); - + g_type_add_interface_static (esne_type, GTK_TYPE_CELL_EDITABLE, &cell_editable_info); } - + return esne_type; } @@ -141,7 +141,7 @@ e_select_names_editable_get_emails (ESelectNamesEditable *esne) return NULL; destination = destinations->data; - if (e_destination_is_evolution_list (destination)) { + if (e_destination_is_evolution_list (destination)) { const GList *list_dests, *l; list_dests = e_destination_list_get_dests (destination); @@ -151,7 +151,7 @@ e_select_names_editable_get_emails (ESelectNamesEditable *esne) } else { /* check if the contact is contact list, it does not contain all the email ids */ /* we dont expand it currently, TODO do we need to expand it by getting it from addressbook*/ - if (e_destination_get_contact (destination) && + if (e_destination_get_contact (destination) && e_contact_get (e_destination_get_contact (destination), E_CONTACT_IS_LIST)) { /* If its a contact_list which is not expanded, it wont have a email id, so we can use the name as the email id */ @@ -202,10 +202,10 @@ e_select_names_editable_get_names (ESelectNamesEditable *esne) if (!destinations) return NULL; - destination = destinations->data; + destination = destinations->data; if (e_destination_is_evolution_list (destination)) { const GList *list_dests, *l; - + list_dests = e_destination_list_get_dests (destination); for (l = list_dests; l != NULL; l = g_list_next (l)) { result = g_list_append (result, g_strdup (e_destination_get_name (l->data))); @@ -238,7 +238,7 @@ e_select_names_editable_set_address (ESelectNamesEditable *esne, const gchar *na e_destination_set_name (destination, name); e_destination_set_email (destination, email); - + if (!destinations) e_destination_store_append_destination (destination_store, destination); g_object_unref (destination); diff --git a/calendar/gui/e-select-names-editable.h b/calendar/gui/e-select-names-editable.h index c2c7c2e3e9..5177bba391 100644 --- a/calendar/gui/e-select-names-editable.h +++ b/calendar/gui/e-select-names-editable.h @@ -6,7 +6,7 @@ * Copyright (C) 2003 Ximian Inc. * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index 4cbc49bd05..e1c001cdc5 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -6,7 +6,7 @@ * Copyright (C) 2003 Ximian Inc. * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -61,13 +61,13 @@ e_select_names_renderer_editing_done (GtkCellEditable *editable, ESelectNamesRen g_signal_handlers_disconnect_matched (editable, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, cell); if (GTK_ENTRY (editable)->editing_canceled) { - gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (cell), TRUE); + gtk_cell_renderer_stop_editing (GTK_CELL_RENDERER (cell), TRUE); goto cleanup; } - + addresses = e_select_names_editable_get_emails (E_SELECT_NAMES_EDITABLE (editable)); names = e_select_names_editable_get_names (E_SELECT_NAMES_EDITABLE (editable)); - + g_signal_emit (cell, signals [CELL_EDITED], 0, cell->priv->path, addresses, names); g_list_foreach (addresses, (GFunc)g_free, NULL); @@ -97,14 +97,14 @@ e_select_names_renderer_start_editing (GtkCellRenderer *cell, GdkEvent *event, G ESelectNamesRenderer *sn_cell = E_SELECT_NAMES_RENDERER (cell); GtkCellRendererText *text_cell = GTK_CELL_RENDERER_TEXT (cell); ESelectNamesEditable *editable; - + if (!text_cell->editable) return NULL; editable = E_SELECT_NAMES_EDITABLE (e_select_names_editable_new ()); gtk_entry_set_has_frame (GTK_ENTRY (editable), FALSE); gtk_entry_set_alignment (GTK_ENTRY (editable), cell->xalign); - if (sn_cell->priv->email && *sn_cell->priv->email) + if (sn_cell->priv->email && *sn_cell->priv->email) e_select_names_editable_set_address (editable, sn_cell->priv->name, sn_cell->priv->email); gtk_widget_show (GTK_WIDGET (editable)); @@ -182,7 +182,7 @@ e_select_names_renderer_class_init (ESelectNamesRendererClass *class) { GtkCellRendererClass *cell_class = GTK_CELL_RENDERER_CLASS (class); GObjectClass *obj_class = G_OBJECT_CLASS (class); - + obj_class->finalize = e_select_names_renderer_finalize; obj_class->get_property = e_select_names_renderer_get_property; obj_class->set_property = e_select_names_renderer_set_property; diff --git a/calendar/gui/e-select-names-renderer.h b/calendar/gui/e-select-names-renderer.h index e15b307e5f..8087977ace 100644 --- a/calendar/gui/e-select-names-renderer.h +++ b/calendar/gui/e-select-names-renderer.h @@ -6,7 +6,7 @@ * Copyright (C) 2003 Ximian Inc. * * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -49,10 +49,10 @@ struct _ESelectNamesRendererClass { GtkCellRendererTextClass parent_class; - void (* cell_edited) (ESelectNamesRenderer *renderer, - const gchar *path, - GList *addresses, - GList *names); + void (* cell_edited) (ESelectNamesRenderer *renderer, + const gchar *path, + GList *addresses, + GList *names); }; GType e_select_names_renderer_get_type (void); diff --git a/calendar/gui/e-tasks.c b/calendar/gui/e-tasks.c index a2faca60f4..b127fdab30 100644 --- a/calendar/gui/e-tasks.c +++ b/calendar/gui/e-tasks.c @@ -69,13 +69,13 @@ struct _ETasksPrivate { ECal *default_client; ECalView *query; - + EConfigListener *config_listener; /* The ECalendarTable showing the tasks. */ GtkWidget *tasks_view; ECalendarTableConfig *tasks_view_config; - + /* Calendar search bar for tasks */ GtkWidget *search_bar; @@ -87,11 +87,11 @@ struct _ETasksPrivate { /* The preview */ GtkWidget *preview; - + gchar *current_uid; char *sexp; guint update_timeout; - + /* View instance and the view menus handler */ GalViewInstance *view_instance; GalViewMenus *view_menus; @@ -145,27 +145,27 @@ table_cursor_change_cb (ETable *etable, int row, gpointer data) priv = tasks->priv; n_selected = e_table_selected_count (etable); - + /* update the HTML widget */ if (n_selected != 1) { e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview)); return; } - + model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); - + comp_data = e_cal_model_get_component_at (model, e_table_get_cursor_row (etable)); comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); e_cal_component_preview_display (E_CAL_COMPONENT_PREVIEW (priv->preview), comp_data->client, comp); - + e_cal_component_get_uid (comp, &uid); if (priv->current_uid) g_free (priv->current_uid); priv->current_uid = g_strdup (uid); - + g_object_unref (comp); } @@ -226,7 +226,7 @@ search_bar_sexp_changed_cb (CalSearchBar *cal_search, const char *sexp, gpointer if (priv->sexp) g_free (priv->sexp); - + priv->sexp = g_strdup (sexp); update_view (tasks); @@ -256,14 +256,14 @@ vpaned_resized_cb (GtkWidget *widget, GdkEventButton *event, ETasks *tasks) } static void -set_timezone (ETasks *tasks) +set_timezone (ETasks *tasks) { ETasksPrivate *priv; icaltimezone *zone; GList *l; - + priv = tasks->priv; - + zone = calendar_config_get_icaltimezone (); for (l = priv->clients_list; l != NULL; l = l->next) { ECal *client = l->data; @@ -271,7 +271,7 @@ set_timezone (ETasks *tasks) e_cal_set_default_timezone (client, zone, NULL); } - if (priv->default_client) + if (priv->default_client) /* FIXME Error checking */ e_cal_set_default_timezone (priv->default_client, zone, NULL); @@ -283,7 +283,7 @@ static void timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { ETasks *tasks = data; - + set_timezone (tasks); } @@ -294,11 +294,11 @@ update_view (ETasks *tasks) ECalModel *model; char *real_sexp = NULL; char *new_sexp = NULL; - + priv = tasks->priv; model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); - + if ((new_sexp = calendar_config_get_hide_completed_tasks_sexp (FALSE)) != NULL) { real_sexp = g_strdup_printf ("(and %s %s)", new_sexp, priv->sexp); e_cal_model_set_search_query (model, real_sexp); @@ -325,7 +325,7 @@ process_completed_tasks (ETasks *tasks, gboolean config_changed) static gboolean update_view_cb (ETasks *tasks) -{ +{ ECalModel *model; model = e_calendar_table_get_model (E_CALENDAR_TABLE (tasks->priv->tasks_view)); @@ -373,16 +373,16 @@ model_row_changed_cb (ETableModel *etm, int row, gpointer data) static void view_progress_cb (ECalModel *model, const char *message, int percent, ECalSourceType type, ETasks *tasks) { - e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), + e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), message, percent); } static void view_done_cb (ECalModel *model, ECalendarStatus status, ECalSourceType type, ETasks *tasks) { - e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), + e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), NULL, -1); - + } static void @@ -407,24 +407,24 @@ setup_config (ETasks *tasks) guint not; priv = tasks->priv; - + /* Timezone */ set_timezone (tasks); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, tasks); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - - not = calendar_config_add_notification_hide_completed_tasks (config_hide_completed_tasks_changed_cb, + + not = calendar_config_add_notification_hide_completed_tasks (config_hide_completed_tasks_changed_cb, tasks); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - - not = calendar_config_add_notification_hide_completed_tasks_units (config_hide_completed_tasks_changed_cb, + + not = calendar_config_add_notification_hide_completed_tasks_units (config_hide_completed_tasks_changed_cb, tasks); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - - not = calendar_config_add_notification_hide_completed_tasks_value (config_hide_completed_tasks_changed_cb, + + not = calendar_config_add_notification_hide_completed_tasks_value (config_hide_completed_tasks_changed_cb, tasks); - priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); + priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); not = calendar_config_add_notification_preview_state (config_preview_state_changed_cb, tasks); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); @@ -570,7 +570,7 @@ table_drag_end (ETable *table, } */ -static void +static void table_drag_data_delete (ETable *table, int row, int col, @@ -635,7 +635,7 @@ setup_widgets (ETasks *tasks) priv->tasks_view = e_calendar_table_new (); g_object_set_data (G_OBJECT (priv->tasks_view), "tasks", tasks); priv->tasks_view_config = e_calendar_table_config_new (E_CALENDAR_TABLE (priv->tasks_view)); - + g_signal_connect (priv->tasks_view, "user_created", G_CALLBACK (user_created_cb), tasks); etable = e_table_scrolled_get_table ( @@ -648,7 +648,7 @@ setup_widgets (ETasks *tasks) e_table_drag_source_set (etable, GDK_BUTTON1_MASK, list_drag_types, num_list_drag_types, GDK_ACTION_MOVE|GDK_ACTION_COPY|GDK_ACTION_ASK); - + g_signal_connect (etable, "table_drag_data_get", G_CALLBACK(table_drag_data_get), tasks); g_signal_connect (etable, "table_drag_data_delete", @@ -670,11 +670,11 @@ setup_widgets (ETasks *tasks) g_signal_connect (etable, "selection_change", G_CALLBACK (table_selection_change_cb), tasks); /* Timeout check to hide completed items */ - priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_view_cb, tasks, NULL); + priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_view_cb, tasks, NULL); /* create the task detail */ priv->preview = e_cal_component_preview_new (); - e_cal_component_preview_set_default_timezone (E_CAL_COMPONENT_PREVIEW (priv->preview), calendar_config_get_icaltimezone ()); + e_cal_component_preview_set_default_timezone (E_CAL_COMPONENT_PREVIEW (priv->preview), calendar_config_get_icaltimezone ()); gtk_paned_add2 (GTK_PANED (priv->paned), priv->preview); state = calendar_config_get_preview_state (); @@ -684,7 +684,7 @@ setup_widgets (ETasks *tasks) model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); g_signal_connect (G_OBJECT (model), "model_row_changed", G_CALLBACK (model_row_changed_cb), tasks); - + g_signal_connect (G_OBJECT (model), "cal_view_progress", G_CALLBACK (view_progress_cb), tasks); g_signal_connect (G_OBJECT (model), "cal_view_done", @@ -702,7 +702,7 @@ e_tasks_class_init (ETasksClass *class) e_tasks_signals[SELECTION_CHANGED] = gtk_signal_new ("selection_changed", GTK_RUN_LAST, - G_TYPE_FROM_CLASS (object_class), + G_TYPE_FROM_CLASS (object_class), GTK_SIGNAL_OFFSET (ETasksClass, selection_changed), g_cclosure_marshal_VOID__INT, GTK_TYPE_NONE, 1, @@ -766,7 +766,7 @@ static void e_tasks_init (ETasks *tasks) { ETasksPrivate *priv; - + priv = g_new0 (ETasksPrivate, 1); tasks->priv = priv; @@ -776,7 +776,7 @@ e_tasks_init (ETasks *tasks) setup_config (tasks); setup_widgets (tasks); - priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); + priv->clients = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); priv->query = NULL; priv->view_instance = NULL; priv->view_menus = NULL; @@ -850,7 +850,7 @@ e_tasks_destroy (GtkObject *object) g_free (priv->current_uid); priv->current_uid = NULL; } - + if (priv->sexp) { g_free (priv->sexp); priv->sexp = NULL; @@ -860,12 +860,12 @@ e_tasks_destroy (GtkObject *object) g_source_remove (priv->update_timeout); priv->update_timeout = 0; } - + if (priv->tasks_view_config) { g_object_unref (priv->tasks_view_config); priv->tasks_view_config = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); priv->notifications = NULL; @@ -893,7 +893,7 @@ set_status_message (ETasks *tasks, const char *message, ...) } priv = tasks->priv; - + e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->tasks_view), msg_string, -1); } @@ -929,7 +929,7 @@ backend_died_cb (ECal *client, gpointer data) ETasks *tasks; ETasksPrivate *priv; ESource *source; - + tasks = E_TASKS (data); priv = tasks->priv; @@ -941,10 +941,10 @@ backend_died_cb (ECal *client, gpointer data) gtk_signal_emit (GTK_OBJECT (tasks), e_tasks_signals[SOURCE_REMOVED], source); e_calendar_table_set_status_message (E_CALENDAR_TABLE (e_tasks_get_calendar_table (tasks)), NULL, -1); - + e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (tasks))), "calendar:tasks-crashed", NULL); - + g_object_unref (source); } @@ -1009,7 +1009,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, ETasks *tasks) case E_CALENDAR_STATUS_OK : g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL); model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); - + e_cal_model_set_default_client (model, ecal); set_status_message (tasks, NULL); break; @@ -1046,11 +1046,11 @@ open_ecal (ETasks *tasks, ECal *cal, gboolean only_if_exists, open_func of) icaltimezone *zone; priv = tasks->priv; - + zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (cal, zone, NULL); - + set_status_message (tasks, _("Opening tasks at %s"), e_cal_get_uri (cal)); g_signal_connect (G_OBJECT (cal), "cal_opened", G_CALLBACK (of), tasks); @@ -1063,7 +1063,7 @@ void e_tasks_open_task (ETasks *tasks) { ECalendarTable *cal_table; - + cal_table = e_tasks_get_calendar_table (tasks); e_calendar_table_open_selected (cal_table); } @@ -1077,7 +1077,7 @@ e_tasks_new_task (ETasks *tasks) const char *category; ECal *ecal; guint32 flags = 0; - + g_return_if_fail (E_IS_TASKS (tasks)); priv = tasks->priv; @@ -1086,9 +1086,9 @@ e_tasks_new_task (ETasks *tasks) ecal = e_tasks_get_default_client (tasks); if (!ecal) return; - + flags |= COMP_EDITOR_NEW_ITEM | COMP_EDITOR_USER_ORG; - + comp = cal_comp_task_new_with_defaults (ecal); category = cal_search_bar_get_category (CAL_SEARCH_BAR (priv->search_bar)); @@ -1117,32 +1117,32 @@ e_tasks_show_preview (ETasks *tasks, gboolean state) ETable *etable; const char *uid; int n_selected; - + etable = e_table_scrolled_get_table (E_TABLE_SCROLLED (E_CALENDAR_TABLE (priv->tasks_view)->etable)); n_selected = e_table_selected_count (etable); - + if (n_selected != 1) { e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview)); } else { model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); - + comp_data = e_cal_model_get_component_at (model, e_table_get_cursor_row (etable)); comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); - + e_cal_component_preview_display (E_CAL_COMPONENT_PREVIEW (priv->preview), comp_data->client, comp); - + e_cal_component_get_uid (comp, &uid); if (priv->current_uid) g_free (priv->current_uid); priv->current_uid = g_strdup (uid); - + g_object_unref (comp); } gtk_widget_show (priv->preview); } else { - e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview)); + e_cal_component_preview_clear (E_CAL_COMPONENT_PREVIEW (priv->preview)); gtk_widget_hide (priv->preview); } } @@ -1168,10 +1168,10 @@ e_tasks_add_todo_source (ETasks *tasks, ESource *source) return TRUE; } else { ESource *default_source; - + if (priv->default_client) { default_source = e_cal_get_source (priv->default_client); - + /* We don't have it but the default client is it */ if (!strcmp (e_source_peek_uid (default_source), uid)) client = g_object_ref (priv->default_client); @@ -1188,7 +1188,7 @@ e_tasks_add_todo_source (ETasks *tasks, ESource *source) g_signal_connect (G_OBJECT (client), "backend_error", G_CALLBACK (backend_error_cb), tasks); g_signal_connect (G_OBJECT (client), "backend_died", G_CALLBACK (backend_died_cb), tasks); - /* add the client to internal structure */ + /* add the client to internal structure */ g_hash_table_insert (priv->clients, g_strdup (uid) , client); priv->clients_list = g_list_prepend (priv->clients_list, client); @@ -1215,19 +1215,19 @@ e_tasks_remove_todo_source (ETasks *tasks, ESource *source) uid = e_source_peek_uid (source); client = g_hash_table_lookup (priv->clients, uid); - if (!client) + if (!client) return TRUE; - + priv->clients_list = g_list_remove (priv->clients_list, client); g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, tasks); + 0, 0, NULL, NULL, tasks); model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view)); e_cal_model_remove_client (model, client); g_hash_table_remove (priv->clients, uid); - + gtk_signal_emit (GTK_OBJECT (tasks), e_tasks_signals[SOURCE_REMOVED], source); @@ -1239,7 +1239,7 @@ e_tasks_set_default_source (ETasks *tasks, ESource *source) { ETasksPrivate *priv; ECal *ecal; - + g_return_val_if_fail (tasks != NULL, FALSE); g_return_val_if_fail (E_IS_TASKS (tasks), FALSE); g_return_val_if_fail (E_IS_SOURCE (source), FALSE); @@ -1268,19 +1268,19 @@ ECal * e_tasks_get_default_client (ETasks *tasks) { ETasksPrivate *priv; - + g_return_val_if_fail (tasks != NULL, NULL); g_return_val_if_fail (E_IS_TASKS (tasks), NULL); priv = tasks->priv; - return e_cal_model_get_default_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view))); + return e_cal_model_get_default_client (e_calendar_table_get_model (E_CALENDAR_TABLE (priv->tasks_view))); } /** * e_tasks_complete_selected: * @tasks: A tasks control widget - * + * * Marks the selected tasks complete **/ void @@ -1304,7 +1304,7 @@ e_tasks_complete_selected (ETasks *tasks) /** * e_tasks_delete_selected: * @tasks: A tasks control widget. - * + * * Deletes the selected tasks in the task list. **/ void @@ -1329,7 +1329,7 @@ e_tasks_delete_selected (ETasks *tasks) /** * e_tasks_expunge: * @tasks: A tasks control widget - * + * * Removes all tasks marked as completed **/ void @@ -1338,7 +1338,7 @@ e_tasks_delete_completed (ETasks *tasks) ETasksPrivate *priv; char *sexp; GList *l; - + g_return_if_fail (tasks != NULL); g_return_if_fail (E_IS_TASKS (tasks)); @@ -1346,23 +1346,23 @@ e_tasks_delete_completed (ETasks *tasks) sexp = g_strdup ("(is-completed?)"); - set_status_message (tasks, _("Expunging")); + set_status_message (tasks, _("Expunging")); for (l = priv->clients_list; l != NULL; l = l->next) { ECal *client = l->data; GList *objects, *m; gboolean read_only = TRUE; - + e_cal_is_read_only (client, &read_only, NULL); if (read_only) continue; - + if (!e_cal_get_object_list (client, sexp, &objects, NULL)) { g_warning (G_STRLOC ": Could not get the objects"); - + continue; } - + for (m = objects; m; m = m->next) { /* FIXME Better error handling */ e_cal_remove_object (client, icalcomponent_get_uid (m->data), NULL); @@ -1396,7 +1396,7 @@ display_view_cb (GalViewInstance *instance, GalView *view, gpointer data) * e_tasks_setup_view_menus: * @tasks: A tasks widget. * @uic: UI controller to use for the menus. - * + * * Sets up the #GalView menus for a tasks control. This function should be * called from the Bonobo control activation callback for this tasks control. * Also, the menus should be discarded using e_tasks_discard_view_menus(). @@ -1432,7 +1432,7 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic) dir0 = g_build_filename (EVOLUTION_GALVIEWSDIR, "tasks", NULL); - dir1 = g_build_filename (tasks_component_peek_base_directory (tasks_component_peek ()), + dir1 = g_build_filename (tasks_component_peek_base_directory (tasks_component_peek ()), "tasks", "views", NULL); gal_view_collection_set_storage_directories (collection, dir0, @@ -1472,7 +1472,7 @@ e_tasks_setup_view_menus (ETasks *tasks, BonoboUIComponent *uic) /** * e_tasks_discard_view_menus: * @tasks: A tasks widget. - * + * * Discards the #GalView menus used by a tasks control. This function should be * called from the Bonobo control deactivation callback for this tasks control. * The menus should have been set up with e_tasks_setup_view_menus(). @@ -1510,7 +1510,7 @@ e_tasks_open_task_id (ETasks *tasks, if (!src_uid || !comp_uid) return; - + for (l = tasks->priv->clients_list; l != NULL; l = l->next) { ESource *client_src; @@ -1521,7 +1521,7 @@ e_tasks_open_task_id (ETasks *tasks, break; } - if (!client) + if (!client) return; e_cal_get_object (client, comp_uid, comp_rid, &icalcomp, NULL); @@ -1539,9 +1539,9 @@ e_tasks_open_task_id (ETasks *tasks, /** * e_tasks_get_calendar_table: * @tasks: A tasks widget. - * + * * Queries the #ECalendarTable contained in a tasks widget. - * + * * Return value: The #ECalendarTable that the tasks widget uses to display its * information. **/ diff --git a/calendar/gui/e-timezone-entry.c b/calendar/gui/e-timezone-entry.c index 81bbcbaf66..86f8b81261 100644 --- a/calendar/gui/e-timezone-entry.c +++ b/calendar/gui/e-timezone-entry.c @@ -86,7 +86,7 @@ e_timezone_entry_class_init (ETimezoneEntryClass *class) { GtkObjectClass *object_class = (GtkObjectClass *) class; GtkWidgetClass *widget_class = GTK_WIDGET_CLASS (class) ; - + object_class = (GtkObjectClass*) class; widget_class->mnemonic_activate = e_timezone_entry_mnemonic_activate; @@ -125,7 +125,7 @@ e_timezone_entry_init (ETimezoneEntry *tentry) gtk_box_pack_start (GTK_BOX (tentry), priv->entry, TRUE, TRUE, 0); gtk_widget_show (priv->entry); g_signal_connect (priv->entry, "changed", G_CALLBACK (on_entry_changed), tentry); - + priv->button = gtk_button_new (); g_signal_connect (priv->button, "clicked", G_CALLBACK (on_button_clicked), tentry); gtk_box_pack_start (GTK_BOX (tentry), priv->button, FALSE, FALSE, 6); @@ -146,7 +146,7 @@ e_timezone_entry_init (ETimezoneEntry *tentry) * * Description: Creates a new #ETimezoneEntry widget which can be used * to provide an easy to use way for entering dates and times. - * + * * Returns: a new #ETimezoneEntry widget. */ GtkWidget * @@ -330,8 +330,8 @@ e_timezone_entry_set_entry (ETimezoneEntry *tentry) gtk_entry_set_text (GTK_ENTRY (priv->entry), name_buffer); /* do we need to hide the timezone entry at all? i know this overrules the previous case of hiding the timezone - * entry field when we select the default timezone - */ + * entry field when we select the default timezone + */ gtk_widget_show (priv->entry); g_free (name_buffer); @@ -343,13 +343,13 @@ e_timezone_entry_mnemonic_activate (GtkWidget *widget, gboolean group_cycling) { GtkButton *button = NULL; - + if (GTK_WIDGET_CAN_FOCUS (widget)) { button = GTK_BUTTON (((ETimezoneEntryPrivate *) ((ETimezoneEntry *) widget)->priv)->button); if (button != NULL) gtk_widget_grab_focus (GTK_WIDGET (button)); } - + return TRUE; } diff --git a/calendar/gui/e-timezone-entry.h b/calendar/gui/e-timezone-entry.h index 8c941077ad..3593b59008 100644 --- a/calendar/gui/e-timezone-entry.h +++ b/calendar/gui/e-timezone-entry.h @@ -30,11 +30,11 @@ */ #ifndef __E_TIMEZONE_ENTRY_H_ -#define __E_TIMEZONE_ENTRY_H_ +#define __E_TIMEZONE_ENTRY_H_ #include <gtk/gtkhbox.h> #include <libecal/e-cal.h> - + G_BEGIN_DECLS diff --git a/calendar/gui/e-week-view-config.c b/calendar/gui/e-week-view-config.c index de2c9a895b..40404da915 100644 --- a/calendar/gui/e-week-view-config.c +++ b/calendar/gui/e-week-view-config.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Rodrigo Moya <rodrigo@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -44,7 +44,7 @@ e_week_view_config_set_property (GObject *object, guint property_id, const GValu EWeekViewConfig *view_config; view_config = E_WEEK_VIEW_CONFIG (object); - + switch (property_id) { case PROP_VIEW: e_week_view_config_set_view (view_config, g_value_get_object (value)); @@ -61,7 +61,7 @@ e_week_view_config_get_property (GObject *object, guint property_id, GValue *val EWeekViewConfig *view_config; view_config = E_WEEK_VIEW_CONFIG (object); - + switch (property_id) { case PROP_VIEW: g_value_set_object (value, e_week_view_config_get_view (view_config)); @@ -78,7 +78,7 @@ e_week_view_config_dispose (GObject *object) EWeekViewConfig *view_config = E_WEEK_VIEW_CONFIG (object); e_week_view_config_set_view (view_config, NULL); - + if (G_OBJECT_CLASS (e_week_view_config_parent_class)->dispose) G_OBJECT_CLASS (e_week_view_config_parent_class)->dispose (object); } @@ -88,11 +88,11 @@ e_week_view_config_finalize (GObject *object) { EWeekViewConfig *view_config = E_WEEK_VIEW_CONFIG (object); EWeekViewConfigPrivate *priv; - + priv = view_config->priv; g_free (priv); - + if (G_OBJECT_CLASS (e_week_view_config_parent_class)->finalize) G_OBJECT_CLASS (e_week_view_config_parent_class)->finalize (object); } @@ -102,7 +102,7 @@ e_week_view_config_class_init (EWeekViewConfigClass *klass) { GObjectClass *gobject_class = G_OBJECT_CLASS (klass); GParamSpec *spec; - + /* Method override */ gobject_class->set_property = e_week_view_config_set_property; gobject_class->get_property = e_week_view_config_get_property; @@ -125,14 +125,14 @@ EWeekViewConfig * e_week_view_config_new (EWeekView *week_view) { EWeekViewConfig *view_config; - + view_config = g_object_new (e_week_view_config_get_type (), "view", week_view, NULL); return view_config; } EWeekView * -e_week_view_config_get_view (EWeekViewConfig *view_config) +e_week_view_config_get_view (EWeekViewConfig *view_config) { EWeekViewConfigPrivate *priv; @@ -140,16 +140,16 @@ e_week_view_config_get_view (EWeekViewConfig *view_config) g_return_val_if_fail (E_IS_WEEK_VIEW_CONFIG (view_config), NULL); priv = view_config->priv; - + return priv->view; } static void -set_timezone (EWeekView *week_view) +set_timezone (EWeekView *week_view) { icaltimezone *zone; - - zone = calendar_config_get_icaltimezone (); + + zone = calendar_config_get_icaltimezone (); e_calendar_view_set_timezone (E_CALENDAR_VIEW (week_view), zone); } @@ -158,16 +158,16 @@ timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer { EWeekViewConfig *view_config = data; EWeekViewConfigPrivate *priv; - + priv = view_config->priv; - + set_timezone (priv->view); } static void -set_week_start (EWeekView *week_view) +set_week_start (EWeekView *week_view) { - int week_start_week; + int week_start_week; week_start_week = calendar_config_get_week_start_day (); @@ -182,14 +182,14 @@ week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointe { EWeekViewConfig *view_config = data; EWeekViewConfigPrivate *priv; - + priv = view_config->priv; - + set_week_start (priv->view); } static void -set_twentyfour_hour (EWeekView *week_view) +set_twentyfour_hour (EWeekView *week_view) { gboolean use_24_hour; @@ -203,14 +203,14 @@ twentyfour_hour_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gp { EWeekViewConfig *view_config = data; EWeekViewConfigPrivate *priv; - + priv = view_config->priv; - + set_twentyfour_hour (priv->view); } static void -set_show_event_end (EWeekView *week_view) +set_show_event_end (EWeekView *week_view) { gboolean show_event_end; @@ -224,14 +224,14 @@ show_event_end_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpo { EWeekViewConfig *view_config = data; EWeekViewConfigPrivate *priv; - + priv = view_config->priv; - + set_show_event_end (priv->view); } static void -set_compress_weekend (EWeekView *week_view) +set_compress_weekend (EWeekView *week_view) { gboolean compress_weekend; @@ -245,29 +245,29 @@ compress_weekend_changed_cb (GConfClient *client, guint id, GConfEntry *entry, g { EWeekViewConfig *view_config = data; EWeekViewConfigPrivate *priv; - + priv = view_config->priv; - + set_compress_weekend (priv->view); } void -e_week_view_config_set_view (EWeekViewConfig *view_config, EWeekView *week_view) +e_week_view_config_set_view (EWeekViewConfig *view_config, EWeekView *week_view) { EWeekViewConfigPrivate *priv; guint not; GList *l; - + g_return_if_fail (view_config != NULL); g_return_if_fail (E_IS_WEEK_VIEW_CONFIG (view_config)); priv = view_config->priv; - + if (priv->view) { g_object_unref (priv->view); priv->view = NULL; } - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); @@ -277,26 +277,26 @@ e_week_view_config_set_view (EWeekViewConfig *view_config, EWeekView *week_view) /* If the new view is NULL, return right now */ if (!week_view) return; - + priv->view = g_object_ref (week_view); /* Time zone */ set_timezone (week_view); - + not = calendar_config_add_notification_timezone (timezone_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - + /* Week start */ - set_week_start (week_view); + set_week_start (week_view); not = calendar_config_add_notification_week_start_day (week_start_changed_cb, view_config); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* 24 Hour format */ - set_twentyfour_hour (week_view); + set_twentyfour_hour (week_view); not = calendar_config_add_notification_24_hour_format (twentyfour_hour_changed_cb, view_config); - priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); + priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* Show event end */ set_show_event_end (week_view); diff --git a/calendar/gui/e-week-view-config.h b/calendar/gui/e-week-view-config.h index 2cbedf51e3..f79679837c 100644 --- a/calendar/gui/e-week-view-config.h +++ b/calendar/gui/e-week-view-config.h @@ -1,12 +1,12 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * JP Rosevear <jpr@ximian.com> * * Copyright 2003, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -30,7 +30,7 @@ G_BEGIN_DECLS #define E_WEEK_VIEW_CONFIG(obj) GTK_CHECK_CAST (obj, e_week_view_config_get_type (), EWeekViewConfig) #define E_WEEK_VIEW_CONFIG_CLASS(klass) GTK_CHECK_CLASS_CAST (klass, e_week_view_config_get_type (), EWeekViewConfigClass) #define E_IS_WEEK_VIEW_CONFIG(obj) GTK_CHECK_TYPE (obj, e_week_view_config_get_type ()) - + typedef struct _EWeekViewConfig EWeekViewConfig; typedef struct _EWeekViewConfigClass EWeekViewConfigClass; typedef struct _EWeekViewConfigPrivate EWeekViewConfigPrivate; diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 8ac563191a..f31932b050 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 2001, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -143,7 +143,7 @@ e_week_view_event_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) item = GNOME_CANVAS_ITEM (o); wveitem = E_WEEK_VIEW_EVENT_ITEM (o); - + switch (arg_id){ case ARG_EVENT_NUM: wveitem->event_num = GTK_VALUE_INT (*arg); @@ -270,7 +270,7 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, /* Get the start & end times in 24-hour format. */ start_hour = event->start_minute / 60; start_minute = event->start_minute % 60; - + /* Modulo 24 because a midnight end time will be '24' */ end_hour = (event->end_minute / 60) % 24; end_minute = event->end_minute % 60; @@ -617,17 +617,17 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, draw_recurrence_icon = TRUE; num_icons++; } - + if (e_cal_component_has_attachments (comp)) { draw_attach_icon = TRUE; num_icons++; } - + if (e_cal_component_has_organizer (comp)) { draw_meeting_icon = TRUE; num_icons++; } - + if (event->different_timezone) { draw_timezone_icon = TRUE; num_icons++; @@ -664,7 +664,7 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, 0, 0); icon_x += icon_x_inc; } - + if (draw_recurrence_icon && icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) { gdk_gc_set_clip_mask (gc, NULL); gdk_draw_pixbuf (drawable, gc, @@ -870,7 +870,7 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, /* Get the start & end times in 24-hour format. */ start_hour = event->start_minute / 60; start_minute = event->start_minute % 60; - + /* Modulo 24 because a midnight end time will be '24' */ end_hour = (event->end_minute / 60) % 24; end_minute = event->end_minute % 60; @@ -886,7 +886,7 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, time_x = x1 + E_WEEK_VIEW_EVENT_L_PAD + 1; rect_x = x1 + E_WEEK_VIEW_EVENT_L_PAD; rect_w = x2 - x1 - E_WEEK_VIEW_EVENT_L_PAD - E_WEEK_VIEW_EVENT_R_PAD + 1; - + if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)), event->comp_data), &bg_color)) { @@ -906,17 +906,17 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, red = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green; green = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green; blue = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green; - } + } /* Here we draw the border around the event*/ cairo_save (cr); - cx0 = rect_x; + cx0 = rect_x; cy0 = y1 + 1; rect_width = rect_w; rect_height = y2 - y1 - 1; - radius = 12; + radius = 12; draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); @@ -924,17 +924,17 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_set_source_rgb (cr, red/cc, green/cc, blue/cc); cairo_stroke (cr); cairo_restore (cr); - + /* Fill it in the Event */ cairo_save (cr); - cx0 = rect_x + 1.5; + cx0 = rect_x + 1.5; cy0 = y1 + 2.75; rect_width = rect_w - 3.; rect_height = y2 - y1 - 4.5; - radius = 8; + radius = 8; draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); @@ -1045,16 +1045,16 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, red = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green; green = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green; blue = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green; - } + } /* Here we draw the border around the event */ - cx0 = rect_x; + cx0 = rect_x; cy0 = y1 + 1; rect_width = rect_w; rect_height = y2 - y1 - 1; - radius = 12; + radius = 12; draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); @@ -1067,12 +1067,12 @@ e_week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); - cx0 = rect_x + 1.5; + cx0 = rect_x + 1.5; cy0 = y1 + 2.75; rect_width = rect_w - 3.; rect_height = y2 - y1 - 4.5; - radius = 8; + radius = 8; draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); @@ -1254,7 +1254,7 @@ e_week_view_draw_time (EWeekView *week_view, time_x, time_y_small_font, layout); - + pango_layout_set_font_description (layout, style->font_desc); time_x += week_view->small_digit_width * 2; @@ -1262,7 +1262,7 @@ e_week_view_draw_time (EWeekView *week_view, /* Draw the 'am'/'pm' suffix, if 12-hour format. */ if (!e_calendar_view_get_use_24_hour_format (E_CALENDAR_VIEW (week_view))) { pango_layout_set_text (layout, suffix, -1); - + gdk_draw_layout (drawable, gc, time_x, time_y_normal_font, @@ -1329,7 +1329,7 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, draw_recurrence_icon = TRUE; num_icons++; } - + if (e_cal_component_has_attachments (comp)) { draw_attach_icon = TRUE; num_icons++; @@ -1339,7 +1339,7 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, draw_meeting_icon = TRUE; num_icons++; } - + if (event->different_timezone) { draw_timezone_icon = TRUE; num_icons++; @@ -1371,7 +1371,7 @@ e_week_view_event_item_draw_icons (EWeekViewEventItem *wveitem, icon_x += icon_x_inc; } - + if (draw_recurrence_icon && icon_x + E_WEEK_VIEW_ICON_WIDTH <= x2) { cairo_save (cr); gdk_cairo_set_source_pixbuf (cr, week_view->recurrence_icon, icon_x, icon_y); diff --git a/calendar/gui/e-week-view-event-item.h b/calendar/gui/e-week-view-event-item.h index 404359cd50..59440ef291 100644 --- a/calendar/gui/e-week-view-event-item.h +++ b/calendar/gui/e-week-view-event-item.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 2001, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-week-view-layout.h b/calendar/gui/e-week-view-layout.h index 0d42429bd1..9f51f53bd8 100644 --- a/calendar/gui/e-week-view-layout.h +++ b/calendar/gui/e-week-view-layout.h @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 2001, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index abfc0993cd..9f214af1d2 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -110,7 +110,7 @@ e_week_view_main_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) EWeekViewMainItem *wvmitem; wvmitem = E_WEEK_VIEW_MAIN_ITEM (o); - + switch (arg_id){ case ARG_WEEK_VIEW: wvmitem->week_view = GTK_VALUE_POINTER (*arg); @@ -281,7 +281,7 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, width - 5, line_y - y); } } - + /* Display the date in the top of the cell. In the week view, display the long format "10 January" in all cells, or abbreviate it to "10 Jan" or "10" if that doesn't fit. @@ -338,10 +338,10 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, } else if (week_view->multi_week_view) { struct icaltimetype tt; - /* Check if we are drawing today */ + /* Check if we are drawing today */ tt = icaltime_from_timet_with_zone (time (NULL), FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - if (g_date_get_year (date) == tt.year + if (g_date_get_year (date) == tt.year && g_date_get_month (date) == tt.month && g_date_get_day (date) == tt.day) { gdk_gc_set_foreground (gc, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]); @@ -357,11 +357,11 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, g_date_strftime (buffer, sizeof (buffer), format_string ? format_string : "<b>%d</b>", date); layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), buffer); - pango_layout_set_markup (layout, buffer, strlen(buffer)); + pango_layout_set_markup (layout, buffer, strlen(buffer)); } else { g_date_strftime (buffer, sizeof (buffer), format_string ? format_string : "%d", date); - layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), buffer); + layout = gtk_widget_create_pango_layout (GTK_WIDGET (week_view), buffer); } pango_layout_get_pixel_size (layout, &date_width, NULL); @@ -440,9 +440,9 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, month starts (defaults are white for odd - January, March, ... and light gray for even). In the week view the background is always the same color, the color used for the odd months in the month view. */ - if (week_view->multi_week_view && (month % 2 == 0)) + if (week_view->multi_week_view && (month % 2 == 0)) bg_color = &week_view->colors[E_WEEK_VIEW_COLOR_EVEN_MONTHS]; - else + else bg_color = &week_view->colors[E_WEEK_VIEW_COLOR_ODD_MONTHS]; cairo_save (cr); @@ -481,7 +481,7 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]); } - if (week_view->multi_week_view) { + if (week_view->multi_week_view) { cairo_rectangle (cr, x + 2, y + 1, width - 5, E_WEEK_VIEW_DATE_T_PAD - 1 + @@ -493,9 +493,9 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, width - 5, line_y - y); cairo_fill (cr); } - } - cairo_restore (cr); - + } + cairo_restore (cr); + /* Display the date in the top of the cell. In the week view, display the long format "10 January" in all cells, or abbreviate it to "10 Jan" or "10" if that doesn't fit. @@ -553,10 +553,10 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, } else if (week_view->multi_week_view) { struct icaltimetype tt; - /* Check if we are drawing today */ + /* Check if we are drawing today */ tt = icaltime_from_timet_with_zone (time (NULL), FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - if (g_date_get_year (date) == tt.year + if (g_date_get_year (date) == tt.year && g_date_get_month (date) == tt.month && g_date_get_day (date) == tt.day) { gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_TODAY]); @@ -577,7 +577,7 @@ e_week_view_main_item_draw_day (EWeekViewMainItem *wvmitem, layout = pango_cairo_create_layout (cr); pango_layout_set_font_description (layout, font_desc); pango_layout_set_text (layout, buffer, -1); - pango_layout_set_markup (layout, buffer, strlen(buffer)); + pango_layout_set_markup (layout, buffer, strlen(buffer)); } else { g_date_strftime (buffer, sizeof (buffer), format_string ? format_string : "%d", date); diff --git a/calendar/gui/e-week-view-main-item.h b/calendar/gui/e-week-view-main-item.h index 551d0b4c68..f475024051 100644 --- a/calendar/gui/e-week-view-main-item.h +++ b/calendar/gui/e-week-view-main-item.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 2001, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c index 0ff79a8eff..08f401e599 100644 --- a/calendar/gui/e-week-view-titles-item.c +++ b/calendar/gui/e-week-view-titles-item.c @@ -1,13 +1,13 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -96,7 +96,7 @@ e_week_view_titles_item_set_arg (GtkObject *o, GtkArg *arg, guint arg_id) EWeekViewTitlesItem *wvtitem; wvtitem = E_WEEK_VIEW_TITLES_ITEM (o); - + switch (arg_id){ case ARG_WEEK_VIEW: wvtitem->week_view = GTK_VALUE_POINTER (*arg); diff --git a/calendar/gui/e-week-view-titles-item.h b/calendar/gui/e-week-view-titles-item.h index 1b276b0da1..e70193b14b 100644 --- a/calendar/gui/e-week-view-titles-item.h +++ b/calendar/gui/e-week-view-titles-item.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 2001, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index be189a0905..6915ec1b7d 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -251,10 +251,10 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo /* Calculate the weekday of the given date, 0 = Mon. */ weekday = g_date_get_weekday (&date) - 1; - + /* Convert it to an offset from the start of the display. */ week_start_offset = (weekday + 7 - week_view->display_start_day) % 7; - + /* Set the day_offset to the result, so we move back to the start of the week. */ day_offset = week_start_offset; @@ -270,7 +270,7 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo week_view->base_date = base_date; update_adjustment_value = TRUE; } - + /* See if we need to update the first day shown. */ if (!g_date_valid (&week_view->first_day_shown) || g_date_compare (&week_view->first_day_shown, &base_date)) { @@ -285,13 +285,13 @@ time_range_changed_cb (ECalModel *model, time_t start_time, time_t end_time, gpo /* Reset the adjustment value to 0 if the base address has changed. Note that we do this after updating first_day_shown so that our signal handler will not try to reload the events. */ - if (update_adjustment_value) + if (update_adjustment_value) gtk_adjustment_set_value (GTK_RANGE (week_view->vscrollbar)->adjustment, 0); gtk_widget_queue_draw (week_view->main_canvas); /* FIXME Preserve selection if possible */ - if (week_view->selection_start_day == -1 || + if (week_view->selection_start_day == -1 || (week_view->multi_week_view ? week_view->weeks_shown * 7 : 7) <= week_view->selection_start_day) e_week_view_set_selected_time_range (E_CALENDAR_VIEW (week_view), start_time, start_time); } @@ -390,9 +390,9 @@ model_rows_deleted_cb (ETableModel *etm, int row, int count, gpointer user_data) { EWeekView *week_view = E_WEEK_VIEW (user_data); int i; - + /* FIXME Stop editing? */ - + for (i = row + count; i > row; i--) { gint event_num; const char *uid, *rid = NULL; @@ -426,7 +426,7 @@ timezone_changed_cb (ECalendarView *cal_view, icaltimezone *old_zone, struct icaltimetype tt = icaltime_null_time (); time_t lower; EWeekView *week_view = (EWeekView *) cal_view; - + g_return_if_fail (E_IS_WEEK_VIEW (week_view)); /* If we don't have a valid date set yet, just return. */ @@ -589,7 +589,7 @@ e_week_view_init (EWeekView *week_view) /* Get the model */ model = e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)); - + /* connect to ECalModel's signals */ g_signal_connect (G_OBJECT (model), "time_range_changed", G_CALLBACK (time_range_changed_cb), week_view); @@ -618,10 +618,10 @@ GtkWidget * e_week_view_new (void) { GtkWidget *week_view; - + week_view = GTK_WIDGET (g_object_new (e_week_view_get_type (), NULL)); e_cal_model_set_flags (e_calendar_view_get_model (E_CALENDAR_VIEW (week_view)), E_CAL_MODEL_FLAGS_EXPAND_RECURRENCES); - + return week_view; } @@ -686,7 +686,7 @@ e_week_view_realize (GtkWidget *widget) /* Allocate the colors. */ e_week_view_set_colors(week_view, widget); - + gdk_gc_set_colormap (week_view->main_gc, colormap); /* Create the pixmaps. */ @@ -780,9 +780,9 @@ static GdkColor e_week_view_get_text_color (EWeekView *week_view, EWeekViewEvent *event, GtkWidget *widget) { GdkColor color, bg_color; - guint16 red, green, blue; + guint16 red, green, blue; gdouble cc = 65535.0; - + red = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].red; green = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].green; blue = week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BACKGROUND].blue; @@ -1418,7 +1418,7 @@ e_week_view_set_selected_time_range_visible (EWeekView *week_view, g_return_if_fail (E_IS_WEEK_VIEW (week_view)); time_to_gdate_with_zone (&date, start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - + /* Set the selection to the given days. */ week_view->selection_start_day = g_date_get_julian (&date) - g_date_get_julian (&week_view->first_day_shown); @@ -1848,23 +1848,23 @@ e_week_view_recalc_display_start_day (EWeekView *week_view) static void set_text_as_bold (EWeekViewEvent *event, EWeekViewEventSpan *span) { - ECalComponent *comp; + ECalComponent *comp; char *address; GSList *attendees, *l; ECalComponentAttendee *at = NULL; comp = e_cal_component_new (); e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (event->comp_data->icalcomp)); - address = itip_get_comp_attendee (comp, event->comp_data->client); + address = itip_get_comp_attendee (comp, event->comp_data->client); e_cal_component_get_attendee_list (comp, &attendees); for (l = attendees; l; l = l->next) { ECalComponentAttendee *attendee = l->data; if (g_str_equal (itip_strip_mailto (attendee->value), address)) { - at = attendee; + at = attendee; break; - } + } } /* The attendee has not yet accepted the meeting, display the summary as bolded. @@ -2115,7 +2115,7 @@ e_week_view_on_button_press (GtkWidget *widget, /* FIXME: Optimise? */ gtk_widget_queue_draw (week_view->main_canvas); } - + e_week_view_show_popup_menu (week_view, event, -1); } @@ -2149,18 +2149,18 @@ e_week_view_on_scroll (GtkWidget *widget, gfloat new_value; GtkWidget *tool_window = g_object_get_data (G_OBJECT (week_view), "tooltip-window"); guint timeout; - + timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (week_view), "tooltip-timeout")); if (timeout) { g_source_remove (timeout); g_object_set_data (G_OBJECT (week_view), "tooltip-timeout", NULL); } - + if (tool_window) { gtk_widget_destroy (tool_window); g_object_set_data (G_OBJECT (week_view), "tooltip-window", NULL); } - + switch (scroll->direction){ case GDK_SCROLL_UP: new_value = adj->value - adj->page_increment; @@ -2171,10 +2171,10 @@ e_week_view_on_scroll (GtkWidget *widget, default: return FALSE; } - + new_value = CLAMP (new_value, adj->lower, adj->upper - adj->page_size); gtk_adjustment_set_value (adj, new_value); - + return TRUE; } @@ -2560,7 +2560,7 @@ tooltip_get_view_event (EWeekView *week_view, int day, int event_num) EWeekViewEvent *pevent; pevent = &g_array_index (week_view->events, EWeekViewEvent, event_num); - + return pevent; } @@ -2570,20 +2570,20 @@ tooltip_destroy (EWeekView *week_view, GnomeCanvasItem *item) int event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; guint timeout; - + timeout = GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (week_view), "tooltip-timeout")); if (timeout) { g_source_remove (timeout); g_object_set_data (G_OBJECT (week_view), "tooltip-timeout", NULL); } - + pevent = tooltip_get_view_event (week_view, -1, event_num); if (pevent) { if (pevent->tooltip && g_object_get_data (G_OBJECT (week_view), "tooltip-window")) { gtk_widget_destroy (pevent->tooltip); pevent->tooltip = NULL; } - + g_object_set_data (G_OBJECT (week_view), "tooltip-window", NULL); } } @@ -2595,36 +2595,36 @@ tooltip_event_cb (GnomeCanvasItem *item, { int event_num = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; - + pevent = tooltip_get_view_event (view, -1, event_num); - + switch (event->type) { case GDK_ENTER_NOTIFY: { ECalendarViewEventData *data; - + data = g_malloc (sizeof (ECalendarViewEventData)); - + pevent->x = ((GdkEventCrossing *)event)->x_root; pevent->y = ((GdkEventCrossing *)event)->y_root; - pevent->tooltip = NULL; + pevent->tooltip = NULL; data->cal_view = (ECalendarView *)view; data->day = -1; data->event_num = event_num; data->get_view_event = (ECalendarViewEvent * (*)(ECalendarView *, int, int)) tooltip_get_view_event; pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, data); - g_object_set_data ((GObject *)view, "tooltip-timeout", GUINT_TO_POINTER (pevent->timeout)); - + g_object_set_data ((GObject *)view, "tooltip-timeout", GUINT_TO_POINTER (pevent->timeout)); + return TRUE; } case GDK_MOTION_NOTIFY: pevent->x = ((GdkEventMotion *)event)->x_root; pevent->y = ((GdkEventMotion *)event)->y_root; pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (view), "tooltip-window"); - + if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); } return TRUE; @@ -2716,12 +2716,12 @@ e_week_view_reshape_event_span (EWeekView *week_view, e_week_view_event_item_get_type (), NULL); } - + g_object_set_data ((GObject *)span->background_item, "event-num", GINT_TO_POINTER (event_num)); g_signal_connect (span->background_item, "event", G_CALLBACK (tooltip_event_cb), week_view); - + gnome_canvas_item_set (span->background_item, "event_num", event_num, "span_num", span_num, @@ -2751,16 +2751,16 @@ e_week_view_reshape_event_span (EWeekView *week_view, "fill_color_gdk", &color, "im_context", E_CANVAS (week_view->main_canvas)->im_context, NULL); - + if (free_text) g_free ((gchar*)summary); - -/* Uncomment once the pango fix is in - if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) + +/* Uncomment once the pango fix is in + if (e_cal_get_static_capability (event->comp_data->client, CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) { set_text_as_bold (event, span); } */ - g_object_set_data (G_OBJECT (span->text_item), "event-num", GINT_TO_POINTER (event_num)); + g_object_set_data (G_OBJECT (span->text_item), "event-num", GINT_TO_POINTER (event_num)); g_signal_connect (span->text_item, "event", G_CALLBACK (e_week_view_on_text_item_event), week_view); @@ -2921,7 +2921,7 @@ e_week_view_start_editing_event (EWeekView *week_view, ETextEventProcessorCommand command; ECalModelComponent *comp_data; gboolean read_only; - + /* If we are already editing the event, just return. */ if (event_num == week_view->editing_event_num && span_num == week_view->editing_span_num) @@ -2946,14 +2946,14 @@ e_week_view_start_editing_event (EWeekView *week_view, /* Save the comp_data value because we use that as our invariant */ comp_data = event->comp_data; - + e_canvas_item_grab_focus (span->text_item, TRUE); - + /* If the above focus caused things to redraw, then find the * the event and the span again */ if (event_num < week_view->events->len) event = &g_array_index (week_view->events, EWeekViewEvent, event_num); - + if (event_num >= week_view->events->len || event->comp_data != comp_data) { /* Unfocussing can cause a removal but not a new * addition so just run backwards through the @@ -2963,8 +2963,8 @@ e_week_view_start_editing_event (EWeekView *week_view, if (event->comp_data == comp_data) break; } - g_return_val_if_fail (event_num >= 0, FALSE); - } + g_return_val_if_fail (event_num >= 0, FALSE); + } span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + span_num); /* Try to move the cursor to the end of the text. */ @@ -3021,7 +3021,7 @@ cancel_editing (EWeekView *week_view) if (free_text) g_free ((gchar*)summary); - + /* Stop editing */ e_week_view_stop_editing_event (week_view); } @@ -3035,13 +3035,13 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, gint event_num, span_num; int nevent = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (item), "event-num")); EWeekViewEvent *pevent; - + pevent = tooltip_get_view_event (week_view, -1, nevent); #if 0 g_print ("In e_week_view_on_text_item_event\n"); #endif - + switch (gdkevent->type) { case GDK_KEY_PRESS: tooltip_destroy (week_view, item); @@ -3168,13 +3168,13 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, &nspan)) return FALSE; - - g_object_set_data ((GObject *)item, "event-num", GINT_TO_POINTER (nevent)); - + + g_object_set_data ((GObject *)item, "event-num", GINT_TO_POINTER (nevent)); + pevent = tooltip_get_view_event (week_view, -1, nevent); data = g_malloc (sizeof (ECalendarViewEventData)); - + pevent->x = ((GdkEventCrossing *)gdkevent)->x_root; pevent->y = ((GdkEventCrossing *)gdkevent)->y_root; pevent->tooltip = NULL; @@ -3183,24 +3183,24 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, data->day = -1; data->event_num = nevent; data->get_view_event = (ECalendarViewEvent * (*)(ECalendarView *, int, int)) tooltip_get_view_event; - pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, data); + pevent->timeout = g_timeout_add (500, (GSourceFunc)e_calendar_view_get_tooltips, data); g_object_set_data ((GObject *)week_view, "tooltip-timeout", GUINT_TO_POINTER (pevent->timeout)); - + return TRUE; - } + } case GDK_LEAVE_NOTIFY: tooltip_destroy (week_view, item); - + return FALSE; case GDK_MOTION_NOTIFY: pevent->x = ((GdkEventMotion *)gdkevent)->x_root; pevent->y = ((GdkEventMotion *)gdkevent)->y_root; pevent->tooltip = (GtkWidget *)g_object_get_data (G_OBJECT (week_view), "tooltip-window"); - + if (pevent->tooltip) { - e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); + e_calendar_view_move_tip (pevent->tooltip, pevent->x+16, pevent->y+16); } - return TRUE; + return TRUE; case GDK_FOCUS_CHANGE: if (gdkevent->focus_change.in) { e_week_view_on_editing_started (week_view, item); @@ -3242,7 +3242,7 @@ static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDir if (start_time.is_date && end_time.is_date) is_all_day = TRUE; - current_end_day = e_week_view_get_day_offset_of_event (week_view,end_dt); + current_end_day = e_week_view_get_day_offset_of_event (week_view,end_dt); switch (direction) { case E_CAL_VIEW_MOVE_UP: @@ -3256,11 +3256,11 @@ static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDir break; case E_CAL_VIEW_MOVE_RIGHT: adjust_days = e_week_view_get_adjust_days_for_move_right (week_view,current_end_day); - break; + break; default: break; } - + icaltime_adjust (&start_time ,adjust_days,0,0,0); icaltime_adjust (&end_time ,adjust_days,0,0,0); start_dt = icaltime_as_timet_with_zone (start_time, @@ -3285,7 +3285,7 @@ static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDir return TRUE; } } - + e_week_view_change_event_time (week_view, start_dt, end_dt, is_all_day); return TRUE; } @@ -3294,7 +3294,7 @@ static gint e_week_view_get_day_offset_of_event (EWeekView *week_view, time_t event_time) { time_t first_day = week_view->day_starts[0]; - + if (event_time - first_day < 0) return -1; else @@ -3306,7 +3306,7 @@ e_week_view_scroll_a_step (EWeekView *week_view, ECalViewMoveDirection direction { GtkAdjustment *adj = GTK_RANGE (week_view->vscrollbar)->adjustment; gfloat new_value; - + switch (direction){ case E_CAL_VIEW_MOVE_UP: new_value = adj->value - adj->step_increment; @@ -3357,7 +3357,7 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end /* FIXME: Should probably keep the timezone of the original start and end times. */ date.tzid = icaltimezone_get_tzid (e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - + *date.value = icaltime_from_timet_with_zone (start_dt, is_all_day, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); e_cal_component_set_dtstart (comp, &date); @@ -3366,12 +3366,12 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end e_cal_component_set_dtend (comp, &date); e_cal_component_commit_sequence (comp); - + if (week_view->last_edited_comp_string != NULL) { g_free (week_view->last_edited_comp_string); week_view->last_edited_comp_string = NULL; } - + week_view->last_edited_comp_string = e_cal_component_get_as_string (comp); @@ -3388,13 +3388,13 @@ e_week_view_change_event_time (EWeekView *week_view, time_t start_dt, time_t end e_cal_component_set_exrule_list (comp, NULL); } } - + toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (week_view))); e_cal_component_commit_sequence (comp); e_calendar_view_modify_and_send (comp, client, mod, toplevel, TRUE); -out: +out: g_object_unref (comp); } @@ -3439,7 +3439,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, ECal *client; const char *uid; gboolean on_server; - + /* Note: the item we are passed here isn't reliable, so we just stop the edit of whatever item was being edited. We also receive this event twice for some reason. */ @@ -3470,10 +3470,10 @@ e_week_view_on_editing_stopped (EWeekView *week_view, client = event->comp_data->client; on_server = cal_comp_is_on_server (comp, client); - + if (string_is_empty (text) && !on_server) { e_cal_component_get_uid (comp, &uid); - g_signal_handlers_disconnect_by_func(item, e_week_view_on_text_item_event, week_view); + g_signal_handlers_disconnect_by_func(item, e_week_view_on_text_item_event, week_view); e_week_view_foreach_event_with_uid (week_view, uid, e_week_view_remove_event_cb, NULL); week_view->event_destroyed = TRUE; @@ -3490,12 +3490,12 @@ e_week_view_on_editing_stopped (EWeekView *week_view, span_num); } else if (summary.value || !string_is_empty (text)) { icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp); - + summary.value = text; summary.altrep = NULL; e_cal_component_set_summary (comp, &summary); e_cal_component_commit_sequence (comp); - + if (!on_server) { if (!e_cal_create_object (client, icalcomp, NULL, NULL)) g_message (G_STRLOC ": Could not create the object!"); @@ -3507,7 +3507,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, } else { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; - + if (e_cal_component_is_instance (comp)) { if (!recur_component_dialog (client, comp, &mod, NULL, FALSE)) { goto out; @@ -3552,7 +3552,7 @@ e_week_view_on_editing_stopped (EWeekView *week_view, e_cal_component_commit_sequence (comp); } } - + /* FIXME When sending here, what exactly should we send? */ toplevel = GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (week_view))); e_calendar_view_modify_and_send (comp, client, mod, toplevel, FALSE); @@ -3681,7 +3681,7 @@ e_week_view_do_cursor_key_up (EWeekView *week_view) { if (week_view->selection_start_day <= 0) return; - + week_view->selection_start_day--; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3694,7 +3694,7 @@ e_week_view_do_cursor_key_down (EWeekView *week_view) if (week_view->selection_start_day == -1 || week_view->selection_start_day >= 6) return; - + week_view->selection_start_day++; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3706,7 +3706,7 @@ e_week_view_do_cursor_key_left (EWeekView *week_view) { if (week_view->selection_start_day == -1) return; - + week_view->selection_start_day = map_left[week_view->selection_start_day]; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3718,7 +3718,7 @@ e_week_view_do_cursor_key_right (EWeekView *week_view) { if (week_view->selection_start_day == -1) return; - + week_view->selection_start_day = map_right[week_view->selection_start_day]; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3730,7 +3730,7 @@ e_month_view_do_cursor_key_up (EWeekView *week_view) { if (week_view->selection_start_day < 7) return; - + week_view->selection_start_day -= 7; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3745,7 +3745,7 @@ e_month_view_do_cursor_key_down (EWeekView *week_view) if (week_view->selection_start_day == -1 || week_view->selection_start_day >= (weeks_shown - 1) * 7) return; - + week_view->selection_start_day += 7; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3757,7 +3757,7 @@ e_month_view_do_cursor_key_left (EWeekView *week_view) { if (week_view->selection_start_day <= 0) return; - + week_view->selection_start_day--; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3772,7 +3772,7 @@ e_month_view_do_cursor_key_right (EWeekView *week_view) if (week_view->selection_start_day == -1 || week_view->selection_start_day >= weeks_shown * 7 - 1) return; - + week_view->selection_start_day++; week_view->selection_end_day = week_view->selection_start_day; g_signal_emit_by_name (week_view, "selected_time_changed"); @@ -3858,7 +3858,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) gboolean read_only = TRUE; gboolean stop_emission; GnomeCalendarViewType view_type; - + g_return_val_if_fail (widget != NULL, FALSE); g_return_val_if_fail (E_IS_WEEK_VIEW (widget), FALSE); g_return_val_if_fail (event != NULL, FALSE); @@ -3886,15 +3886,15 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) case GDK_Page_Up: if (!week_view->multi_week_view) e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_UP); - else + else e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_PAGE_UP); break; case GDK_Page_Down: if (!week_view->multi_week_view) e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_DOWN); - else + else e_week_view_scroll_a_step (week_view, E_CAL_VIEW_MOVE_PAGE_DOWN); - break; + break; case GDK_Up: e_week_view_cursor_key_up (week_view, view_type); break; @@ -3914,7 +3914,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) } if (stop_emission) return TRUE; - + /*Navigation through days with arrow keys*/ if (((event->state & GDK_SHIFT_MASK) != GDK_SHIFT_MASK) &&((event->state & GDK_CONTROL_MASK) != GDK_CONTROL_MASK) @@ -3928,7 +3928,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) else if (keyval == GDK_Right || keyval == GDK_KP_Right) return e_week_view_event_move ((ECalendarView *) week_view, E_CAL_VIEW_MOVE_RIGHT); } - + if (week_view->selection_start_day == -1) return FALSE; @@ -3998,7 +3998,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) event_num); span = &g_array_index (week_view->spans, EWeekViewEventSpan, wvevent->spans_index + 0); - + /* If the event can't be fit on the screen, don't try to edit it. */ if (!span->text_item) { e_week_view_foreach_event_with_uid (week_view, uid, @@ -4007,7 +4007,7 @@ e_week_view_do_key_press (GtkWidget *widget, GdkEventKey *event) e_week_view_start_editing_event (week_view, event_num, 0, initial_text); } - + } else { g_warning ("Couldn't find event to start editing.\n"); } @@ -4076,7 +4076,7 @@ e_week_view_show_popup_menu (EWeekView *week_view, gint event_num) { GtkMenu *popup; - + week_view->popup_event_num = event_num; popup = e_calendar_view_create_popup_menu (E_CALENDAR_VIEW (week_view)); diff --git a/calendar/gui/e-week-view.h b/calendar/gui/e-week-view.h index 579ba43eb7..ca46060c37 100644 --- a/calendar/gui/e-week-view.h +++ b/calendar/gui/e-week-view.h @@ -1,14 +1,14 @@ /* -*- Mode: C; tab-width: 8; indent-tabs-mode: t; c-basic-offset: 8 -*- */ -/* - * Author : +/* + * Author : * Damon Chaplin <damon@ximian.com> * * Copyright 1999, Ximian, Inc. * Copyright 2001, Ximian, Inc. * - * This program is free software; you can redistribute it and/or - * modify it under the terms of version 2 of the GNU General Public + * 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, @@ -108,7 +108,7 @@ typedef enum E_WEEK_VIEW_COLOR_DATES, E_WEEK_VIEW_COLOR_DATES_SELECTED, E_WEEK_VIEW_COLOR_TODAY, - + E_WEEK_VIEW_COLOR_LAST } EWeekViewColors; @@ -205,7 +205,7 @@ struct _EWeekView gboolean multi_week_view; gboolean update_base_date; - + /* How many weeks we are showing. This is only relevant if display_month is TRUE. */ gint weeks_shown; @@ -336,7 +336,7 @@ struct _EWeekView /* remember last selected interval when click and restore on double click, if we double clicked inside that interval. */ - guint32 bc_event_time; + guint32 bc_event_time; time_t before_click_dtstart; time_t before_click_dtend; }; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 140f84f3c7..768ed6e89b 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -96,7 +96,7 @@ /* Private part of the GnomeCalendar structure */ struct _GnomeCalendarPrivate { /* The clients for display */ - + GHashTable *clients[E_CAL_SOURCE_TYPE_LAST]; GList *clients_list[E_CAL_SOURCE_TYPE_LAST]; ECal *default_client[E_CAL_SOURCE_TYPE_LAST]; @@ -109,7 +109,7 @@ struct _GnomeCalendarPrivate { /* This is the last time explicitly selected by the user */ time_t base_view_time; - + /* Widgets */ GtkWidget *search_bar; @@ -119,13 +119,13 @@ struct _GnomeCalendarPrivate { GtkWidget *vpane; ECalendar *date_navigator; - EMiniCalendarConfig *date_navigator_config; + EMiniCalendarConfig *date_navigator_config; GtkWidget *todo; ECalendarTableConfig *todo_config; - + GtkWidget *memo; EMemoTableConfig *memo_config; - + GtkWidget *day_view; GtkWidget *work_week_view; GtkWidget *week_view; @@ -147,7 +147,7 @@ struct _GnomeCalendarPrivate { char *memo_sexp; guint update_timeout; guint update_marcus_bains_line_timeout; - + /* This is the view currently shown. We use it to keep track of the positions of the panes. range_selected is TRUE if a range of dates was selected in the date navigator to show the view. */ @@ -155,7 +155,7 @@ struct _GnomeCalendarPrivate { GObject *configs[GNOME_CAL_LAST_VIEW]; GnomeCalendarViewType current_view_type; GList *notifications; - + gboolean range_selected; /* These are the saved positions of the panes. They are multiples of @@ -175,7 +175,7 @@ struct _GnomeCalendarPrivate { /* Our current week start */ int week_start; - + /* Our current timezone. */ icaltimezone *zone; @@ -453,7 +453,7 @@ gnome_calendar_class_init (GnomeCalendarClass *class) "goto_date",1, G_TYPE_ENUM, GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); - + /* Ctrl+Y/J/K/M/L to switch between * DayView/WorkWeekView/WeekView/MonthView/ListView */ gtk_binding_entry_add_signal (binding_set, GDK_y, @@ -518,7 +518,7 @@ dn_e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer data) GnomeCalendar *gcal; GnomeCalendarPrivate *priv; GList *l; - + gcal = GNOME_CALENDAR (data); priv = gcal->priv; @@ -529,7 +529,7 @@ dn_e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer data) comp = e_cal_component_new (); if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (l->data))) { g_object_unref (comp); - + continue; } @@ -595,9 +595,9 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_ gboolean has_working_days = FALSE; guint offset; struct icaltimetype tt = icaltime_null_time (); - + priv = gcal->priv; - + switch (view_type) { case GNOME_CAL_DAY_VIEW: shown = e_day_view_get_days_shown (E_DAY_VIEW (priv->views[view_type])); @@ -667,7 +667,7 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_ shown = e_week_view_get_weeks_shown (E_WEEK_VIEW (priv->views[view_type])); /* FIXME We should be using the same day of the week enum every where */ display_start = (E_WEEK_VIEW (priv->views[view_type])->display_start_day + 1) % 7; - + if (!priv->range_selected) *start_time = time_month_begin_with_zone (*start_time, priv->zone); *start_time = time_week_begin_with_zone (*start_time, display_start, priv->zone); @@ -677,7 +677,7 @@ get_times_for_views (GnomeCalendar *gcal, GnomeCalendarViewType view_type, time_ /* FIXME What to do here? */ *start_time = time_month_begin_with_zone (*start_time, priv->zone); *end_time = time_add_month_with_zone (*start_time, 1, priv->zone); - break; + break; default: g_return_if_reached (); } @@ -1024,10 +1024,10 @@ gnome_calendar_emit_user_created_signal (gpointer instance, GnomeCalendar *gcal, static void user_created_cb (GtkWidget *view, GnomeCalendar *gcal) { - GnomeCalendarPrivate *priv; + GnomeCalendarPrivate *priv; ECal *ecal; - - priv = gcal->priv; + + priv = gcal->priv; ecal = priv->user_created_cal; if (!ecal) { @@ -1115,9 +1115,9 @@ static void connect_list_view_focus (GnomeCalendar *gcal, ECalListView *lv) { ETable *etable; - + etable = e_table_scrolled_get_table (lv->table_scrolled); - + g_signal_connect (etable->table_canvas, "focus_in_event", G_CALLBACK (calendar_focus_change_cb), gcal); g_signal_connect (etable->table_canvas, "focus_out_event", @@ -1153,7 +1153,7 @@ set_week_start (GnomeCalendar *calendar) GnomeCalendarPrivate *priv; priv = calendar->priv; - + priv->week_start = calendar_config_get_week_start_day (); /* Only do this if views exist */ @@ -1168,7 +1168,7 @@ static void week_start_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { GnomeCalendar *calendar = data; - + set_week_start (calendar); } @@ -1178,7 +1178,7 @@ set_working_days (GnomeCalendar *calendar) GnomeCalendarPrivate *priv; priv = calendar->priv; - + /* Only do this if views exist */ if (priv->day_view && priv->work_week_view && priv->week_view && priv->month_view && priv->list_view) { update_view_times (calendar, priv->base_view_time); @@ -1191,18 +1191,18 @@ static void working_days_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { GnomeCalendar *calendar = data; - + set_working_days (calendar); } static void -set_timezone (GnomeCalendar *calendar) +set_timezone (GnomeCalendar *calendar) { GnomeCalendarPrivate *priv; int i; - + priv = calendar->priv; - + priv->zone = calendar_config_get_icaltimezone (); for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) { @@ -1210,13 +1210,13 @@ set_timezone (GnomeCalendar *calendar) for (l = priv->clients_list[i]; l != NULL; l = l->next) { ECal *client = l->data; - + if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED) /* FIXME Error checking */ e_cal_set_default_timezone (client, priv->zone, NULL); } - if (priv->default_client[i] + if (priv->default_client[i] && e_cal_get_load_state (priv->default_client[i]) == E_CAL_LOAD_LOADED) /* FIXME Error checking */ e_cal_set_default_timezone (priv->default_client[i], priv->zone, NULL); @@ -1227,7 +1227,7 @@ static void timezone_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) { GnomeCalendar *calendar = data; - + set_timezone (calendar); } @@ -1237,16 +1237,16 @@ update_todo_view (GnomeCalendar *gcal) GnomeCalendarPrivate *priv; ECalModel *model; char *sexp = NULL; - + priv = gcal->priv; - + /* Set the query on the task pad */ if (priv->todo_sexp) { g_free (priv->todo_sexp); } - + model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)); - + if ((sexp = calendar_config_get_hide_completed_tasks_sexp (FALSE)) != NULL) { priv->todo_sexp = g_strdup_printf ("(and %s %s)", sexp, priv->sexp); e_cal_model_set_search_query (model, priv->todo_sexp); @@ -1255,7 +1255,7 @@ update_todo_view (GnomeCalendar *gcal) priv->todo_sexp = g_strdup (priv->sexp); e_cal_model_set_search_query (model, priv->todo_sexp); } - + } static void @@ -1263,11 +1263,11 @@ update_memo_view (GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; ECalModel *model, *view_model; - time_t start, end; + time_t start, end; char *iso_start, *iso_end; - + priv = gcal->priv; - + /* Set the query on the memo pad*/ model = e_memo_table_get_model (E_MEMO_TABLE (priv->memo)); view_model = e_calendar_view_get_model(priv->views[priv->current_view_type]); @@ -1280,11 +1280,11 @@ update_memo_view (GnomeCalendar *gcal) if (priv->memo_sexp) { g_free (priv->memo_sexp); } - + priv->memo_sexp = g_strdup_printf ("(not (has-start?)) or (and (occur-in-time-range? (make-time \"%s\")" " (make-time \"%s\"))" " %s)", - iso_start, iso_end, + iso_start, iso_end, priv->sexp ? priv->sexp : ""); e_cal_model_set_search_query (model, priv->memo_sexp); @@ -1308,7 +1308,7 @@ process_completed_tasks (GnomeCalendar *gcal, gboolean config_changed) static gboolean update_todo_view_cb (GnomeCalendar *gcal) -{ +{ ECalModel *model; model = e_calendar_table_get_model (E_CALENDAR_TABLE (gcal->priv->todo)); @@ -1321,7 +1321,7 @@ update_todo_view_cb (GnomeCalendar *gcal) static gboolean update_marcus_bains_line_cb (GnomeCalendar *gcal) -{ +{ GnomeCalendarPrivate *priv; priv = gcal->priv; @@ -1359,23 +1359,23 @@ setup_config (GnomeCalendar *calendar) priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* Timezone */ - set_timezone (calendar); + set_timezone (calendar); not = calendar_config_add_notification_timezone (timezone_changed_cb, calendar); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); /* Hide completed tasks */ - not = calendar_config_add_notification_hide_completed_tasks (config_hide_completed_tasks_changed_cb, + not = calendar_config_add_notification_hide_completed_tasks (config_hide_completed_tasks_changed_cb, calendar); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - - not = calendar_config_add_notification_hide_completed_tasks_units (config_hide_completed_tasks_changed_cb, + + not = calendar_config_add_notification_hide_completed_tasks_units (config_hide_completed_tasks_changed_cb, calendar); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - - not = calendar_config_add_notification_hide_completed_tasks_value (config_hide_completed_tasks_changed_cb, + + not = calendar_config_add_notification_hide_completed_tasks_value (config_hide_completed_tasks_changed_cb, calendar); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); - + /* Pane positions */ priv->hpane_pos = calendar_config_get_hpane_pos (); priv->vpane_pos = calendar_config_get_vpane_pos (); @@ -1384,7 +1384,7 @@ setup_config (GnomeCalendar *calendar) } static void -update_adjustment (GnomeCalendar *gcal, GtkAdjustment *adjustment, EWeekView *week_view) +update_adjustment (GnomeCalendar *gcal, GtkAdjustment *adjustment, EWeekView *week_view) { GDate date; gint week_offset; @@ -1424,13 +1424,13 @@ update_adjustment (GnomeCalendar *gcal, GtkAdjustment *adjustment, EWeekView *we } static void -week_view_adjustment_changed_cb (GtkAdjustment *adjustment, GnomeCalendar *gcal) +week_view_adjustment_changed_cb (GtkAdjustment *adjustment, GnomeCalendar *gcal) { - update_adjustment (gcal, adjustment, E_WEEK_VIEW (gcal->priv->week_view)); + update_adjustment (gcal, adjustment, E_WEEK_VIEW (gcal->priv->week_view)); } static void -month_view_adjustment_changed_cb (GtkAdjustment *adjustment, GnomeCalendar *gcal) +month_view_adjustment_changed_cb (GtkAdjustment *adjustment, GnomeCalendar *gcal) { update_adjustment (gcal, adjustment, E_WEEK_VIEW (gcal->priv->month_view)); } @@ -1481,10 +1481,10 @@ view_done_cb (ECalModel *model, ECalendarStatus status, ECalSourceType type, Gno } else if (type == E_CAL_SOURCE_TYPE_JOURNAL) { e_memo_table_set_status_message (E_MEMO_TABLE (gcal->priv->memo), NULL); } - + } -GtkWidget * +GtkWidget * gnome_calendar_get_tag (GnomeCalendar *gcal) { return GTK_WIDGET (gcal->priv->date_navigator); @@ -1519,7 +1519,7 @@ setup_widgets (GnomeCalendar *gcal) /* The main HPaned, with the notebook of calendar views on the left and the ECalendar and ToDo list on the right. */ priv->hpane = gtk_hpaned_new (); - g_signal_connect_after(priv->hpane, "realize", + g_signal_connect_after(priv->hpane, "realize", G_CALLBACK(gnome_calendar_hpane_realized), gcal); g_signal_connect (priv->hpane, "button_release_event", G_CALLBACK (gnome_calendar_hpane_resized), gcal); @@ -1550,7 +1550,7 @@ setup_widgets (GnomeCalendar *gcal) G_CALLBACK (gnome_calendar_on_date_navigator_date_range_changed), gcal); g_signal_connect (w, "scroll-event", G_CALLBACK (gnome_calendar_date_navigator_scrolled), gcal); - + /* The VPaned widget, to contain the ToDo list & Memo list */ priv->vpane = gtk_vpaned_new (); g_signal_connect_after (priv->vpane, "realize", @@ -1564,18 +1564,18 @@ setup_widgets (GnomeCalendar *gcal) vbox = gtk_vbox_new (FALSE, 0); sep = gtk_hseparator_new (); gtk_box_pack_start ((GtkBox *)vbox, sep, FALSE, TRUE, 0); - + label = gtk_label_new (NULL); tmp = g_strdup_printf ("<b> %s </b>", _("Tasks")); gtk_label_set_markup ((GtkLabel *)label, tmp); g_free (tmp); gtk_box_pack_start ((GtkBox *)vbox, label, FALSE, TRUE, 0); - + priv->todo = e_calendar_table_new (); priv->todo_config = e_calendar_table_config_new (E_CALENDAR_TABLE (priv->todo)); gtk_paned_pack1 (GTK_PANED (priv->vpane), vbox, FALSE, TRUE); gtk_box_pack_end ((GtkBox *)vbox, priv->todo, TRUE, TRUE, 0); - + gtk_widget_show (priv->todo); gtk_widget_show (label); gtk_widget_show (vbox); @@ -1584,7 +1584,7 @@ setup_widgets (GnomeCalendar *gcal) filename = g_build_filename (calendar_component_peek_config_directory (calendar_component_peek ()), "TaskPad", NULL); e_calendar_table_load_state (E_CALENDAR_TABLE (priv->todo), filename); - + update_todo_view (gcal); g_free (filename); @@ -1596,14 +1596,14 @@ setup_widgets (GnomeCalendar *gcal) g_signal_connect (etable, "selection_change", G_CALLBACK (table_selection_change_cb), gcal); - + g_signal_connect (e_calendar_table_get_model ((ECalendarTable *)priv->todo), "cal_view_progress", G_CALLBACK (view_progress_cb), gcal); g_signal_connect (e_calendar_table_get_model ((ECalendarTable *)priv->todo), "cal_view_done", G_CALLBACK (view_done_cb), gcal); /* Timeout check to hide completed items */ - priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_todo_view_cb, gcal, NULL); + priv->update_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_todo_view_cb, gcal, NULL); /* The Day View. */ priv->day_view = e_day_view_new (); @@ -1623,7 +1623,7 @@ setup_widgets (GnomeCalendar *gcal) connect_day_view_focus (gcal, E_DAY_VIEW (priv->work_week_view)); /* The Marcus Bains line */ - priv->update_marcus_bains_line_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_marcus_bains_line_cb, gcal, NULL); + priv->update_marcus_bains_line_timeout = g_timeout_add_full (G_PRIORITY_LOW, 60000, (GSourceFunc) update_marcus_bains_line_cb, gcal, NULL); /* The Week View. */ priv->week_view = e_week_view_new (); @@ -1643,7 +1643,7 @@ setup_widgets (GnomeCalendar *gcal) G_CALLBACK (view_progress_cb), gcal); g_signal_connect (w_model, "cal_view_done", G_CALLBACK (view_done_cb), gcal); - + /* The Month View. */ priv->month_view = e_week_view_new (); e_calendar_view_set_calendar (E_CALENDAR_VIEW (priv->month_view), gcal); @@ -1659,7 +1659,7 @@ setup_widgets (GnomeCalendar *gcal) g_signal_connect (adjustment, "value_changed", G_CALLBACK (month_view_adjustment_changed_cb), gcal); - + /* The List View. */ priv->list_view = e_cal_list_view_new (); @@ -1696,13 +1696,13 @@ setup_widgets (GnomeCalendar *gcal) label = gtk_label_new (NULL); tmp = g_strdup_printf ("<b> %s </b>", _("Memos")); gtk_label_set_markup ((GtkLabel *)label, tmp); - g_free (tmp); + g_free (tmp); gtk_box_pack_start ((GtkBox *)vbox, label, FALSE, TRUE, 0); priv->memo = e_memo_table_new (); priv->memo_config = e_memo_table_config_new (E_MEMO_TABLE (priv->memo)); gtk_paned_pack2 (GTK_PANED (priv->vpane), vbox, TRUE, TRUE); gtk_box_pack_end ((GtkBox *)vbox, priv->memo, TRUE, TRUE, 0); - + gtk_widget_show (priv->memo); gtk_widget_show (label); gtk_widget_show (vbox); @@ -1710,7 +1710,7 @@ setup_widgets (GnomeCalendar *gcal) filename = g_build_filename (memos_component_peek_config_directory (memos_component_peek ()), "MemoPad", NULL); e_memo_table_load_state (E_MEMO_TABLE (priv->memo), filename); - + update_memo_view (gcal); g_free (filename); @@ -1722,7 +1722,7 @@ setup_widgets (GnomeCalendar *gcal) g_signal_connect (etable, "selection_change", G_CALLBACK (memo_selection_change_cb), gcal); - + g_signal_connect (e_memo_table_get_model ((EMemoTable *)priv->memo), "cal_view_progress", G_CALLBACK (view_progress_cb), gcal); g_signal_connect (e_memo_table_get_model ((EMemoTable *)priv->memo), "cal_view_done", @@ -1731,7 +1731,7 @@ setup_widgets (GnomeCalendar *gcal) /* make sure we set the initial time ranges for the views */ update_view_times (gcal, time (NULL)); - gnome_calendar_update_date_navigator (gcal); + gnome_calendar_update_date_navigator (gcal); } /* Object initialization function for the gnome calendar */ @@ -1740,13 +1740,13 @@ gnome_calendar_init (GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; int i; - + priv = g_new0 (GnomeCalendarPrivate, 1); gcal->priv = priv; for (i = 0; i < E_CAL_SOURCE_TYPE_LAST; i++) priv->clients[i] = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_object_unref); - + priv->config_listener = e_config_listener_new (); g_signal_connect (priv->config_listener, "key_changed", G_CALLBACK (config_categories_changed_cb), gcal); @@ -1761,7 +1761,7 @@ gnome_calendar_init (GnomeCalendar *gcal) priv->taskpad_menu = e_cal_menu_new("org.gnome.evolution.calendar.taskpad"); priv->memopad_menu = e_cal_menu_new ("org.gnome.evolution.calendar.memopad"); - priv->dn_queries = NULL; + priv->dn_queries = NULL; priv->sexp = g_strdup ("#t"); /* Match all */ priv->todo_sexp = g_strdup ("#t"); priv->memo_sexp = g_strdup ("#t"); @@ -1815,11 +1815,11 @@ gnome_calendar_destroy (GtkObject *object) priv->clients_list[i] = NULL; if (priv->default_client[i]) { - g_signal_handlers_disconnect_matched (priv->default_client[i], + g_signal_handlers_disconnect_matched (priv->default_client[i], G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, gcal); g_object_unref (priv->default_client[i]); - } + } priv->default_client[i] = NULL; } @@ -1831,18 +1831,18 @@ gnome_calendar_destroy (GtkObject *object) g_object_unref (priv->date_navigator_config); g_object_unref (priv->todo_config); g_object_unref (priv->memo_config); - + for (l = priv->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); g_list_free (priv->notifications); priv->notifications = NULL; - + /* Save the TaskPad layout. */ filename = g_build_filename (calendar_component_peek_config_directory (calendar_component_peek ()), "TaskPad", NULL); e_calendar_table_save_state (E_CALENDAR_TABLE (priv->todo), filename); g_free (filename); - + /* Save the MemoPad layout. */ filename = g_build_filename (memos_component_peek_config_directory (memos_component_peek ()), "MemoPad", NULL); @@ -1864,7 +1864,7 @@ gnome_calendar_destroy (GtkObject *object) g_free (priv->sexp); priv->sexp = NULL; } - + if (priv->todo_sexp) { g_free (priv->todo_sexp); priv->todo_sexp = NULL; @@ -1931,7 +1931,7 @@ gnome_calendar_destroy (GtkObject *object) g_free (priv); gcal->priv = NULL; } - + if (GTK_OBJECT_CLASS (gnome_calendar_parent_class)->destroy) (* GTK_OBJECT_CLASS (gnome_calendar_parent_class)->destroy) (object); } @@ -1941,7 +1941,7 @@ notify_selected_time_changed (GnomeCalendar *gcal) { GnomeCalendarPrivate *priv; int i; - + priv = gcal->priv; for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { g_signal_emit_by_name (priv->views[i], "selected_time_changed"); @@ -1953,7 +1953,7 @@ gnome_calendar_goto_date (GnomeCalendar *gcal, GnomeCalendarGotoDateType goto_date) { GnomeCalendarPrivate *priv; - time_t new_time = 0; + time_t new_time = 0; gboolean need_updating = FALSE; g_return_if_fail (gcal != NULL); @@ -2032,11 +2032,11 @@ gnome_calendar_goto (GnomeCalendar *gcal, time_t new_time) update_view_times (gcal, new_time); gnome_calendar_update_date_navigator (gcal); gnome_calendar_notify_dates_shown_changed (gcal); - + for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { - if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (priv->views[i]))->set_selected_time_range) + if (E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (priv->views[i]))->set_selected_time_range) E_CALENDAR_VIEW_CLASS (G_OBJECT_GET_CLASS (priv->views[i]))->set_selected_time_range (priv->views[i], new_time, new_time); - } + } } @@ -2045,9 +2045,9 @@ update_view_times (GnomeCalendar *gcal, time_t start_time) { GnomeCalendarPrivate *priv; int i; - + priv = gcal->priv; - + priv->base_view_time = start_time; for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { @@ -2245,7 +2245,7 @@ display_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type, gboolean gra case GNOME_CAL_DAY_VIEW: if (!priv->range_selected) e_day_view_set_days_shown (E_DAY_VIEW (priv->day_view), 1); - + gtk_widget_show (GTK_WIDGET (gcal->priv->date_navigator)); break; @@ -2270,7 +2270,7 @@ display_view (GnomeCalendar *gcal, GnomeCalendarViewType view_type, gboolean gra case GNOME_CAL_LIST_VIEW: if (!priv->lview_select_daten_range) gtk_widget_hide (GTK_WIDGET (gcal->priv->date_navigator)); - else + else gtk_widget_show (GTK_WIDGET (gcal->priv->date_navigator)); break; @@ -2300,7 +2300,7 @@ static void gnome_calendar_change_view (GnomeCalendar *gcal, GnomeCalendarViewTy { if (gnome_calendar_get_view(gcal) == view_type) return; - + gnome_calendar_set_view(gcal, view_type); } @@ -2312,41 +2312,41 @@ display_view_cb (GalViewInstance *view_instance, GalView *view, gpointer data) GnomeCalendarPrivate *priv; CalendarView *cal_view; GnomeCalendarViewType view_type; - + gcal = GNOME_CALENDAR (data); priv = gcal->priv; - + if (GAL_IS_VIEW_ETABLE(view)) { ETable *table; - + view_type = GNOME_CAL_LIST_VIEW; - + table = e_table_scrolled_get_table (E_CAL_LIST_VIEW (priv->list_view)->table_scrolled); gal_view_etable_attach_table (GAL_VIEW_ETABLE (view), table); } else if (IS_CALENDAR_VIEW (view)) { cal_view = CALENDAR_VIEW (view); - + view_type = calendar_view_get_view_type (cal_view); } else { g_error (G_STRLOC ": Unknown type of view for GnomeCalendar"); return; } - + display_view (gcal, view_type, TRUE); gnome_calendar_update_date_navigator (gcal); gnome_calendar_notify_dates_shown_changed (gcal); if (!priv->lview_select_daten_range && priv->current_view_type != GNOME_CAL_LIST_VIEW) update_query (gcal); - + } /** * gnome_calendar_setup_view_menus: * @gcal: A calendar. * @uic: UI controller to use for the menus. - * + * * Sets up the #GalView menus for a calendar. This function should be called * from the Bonobo control activation callback for this calendar. Also, the * menus should be discarded using gnome_calendar_discard_view_menus(). @@ -2381,7 +2381,7 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic) path0 = g_build_filename (EVOLUTION_GALVIEWSDIR, "calendar", NULL); - path1 = g_build_filename (calendar_component_peek_base_directory (calendar_component_peek ()), + path1 = g_build_filename (calendar_component_peek_base_directory (calendar_component_peek ()), "calendar", "views", NULL); gal_view_collection_set_storage_directories (collection, path0, @@ -2437,7 +2437,7 @@ gnome_calendar_setup_view_menus (GnomeCalendar *gcal, BonoboUIComponent *uic) /** * gnome_calendar_discard_view_menus: * @gcal: A calendar. - * + * * Discards the #GalView menus used by a calendar. This function should be * called from the Bonobo control deactivation callback for this calendar. The * menus should have been set up with gnome_calendar_setup_view_menus(). @@ -2651,7 +2651,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) break; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: if (source_type == E_CAL_SOURCE_TYPE_EVENT) - e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), + e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), "calendar:prompt-no-contents-offline-calendar", NULL); default: /* Make sure the source doesn't disappear on us */ @@ -2680,7 +2680,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) /* add client to the views */ for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { ECalModel *model; - + model = e_calendar_view_get_model (priv->views[i]); e_cal_model_add_client (model, ecal); } @@ -2690,7 +2690,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); break; - + case E_CAL_SOURCE_TYPE_TODO : msg = g_strdup_printf (_("Loading tasks at %s"), e_cal_get_uri (ecal)); e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), msg, -1); @@ -2706,7 +2706,7 @@ client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar *gcal) g_free (msg); e_cal_model_add_client (e_memo_table_get_model (E_MEMO_TABLE (priv->memo)), ecal); e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL); - break; + break; default: g_return_if_reached (); } @@ -2730,7 +2730,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); - break; + break; case E_CAL_SOURCE_TYPE_TODO: e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1); break; @@ -2740,7 +2740,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar default: break; } - + switch (status) { case E_CALENDAR_STATUS_OK: break; @@ -2751,7 +2751,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar case E_CALENDAR_STATUS_INVALID_SERVER_VERSION : e_error_run (NULL, "calendar:server-version", NULL); status = E_CALENDAR_STATUS_OK; - default: + default: /* Make sure the source doesn't disappear on us */ g_object_ref (source); @@ -2773,7 +2773,7 @@ default_client_cal_opened_cb (ECal *ecal, ECalendarStatus status, GnomeCalendar g_signal_handlers_disconnect_matched (ecal, G_SIGNAL_MATCH_FUNC, 0, 0, NULL, default_client_cal_opened_cb, NULL); - + switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) { @@ -2807,7 +2807,7 @@ open_ecal (GnomeCalendar *gcal, ECal *cal, gboolean only_if_exists, open_func of zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (cal, zone, NULL); - + msg = g_strdup_printf (_("Opening %s"), e_cal_get_uri (cal)); switch (e_cal_get_source_type (cal)) { case E_CAL_SOURCE_TYPE_EVENT : @@ -2874,15 +2874,15 @@ backend_died_cb (ECal *ecal, gpointer data) /* Make sure the source doesn't go away on us since we use it below */ source_type = e_cal_get_source_type (ecal); - source = g_object_ref (e_cal_get_source (ecal)); - + source = g_object_ref (e_cal_get_source (ecal)); + priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], ecal); g_hash_table_remove (priv->clients[source_type], e_source_peek_uid (source)); switch (source_type) { - case E_CAL_SOURCE_TYPE_EVENT: + case E_CAL_SOURCE_TYPE_EVENT: id = "calendar:calendar-crashed"; - + e_calendar_view_set_status_message (E_CALENDAR_VIEW (priv->week_view), NULL, -1); gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[SOURCE_REMOVED], source_type, source); @@ -2890,15 +2890,15 @@ backend_died_cb (ECal *ecal, gpointer data) case E_CAL_SOURCE_TYPE_TODO: id = "calendar:tasks-crashed"; - + e_calendar_table_set_status_message (E_CALENDAR_TABLE (priv->todo), NULL, -1); gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[SOURCE_REMOVED], source_type, source); break; - + case E_CAL_SOURCE_TYPE_JOURNAL: id = "calendar:memos-crashed"; - + e_memo_table_set_status_message (E_MEMO_TABLE (priv->memo), NULL); gtk_signal_emit (GTK_OBJECT (gcal), gnome_calendar_signals[SOURCE_REMOVED], source_type, source); @@ -2908,7 +2908,7 @@ backend_died_cb (ECal *ecal, gpointer data) } g_object_unref (source); - + e_error_run (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (gcal))), id, NULL); } @@ -2941,22 +2941,22 @@ gnome_calendar_new (void) return GTK_WIDGET (gcal); } -void +void gnome_calendar_set_activity_handler (GnomeCalendar *cal, EActivityHandler *activity_handler) { GnomeCalendarPrivate *priv; int i; - + g_return_if_fail (cal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (cal)); priv = cal->priv; priv->activity_handler = activity_handler; - + for (i = 0; i < GNOME_CAL_LAST_VIEW; i++) e_calendar_view_set_activity_handler (priv->views[i], activity_handler); - + e_calendar_table_set_activity_handler (E_CALENDAR_TABLE (priv->todo), activity_handler); } @@ -3021,7 +3021,7 @@ gnome_calendar_add_source (GnomeCalendar *gcal, ECalSourceType source_type, ESou { GnomeCalendarPrivate *priv; ECal *client; - + g_return_val_if_fail (gcal != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE); g_return_val_if_fail (E_IS_SOURCE (source), FALSE); @@ -3035,7 +3035,7 @@ gnome_calendar_add_source (GnomeCalendar *gcal, ECalSourceType source_type, ESou return TRUE; } else { ESource *default_source; - + if (priv->default_client[source_type]) { default_source = e_cal_get_source (priv->default_client[source_type]); @@ -3045,14 +3045,14 @@ gnome_calendar_add_source (GnomeCalendar *gcal, ECalSourceType source_type, ESou client = g_object_ref (priv->default_client[source_type]); } - /* Create a new one */ + /* Create a new one */ if (!client) { client = auth_new_cal_from_source (source, source_type); if (!client) return FALSE; } } - + g_signal_connect (G_OBJECT (client), "backend_error", G_CALLBACK (backend_error_cb), gcal); g_signal_connect (G_OBJECT (client), "backend_died", G_CALLBACK (backend_died_cb), gcal); @@ -3081,7 +3081,7 @@ gboolean gnome_calendar_remove_source (GnomeCalendar *gcal, ECalSourceType source_type, ESource *source) { gboolean result; - + g_return_val_if_fail (gcal != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE); g_return_val_if_fail (E_IS_SOURCE (source), FALSE); @@ -3114,7 +3114,7 @@ gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, ECalSourceType source_ priv->clients_list[source_type] = g_list_remove (priv->clients_list[source_type], client); g_signal_handlers_disconnect_matched (client, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, gcal); + 0, 0, NULL, NULL, gcal); switch (source_type) { case E_CAL_SOURCE_TYPE_EVENT: @@ -3139,7 +3139,7 @@ gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, ECalSourceType source_ /* update date navigator query */ update_query (gcal); break; - + case E_CAL_SOURCE_TYPE_TODO: model = e_calendar_table_get_model (E_CALENDAR_TABLE (priv->todo)); e_cal_model_remove_client (model, client); @@ -3149,11 +3149,11 @@ gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, ECalSourceType source_ model = e_memo_table_get_model (E_MEMO_TABLE (priv->memo)); e_cal_model_remove_client (model, client); break; - + default: g_return_val_if_reached (TRUE); } - + g_hash_table_remove (priv->clients[source_type], uid); return TRUE; @@ -3163,11 +3163,11 @@ gnome_calendar_remove_source_by_uid (GnomeCalendar *gcal, ECalSourceType source_ * gnome_calendar_set_default_source: * @gcal: A calendar view * @source: The #ESource to use as default - * + * * Set the default uri on the given calendar view, the default uri * will be used as the default when creating events in the view. - * + * * Return value: TRUE if the uri was already added and is set, FALSE * otherwise **/ @@ -3176,7 +3176,7 @@ gnome_calendar_set_default_source (GnomeCalendar *gcal, ECalSourceType source_ty { GnomeCalendarPrivate *priv; ECal *client; - + g_return_val_if_fail (gcal != NULL, FALSE); g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), FALSE); g_return_val_if_fail (E_IS_SOURCE (source), FALSE); @@ -3195,7 +3195,7 @@ gnome_calendar_set_default_source (GnomeCalendar *gcal, ECalSourceType source_ty if (!priv->default_client[source_type]) return FALSE; } - + open_ecal (gcal, priv->default_client[source_type], FALSE, default_client_cal_opened_cb); @@ -3227,7 +3227,7 @@ gnome_calendar_get_selected_time_range (GnomeCalendar *gcal, { GnomeCalendarPrivate *priv; ECalModel *model; - + g_return_if_fail (gcal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (gcal)); @@ -3258,7 +3258,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) guint32 flags = 0; ECalComponentDateTime dt; struct icaltimetype itt; - + g_return_if_fail (gcal != NULL); g_return_if_fail (GNOME_IS_CALENDAR (gcal)); @@ -3267,7 +3267,7 @@ gnome_calendar_new_task (GnomeCalendar *gcal, time_t *dtstart, time_t *dtend) ecal = e_cal_model_get_default_client (model); if (!ecal) return; - + flags |= COMP_EDITOR_NEW_ITEM; tedit = task_editor_new (ecal, flags); @@ -3349,21 +3349,21 @@ gnome_calendar_update_date_navigator (GnomeCalendar *gcal) if (priv->current_view_type == GNOME_CAL_LIST_VIEW && !priv->lview_select_daten_range) return; - + model = e_calendar_view_get_model (priv->views[priv->current_view_type]); e_cal_model_get_time_range (model, &start, &end); - + time_to_gdate_with_zone (&start_date, start, priv->zone); if (priv->current_view_type == GNOME_CAL_MONTH_VIEW) { EWeekView *week_view = E_WEEK_VIEW (priv->views[priv->current_view_type]); - if (priv->week_start == 0 + if (priv->week_start == 0 && (!week_view->multi_week_view || week_view->compress_weekend)) g_date_add_days (&start_date, 1); } time_to_gdate_with_zone (&end_date, end, priv->zone); g_date_subtract_days (&end_date, 1); - + e_calendar_item_set_selection (priv->date_navigator->calitem, &start_date, &end_date); } @@ -3381,12 +3381,12 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, Gnom struct icaltimetype tt; priv = gcal->priv; - + starts_on_week_start_day = FALSE; model = e_calendar_view_get_model (priv->views[priv->current_view_type]); e_cal_model_get_time_range (model, &start, &end); - + time_to_gdate_with_zone (&start_date, start, priv->zone); if (priv->current_view_type == GNOME_CAL_MONTH_VIEW) { EWeekView *week_view = E_WEEK_VIEW (priv->views[priv->current_view_type]); @@ -3403,7 +3403,7 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, Gnom if (!g_date_compare (&start_date, &new_start_date) && !g_date_compare (&end_date, &new_end_date)) return; - + new_days_shown = g_date_get_julian (&new_end_date) - g_date_get_julian (&new_start_date) + 1; /* If a complete week is selected we show the Week view. @@ -3419,7 +3419,7 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, Gnom tt.month = g_date_get_month (&new_start_date); tt.day = g_date_get_day (&new_start_date); new_time = icaltime_as_timet_with_zone (tt, priv->zone); - + /* Switch views as appropriate, and change the number of days or weeks shown. */ if (new_days_shown > 9) { @@ -3434,10 +3434,10 @@ gnome_calendar_on_date_navigator_selection_changed (ECalendarItem *calitem, Gnom view_type = GNOME_CAL_LIST_VIEW; } else if (new_days_shown == 7 && starts_on_week_start_day) { view_type = GNOME_CAL_WEEK_VIEW; - } else { + } else { e_day_view_set_days_shown (E_DAY_VIEW (priv->day_view), new_days_shown); - - if (new_days_shown == 5 && starts_on_week_start_day + + if (new_days_shown == 5 && starts_on_week_start_day && priv->current_view_type == GNOME_CAL_WORK_WEEK_VIEW) view_type = GNOME_CAL_WORK_WEEK_VIEW; else @@ -3471,13 +3471,13 @@ gnome_calendar_hpane_realized (GtkWidget *w, GnomeCalendar *gcal) } } -static void +static void gnome_calendar_date_navigator_scrolled (GtkWidget *widget, GdkEventScroll *event, gpointer user_data) { GnomeCalendar *gcal = user_data; - ECalendarItem *calitem = gcal->priv->date_navigator->calitem; + ECalendarItem *calitem = gcal->priv->date_navigator->calitem; GDate start_date, end_date; - + if (e_calendar_item_get_selection (calitem, &start_date, &end_date)) { switch (event->direction) { case GDK_SCROLL_UP: @@ -3489,8 +3489,8 @@ gnome_calendar_date_navigator_scrolled (GtkWidget *widget, GdkEventScroll *event g_date_add_months (&end_date, 1); break; default: - break; - + break; + } e_calendar_item_set_selection (calitem, &start_date, &end_date); gnome_calendar_on_date_navigator_selection_changed (calitem, gcal); @@ -3520,8 +3520,8 @@ gnome_calendar_hpane_resized (GtkWidget *w, GdkEventButton *e, GnomeCalendar *gc gtk_widget_set_size_request (E_DAY_VIEW (priv->day_view)->time_canvas, times_width, -1); else gtk_widget_set_size_request (E_DAY_VIEW (priv->day_view)->time_canvas, priv->hpane_pos - 20, -1); - - + + return FALSE; } static void @@ -3673,10 +3673,10 @@ gnome_calendar_get_num_events_selected (GnomeCalendar *gcal) /** * gnome_calendar_get_num_tasks_selected: * @gcal: A calendar view. - * + * * Queries the number of tasks that are currently selected in the task pad of a * calendar view. - * + * * Return value: Number of selected tasks. **/ gint @@ -3772,16 +3772,16 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) ECal *client = l->data; GList *objects, *m; gboolean read_only; - + if (!e_cal_is_read_only (client, &read_only, NULL) || read_only) continue; - + if (!e_cal_get_object_list (client, sexp, &objects, NULL)) { g_warning (G_STRLOC ": Could not get the objects"); - + continue; } - + for (m = objects; m; m = m->next) { gboolean remove = TRUE; @@ -3805,7 +3805,7 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) if (!icaltime_is_null_time (recur_id) ) rid = icaltime_as_ical_string (recur_id); - + e_cal_remove_object_with_mod (client, uid, rid, CALOBJ_MOD_ALL, &error); } else { e_cal_remove_object (client, uid, &error); @@ -3842,15 +3842,15 @@ GtkWidget * gnome_calendar_get_e_calendar_widget (GnomeCalendar *gcal) { g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); - + return GTK_WIDGET(gcal->priv->date_navigator); } - + GtkWidget * gnome_calendar_get_search_bar_widget (GnomeCalendar *gcal) { g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); - + return GTK_WIDGET(gcal->priv->search_bar); } @@ -3858,28 +3858,28 @@ GtkWidget * gnome_calendar_get_view_notebook_widget (GnomeCalendar *gcal) { g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); - + return GTK_WIDGET(gcal->priv->notebook); } ECalMenu *gnome_calendar_get_taskpad_menu (GnomeCalendar *gcal) { g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); - + return gcal->priv->taskpad_menu; } ECalMenu *gnome_calendar_get_calendar_menu (GnomeCalendar *gcal) { g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); - + return gcal->priv->calendar_menu; } ECalMenu *gnome_calendar_get_memopad_menu (GnomeCalendar *gcal) { g_return_val_if_fail (GNOME_IS_CALENDAR (gcal), NULL); - + return gcal->priv->memopad_menu; } @@ -3897,7 +3897,7 @@ gnome_calendar_edit_appointment (GnomeCalendar *gcal, if (!src_uid || !comp_uid) return; - + for (l = gcal->priv->clients_list[E_CAL_SOURCE_TYPE_EVENT]; l != NULL; l = l->next) { ESource *client_src; @@ -3908,7 +3908,7 @@ gnome_calendar_edit_appointment (GnomeCalendar *gcal, break; } - if (!client) + if (!client) return; e_cal_get_object (client, comp_uid, comp_rid, &icalcomp, NULL); @@ -3918,6 +3918,6 @@ gnome_calendar_edit_appointment (GnomeCalendar *gcal, attendee_prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); e_calendar_view_edit_appointment (gcal->priv->views[gcal->priv->current_view_type], - client, icalcomp, attendee_prop ? TRUE:FALSE); + client, icalcomp, attendee_prop ? TRUE:FALSE); icalcomponent_free (icalcomp); } diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index 8524545037..f370c5930a 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -135,7 +135,7 @@ void gnome_calendar_set_view (GnomeCalendar *gcal, GnomeCalendarViewType view_ty GtkWidget *gnome_calendar_get_current_view_widget (GnomeCalendar *gcal); ECalendarTable *gnome_calendar_get_task_pad (GnomeCalendar *gcal); -GtkWidget *gnome_calendar_get_e_calendar_widget (GnomeCalendar *gcal); +GtkWidget *gnome_calendar_get_e_calendar_widget (GnomeCalendar *gcal); GtkWidget *gnome_calendar_get_search_bar_widget (GnomeCalendar *gcal); GtkWidget *gnome_calendar_get_view_notebook_widget (GnomeCalendar *gcal); GtkWidget *gnome_calendar_get_tag (GnomeCalendar *gcal); diff --git a/calendar/gui/goto.c b/calendar/gui/goto.c index c8cd424d8e..91715e3526 100644 --- a/calendar/gui/goto.c +++ b/calendar/gui/goto.c @@ -24,10 +24,10 @@ #include "tag-calendar.h" #include "goto.h" -typedef struct +typedef struct { GladeXML *xml; - GtkWidget *dialog; + GtkWidget *dialog; GtkWidget *month; GtkWidget *year; @@ -38,7 +38,7 @@ typedef struct gint year_val; gint month_val; gint day_val; - + } GoToDialog; static GoToDialog *dlg = NULL; @@ -59,7 +59,7 @@ month_changed (GtkToggleButton *toggle, gpointer data) { GoToDialog *dlg = data; GtkWidget *menu, *active; - + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month)); active = gtk_menu_get_active (GTK_MENU (menu)); dlg->month_val = g_list_index (GTK_MENU_SHELL (menu)->children, active); @@ -72,7 +72,7 @@ ecal_date_range_changed (ECalendarItem *calitem, gpointer user_data) { GoToDialog *dlg = user_data; ECal *client; - + client = gnome_calendar_get_default_client (dlg->gcal); if (client) tag_calendar_by_client (dlg->ecal, client); @@ -88,7 +88,7 @@ ecal_event (ECalendarItem *calitem, gpointer user_data) GDate start_date, end_date; struct icaltimetype tt = icaltime_null_time (); time_t et; - + e_calendar_item_get_selection (calitem, &start_date, &end_date); tt.year = g_date_get_year (&start_date); @@ -133,10 +133,10 @@ static void create_ecal (GoToDialog *dlg) { ECalendarItem *calitem; - + dlg->ecal = E_CALENDAR (e_calendar_new ()); calitem = dlg->ecal->calitem; - + gnome_canvas_item_set (GNOME_CANVAS_ITEM (calitem), "move_selection_when_moving", FALSE, NULL); @@ -148,7 +148,7 @@ create_ecal (GoToDialog *dlg) e_calendar_item_set_get_time_callback (calitem, get_current_time, dlg, NULL); - + ecal_date_range_changed (calitem, dlg); } @@ -179,12 +179,12 @@ get_widgets (GoToDialog *dlg) } static void -goto_dialog_init_widgets (GoToDialog *dlg) +goto_dialog_init_widgets (GoToDialog *dlg) { GtkWidget *menu; GtkAdjustment *adj; GList *l; - + menu = gtk_option_menu_get_menu (GTK_OPTION_MENU (dlg->month)); for (l = GTK_MENU_SHELL (menu)->children; l != NULL; l = l->next) g_signal_connect (menu, "selection_done", G_CALLBACK (month_changed), dlg); @@ -208,9 +208,9 @@ goto_dialog (GnomeCalendar *gcal) if (dlg) { return; } - + dlg = g_new0 (GoToDialog, 1); - + /* Load the content widgets */ gladefile = g_build_filename (EVOLUTION_GLADEDIR, "goto-dialog.glade", @@ -238,7 +238,7 @@ goto_dialog (GnomeCalendar *gcal) gtk_option_menu_set_history (GTK_OPTION_MENU (dlg->month), dlg->month_val); gtk_spin_button_set_value (GTK_SPIN_BUTTON (dlg->year), dlg->year_val); - + create_ecal (dlg); goto_dialog_init_widgets (dlg); diff --git a/calendar/gui/itip-bonobo-control.c b/calendar/gui/itip-bonobo-control.c index 03402776e6..d386f2ad58 100644 --- a/calendar/gui/itip-bonobo-control.c +++ b/calendar/gui/itip-bonobo-control.c @@ -78,11 +78,11 @@ stream_read (Bonobo_Stream stream) memcpy (data + length, buffer->_buffer, buffer->_length); length += buffer->_length; data[length] = '\0'; - + CORBA_free (buffer); #undef READ_CHUNK_SIZE } while (1); - + CORBA_free (buffer); CORBA_exception_free (&ev); @@ -101,15 +101,15 @@ typedef struct { } idle_data; static gboolean -set_data_idle_cb (gpointer data) -{ +set_data_idle_cb (gpointer data) +{ idle_data *id = data; - + e_itip_control_set_data (id->itip, id->text); g_object_unref (id->itip); g_free (id->text); g_free (id); - + return FALSE; } @@ -120,8 +120,8 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, { EItipControl *itip = data; idle_data *id; - - if (type && g_ascii_strcasecmp (type, "text/calendar") != 0 && + + if (type && g_ascii_strcasecmp (type, "text/calendar") != 0 && g_ascii_strcasecmp (type, "text/x-calendar") != 0) { bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType); return; @@ -135,7 +135,7 @@ pstream_load (BonoboPersistStream *ps, const Bonobo_Stream stream, } g_object_ref (itip); id->itip = itip; - + g_idle_add (set_data_idle_cb, id); } /* @@ -150,8 +150,8 @@ pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream, gchar *text; gint len; - if (type && g_ascii_strcasecmp (type, "text/calendar") != 0 && - g_ascii_strcasecmp (type, "text/x-calendar") != 0) { + if (type && g_ascii_strcasecmp (type, "text/calendar") != 0 && + g_ascii_strcasecmp (type, "text/x-calendar") != 0) { bonobo_exception_set (ev, ex_Bonobo_Persist_WrongDataType); return; } @@ -169,9 +169,9 @@ pstream_save (BonoboPersistStream *ps, const Bonobo_Stream stream, /* { */ /* EItipControl *itip = data; */ /* gint len; */ - + /* len = e_itip_control_get_data_size (itip); */ - + /* if (len > 0) */ /* return len; */ @@ -186,9 +186,9 @@ pstream_get_content_types (BonoboPersistStream *ps, void *closure, } static void -get_prop (BonoboPropertyBag *bag, +get_prop (BonoboPropertyBag *bag, BonoboArg *arg, - guint arg_id, + guint arg_id, CORBA_Environment *ev, gpointer user_data) { @@ -205,9 +205,9 @@ get_prop (BonoboPropertyBag *bag, } static void -set_prop ( BonoboPropertyBag *bag, +set_prop ( BonoboPropertyBag *bag, const BonoboArg *arg, - guint arg_id, + guint arg_id, CORBA_Environment *ev, gpointer user_data) { @@ -235,7 +235,7 @@ itip_bonobo_control_new (void) itip = e_itip_control_new (); gtk_widget_show (itip); control = bonobo_control_new (itip); - + /* create a property bag */ prop_bag = bonobo_property_bag_new (get_prop, set_prop, itip); bonobo_property_bag_add (prop_bag, "from_address", FROM_ADDRESS_ARG_ID, BONOBO_ARG_STRING, NULL, diff --git a/calendar/gui/itip-bonobo-control.h b/calendar/gui/itip-bonobo-control.h index 42b1d03d8a..84a4fea8ef 100644 --- a/calendar/gui/itip-bonobo-control.h +++ b/calendar/gui/itip-bonobo-control.h @@ -3,7 +3,7 @@ * Copyright (C) 2000 Ximian, Inc. * Copyright (C) 2000 Ximian, Inc. * - * Authors: + * Authors: * Jesse Pavel <jpavel@ximian.com> * JP Rosevear <jpr@ximian.com> * diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 2cfd5244c3..63b0163ef9 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -93,7 +93,7 @@ itip_organizer_is_user (ECalComponent *comp, ECal *client) ECalComponentOrganizer organizer; const char *strip; gboolean user_org = FALSE; - + if (!e_cal_component_has_organizer (comp) || e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER)) return FALSE; @@ -101,20 +101,20 @@ itip_organizer_is_user (ECalComponent *comp, ECal *client) if (organizer.value != NULL) { strip = itip_strip_mailto (organizer.value); - - if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) { + + if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) { char *email = NULL; - + if (e_cal_get_cal_address (client, &email, NULL) && !g_ascii_strcasecmp (email, strip)) { g_free (email); - + return TRUE; } - + g_free (email); return FALSE; } - + user_org = e_account_list_find(itip_addresses_get(), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; } @@ -127,7 +127,7 @@ itip_sentby_is_user (ECalComponent *comp) ECalComponentOrganizer organizer; const char *strip; gboolean user_sentby = FALSE; - + if (!e_cal_component_has_organizer (comp)) return FALSE; @@ -141,7 +141,7 @@ itip_sentby_is_user (ECalComponent *comp) } static ECalComponentAttendee * -get_attendee (GSList *attendees, char *address) +get_attendee (GSList *attendees, char *address) { GSList *l; @@ -152,15 +152,15 @@ get_attendee (GSList *attendees, char *address) ECalComponentAttendee *attendee = l->data; if (!g_ascii_strcasecmp (itip_strip_mailto (attendee->value), address)) { - return attendee; - } + return attendee; + } } return NULL; } static ECalComponentAttendee * -get_attendee_if_attendee_sentby_is_user (GSList *attendees, char *address) +get_attendee_if_attendee_sentby_is_user (GSList *attendees, char *address) { GSList *l; @@ -168,8 +168,8 @@ get_attendee_if_attendee_sentby_is_user (GSList *attendees, char *address) ECalComponentAttendee *attendee = l->data; if (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address)) { - return attendee; - } + return attendee; + } } return NULL; @@ -200,8 +200,8 @@ html_new_lines_for (char *string) html_string[index++] = *temp; temp++; } - temp++; - + temp++; + html_string[index++] = '<'; html_string[index++] = 'b'; html_string[index++] = 'r'; @@ -216,9 +216,9 @@ html_new_lines_for (char *string) html_string[index++] = *temp; temp++; } - + html_string[index] = '\0'; - + return html_string; } @@ -232,14 +232,14 @@ itip_get_comp_attendee (ECalComponent *comp, ECal *client) ECalComponentAttendee *attendee = NULL; char *address = NULL; - e_cal_component_get_attendee_list (comp, &attendees); + e_cal_component_get_attendee_list (comp, &attendees); al = itip_addresses_get (); - + if (client) e_cal_get_cal_address (client, &address, NULL); if (address && *address) { - attendee = get_attendee (attendees, address); + attendee = get_attendee (attendees, address); if (attendee) { char *user_email = g_strdup (itip_strip_mailto (attendee->value)); @@ -268,15 +268,15 @@ itip_get_comp_attendee (ECalComponent *comp, ECal *client) e_iterator_next(it)) { a = (EAccount *) e_iterator_get(it); - if (!a->enabled) + if (!a->enabled) continue; attendee = get_attendee (attendees, a->id->address); if (attendee) { char *user_email = g_strdup (itip_strip_mailto (attendee->value)); - + e_cal_component_free_attendee_list (attendees); - return user_email; + return user_email; } /* If the account was not found in the attendees list, then let's @@ -284,9 +284,9 @@ itip_get_comp_attendee (ECalComponent *comp, ECal *client) attendee = get_attendee_if_attendee_sentby_is_user (attendees, a->id->address); if (attendee) { char *user_email = g_strdup (itip_strip_mailto (attendee->sentby)); - + e_cal_component_free_attendee_list (attendees); - return user_email; + return user_email; } } @@ -295,17 +295,17 @@ itip_get_comp_attendee (ECalComponent *comp, ECal *client) /* FIXME do we have a better way ? */ a = itip_addresses_get_default (); address = g_strdup ((a != NULL) ? a->id->address : ""); - + e_cal_component_free_attendee_list (attendees); return address; } const gchar * -itip_strip_mailto (const gchar *address) +itip_strip_mailto (const gchar *address) { if (address == NULL) return NULL; - + if (!g_ascii_strncasecmp (address, "mailto:", 7)) address += 7; @@ -329,7 +329,7 @@ get_label (struct icaltimetype *tt) typedef struct { GHashTable *tzids; - icalcomponent *icomp; + icalcomponent *icomp; ECal *client; icalcomponent *zones; } ItipUtilTZData; @@ -338,7 +338,7 @@ typedef struct { static void foreach_tzid_callback (icalparameter *param, gpointer data) { - ItipUtilTZData *tz_data = data; + ItipUtilTZData *tz_data = data; const char *tzid; icaltimezone *zone = NULL; icalcomponent *vtimezone_comp; @@ -353,7 +353,7 @@ foreach_tzid_callback (icalparameter *param, gpointer data) zone = icalcomponent_get_timezone (tz_data->zones, tzid); if (zone == NULL) zone = icaltimezone_get_builtin_timezone_from_tzid (tzid); - if (zone == NULL && tz_data->client != NULL) + if (zone == NULL && tz_data->client != NULL) e_cal_get_timezone (tz_data->client, tzid, &zone, NULL); if (zone == NULL) return; @@ -364,7 +364,7 @@ foreach_tzid_callback (icalparameter *param, gpointer data) return; icalcomponent_add_component (tz_data->icomp, icalcomponent_new_clone (vtimezone_comp)); - g_hash_table_insert (tz_data->tzids, (char *)tzid, (char *)tzid); + g_hash_table_insert (tz_data->tzids, (char *)tzid, (char *)tzid); } static icalcomponent * @@ -384,7 +384,7 @@ comp_toplevel_with_zones (ECalComponentItipMethod method, ECalComponent *comp, E icomp = e_cal_component_get_icalcomponent (comp); icomp = icalcomponent_new_clone (icomp); - + tz_data.tzids = g_hash_table_new (g_str_hash, g_str_equal); tz_data.icomp = top_level; tz_data.client = client; @@ -418,33 +418,33 @@ comp_from (ECalComponentItipMethod method, ECalComponent *comp) GSList *attendees; CORBA_char *str; char *sender = NULL; - + switch (method) { case E_CAL_COMPONENT_METHOD_PUBLISH: return CORBA_string_dup (""); - + case E_CAL_COMPONENT_METHOD_REQUEST: sender = itip_get_comp_attendee (comp, NULL); if (sender) { str = CORBA_string_dup (sender); g_free (sender); return str; - } - - case E_CAL_COMPONENT_METHOD_REPLY: + } + + case E_CAL_COMPONENT_METHOD_REPLY: sender = itip_get_comp_attendee (comp, NULL); if (sender) { str = CORBA_string_dup (sender); g_free (sender); return str; - } + } if (!e_cal_component_has_attendees (comp)) return CORBA_string_dup (""); case E_CAL_COMPONENT_METHOD_CANCEL: - case E_CAL_COMPONENT_METHOD_ADD: - + case E_CAL_COMPONENT_METHOD_ADD: + e_cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { e_notice (NULL, GTK_MESSAGE_ERROR, @@ -453,7 +453,7 @@ comp_from (ECalComponentItipMethod method, ECalComponent *comp) } return CORBA_string_dup (itip_strip_mailto (organizer.value)); - + default: if (!e_cal_component_has_attendees (comp)) return CORBA_string_dup (""); @@ -488,7 +488,7 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, e_cal_component_free_attendee_list (attendees); return NULL; } - + to_list = GNOME_Evolution_Composer_RecipientList__alloc (); to_list->_maximum = len; to_list->_length = 0; @@ -526,7 +526,7 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, else recipient->name = CORBA_string_dup (""); recipient->address = CORBA_string_dup (itip_strip_mailto (att->value)); - + to_list->_length++; } g_free (sender); @@ -547,7 +547,7 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, e_cal_component_free_attendee_list (attendees); return to_list; } - + to_list = GNOME_Evolution_Composer_RecipientList__alloc (); to_list->_maximum = len; to_list->_length = 0; @@ -559,14 +559,14 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, for (l = attendees; l != NULL; l = l->next) { ECalComponentAttendee *att = l->data; - + recipient = &(to_list->_buffer[to_list->_length]); if (att->cn) recipient->name = CORBA_string_dup (att->cn); else recipient->name = CORBA_string_dup (""); recipient->address = CORBA_string_dup (itip_strip_mailto (att->value)); - + to_list->_length++; } @@ -581,7 +581,7 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (1); recipient = &(to_list->_buffer[to_list->_length]); - + e_cal_component_get_organizer (comp, &organizer); if (organizer.value) { recipient->name = CORBA_string_dup (""); @@ -591,11 +591,11 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, } else { recipient->address = CORBA_string_dup (""); recipient->name = CORBA_string_dup (""); - } + } } break; - - + + case E_CAL_COMPONENT_METHOD_ADD: case E_CAL_COMPONENT_METHOD_REFRESH: case E_CAL_COMPONENT_METHOD_COUNTER: @@ -606,7 +606,7 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, _("An organizer must be set.")); return NULL; } - + len = 2; to_list = GNOME_Evolution_Composer_RecipientList__alloc (); @@ -621,8 +621,8 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, else recipient->name = CORBA_string_dup (""); recipient->address = CORBA_string_dup (itip_strip_mailto (organizer.value)); - - /* send the status to delegatee to the delegate also*/ + + /* send the status to delegatee to the delegate also*/ e_cal_component_get_attendee_list (comp, &attendees); sender = itip_get_comp_attendee (comp, NULL); @@ -642,7 +642,7 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, } e_cal_component_free_attendee_list (attendees); - + break; case E_CAL_COMPONENT_METHOD_PUBLISH: if(users) { @@ -653,7 +653,7 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, to_list->_maximum = len; to_list->_length = 0; to_list->_buffer = CORBA_sequence_GNOME_Evolution_Composer_Recipient_allocbuf (len); - + for (list = users; list != NULL; list = list->next) { recipient = &(to_list->_buffer[to_list->_length]); recipient->name = CORBA_string_dup (""); @@ -670,9 +670,9 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, } CORBA_sequence_set_release (to_list, TRUE); - return to_list; + return to_list; } - + static CORBA_char * comp_subject (ECalComponentItipMethod method, ECalComponent *comp) { @@ -684,7 +684,7 @@ comp_subject (ECalComponentItipMethod method, ECalComponent *comp) ECalComponentAttendee *a = NULL; e_cal_component_get_summary (comp, &caltext); - if (caltext.value != NULL) + if (caltext.value != NULL) description = caltext.value; else { switch (e_cal_component_get_vtype (comp)) { @@ -717,7 +717,7 @@ comp_subject (ECalComponentItipMethod method, ECalComponent *comp) for (l = alist; l != NULL ; l = l->next) { a = l->data; - if ((sender && *sender) && (g_ascii_strcasecmp (itip_strip_mailto (a->value), sender) || (a->sentby && g_ascii_strcasecmp (itip_strip_mailto (a->sentby), sender)))) + if ((sender && *sender) && (g_ascii_strcasecmp (itip_strip_mailto (a->value), sender) || (a->sentby && g_ascii_strcasecmp (itip_strip_mailto (a->sentby), sender)))) break; } g_free (sender); @@ -782,8 +782,8 @@ comp_subject (ECalComponentItipMethod method, ECalComponent *comp) static CORBA_char * comp_content_type (ECalComponent *comp, ECalComponentItipMethod method) { - char tmp[256]; - + char tmp[256]; + sprintf (tmp, "text/calendar; name=\"%s\"; charset=utf-8; METHOD=%s", e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_FREEBUSY ? "freebusy.ifb" : "calendar.ics", itip_methods[method]); @@ -845,20 +845,20 @@ comp_description (ECalComponent *comp) } static gboolean -comp_server_send (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, +comp_server_send (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, icalcomponent *zones, GList **users) { icalcomponent *top_level, *returned_icalcomp = NULL; gboolean retval = TRUE; GError *error = NULL; - + top_level = comp_toplevel_with_zones (method, comp, client, zones); if (!e_cal_send_objects (client, top_level, users, &returned_icalcomp, &error)) { /* FIXME Really need a book problem status code */ if (error->code != E_CALENDAR_STATUS_OK) { /* FIXME Better error message */ e_notice (NULL, GTK_MESSAGE_ERROR, "Unable to book"); - + retval = FALSE; } } @@ -873,7 +873,7 @@ comp_server_send (ECalComponentItipMethod method, ECalComponent *comp, ECal *cli } static gboolean -comp_limit_attendees (ECalComponent *comp) +comp_limit_attendees (ECalComponent *comp) { icalcomponent *icomp; icalproperty *prop; @@ -897,7 +897,7 @@ comp_limit_attendees (ECalComponent *comp) list = g_slist_prepend (list, prop); continue; } - + attendee = icalproperty_get_value_as_string (prop); if (!attendee) continue; @@ -918,7 +918,7 @@ comp_limit_attendees (ECalComponent *comp) g_free(attendee_text); g_free (attendee_sentby_text); - + if (!match) list = g_slist_prepend (list, prop); match = FALSE; @@ -941,7 +941,7 @@ comp_sentby (ECalComponent *comp, ECal *client) ECalComponentOrganizer organizer; GSList * attendees, *l; char *user = NULL; - + e_cal_component_get_organizer (comp, &organizer); if (!organizer.value) { EAccount *a = itip_addresses_get_default (); @@ -950,10 +950,10 @@ comp_sentby (ECalComponent *comp, ECal *client) organizer.sentby = NULL; organizer.cn = a->id->name; organizer.language = NULL; - + e_cal_component_set_organizer (comp, &organizer); g_free ((char *) organizer.value); - + return; } @@ -967,15 +967,15 @@ comp_sentby (ECalComponent *comp, ECal *client) return; } } - + if (!itip_organizer_is_user (comp, client) && !itip_sentby_is_user (comp)) { EAccount *a = itip_addresses_get_default (); - + organizer.value = g_strdup (organizer.value); organizer.sentby = g_strdup_printf ("MAILTO:%s", a->id->address); organizer.cn = g_strdup (organizer.cn); organizer.language = g_strdup (organizer.language); - + e_cal_component_set_organizer (comp, &organizer); g_free ((char *)organizer.value); @@ -995,13 +995,13 @@ comp_minimal (ECalComponent *comp, gboolean attendee) GSList *comments; struct icaltimetype itt; ECalComponentRange recur_id; - + clone = e_cal_component_new (); e_cal_component_set_new_vtype (clone, e_cal_component_get_vtype (comp)); if (attendee) { GSList *attendees; - + e_cal_component_get_attendee_list (comp, &attendees); e_cal_component_set_attendee_list (clone, attendees); @@ -1011,7 +1011,7 @@ comp_minimal (ECalComponent *comp, gboolean attendee) goto error; } } - + itt = icaltime_from_timet_with_zone (time (NULL), FALSE, icaltimezone_get_utc_timezone ()); e_cal_component_set_dtstamp (clone, &itt); @@ -1029,17 +1029,17 @@ comp_minimal (ECalComponent *comp, gboolean attendee) e_cal_component_set_comment_list (clone, comments); } else { GSList *l = comments; - + comments = g_slist_remove_link (comments, l); e_cal_component_set_comment_list (clone, l); e_cal_component_free_text_list (l); } e_cal_component_free_text_list (comments); - + e_cal_component_get_recurid (comp, &recur_id); if (recur_id.datetime.value != NULL) e_cal_component_set_recurid (clone, &recur_id); - + icomp = e_cal_component_get_icalcomponent (comp); icomp_clone = e_cal_component_get_icalcomponent (clone); for (prop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY); @@ -1047,13 +1047,13 @@ comp_minimal (ECalComponent *comp, gboolean attendee) prop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY)) { icalproperty *p; - + p = icalproperty_new_clone (prop); icalcomponent_add_property (icomp_clone, p); } e_cal_component_rescan (clone); - + return clone; error: @@ -1066,7 +1066,7 @@ comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *clien { ECalComponent *clone, *temp_clone; struct icaltimetype itt; - + clone = e_cal_component_clone (comp); itt = icaltime_from_timet_with_zone (time (NULL), FALSE, icaltimezone_get_utc_timezone ()); @@ -1077,14 +1077,14 @@ comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *clien && e_cal_component_has_simple_recurrence (clone)) { GSList *rrule_list; struct icalrecurrencetype *r; - + e_cal_component_get_rrule_list (clone, &rrule_list); r = rrule_list->data; if (!icaltime_is_null_time (r->until) && r->until.is_date) { ECalComponentDateTime dt; icaltimezone *from_zone = NULL, *to_zone; - + e_cal_component_get_dtstart (clone, &dt); if (dt.value->is_date) { @@ -1100,14 +1100,14 @@ comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *clien /* FIXME Error checking */ e_cal_get_timezone (client, dt.tzid, &from_zone, NULL); } - + to_zone = icaltimezone_get_utc_timezone (); r->until.hour = dt.value->hour; r->until.minute = dt.value->minute; r->until.second = dt.value->second; r->until.is_date = FALSE; - + icaltimezone_convert_time (&r->until, from_zone, to_zone); r->until.is_utc = TRUE; @@ -1117,13 +1117,13 @@ comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *clien e_cal_component_free_recur_list (rrule_list); } - + /* We delete incoming alarms anyhow, and this helps with outlook */ e_cal_component_remove_all_alarms (clone); /* Strip X-LIC-ERROR stuff */ e_cal_component_strip_errors (clone); - + /* Comply with itip spec */ switch (method) { case E_CAL_COMPONENT_METHOD_PUBLISH: @@ -1135,7 +1135,7 @@ comp_compliant (ECalComponentItipMethod method, ECalComponent *comp, ECal *clien break; case E_CAL_COMPONENT_METHOD_CANCEL: comp_sentby (clone, client); - break; + break; case E_CAL_COMPONENT_METHOD_REPLY: break; case E_CAL_COMPONENT_METHOD_ADD: @@ -1176,14 +1176,14 @@ append_cal_attachments (GNOME_Evolution_Composer composer_server, ECalComponent for (l = attach_list; l ; l = l->next) { mime_attach = (struct CalMimeAttach *) l->data; - + filename = CORBA_string_dup (mime_attach->filename ? mime_attach->filename : ""); content_type = CORBA_string_dup (mime_attach->content_type); description = CORBA_string_dup (mime_attach->description); - + attach_data = GNOME_Evolution_Composer_AttachmentData__alloc (); attach_data->_length = mime_attach->length; - attach_data->_maximum = attach_data->_length; + attach_data->_maximum = attach_data->_length; attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length); memcpy (attach_data->_buffer, mime_attach->encoded_data, attach_data->_length); @@ -1212,7 +1212,7 @@ append_cal_attachments (GNOME_Evolution_Composer composer_server, ECalComponent g_free (mime_attach->description); g_free (mime_attach->encoded_data); } - + return retval; } @@ -1236,7 +1236,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp, /* check whether backend could handle sending requests/updates */ if (method != E_CAL_COMPONENT_METHOD_PUBLISH && e_cal_get_save_schedules (client)) return TRUE; - + CORBA_exception_init (&ev); /* Give the server a chance to manipulate the comp */ @@ -1244,7 +1244,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp, if (!comp_server_send (method, send_comp, client, zones, &users)) goto cleanup; } - + /* Tidy up the comp */ comp = comp_compliant (method, send_comp, client, zones); @@ -1269,10 +1269,10 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp, cc_list->_maximum = cc_list->_length = 0; bcc_list = GNOME_Evolution_Composer_RecipientList__alloc (); bcc_list->_maximum = bcc_list->_length = 0; - + /* Subject information */ subject = comp_subject (method, comp); - + /* From address */ from = comp_from (method, comp); @@ -1319,7 +1319,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp, attach_data = GNOME_Evolution_Composer_AttachmentData__alloc (); attach_data->_length = strlen (ical_string); - attach_data->_maximum = attach_data->_length; + attach_data->_maximum = attach_data->_length; attach_data->_buffer = CORBA_sequence_CORBA_char_allocbuf (attach_data->_length); memcpy (attach_data->_buffer, ical_string, attach_data->_length); @@ -1328,7 +1328,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp, TRUE, attach_data, &ev); } - + if (BONOBO_EX (&ev)) { g_warning ("Unable to place iTip message in composer"); goto cleanup; @@ -1345,14 +1345,14 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp, g_warning ("Unable to show the composer while sending iTip message"); else retval = TRUE; - } else { + } else { GNOME_Evolution_Composer_send (composer_server, &ev); if (BONOBO_EX (&ev)) g_warning ("Unable to send iTip message"); else retval = TRUE; } - + cleanup: CORBA_exception_free (&ev); @@ -1365,7 +1365,7 @@ itip_send_comp (ECalComponentItipMethod method, ECalComponent *send_comp, g_list_foreach (users, (GFunc) g_free, NULL); g_list_free (users); } - + if (to_list != NULL) CORBA_free (to_list); if (cc_list != NULL) @@ -1425,10 +1425,10 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp cc_list->_maximum = cc_list->_length = 0; bcc_list = GNOME_Evolution_Composer_RecipientList__alloc (); bcc_list->_maximum = bcc_list->_length = 0; - + /* Subject information */ subject = comp_subject (method, comp); - + /* From address */ from = comp_from (method, comp); @@ -1457,7 +1457,7 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp ical_string = icalcomponent_as_ical_string (top_level); if (e_cal_component_get_vtype (comp) == E_CAL_COMPONENT_EVENT){ - + GString *body; char *orig_from = NULL; char *description = NULL; @@ -1480,7 +1480,7 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp description = (char *)text.value; else description = ""; - } else { + } else { description = ""; } @@ -1496,12 +1496,12 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp if (organizer.value) orig_from = g_strdup (itip_strip_mailto (organizer.value)); - + e_cal_component_get_location (comp, &location); if (!location) location = "Unspecified"; - + e_cal_component_get_dtstart (comp, &dtstart); if (dtstart.value) { start_zone = icaltimezone_get_builtin_timezone_from_tzid (dtstart.tzid); @@ -1516,8 +1516,8 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp start = icaltime_as_timet_with_zone (*dtstart.value, start_zone); time = g_strdup (ctime (&start)); } - - + + body = g_string_new ("<br><br><hr><br><b>______ Original Appointment ______ </b><br><br><table>"); if (orig_from && *orig_from) @@ -1558,13 +1558,13 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp } - + GNOME_Evolution_Composer_show (composer_server, &ev); if (BONOBO_EX (&ev)) g_warning ("Unable to show the composer while sending iTip message"); else retval = TRUE; - + cleanup: CORBA_exception_free (&ev); @@ -1577,7 +1577,7 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp g_list_foreach (users, (GFunc) g_free, NULL); g_list_free (users); } - + if (to_list != NULL) CORBA_free (to_list); if (cc_list != NULL) @@ -1596,33 +1596,33 @@ reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp } gboolean -itip_publish_begin (ECalComponent *pub_comp, ECal *client, +itip_publish_begin (ECalComponent *pub_comp, ECal *client, gboolean cloned, ECalComponent **clone) { icalcomponent *icomp =NULL, *icomp_clone = NULL; icalproperty *prop; - + if (e_cal_component_get_vtype (pub_comp) == E_CAL_COMPONENT_FREEBUSY) { - + if (!cloned) { *clone = e_cal_component_clone (pub_comp); cloned = TRUE; } else { - + icomp = e_cal_component_get_icalcomponent (pub_comp); icomp_clone = e_cal_component_get_icalcomponent (*clone); for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); prop != NULL; - prop = icalcomponent_get_next_property (icomp, + prop = icalcomponent_get_next_property (icomp, ICAL_FREEBUSY_PROPERTY)) { icalproperty *p; - + p = icalproperty_new_clone (prop); icalcomponent_add_property (icomp_clone, p); } - } + } } return TRUE; @@ -1632,19 +1632,19 @@ static void fb_sort (struct icalperiodtype *ipt, int fb_count) { int i,j; - + if (ipt == NULL || fb_count == 0) return; - + for (i = 0; i < fb_count-1; i++) { for (j = i+1; j < fb_count; j++) { struct icalperiodtype temp; - + if (icaltime_compare (ipt[i].start, ipt[j].start) < 0) continue; - + if (icaltime_compare (ipt[i].start, ipt[j].start) == 0){ - if (icaltime_compare (ipt[i].end, + if (icaltime_compare (ipt[i].end, ipt[j].start) < 0) continue; } @@ -1664,48 +1664,48 @@ comp_fb_normalize (icalcomponent *icomp) struct icaltimetype itt; int fb_count, i = 0, j; struct icalperiodtype *ipt; - + iclone = icalcomponent_new (ICAL_VFREEBUSY_COMPONENT); - - prop = icalcomponent_get_first_property (icomp, + + prop = icalcomponent_get_first_property (icomp, ICAL_ORGANIZER_PROPERTY); if (prop) { p = icalproperty_new_clone (prop); icalcomponent_add_property (iclone, p); } - + itt = icalcomponent_get_dtstart (icomp); icalcomponent_set_dtstart (iclone, itt); - + itt = icalcomponent_get_dtend (icomp); icalcomponent_set_dtend (iclone, itt); - - fb_count = icalcomponent_count_properties (icomp, + + fb_count = icalcomponent_count_properties (icomp, ICAL_FREEBUSY_PROPERTY); ipt = g_new0 (struct icalperiodtype, fb_count+1); - - for (prop = icalcomponent_get_first_property (icomp, + + for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); prop != NULL; - prop = icalcomponent_get_next_property (icomp, + prop = icalcomponent_get_next_property (icomp, ICAL_FREEBUSY_PROPERTY)) { ipt[i] = icalproperty_get_freebusy (prop); i++; } - + fb_sort (ipt, fb_count); - + for (j = 0; j <= fb_count-1; j++) { icalparameter *param; - + prop = icalproperty_new_freebusy (ipt[j]); param = icalparameter_new_fbtype (ICAL_FBTYPE_BUSY); icalproperty_add_parameter (prop, param); icalcomponent_add_property (iclone, prop); } g_free (ipt); - + /* Should I strip this RFC 2446 says there must not be a UID if the METHOD is PUBLISH?? */ uid = icalcomponent_get_uid (icomp); @@ -1714,14 +1714,14 @@ comp_fb_normalize (icalcomponent *icomp) itt = icaltime_from_timet_with_zone (time (NULL), FALSE, icaltimezone_get_utc_timezone ()); - icalcomponent_set_dtstamp (iclone, itt); - + icalcomponent_set_dtstamp (iclone, itt); + prop = icalcomponent_get_first_property (icomp, ICAL_URL_PROPERTY); if (prop) { p = icalproperty_new_clone (prop); icalcomponent_add_property (iclone, p); } - + comment = icalcomponent_get_comment (icomp); if (comment) icalcomponent_set_comment (iclone, comment); @@ -1729,11 +1729,11 @@ comp_fb_normalize (icalcomponent *icomp) for (prop = icalcomponent_get_first_property (icomp, ICAL_X_PROPERTY); prop != NULL; prop = icalcomponent_get_next_property (icomp, ICAL_X_PROPERTY)) - { + { p = icalproperty_new_clone (prop); icalcomponent_add_property (iclone, p); } - + return iclone; /* this will never be reached */ g_object_unref (iclone); @@ -1741,7 +1741,7 @@ comp_fb_normalize (icalcomponent *icomp) } gboolean -itip_publish_comp (ECal *client, gchar *uri, gchar *username, +itip_publish_comp (ECal *client, gchar *uri, gchar *username, gchar *password, ECalComponent **pub_comp) { icalcomponent *toplevel = NULL, *icalcomp = NULL; @@ -1750,15 +1750,15 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username, SoupMessage *msg; SoupUri *real_uri; char *ical_string; - + toplevel = e_cal_util_new_top_level (); icalcomponent_set_method (toplevel, ICAL_METHOD_PUBLISH); - + e_cal_component_set_url (*pub_comp, uri); - + icalcomp = e_cal_component_get_icalcomponent (*pub_comp); - - icomp = comp_fb_normalize (icalcomp); + + icomp = comp_fb_normalize (icalcomp); icalcomponent_add_component (toplevel, icomp); ical_string = icalcomponent_as_ical_string (toplevel); @@ -1772,10 +1772,10 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username, g_object_unref (session); return FALSE; } - + real_uri->user = g_strdup (username); real_uri->passwd = g_strdup (password); - + /* build the SOAP message */ msg = soup_message_new_from_uri (SOUP_METHOD_PUT, real_uri); if (!msg) { @@ -1783,23 +1783,23 @@ itip_publish_comp (ECal *client, gchar *uri, gchar *username, g_object_unref (session); return FALSE; } - soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); + soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); soup_message_set_request (msg, "text/calendar", SOUP_BUFFER_USER_OWNED, ical_string, strlen (ical_string)); - + /* send message to server */ soup_session_send_message (session, msg); if (!SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { - g_warning(G_STRLOC ": Could not publish Free/Busy: %d: %s", - msg->status_code, + g_warning(G_STRLOC ": Could not publish Free/Busy: %d: %s", + msg->status_code, soup_status_get_phrase (msg->status_code)); g_object_unref (session); return FALSE; } - + soup_uri_free (real_uri); g_object_unref (session); - + return TRUE; } diff --git a/calendar/gui/itip-utils.h b/calendar/gui/itip-utils.h index eded65974d..e7014c9f47 100644 --- a/calendar/gui/itip-utils.h +++ b/calendar/gui/itip-utils.h @@ -42,10 +42,10 @@ char *itip_get_comp_attendee (ECalComponent *comp, ECal *client); gboolean itip_send_comp (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, icalcomponent *zones, GSList *attachments_list, GList *users); -gboolean itip_publish_comp (ECal *client, gchar* uri, gchar* username, +gboolean itip_publish_comp (ECal *client, gchar* uri, gchar* username, gchar* password, ECalComponent **pub_comp); -gboolean itip_publish_begin (ECalComponent *pub_comp, ECal *client, +gboolean itip_publish_begin (ECalComponent *pub_comp, ECal *client, gboolean cloned, ECalComponent **clone); gboolean reply_to_calendar_comp (ECalComponentItipMethod method, ECalComponent *send_comp, diff --git a/calendar/gui/main.c b/calendar/gui/main.c index cbd90ea431..3f15b77c8e 100644 --- a/calendar/gui/main.c +++ b/calendar/gui/main.c @@ -130,14 +130,14 @@ initialize (void) EImportClass *klass; comp_editor_registry = E_COMP_EDITOR_REGISTRY (e_comp_editor_registry_new ()); - + #if 0 itip_control_factory_init (); component_editor_factory_init (); #endif launch_alarm_daemon (); - + /* Initialize plugin system */ e_plugin_hook_register_type (e_cal_popup_hook_get_type()); diff --git a/calendar/gui/memos-component.c b/calendar/gui/memos-component.c index 40b71cf5f5..8766649959 100644 --- a/calendar/gui/memos-component.c +++ b/calendar/gui/memos-component.c @@ -84,16 +84,16 @@ extern ECompEditorRegistry *comp_editor_registry; typedef struct _MemosComponentView { ESourceList *source_list; - + GSList *source_selection; - + EMemos *memos; ETable *table; ETableModel *model; EInfoLabel *info_label; GtkWidget *source_selector; - + BonoboControl *view_control; BonoboControl *sidebar_control; BonoboControl *statusbar_control; @@ -113,9 +113,9 @@ struct _MemosComponentPrivate { GSList *source_selection; GList *views; - + ECal *create_ecal; - + GList *notifications; }; @@ -157,7 +157,7 @@ ensure_sources (MemosComponent *component) group = E_SOURCE_GROUP (g->data); - /* compare only file:// part. If user home dir name changes we do not want to create + /* compare only file:// part. If user home dir name changes we do not want to create one more group */ if (!on_this_computer && !strncmp (base_uri_proto, e_source_group_peek_base_uri (group), 7)) @@ -249,10 +249,10 @@ static gboolean is_in_selection (GSList *selection, ESource *source) { GSList *l; - + for (l = selection; l; l = l->next) { ESource *selected_source = l->data; - + if (!strcmp (e_source_peek_uid (selected_source), e_source_peek_uid (source))) return TRUE; } @@ -264,10 +264,10 @@ static gboolean is_in_uids (GSList *uids, ESource *source) { GSList *l; - + for (l = uids; l; l = l->next) { const char *uid = l->data; - + if (!strcmp (uid, e_source_peek_uid (source))) return TRUE; } @@ -279,19 +279,19 @@ static void update_uris_for_selection (MemosComponentView *component_view) { GSList *selection, *l, *uids_selected = NULL; - + selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (component_view->source_selector)); - + for (l = component_view->source_selection; l; l = l->next) { ESource *old_selected_source = l->data; if (!is_in_selection (selection, old_selected_source)) e_memos_remove_memo_source (component_view->memos, old_selected_source); - } - + } + for (l = selection; l; l = l->next) { ESource *selected_source = l->data; - + e_memos_add_memo_source (component_view->memos, selected_source); uids_selected = g_slist_append (uids_selected, (char *)e_source_peek_uid (selected_source)); } @@ -322,7 +322,7 @@ update_uri_for_primary_selection (MemosComponentView *component_view) etable = e_memo_table_get_table (cal_table); memos_control_sensitize_commands (component_view->view_control, component_view->memos, e_table_selected_count (etable)); - + /* Save the selection for next time we start up */ calendar_config_set_primary_memos (e_source_peek_uid (source)); } @@ -331,7 +331,7 @@ static void update_selection (MemosComponentView *component_view) { GSList *selection, *uids_selected, *l; - + d(g_message("memos-component.c: update_selection called");) /* Get the selection in gconf */ @@ -343,10 +343,10 @@ update_selection (MemosComponentView *component_view) for (l = selection; l; l = l->next) { ESource *source = l->data; - if (!is_in_uids (uids_selected, source)) + if (!is_in_uids (uids_selected, source)) e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), source); } - + e_source_selector_free_selection (selection); /* Make sure the whole selection is there */ @@ -355,9 +355,9 @@ update_selection (MemosComponentView *component_view) ESource *source; source = e_source_list_peek_source_by_uid (component_view->source_list, uid); - if (source) + if (source) e_source_selector_select_source (E_SOURCE_SELECTOR (component_view->source_selector), source); - + g_free (uid); } g_slist_free (uids_selected); @@ -374,7 +374,7 @@ update_primary_selection (MemosComponentView *component_view) source = e_source_list_peek_source_by_uid (component_view->source_list, uid); g_free (uid); } - + if (source) { e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector), source); } else { @@ -394,7 +394,7 @@ copy_memo_list_cb (EPopup *ep, EPopupItem *pitem, void *data) { MemosComponentView *component_view = data; ESource *selected_source; - + selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; @@ -434,7 +434,7 @@ delete_memo_list_cb (EPopup *ep, EPopupItem *pitem, void *data) e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), selected_source); } - + e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); e_source_list_sync (component_view->source_list, NULL); } @@ -533,7 +533,7 @@ set_info (MemosComponentView *component_view) { GString *message = g_string_new (NULL); int rows, selected_rows; - + rows = e_table_model_row_count (component_view->model); selected_rows = e_table_selected_count (component_view->table); @@ -596,11 +596,11 @@ impl_upgradeFromVersion (PortableServer_Servant servant, } static gboolean -selector_tree_drag_drop (GtkWidget *widget, - GdkDragContext *context, - int x, - int y, - guint time, +selector_tree_drag_drop (GtkWidget *widget, + GdkDragContext *context, + int x, + int y, + guint time, CalendarComponent *component) { GtkTreeViewColumn *column; @@ -610,12 +610,12 @@ selector_tree_drag_drop (GtkWidget *widget, GtkTreeModel *model; GtkTreeIter iter; gpointer data; - - if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path, + + if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &column, &cell_x, &cell_y)) return FALSE; - - + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); if (!gtk_tree_model_get_iter (model, &iter, path)) { @@ -624,17 +624,17 @@ selector_tree_drag_drop (GtkWidget *widget, } gtk_tree_model_get (model, &iter, 0, &data, -1); - + if (E_IS_SOURCE_GROUP (data)) { g_object_unref (data); gtk_tree_path_free (path); return FALSE; } - + gtk_tree_path_free (path); return TRUE; } - + static gboolean selector_tree_drag_motion (GtkWidget *widget, GdkDragContext *context, @@ -649,21 +649,21 @@ selector_tree_drag_motion (GtkWidget *widget, GtkTreeModel *model; GtkTreeIter iter; GdkDragAction action = GDK_ACTION_DEFAULT; - + if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) goto finish; - + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); - + if (!gtk_tree_model_get_iter (model, &iter, path)) goto finish; - + gtk_tree_model_get (model, &iter, 0, &data, -1); if (E_IS_SOURCE_GROUP (data) || e_source_get_readonly (data)) goto finish; - + gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), path, GTK_TREE_VIEW_DROP_INTO_OR_BEFORE); action = context->suggested_action; if (action == GDK_ACTION_COPY && (context->actions & GDK_ACTION_MOVE)) @@ -688,7 +688,7 @@ update_single_object (ECal *client, icalcomponent *icalcomp, gboolean fail_on_mo d(g_message("memos-component.c: update_single_object called");) uid = (char *) icalcomponent_get_uid (icalcomp); - + if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL)) { if (fail_on_modify) return FALSE; @@ -696,7 +696,7 @@ update_single_object (ECal *client, icalcomponent *icalcomp, gboolean fail_on_mo return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL); } - return e_cal_create_object (client, icalcomp, &uid, NULL); + return e_cal_create_object (client, icalcomp, &uid, NULL); } static gboolean @@ -704,7 +704,7 @@ update_objects (ECal *client, icalcomponent *icalcomp) { icalcomponent *subcomp; icalcomponent_kind kind; - + d(g_message("memos-component.c: update_objects called");) kind = icalcomponent_isa (icalcomp); @@ -716,7 +716,7 @@ update_objects (ECal *client, icalcomponent *icalcomp) subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT); while (subcomp) { gboolean success; - + kind = icalcomponent_isa (subcomp); if (kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; @@ -741,10 +741,10 @@ update_objects (ECal *client, icalcomponent *icalcomp) } static void -selector_tree_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, +selector_tree_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, GtkSelectionData *data, guint info, guint time, @@ -764,13 +764,13 @@ selector_tree_drag_data_received (GtkWidget *widget, if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) goto finish; - + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); - + if (!gtk_tree_model_get_iter (model, &iter, path)) goto finish; - - + + gtk_tree_model_get (model, &iter, 0, &source, -1); if (E_IS_SOURCE_GROUP (source) || e_source_get_readonly (source) || !data->data) @@ -865,12 +865,12 @@ selector_tree_drag_data_received (GtkWidget *widget, gtk_tree_path_free (path); gtk_drag_finish (context, success, success && context->action == GDK_ACTION_MOVE, time); -} +} static void selector_tree_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, gpointer data) { - gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), + gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), NULL, GTK_TREE_VIEW_DROP_BEFORE); } @@ -883,33 +883,33 @@ control_activate_cb (BonoboControl *control, gboolean activate, gpointer data) if (activate) { BonoboUIComponent *uic; uic = bonobo_control_get_ui_component (component_view->view_control); - + e_user_creatable_items_handler_activate (component_view->creatable_items_handler, uic); - } + } } static void config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) -{ +{ MemosComponent *component = data; MemosComponentPrivate *priv; - + priv = component->priv; g_object_unref (priv->create_ecal); priv->create_ecal = NULL; - + priv->notifications = g_list_remove (priv->notifications, GUINT_TO_POINTER (id)); } static ECal * -setup_create_ecal (MemosComponent *component, MemosComponentView *component_view) +setup_create_ecal (MemosComponent *component, MemosComponentView *component_view) { MemosComponentPrivate *priv; ESource *source = NULL; char *uid; guint not; - + priv = component->priv; if (component_view) { @@ -919,10 +919,10 @@ setup_create_ecal (MemosComponent *component, MemosComponentView *component_view if (default_ecal) return default_ecal; } - + if (priv->create_ecal) - return priv->create_ecal; - + return priv->create_ecal; + /* Get the current primary calendar, or try to set one if it doesn't already exist */ uid = calendar_config_get_primary_memos (); if (uid) { @@ -938,15 +938,15 @@ setup_create_ecal (MemosComponent *component, MemosComponentView *component_view if (source) priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_JOURNAL); } - + if (priv->create_ecal) { if (!e_cal_open (priv->create_ecal, FALSE, NULL)) { GtkWidget *dialog; - + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, - _("Unable to open the memo list '%s' for creating events and meetings"), + _("Unable to open the memo list '%s' for creating events and meetings"), e_source_peek_name (source)); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -956,7 +956,7 @@ setup_create_ecal (MemosComponent *component, MemosComponentView *component_view } else { GtkWidget *dialog; - + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("There is no calendar available for creating memos")); @@ -964,10 +964,10 @@ setup_create_ecal (MemosComponent *component, MemosComponentView *component_view gtk_widget_destroy (dialog); return NULL; - } + } /* Handle the fact it may change on us */ - not = calendar_config_add_notification_primary_memos (config_create_ecal_changed_cb, + not = calendar_config_add_notification_primary_memos (config_create_ecal_changed_cb, component); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); @@ -995,7 +995,7 @@ create_new_memo (MemosComponent *memo_component, gboolean is_assigned, MemosComp ECalComponent *comp; MemoEditor *editor; CompEditorFlags flags = 0; - + ecal = setup_create_ecal (memo_component, component_view); if (!ecal) return FALSE; @@ -1026,18 +1026,18 @@ create_local_item_cb (EUserCreatableItemsHandler *handler, const char *item_type MemosComponentPrivate *priv; MemosComponentView *component_view = NULL; GList *l; - + priv = memos_component->priv; - + for (l = priv->views; l; l = l->next) { component_view = l->data; if (component_view->creatable_items_handler == handler) break; - + component_view = NULL; } - + if (strcmp (item_type_name, CREATE_MEMO_ID) == 0) { create_new_memo (memos_component, FALSE, component_view); } else if (strcmp (item_type_name, CREATE_SHARED_MEMO_ID) == 0) { @@ -1055,28 +1055,28 @@ create_component_view (MemosComponent *memos_component) GtkWidget *selector_scrolled_window, *vbox; GtkWidget *statusbar_widget; AtkObject *a11y; - + priv = memos_component->priv; /* Create the calendar component view */ component_view = g_new0 (MemosComponentView, 1); - + /* Add the source lists */ component_view->source_list = g_object_ref (priv->source_list); - + /* Create sidebar selector */ component_view->source_selector = e_source_selector_new (memos_component->priv->source_list); e_source_selector_set_select_new ((ESourceSelector *)component_view->source_selector, TRUE); a11y = gtk_widget_get_accessible (GTK_WIDGET (component_view->source_selector)); atk_object_set_name (a11y, _("Memo Source Selector")); - g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), + g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), memos_component); - g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave), + g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave), memos_component); - g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop), + g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop), memos_component); - g_signal_connect (component_view->source_selector, "drag-data-received", + g_signal_connect (component_view->source_selector, "drag-data-received", G_CALLBACK (selector_tree_drag_data_received), memos_component); gtk_drag_dest_set(component_view->source_selector, GTK_DEST_DEFAULT_ALL, drag_types, @@ -1116,9 +1116,9 @@ create_component_view (MemosComponent *memos_component) component_view->model = E_TABLE_MODEL (e_memo_table_get_model (e_memos_get_calendar_table (component_view->memos))); /* This signal is thrown if backends die - we update the selector */ - g_signal_connect (component_view->memos, "source_added", + g_signal_connect (component_view->memos, "source_added", G_CALLBACK (source_added_cb), component_view); - g_signal_connect (component_view->memos, "source_removed", + g_signal_connect (component_view->memos, "source_removed", G_CALLBACK (source_removed_cb), component_view); /* Create status bar */ @@ -1128,9 +1128,9 @@ create_component_view (MemosComponent *memos_component) gtk_widget_show (statusbar_widget); component_view->statusbar_control = bonobo_control_new (statusbar_widget); - + e_memo_table_set_activity_handler (e_memos_get_calendar_table (component_view->memos), component_view->activity_handler); - + /* connect after setting the initial selections, or we'll get unwanted calls to calendar_control_sensitize_calendar_commands */ g_signal_connect (component_view->source_selector, "selection_changed", @@ -1148,7 +1148,7 @@ create_component_view (MemosComponent *memos_component) set_info (component_view); g_signal_connect (component_view->table, "selection_change", G_CALLBACK (table_selection_change_cb), component_view); - g_signal_connect (component_view->model, "model_changed", + g_signal_connect (component_view->model, "model_changed", G_CALLBACK (model_changed_cb), component_view); g_signal_connect (component_view->model, "model_rows_inserted", G_CALLBACK (model_rows_inserted_cb), component_view); @@ -1156,7 +1156,7 @@ create_component_view (MemosComponent *memos_component) G_CALLBACK (model_rows_deleted_cb), component_view); /* Load the selection from the last run */ - update_selection (component_view); + update_selection (component_view); update_primary_selection (component_view); return component_view; @@ -1164,15 +1164,15 @@ create_component_view (MemosComponent *memos_component) static void destroy_component_view (MemosComponentView *component_view) -{ +{ GList *l; - + if (component_view->source_list) g_object_unref (component_view->source_list); if (component_view->source_selection) e_source_selector_free_selection (component_view->source_selection); - + for (l = component_view->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); g_list_free (component_view->notifications); @@ -1192,12 +1192,12 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was) MemosComponent *memos_component = data; MemosComponentPrivate *priv; GList *l; - + priv = memos_component->priv; for (l = priv->views; l; l = l->next) { MemosComponentView *component_view = l->data; - + if (G_OBJECT (component_view->view_control) == where_the_object_was) { priv->views = g_list_remove (priv->views, component_view); destroy_component_view (component_view); @@ -1216,7 +1216,7 @@ impl_createView (PortableServer_Servant servant, MemosComponentPrivate *priv; MemosComponentView *component_view; EComponentView *ecv; - + priv = component->priv; /* Create the calendar component view */ @@ -1230,7 +1230,7 @@ impl_createView (PortableServer_Servant servant, g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, component); priv->views = g_list_append (priv->views, component_view); - + /* TODO: Make CalendarComponentView just subclass EComponentView */ ecv = e_component_view_new_controls (parent, "memos", component_view->sidebar_control, component_view->view_control, component_view->statusbar_control); @@ -1283,7 +1283,7 @@ impl_requestCreateItem (PortableServer_Servant servant, CORBA_Environment *ev) { MemosComponent *memos_component = MEMOS_COMPONENT (bonobo_object_from_servant (servant)); - + if (strcmp (item_type_name, CREATE_MEMO_ID) == 0) { if (!create_new_memo (memos_component, FALSE, NULL)) bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed); @@ -1308,7 +1308,7 @@ impl_dispose (GObject *object) MemosComponent *memos_component = MEMOS_COMPONENT (object); MemosComponentPrivate *priv = memos_component->priv; GList *l; - + if (priv->source_list != NULL) { g_object_unref (priv->source_list); priv->source_list = NULL; @@ -1325,7 +1325,7 @@ impl_dispose (GObject *object) for (l = priv->views; l; l = l->next) { MemosComponentView *component_view = l->data; - + g_object_weak_unref (G_OBJECT (component_view->view_control), view_destroyed_cb, memos_component); } g_list_free (priv->views); @@ -1344,10 +1344,10 @@ impl_finalize (GObject *object) { MemosComponentPrivate *priv = MEMOS_COMPONENT (object)->priv; GList *l; - + for (l = priv->views; l; l = l->next) { MemosComponentView *component_view = l->data; - + destroy_component_view (component_view); } g_list_free (priv->views); @@ -1382,7 +1382,7 @@ memos_component_init (MemosComponent *component, MemosComponentClass *klass) MemosComponentPrivate *priv; priv = g_new0 (MemosComponentPrivate, 1); - + priv->base_directory = g_build_filename (g_get_home_dir (), ".evolution", NULL); priv->config_directory = g_build_filename (g_get_home_dir (), ".evolution", "memos", "config", @@ -1428,7 +1428,7 @@ memos_component_peek_config_directory (MemosComponent *component) ESourceList * memos_component_peek_source_list (MemosComponent *component) { - return component->priv->source_list; + return component->priv->source_list; } BONOBO_TYPE_FUNC_FULL (MemosComponent, GNOME_Evolution_Component, PARENT_TYPE, memos_component) diff --git a/calendar/gui/migration.c b/calendar/gui/migration.c index f6b977bbe9..3ed7d9fb5c 100644 --- a/calendar/gui/migration.c +++ b/calendar/gui/migration.c @@ -150,16 +150,16 @@ static void setup_progress_dialog (gboolean tasks) { GtkWidget *vbox, *hbox, *w; - + window = gtk_window_new (GTK_WINDOW_TOPLEVEL); gtk_window_set_title ((GtkWindow *) window, _("Migrating...")); gtk_window_set_modal ((GtkWindow *) window, TRUE); gtk_container_set_border_width ((GtkContainer *) window, 6); - + vbox = gtk_vbox_new (FALSE, 6); gtk_widget_show (vbox); gtk_container_add ((GtkContainer *) window, vbox); - + if (tasks) w = gtk_label_new (_("The location and hierarchy of the Evolution task " "folders has changed since Evolution 1.x.\n\nPlease be " @@ -172,19 +172,19 @@ setup_progress_dialog (gboolean tasks) gtk_label_set_line_wrap ((GtkLabel *) w, TRUE); gtk_widget_show (w); gtk_box_pack_start_defaults ((GtkBox *) vbox, w); - + hbox = gtk_hbox_new (FALSE, 6); gtk_widget_show (hbox); gtk_box_pack_start_defaults ((GtkBox *) vbox, hbox); - + label = (GtkLabel *) gtk_label_new (""); gtk_widget_show ((GtkWidget *) label); gtk_box_pack_start_defaults ((GtkBox *) hbox, (GtkWidget *) label); - + progress = (GtkProgressBar *) gtk_progress_bar_new (); gtk_widget_show ((GtkWidget *) progress); gtk_box_pack_start_defaults ((GtkBox *) hbox, (GtkWidget *) progress); - + gtk_widget_show (window); } @@ -198,13 +198,13 @@ static void dialog_set_folder_name (const char *folder_name) { char *text; - + text = g_strdup_printf (_("Migrating `%s':"), folder_name); gtk_label_set_text (label, text); g_free (text); - + gtk_progress_bar_set_fraction (progress, 0.0); - + while (gtk_events_pending ()) gtk_main_iteration (); } @@ -213,12 +213,12 @@ static void dialog_set_progress (double percent) { char text[5]; - + snprintf (text, sizeof (text), "%d%%", (int) (percent * 100.0f)); - + gtk_progress_bar_set_fraction (progress, percent); gtk_progress_bar_set_text (progress, text); - + while (gtk_events_pending ()) gtk_main_iteration (); } @@ -290,7 +290,7 @@ migrate_ical (ECal *old_ecal, ECal *new_ecal) int num_added = 0; int num_objects; gboolean retval = TRUE; - + /* both ecals are loaded, start the actual migration */ if (!e_cal_get_object_list (old_ecal, "#t", &objects, NULL)) return FALSE; @@ -304,7 +304,7 @@ migrate_ical (ECal *old_ecal, ECal *new_ecal) g_warning ("Migration of object failed: %s", error->message); retval = FALSE; } - + g_clear_error (&error); num_added ++; @@ -326,7 +326,7 @@ migrate_ical_folder_to_source (char *old_path, ESource *new_source, ECalSourceTy char *old_uri = g_strdup_printf ("file://%s", old_path); GError *error = NULL; gboolean retval = FALSE; - + group = e_source_group_new ("", old_uri); old_source = e_source_new ("", ""); e_source_group_add_source (group, old_source, -1); @@ -364,7 +364,7 @@ finish: g_object_unref (new_ecal); g_free (old_uri); - return retval; + return retval; } static gboolean @@ -372,7 +372,7 @@ migrate_ical_folder (char *old_path, ESourceGroup *dest_group, char *source_name { ESource *new_source; gboolean retval; - + new_source = e_source_new (source_name, source_name); e_source_set_relative_uri (new_source, e_source_peek_uid (new_source)); e_source_group_add_source (dest_group, new_source, -1); @@ -397,7 +397,7 @@ create_calendar_contact_source (ESourceList *source_list) { ESourceGroup *group; ESource *source; - + /* Create the contacts group */ group = e_source_group_new (_("Contacts"), CONTACTS_BASE_URI); e_source_list_add_group (source_list, group, -1); @@ -490,7 +490,7 @@ create_calendar_sources (CalendarComponent *component, /* Create the default Person calendar */ ESource *source = e_source_new (_("Personal"), PERSONAL_RELATIVE_URI); e_source_group_add_source (*on_this_computer, source, -1); - + if (!primary_calendar && !calendar_config_get_calendars_selected ()) { GSList selected; @@ -501,7 +501,7 @@ create_calendar_sources (CalendarComponent *component, calendar_config_set_calendars_selected (&selected); } - g_free (primary_calendar); + g_free (primary_calendar); e_source_set_color_spec (source, "#BECEDD"); *personal_source = source; } @@ -519,7 +519,7 @@ create_calendar_sources (CalendarComponent *component, *contacts = group; } - + g_free (base_uri_proto); g_free (base_uri); } @@ -538,7 +538,7 @@ create_task_sources (TasksComponent *component, *on_this_computer = NULL; *on_the_web = NULL; *personal_source = NULL; - + base_uri = g_build_filename (tasks_component_peek_base_directory (component), "tasks", "local", NULL); @@ -622,7 +622,7 @@ static void migrate_pilot_db_key (const char *key, gpointer user_data) { EXmlHash *xmlhash = user_data; - + e_xmlhash_add (xmlhash, key, ""); } @@ -634,16 +634,16 @@ migrate_pilot_data (const char *component, const char *conduit, const char *old_ const char *ext; char *filename; GDir *dir; - + if (!(dir = g_dir_open (old_path, 0, NULL))) return; - + map = g_alloca (12 + strlen (conduit)); sprintf (map, "pilot-map-%s-", conduit); - + changelog = g_alloca (24 + strlen (conduit)); sprintf (changelog, "pilot-sync-evolution-%s-", conduit); - + while ((dent = g_dir_read_name (dir))) { if (!strncmp (dent, map, strlen (map)) && ((ext = strrchr (dent, '.')) && !strcmp (ext, ".xml"))) { @@ -652,13 +652,13 @@ migrate_pilot_data (const char *component, const char *conduit, const char *old_ size_t nread, nwritten; int fd0, fd1; ssize_t n; - + filename = g_build_filename (old_path, dent, NULL); if ((fd0 = g_open (filename, O_RDONLY|O_BINARY, 0)) == -1) { g_free (filename); continue; } - + g_free (filename); filename = g_build_filename (new_path, dent, NULL); if ((fd1 = g_open (filename, O_WRONLY | O_CREAT | O_TRUNC | O_BINARY, 0666)) == -1) { @@ -666,38 +666,38 @@ migrate_pilot_data (const char *component, const char *conduit, const char *old_ close (fd0); continue; } - + do { do { n = read (fd0, inbuf, sizeof (inbuf)); } while (n == -1 && errno == EINTR); - + if (n < 1) break; - + nread = n; nwritten = 0; do { do { n = write (fd1, inbuf + nwritten, nread - nwritten); } while (n == -1 && errno == EINTR); - + if (n > 0) nwritten += n; } while (nwritten < nread && n != -1); - + if (n == -1) break; } while (1); - + if (n != -1) n = fsync (fd1); - + if (n == -1) { g_warning ("Failed to migrate %s: %s", dent, strerror (errno)); g_unlink (filename); } - + close (fd0); close (fd1); g_free (filename); @@ -707,31 +707,31 @@ migrate_pilot_data (const char *component, const char *conduit, const char *old_ EXmlHash *xmlhash; EDbHash *dbhash; struct stat st; - + filename = g_build_filename (old_path, dent, NULL); if (g_stat (filename, &st) == -1) { g_free (filename); continue; } - + dbhash = e_dbhash_new (filename); g_free (filename); - + filename = g_strdup_printf ("%s/%s.ics-%s", new_path, component, dent); if (g_stat (filename, &st) != -1) g_unlink (filename); xmlhash = e_xmlhash_new (filename); g_free (filename); - + e_dbhash_foreach_key (dbhash, migrate_pilot_db_key, xmlhash); - + e_dbhash_destroy (dbhash); - + e_xmlhash_write (xmlhash); e_xmlhash_destroy (xmlhash); } } - + g_dir_close (dir); } @@ -758,21 +758,21 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis struct stat st; conf_file = g_build_filename (g_get_home_dir (), "evolution", "config.xmldb", NULL); - if (lstat (conf_file, &st) == 0 && S_ISREG (st.st_mode)) + if (lstat (conf_file, &st) == 0 && S_ISREG (st.st_mode)) config_doc = xmlParseFile (conf_file); g_free (conf_file); - + if (config_doc && minor <= 2) { - GConfClient *gconf; + GConfClient *gconf; int res = 0; - + /* move bonobo config to gconf */ gconf = gconf_client_get_default (); - + res = e_bconf_import (gconf, config_doc, calendar_remap_list); - + g_object_unref (gconf); - + xmlFreeDoc(config_doc); if (res != 0) { @@ -798,7 +798,7 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis for (l = migration_dirs; l; l = l->next) { char *source_name; - + if (personal_source && !strcmp ((char*)l->data, local_cal_folder)) continue; @@ -810,17 +810,17 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis g_free(source_name); goto fail; } - + g_free (source_name); } - + g_free (local_cal_folder); dialog_close (); } if (minor <= 4 || (minor == 5 && revision < 5)) { - GConfClient *gconf; + GConfClient *gconf; GConfValue *gconf_val; int i; const char *keys[] = { @@ -830,9 +830,9 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis CALENDAR_CONFIG_MONTH_VPANE_POS, NULL }; - + gconf = gconf_client_get_default (); - + for (i = 0; keys[i]; i++) { gconf_val = gconf_client_get (gconf, keys[i], NULL); if (gconf_val) { @@ -841,13 +841,13 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis gconf_value_free (gconf_val); } } - + g_object_unref (gconf); } - + if (minor < 5 || (minor == 5 && revision <= 10)) { char *old_path, *new_path; - + old_path = g_build_filename (g_get_home_dir (), "evolution", "local", "Calendar", NULL); new_path = g_build_filename (calendar_component_peek_base_directory (component), "calendar", "local", "system", NULL); @@ -883,7 +883,7 @@ migrate_calendars (CalendarComponent *component, int major, int minor, int revis /** @Event: component.migration * @Title: Migration step in component initialization * @Target: ECalEventTargetComponent - * + * * component.migration is emitted during the calendar component * initialization process. This allows new calendar backend types * to be distributed as an e-d-s backend and a plugin without @@ -920,7 +920,7 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE creates the groups/sources or it finds the necessary groups/sources. */ create_task_sources (component, tasks_component_peek_source_list (component), &on_this_computer, &on_the_web, &personal_source); - + #ifndef G_OS_WIN32 if (major == 1) { xmlDocPtr config_doc = NULL; @@ -930,18 +930,18 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE if (g_file_test (conf_file, G_FILE_TEST_IS_REGULAR)) config_doc = e_xml_parse_file (conf_file); g_free (conf_file); - + if (config_doc && minor <= 2) { - GConfClient *gconf; + GConfClient *gconf; int res = 0; - + /* move bonobo config to gconf */ gconf = gconf_client_get_default (); - + res = e_bconf_import (gconf, config_doc, task_remap_list); - + g_object_unref (gconf); - + xmlFreeDoc(config_doc); if (res != 0) { @@ -953,9 +953,9 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE if (minor <= 4) { GSList *migration_dirs, *l; char *path, *local_task_folder; - + setup_progress_dialog (TRUE); - + path = g_build_filename (g_get_home_dir (), "evolution", "local", NULL); migration_dirs = e_folder_map_local_folders (path, "tasks"); local_task_folder = g_build_filename (path, "Tasks", NULL); @@ -966,7 +966,7 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE for (l = migration_dirs; l; l = l->next) { char *source_name; - + if (personal_source && !strcmp ((char*)l->data, local_task_folder)) continue; @@ -978,18 +978,18 @@ migrate_tasks (TasksComponent *component, int major, int minor, int revision, GE g_free(source_name); goto fail; } - + g_free (source_name); } - + g_free (local_task_folder); dialog_close (); } - + if (minor < 5 || (minor == 5 && revision <= 10)) { char *old_path, *new_path; - + old_path = g_build_filename (g_get_home_dir (), "evolution", "local", "Tasks", NULL); new_path = g_build_filename (tasks_component_peek_base_directory (component), "tasks", "local", "system", NULL); @@ -1027,14 +1027,14 @@ fail: g_object_unref (on_the_web); if (personal_source) g_object_unref (personal_source); - + return retval; } /******************************************************************************************************** * * MEMOS - * + * ********************************************************************************************************/ static void @@ -1051,7 +1051,7 @@ create_memo_sources (MemosComponent *component, *on_this_computer = NULL; *on_the_web = NULL; *personal_source = NULL; - + base_uri = g_build_filename (memos_component_peek_base_directory (component), "memos", "local", NULL); @@ -1150,8 +1150,8 @@ add_gw_esource (ESourceList *source_list, const char *group_name, const char *s const char * use_ssl; const char *poa_address; const char *offline_sync; - - + + poa_address = url->host; if (!poa_address || strlen (poa_address) ==0) return; @@ -1167,7 +1167,7 @@ add_gw_esource (ESourceList *source_list, const char *group_name, const char *s if (!e_source_list_add_group (source_list, group, -1)) return; relative_uri = g_strdup_printf ("%s@%s/", url->user, poa_address); - + source = e_source_new (source_name, relative_uri); e_source_set_property (source, "auth", "1"); e_source_set_property (source, "username", url->user); @@ -1185,7 +1185,7 @@ add_gw_esource (ESourceList *source_list, const char *group_name, const char *s temp = ids; for (; temp != NULL; temp = g_slist_next (temp)) g_free (temp->data); - + g_slist_free (ids); g_object_unref (source); g_object_unref (group); @@ -1212,7 +1212,7 @@ migrate_memos (MemosComponent *component, int major, int minor, int revision, st if (major == 2 && minor < 8) { EAccountList *al; EAccount *a; - CamelURL *url; + CamelURL *url; EIterator *it; GConfClient *gconf_client = gconf_client_get_default (); al = e_account_list_new (gconf_client); @@ -1220,7 +1220,7 @@ migrate_memos (MemosComponent *component, int major, int minor, int revision, st e_iterator_is_valid(it); e_iterator_next(it)) { a = (EAccount *) e_iterator_get(it); - if (!a->enabled || !is_groupwise_account (a)) + if (!a->enabled || !is_groupwise_account (a)) continue; url = camel_url_new (a->source->url, NULL); add_gw_esource (source_list, a->name, _("Notes"), url, gconf_client); @@ -1239,6 +1239,6 @@ migrate_memos (MemosComponent *component, int major, int minor, int revision, st g_object_unref (on_the_web); if (personal_source) g_object_unref (personal_source); - + return retval; } diff --git a/calendar/gui/misc.c b/calendar/gui/misc.c index c67e37c2ea..f5ce590ea7 100644 --- a/calendar/gui/misc.c +++ b/calendar/gui/misc.c @@ -35,10 +35,10 @@ /** * string_is_empty: * @value: A string. - * + * * Returns whether a string is NULL, the empty string, or completely made up of * whitespace characters. - * + * * Return value: TRUE if the string is empty, FALSE otherwise. **/ gboolean diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 80b7e42355..e56205c036 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -67,13 +67,13 @@ struct PrintCompItem { }; struct PrintCalItem { - GnomeCalendar *gcal; + GnomeCalendar *gcal; time_t start; }; static double evo_calendar_print_renderer_get_width (GtkPrintContext *context, - PangoFontDescription *font, + PangoFontDescription *font, const char *text) { PangoLayout *layout; @@ -315,16 +315,16 @@ print_border_with_triangles (GtkPrintContext *pc, /* Fill in the interior of the rectangle, if desired. */ if (red >= -EPSILON && green >= -EPSILON && blue >= -EPSILON) { - + cairo_move_to (cr, x1, y1); - + if (left_triangle_width > 0.0) cairo_line_to (cr, x1 - left_triangle_width, (y1 + y2) / 2); cairo_line_to (cr, x1, y2); cairo_line_to (cr, x2, y2); - + if (right_triangle_width > 0.0) cairo_line_to (cr, x2 + right_triangle_width, (y1 + y2) / 2); @@ -357,7 +357,7 @@ print_border_with_triangles (GtkPrintContext *pc, cairo_close_path (cr); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width (cr, line_width); - cairo_stroke (cr); + cairo_stroke (cr); } cairo_restore (cr); @@ -435,7 +435,7 @@ print_text (GtkPrintContext *context, PangoFontDescription *desc, cairo_save (cr); /* Set a clipping rectangle. */ - cairo_move_to (cr, x1, y1); + cairo_move_to (cr, x1, y1); cairo_rectangle (cr, x1, y1, x2, y2); cairo_clip (cr); @@ -560,14 +560,14 @@ format_date(time_t time, int flags, char *buffer, int bufflen) return buffer; } -static gboolean +static gboolean instance_cb (ECalComponent *comp, time_t instance_start, time_t instance_end, gpointer data) { - + gboolean *found = ((ECalModelGenerateInstancesData *) data)->cb_data; - + *found = TRUE; - + return FALSE; } @@ -680,19 +680,19 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, sprintf (buf, "%d", day); /* this is a slow messy way to do this ... but easy ... */ - e_cal_model_generate_instances (gnome_calendar_get_calendar_model (gcal), now, + e_cal_model_generate_instances (gnome_calendar_get_calendar_model (gcal), now, time_day_end_with_zone (now, zone), instance_cb, &found); - + font = found ? font_bold : font_normal; next = time_add_day_with_zone (now, 1, zone); - if ((now >= greystart && now < greyend) + if ((now >= greystart && now < greyend) || (greystart >= now && greystart < next)) { print_border (context, cell_left, cell_right, cell_top, cell_bottom, - -1.0, 0.75); + -1.0, 0.75); } print_text (context, font, buf, PANGO_ALIGN_RIGHT, cell_left, text_right, @@ -731,8 +731,8 @@ bound_text (GtkPrintContext *context, /* Set a clipping rectangle. */ cairo_move_to (cr, x1, y1); cairo_rectangle (cr, x1, y1, x2, y2); - cairo_clip (cr); - cairo_new_path (cr); + cairo_clip (cr); + cairo_new_path (cr); cairo_move_to (cr, x1, y1); pango_cairo_show_layout (cr, layout); @@ -762,7 +762,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, int i, hour, row; double hour_minute_x; cairo_t *cr; - + /* Fill the time column in light-gray. */ print_border (context, left, left + width, top, bottom, -1.0, 0.9); @@ -770,7 +770,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, cr = gtk_print_context_get_cairo_context (context); cairo_set_source_rgb (cr, 0, 0, 0); - print_border (context, left, right, top, bottom, 1.0, -1.0); + print_border (context, left, right, top, bottom, 1.0, -1.0); /* Draw the vertical line on the right of the time column. */ cr = gtk_print_context_get_cairo_context (context); @@ -778,7 +778,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, cairo_move_to (cr, left + width, bottom); cairo_line_to (cr, left + width, top); cairo_stroke (cr); - + /* Calculate the row height. */ if (top > bottom) yinc = (top - bottom) / (pdi->end_hour - pdi->start_hour); @@ -801,7 +801,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, row = 0; hour_minute_x = left + width * 0.58; for (i = pdi->start_hour; i < pdi->end_hour; i++) { - y = top + yinc * (row + 1) ; + y = top + yinc * (row + 1) ; cr = gtk_print_context_get_cairo_context (context); cairo_set_source_rgb (cr, 0, 0, 0); @@ -827,7 +827,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, print_text (context, font_minute, minute, PANGO_ALIGN_LEFT, hour_minute_x, left + width - 3, y - yinc + yinc / 2, y - yinc + yinc / 2 + minute_font_size); - + /* Draw the horizontal line between hours, across the entire width of the day view. */ cr = gtk_print_context_get_cairo_context (context); @@ -835,7 +835,7 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, cairo_line_to (cr, right, y); cairo_set_line_width (cr, 1); cairo_stroke (cr); - + /* Draw the horizontal line for the 1/2-hours, across the entire width except for part of the time column. */ cairo_move_to (cr, left + width * 0.6, y - yinc / 2); @@ -1073,7 +1073,7 @@ print_day_event (GtkPrintContext *context, PangoFontDescription *font, row_height = (bottom - top) / pdi->rows; y1 = top + start_row * row_height; y2 = top + (end_row + 1) * row_height; -#if 0 +#if 0 g_print ("Event: %g,%g %g,%g\n row_height: %g start_row: %i top: %g rows: %i\n", x1, y1, x2, y2, row_height, start_row, top, pdi->rows); #endif @@ -1174,7 +1174,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, if (pdi.events[0]->len > 0) { struct icaltimetype tt; - event = &g_array_index (pdi.events[0], EDayViewEvent, 0); + event = &g_array_index (pdi.events[0], EDayViewEvent, 0); tt = icaltime_from_timet_with_zone (event->start, FALSE, zone); if (tt.hour < pdi.start_hour) pdi.start_hour = tt.hour; @@ -1191,7 +1191,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, pdi.rows = (pdi.end_hour - pdi.start_hour) * 2; } - + /* Lay them out the long events, across the top of the page. */ e_day_view_layout_long_events (pdi.long_events, pdi.days_shown, pdi.day_starts, &rows_in_top_display); @@ -1203,7 +1203,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, print_day_long_event (context, font, left, right, top, bottom, DAY_VIEW_ROW_HEIGHT, event, &pdi, model); } - + /* We always leave space for DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY in the top display, but we may have more rows than that, in which case the main display area will be compressed. */ @@ -1216,18 +1216,18 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, cairo_set_source_rgb (cr, 0, 0, 0); print_border (context, left, right, top, top + rows_in_top_display * DAY_VIEW_ROW_HEIGHT - 4, - 1.0, -1.0); - + 1.0, -1.0); + /* Adjust the area containing the main display. */ top += rows_in_top_display * DAY_VIEW_ROW_HEIGHT - 2; - + /* Draw the borders, lines, and times down the left. */ print_day_background (context, gcal, whence, &pdi, left, right, top, bottom); /* Now adjust to get rid of the time column. */ left += DAY_VIEW_TIME_COLUMN_WIDTH; - - + + /* lay out the short events, within the day. */ e_day_view_layout_day_events (pdi.events[0], DAY_VIEW_ROWS, DAY_VIEW_MINS_PER_ROW, pdi.cols_per_row); @@ -1245,7 +1245,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, print_day_event (context, font, left, right, top, bottom, event, &pdi, model); } - + /* Free everything. */ free_event_array (pdi.long_events); pango_font_description_free (font); @@ -1362,7 +1362,7 @@ print_week_day_event (GtkPrintContext *context, PangoFontDescription *font, buffer, sizeof (buffer)); print_rectangle (context, x1, y1, (x2 + 6) - x1, (y2 + 4) - y1, red, green, blue); x1 += print_text_size (context, buffer, PANGO_ALIGN_LEFT, x1, x2, y1, y2 + 3 ) + 4; - print_text_size (context, text, PANGO_ALIGN_LEFT, x1, x2, y1, y2 + 3); + print_text_size (context, text, PANGO_ALIGN_LEFT, x1, x2, y1, y2 + 3); if (psi->weeks_shown <= 2) { date_tm.tm_hour = event->end_minute / 60; @@ -1371,11 +1371,11 @@ print_week_day_event (GtkPrintContext *context, PangoFontDescription *font, e_time_format_time (&date_tm, psi->use_24_hour_format, FALSE, buffer, sizeof (buffer)); - print_rectangle (context, x1, y1, (x2 + 6) - x1, (y2 + 4) - y1, red, green, blue); + print_rectangle (context, x1, y1, (x2 + 6) - x1, (y2 + 4) - y1, red, green, blue); x1 += print_text_size (context, buffer, PANGO_ALIGN_LEFT, x1, x2, y1, y2 + 3) + 4; } - print_text_size (context, text, PANGO_ALIGN_LEFT, x1, x2, y1, y2 + 3); + print_text_size (context, text, PANGO_ALIGN_LEFT, x1, x2, y1, y2 + 3); } @@ -1450,12 +1450,12 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font, psi->day_starts)) { print_week_day_event (context, font, psi, x1, x2, y1, y2, - event, span, text, red, green, blue); + event, span, text, red, green, blue); } else { print_week_long_event (context, font, psi, x1, x2, y1, y2, event, span, text, red, green, blue); - } + } } else { cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -1568,9 +1568,9 @@ print_week_view_background (GtkPrintContext *context, } e_utf8_strftime (buffer, sizeof (buffer), format_string, &tm); - + print_text_size (context, buffer, PANGO_ALIGN_RIGHT, - x1, x2 - 4, y1 + 2, y1 + 2 + font_size); + x1, x2 - 4, y1 + 2, y1 + 2 + font_size); } } @@ -1686,7 +1686,7 @@ print_week_summary (GtkPrintContext *context, GnomeCalendar *gcal, cell_width = (right - left) / 2; cell_height = (bottom - top) / 6; } - + /* Calculate the row height, using the normal font and with room for space or a rectangle around it. */ @@ -1963,31 +1963,31 @@ print_day_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) print_day_details (context, gcal, date, 0.0, todo - 2.0, HEADER_HEIGHT, height); - + /* Print the TaskPad down the right. */ print_todo_details (context, gcal, 0, INT_MAX, todo, width, HEADER_HEIGHT, height); - + /* Print the filled border around the header. */ print_border (context, 0.0, width, 0.0, HEADER_HEIGHT + 2.0, 1.0, 0.9); - + /* Print the 2 mini calendar-months. */ l = width - SMALL_MONTH_PAD - SMALL_MONTH_WIDTH * 2 - SMALL_MONTH_SPACING; print_month_small (context, gcal, date, l, 4, l + SMALL_MONTH_WIDTH, HEADER_HEIGHT + 4, DATE_MONTH | DATE_YEAR, date, date, FALSE); - + l += SMALL_MONTH_SPACING + SMALL_MONTH_WIDTH; print_month_small (context, gcal, time_add_month_with_zone (date, 1, zone), l, 4, l + SMALL_MONTH_WIDTH, HEADER_HEIGHT + 4, DATE_MONTH | DATE_YEAR, 0, 0, FALSE); - - + + /* Print the date, e.g. '8th May, 2001'. */ format_date (date, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); @@ -2042,8 +2042,8 @@ print_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) WEEK_NORMAL_FONT_SIZE, 0.0, width, HEADER_HEIGHT + 20, height); - - + + /* Print the border around the main view. */ print_border (context, 0.0, width, HEADER_HEIGHT , height, 1.0, -1.0); @@ -2135,7 +2135,7 @@ print_year_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS); height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS); - cr = gtk_print_context_get_cairo_context (context); + cr = gtk_print_context_get_cairo_context (context); cairo_show_page (cr); print_year_summary (context, gcal, date, 0.0, @@ -2182,7 +2182,7 @@ get_zone_from_tzid (ECal *client, const char *tzid) the builtin timezone with the TZID first. */ zone = icaltimezone_get_builtin_timezone_from_tzid (tzid); if (!zone) { - if (!e_cal_get_timezone (client, tzid, &zone, NULL)) + if (!e_cal_get_timezone (client, tzid, &zone, NULL)) /* FIXME: Handle error better. */ g_warning ("Couldn't get timezone from server: %s", tzid ? tzid : ""); @@ -2283,7 +2283,7 @@ print_calendar_draw_page (GtkPrintOperation *operation, break; default: g_return_if_reached (); - } + } } void @@ -2338,9 +2338,9 @@ print_comp_draw_page (GtkPrintOperation *operation, width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS); height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS); - /* PrintCompItem structure contains elements to be used + /* PrintCompItem structure contains elements to be used * with the Print Context , obtained in comp_draw_page - */ + */ client = pci->client; comp = pci->comp; @@ -2357,7 +2357,7 @@ print_comp_draw_page (GtkPrintOperation *operation, return; cr = gtk_print_context_get_cairo_context (context); - + /* Print the title in a box at the top of the page. */ font = get_font_for_size (18, PANGO_WEIGHT_BOLD); header_size = 40; @@ -2368,14 +2368,14 @@ print_comp_draw_page (GtkPrintOperation *operation, pango_font_description_free (font); top = header_size + 30; - + /* Summary */ font = get_font_for_size (18, PANGO_WEIGHT_BOLD); e_cal_component_get_summary (comp, &text); summary_string = g_strdup_printf (_("Summary: %s"), text.value); top = bound_text (context, font, summary_string, 0.0, top, width, height); - + g_free (summary_string); /* Location */ @@ -2388,12 +2388,12 @@ print_comp_draw_page (GtkPrintOperation *operation, g_free (location_string); } pango_font_description_free (font); - + /* Date information */ print_date_label (context, comp, client, 0.0, width, top + 3, top + 15); top += 20; font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); - + /* For a VTODO we print the Status, Priority, % Complete and URL. */ if (vtype == E_CAL_COMPONENT_TODO) { icalproperty_status status; @@ -2401,7 +2401,7 @@ print_comp_draw_page (GtkPrintOperation *operation, int *percent; int *priority; const char *url; - + /* Status */ e_cal_component_get_status (comp, &status); if (status != ICAL_STATUS_NONE) { @@ -2473,7 +2473,7 @@ print_comp_draw_page (GtkPrintOperation *operation, g_free (url_string); } } - + /* Categories */ e_cal_component_get_categories (comp, &categories); if (categories && categories[0]) { @@ -2484,7 +2484,7 @@ print_comp_draw_page (GtkPrintOperation *operation, top += get_font_size (font) - 6 ; g_free (categories_string); } - + /* Contacts */ e_cal_component_get_contact_list (comp, &contact_list); if (contact_list) { @@ -2513,7 +2513,7 @@ print_comp_draw_page (GtkPrintOperation *operation, top = 10; //FIXME cairo_show_page (cr); } - if (text->value != NULL) + if (text->value != NULL) top = bound_text (context, font, text->value, 0.0, top + 3, width, height) + 30; } diff --git a/calendar/gui/tag-calendar.c b/calendar/gui/tag-calendar.c index b21e7a7ed1..29b4a491ae 100644 --- a/calendar/gui/tag-calendar.c +++ b/calendar/gui/tag-calendar.c @@ -76,7 +76,7 @@ prepare_tag (ECalendar *ecal, struct calendar_tag_closure *c, icaltimezone *zone } else { c->zone = calendar_config_get_icaltimezone (); } - + c->start_time = icaltime_as_timet_with_zone (start_tt, c->zone); c->end_time = icaltime_as_timet_with_zone (end_tt, c->zone); @@ -118,7 +118,7 @@ tag_calendar_cb (ECalComponent *comp, * tag_calendar_by_client: * @ecal: Calendar widget to tag. * @client: A calendar client object. - * + * * Tags an #ECalendar widget with the events that occur in its current time * range. The occurrences are extracted from the specified calendar @client. **/ @@ -162,7 +162,7 @@ resolve_tzid_cb (const char *tzid, gpointer data) g_return_val_if_fail (data != NULL, NULL); g_return_val_if_fail (E_IS_CAL (data), NULL); - + client = E_CAL (data); /* Try to find the builtin timezone first. */ @@ -181,7 +181,7 @@ resolve_tzid_cb (const char *tzid, gpointer data) * @ecal: Calendar widget to tag. * @comp: A calendar component object. * @clear_first: Whether the #ECalendar should be cleared of any marks first. - * + * * Tags an #ECalendar widget with any occurrences of a specific calendar * component that occur within the calendar's current time range. * Note that TRANSPARENT events are also tagged here. @@ -191,7 +191,7 @@ resolve_tzid_cb (const char *tzid, gpointer data) * have been added to the calendar on the server yet. **/ void -tag_calendar_by_comp (ECalendar *ecal, ECalComponent *comp, ECal *client, icaltimezone *display_zone, +tag_calendar_by_comp (ECalendar *ecal, ECalComponent *comp, ECal *client, icaltimezone *display_zone, gboolean clear_first, gboolean comp_is_on_server) { struct calendar_tag_closure c; diff --git a/calendar/gui/tasks-component.c b/calendar/gui/tasks-component.c index 2f8c563aa7..da1c0e61eb 100644 --- a/calendar/gui/tasks-component.c +++ b/calendar/gui/tasks-component.c @@ -80,19 +80,19 @@ static BonoboObjectClass *parent_class = NULL; extern ECompEditorRegistry *comp_editor_registry; -typedef struct +typedef struct { ESourceList *source_list; - + GSList *source_selection; - + ETasks *tasks; ETable *table; ETableModel *model; EInfoLabel *info_label; GtkWidget *source_selector; - + BonoboControl *view_control; BonoboControl *sidebar_control; BonoboControl *statusbar_control; @@ -112,9 +112,9 @@ struct _TasksComponentPrivate { GSList *source_selection; GList *views; - + ECal *create_ecal; - + GList *notifications; }; @@ -153,7 +153,7 @@ ensure_sources (TasksComponent *component) group = E_SOURCE_GROUP (g->data); - /* compare only file:// part. If user home dir name changes we do not want to create + /* compare only file:// part. If user home dir name changes we do not want to create one more group */ if (!on_this_computer && !strncmp (base_uri_proto, e_source_group_peek_base_uri (group), 7)) @@ -245,10 +245,10 @@ static gboolean is_in_selection (GSList *selection, ESource *source) { GSList *l; - + for (l = selection; l; l = l->next) { ESource *selected_source = l->data; - + if (!strcmp (e_source_peek_uid (selected_source), e_source_peek_uid (source))) return TRUE; } @@ -260,10 +260,10 @@ static gboolean is_in_uids (GSList *uids, ESource *source) { GSList *l; - + for (l = uids; l; l = l->next) { const char *uid = l->data; - + if (!strcmp (uid, e_source_peek_uid (source))) return TRUE; } @@ -275,19 +275,19 @@ static void update_uris_for_selection (TasksComponentView *component_view) { GSList *selection, *l, *uids_selected = NULL; - + selection = e_source_selector_get_selection (E_SOURCE_SELECTOR (component_view->source_selector)); - + for (l = component_view->source_selection; l; l = l->next) { ESource *old_selected_source = l->data; if (!is_in_selection (selection, old_selected_source)) e_tasks_remove_todo_source (component_view->tasks, old_selected_source); - } - + } + for (l = selection; l; l = l->next) { ESource *selected_source = l->data; - + e_tasks_add_todo_source (component_view->tasks, selected_source); uids_selected = g_slist_append (uids_selected, (char *)e_source_peek_uid (selected_source)); } @@ -318,7 +318,7 @@ update_uri_for_primary_selection (TasksComponentView *component_view) etable = e_calendar_table_get_table (cal_table); tasks_control_sensitize_commands (component_view->view_control, component_view->tasks, e_table_selected_count (etable)); - + /* Save the selection for next time we start up */ calendar_config_set_primary_tasks (e_source_peek_uid (source)); } @@ -337,10 +337,10 @@ update_selection (TasksComponentView *component_view) for (l = selection; l; l = l->next) { ESource *source = l->data; - if (!is_in_uids (uids_selected, source)) + if (!is_in_uids (uids_selected, source)) e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), source); } - + e_source_selector_free_selection (selection); /* Make sure the whole selection is there */ @@ -349,9 +349,9 @@ update_selection (TasksComponentView *component_view) ESource *source; source = e_source_list_peek_source_by_uid (component_view->source_list, uid); - if (source) + if (source) e_source_selector_select_source (E_SOURCE_SELECTOR (component_view->source_selector), source); - + g_free (uid); } g_slist_free (uids_selected); @@ -368,7 +368,7 @@ update_primary_selection (TasksComponentView *component_view) source = e_source_list_peek_source_by_uid (component_view->source_list, uid); g_free (uid); } - + if (source) { e_source_selector_set_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector), source); } else { @@ -385,7 +385,7 @@ copy_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data) { TasksComponentView *component_view = data; ESource *selected_source; - + selected_source = e_source_selector_peek_primary_selection (E_SOURCE_SELECTOR (component_view->source_selector)); if (!selected_source) return; @@ -425,7 +425,7 @@ delete_task_list_cb (EPopup *ep, EPopupItem *pitem, void *data) e_source_selector_unselect_source (E_SOURCE_SELECTOR (component_view->source_selector), selected_source); } - + e_source_group_remove_source (e_source_peek_group (selected_source), selected_source); e_source_list_sync (component_view->source_list, NULL); } @@ -524,7 +524,7 @@ set_info (TasksComponentView *component_view) { GString *message = g_string_new (NULL); int rows, selected_rows; - + rows = e_table_model_row_count (component_view->model); selected_rows = e_table_selected_count (component_view->table); @@ -587,11 +587,11 @@ impl_upgradeFromVersion (PortableServer_Servant servant, } static gboolean -selector_tree_drag_drop (GtkWidget *widget, - GdkDragContext *context, - int x, - int y, - guint time, +selector_tree_drag_drop (GtkWidget *widget, + GdkDragContext *context, + int x, + int y, + guint time, CalendarComponent *component) { GtkTreeViewColumn *column; @@ -601,12 +601,12 @@ selector_tree_drag_drop (GtkWidget *widget, GtkTreeModel *model; GtkTreeIter iter; gpointer data; - - if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path, + + if (!gtk_tree_view_get_path_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &column, &cell_x, &cell_y)) return FALSE; - - + + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); if (!gtk_tree_model_get_iter (model, &iter, path)) { @@ -615,17 +615,17 @@ selector_tree_drag_drop (GtkWidget *widget, } gtk_tree_model_get (model, &iter, 0, &data, -1); - + if (E_IS_SOURCE_GROUP (data)) { g_object_unref (data); gtk_tree_path_free (path); return FALSE; } - + gtk_tree_path_free (path); return TRUE; } - + static gboolean selector_tree_drag_motion (GtkWidget *widget, GdkDragContext *context, @@ -640,21 +640,21 @@ selector_tree_drag_motion (GtkWidget *widget, GtkTreeModel *model; GtkTreeIter iter; GdkDragAction action = GDK_ACTION_DEFAULT; - + if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) goto finish; - + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); - + if (!gtk_tree_model_get_iter (model, &iter, path)) goto finish; - + gtk_tree_model_get (model, &iter, 0, &data, -1); if (E_IS_SOURCE_GROUP (data) || e_source_get_readonly (data)) goto finish; - + gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), path, GTK_TREE_VIEW_DROP_INTO_OR_BEFORE); action = context->suggested_action; if (action == GDK_ACTION_COPY && (context->actions & GDK_ACTION_MOVE)) @@ -677,11 +677,11 @@ update_single_object (ECal *client, icalcomponent *icalcomp) icalcomponent *tmp_icalcomp; uid = (char *) icalcomponent_get_uid (icalcomp); - + if (e_cal_get_object (client, uid, NULL, &tmp_icalcomp, NULL)) return e_cal_modify_object (client, icalcomp, CALOBJ_MOD_ALL, NULL); - return e_cal_create_object (client, icalcomp, &uid, NULL); + return e_cal_create_object (client, icalcomp, &uid, NULL); } static gboolean @@ -699,7 +699,7 @@ update_objects (ECal *client, icalcomponent *icalcomp) subcomp = icalcomponent_get_first_component (icalcomp, ICAL_ANY_COMPONENT); while (subcomp) { gboolean success; - + kind = icalcomponent_isa (subcomp); if (kind == ICAL_VTIMEZONE_COMPONENT) { icaltimezone *zone; @@ -725,10 +725,10 @@ update_objects (ECal *client, icalcomponent *icalcomp) } static void -selector_tree_drag_data_received (GtkWidget *widget, - GdkDragContext *context, - gint x, - gint y, +selector_tree_drag_data_received (GtkWidget *widget, + GdkDragContext *context, + gint x, + gint y, GtkSelectionData *data, guint info, guint time, @@ -748,13 +748,13 @@ selector_tree_drag_data_received (GtkWidget *widget, if (!gtk_tree_view_get_dest_row_at_pos (GTK_TREE_VIEW (widget), x, y, &path, &pos)) goto finish; - + model = gtk_tree_view_get_model (GTK_TREE_VIEW (widget)); - + if (!gtk_tree_model_get_iter (model, &iter, path)) goto finish; - - + + gtk_tree_model_get (model, &iter, 0, &source, -1); if (E_IS_SOURCE_GROUP (source) || e_source_get_readonly (source) || !data->data) @@ -849,12 +849,12 @@ selector_tree_drag_data_received (GtkWidget *widget, gtk_tree_path_free (path); gtk_drag_finish (context, success, context->action == GDK_ACTION_MOVE, time); -} +} static void selector_tree_drag_leave (GtkWidget *widget, GdkDragContext *context, guint time, gpointer data) { - gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), + gtk_tree_view_set_drag_dest_row(GTK_TREE_VIEW (widget), NULL, GTK_TREE_VIEW_DROP_BEFORE); } @@ -867,33 +867,33 @@ control_activate_cb (BonoboControl *control, gboolean activate, gpointer data) if (activate) { BonoboUIComponent *uic; uic = bonobo_control_get_ui_component (component_view->view_control); - + e_user_creatable_items_handler_activate (component_view->creatable_items_handler, uic); - } + } } static void config_create_ecal_changed_cb (GConfClient *client, guint id, GConfEntry *entry, gpointer data) -{ +{ TasksComponent *component = data; TasksComponentPrivate *priv; - + priv = component->priv; g_object_unref (priv->create_ecal); priv->create_ecal = NULL; - + priv->notifications = g_list_remove (priv->notifications, GUINT_TO_POINTER (id)); } static ECal * -setup_create_ecal (TasksComponent *component, TasksComponentView *component_view) +setup_create_ecal (TasksComponent *component, TasksComponentView *component_view) { TasksComponentPrivate *priv; ESource *source = NULL; char *uid; guint not; - + priv = component->priv; if (component_view) { @@ -903,18 +903,18 @@ setup_create_ecal (TasksComponent *component, TasksComponentView *component_view if (default_ecal) return default_ecal; } - + if (priv->create_ecal) - return priv->create_ecal; - - /* Get the current primary calendar, or try to set one if it doesn't already exist */ + return priv->create_ecal; + + /* Get the current primary calendar, or try to set one if it doesn't already exist */ uid = calendar_config_get_primary_tasks (); if (uid) { source = e_source_list_peek_source_by_uid (priv->source_list, uid); g_free (uid); priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); - } + } if (!priv->create_ecal) { /* Try to create a default if there isn't one */ @@ -922,19 +922,19 @@ setup_create_ecal (TasksComponent *component, TasksComponentView *component_view if (source) priv->create_ecal = auth_new_cal_from_source (source, E_CAL_SOURCE_TYPE_TODO); } - + if (priv->create_ecal) { icaltimezone *zone; - + zone = calendar_config_get_icaltimezone (); e_cal_set_default_timezone (priv->create_ecal, zone, NULL); if (!e_cal_open (priv->create_ecal, FALSE, NULL)) { GtkWidget *dialog; - + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, - _("Unable to open the task list '%s' for creating events and meetings"), + _("Unable to open the task list '%s' for creating events and meetings"), e_source_peek_name (source)); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -944,7 +944,7 @@ setup_create_ecal (TasksComponent *component, TasksComponentView *component_view } else { GtkWidget *dialog; - + dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, _("There is no calendar available for creating tasks")); @@ -952,10 +952,10 @@ setup_create_ecal (TasksComponent *component, TasksComponentView *component_view gtk_widget_destroy (dialog); return NULL; - } + } /* Handle the fact it may change on us */ - not = calendar_config_add_notification_primary_tasks (config_create_ecal_changed_cb, + not = calendar_config_add_notification_primary_tasks (config_create_ecal_changed_cb, component); priv->notifications = g_list_prepend (priv->notifications, GUINT_TO_POINTER (not)); @@ -982,15 +982,15 @@ create_new_todo (TasksComponent *task_component, gboolean is_assigned, TasksComp ECal *ecal; ECalComponent *comp; TaskEditor *editor; - guint32 flags = 0; - + guint32 flags = 0; + ecal = setup_create_ecal (task_component, component_view); if (!ecal) return FALSE; if (is_assigned) flags |= COMP_EDITOR_IS_ASSIGNED; - + flags |= COMP_EDITOR_NEW_ITEM | COMP_EDITOR_USER_ORG; editor = task_editor_new (ecal, flags); @@ -1015,18 +1015,18 @@ create_local_item_cb (EUserCreatableItemsHandler *handler, const char *item_type TasksComponentPrivate *priv; TasksComponentView *component_view = NULL; GList *l; - + priv = tasks_component->priv; - + for (l = priv->views; l; l = l->next) { component_view = l->data; if (component_view->creatable_items_handler == handler) break; - + component_view = NULL; } - + if (strcmp (item_type_name, CREATE_TASK_ID) == 0) { create_new_todo (tasks_component, FALSE, component_view); } else if (strcmp (item_type_name, CREATE_TASK_ASSIGNED_ID) == 0) { @@ -1044,28 +1044,28 @@ create_component_view (TasksComponent *tasks_component) GtkWidget *selector_scrolled_window, *vbox; GtkWidget *statusbar_widget; AtkObject *a11y; - + priv = tasks_component->priv; /* Create the calendar component view */ component_view = g_new0 (TasksComponentView, 1); - + /* Add the source lists */ component_view->source_list = g_object_ref (priv->source_list); - + /* Create sidebar selector */ component_view->source_selector = e_source_selector_new (tasks_component->priv->source_list); e_source_selector_set_select_new ((ESourceSelector *)component_view->source_selector, TRUE); a11y = gtk_widget_get_accessible (GTK_WIDGET (component_view->source_selector)); atk_object_set_name (a11y, _("Task Source Selector")); - g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), + g_signal_connect (component_view->source_selector, "drag-motion", G_CALLBACK (selector_tree_drag_motion), tasks_component); - g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave), + g_signal_connect (component_view->source_selector, "drag-leave", G_CALLBACK (selector_tree_drag_leave), tasks_component); - g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop), + g_signal_connect (component_view->source_selector, "drag-drop", G_CALLBACK (selector_tree_drag_drop), tasks_component); - g_signal_connect (component_view->source_selector, "drag-data-received", + g_signal_connect (component_view->source_selector, "drag-data-received", G_CALLBACK (selector_tree_drag_data_received), tasks_component); gtk_drag_dest_set(component_view->source_selector, GTK_DEST_DEFAULT_ALL, drag_types, @@ -1105,9 +1105,9 @@ create_component_view (TasksComponent *tasks_component) component_view->model = E_TABLE_MODEL (e_calendar_table_get_model (e_tasks_get_calendar_table (component_view->tasks))); /* This signal is thrown if backends die - we update the selector */ - g_signal_connect (component_view->tasks, "source_added", + g_signal_connect (component_view->tasks, "source_added", G_CALLBACK (source_added_cb), component_view); - g_signal_connect (component_view->tasks, "source_removed", + g_signal_connect (component_view->tasks, "source_removed", G_CALLBACK (source_removed_cb), component_view); /* Create status bar */ @@ -1117,9 +1117,9 @@ create_component_view (TasksComponent *tasks_component) gtk_widget_show (statusbar_widget); component_view->statusbar_control = bonobo_control_new (statusbar_widget); - + e_calendar_table_set_activity_handler (e_tasks_get_calendar_table (component_view->tasks), component_view->activity_handler); - + /* connect after setting the initial selections, or we'll get unwanted calls to calendar_control_sensitize_calendar_commands */ g_signal_connect (component_view->source_selector, "selection_changed", @@ -1137,7 +1137,7 @@ create_component_view (TasksComponent *tasks_component) set_info (component_view); g_signal_connect (component_view->table, "selection_change", G_CALLBACK (table_selection_change_cb), component_view); - g_signal_connect (component_view->model, "model_changed", + g_signal_connect (component_view->model, "model_changed", G_CALLBACK (model_changed_cb), component_view); g_signal_connect (component_view->model, "model_rows_inserted", G_CALLBACK (model_rows_inserted_cb), component_view); @@ -1145,7 +1145,7 @@ create_component_view (TasksComponent *tasks_component) G_CALLBACK (model_rows_deleted_cb), component_view); /* Load the selection from the last run */ - update_selection (component_view); + update_selection (component_view); update_primary_selection (component_view); return component_view; @@ -1153,15 +1153,15 @@ create_component_view (TasksComponent *tasks_component) static void destroy_component_view (TasksComponentView *component_view) -{ +{ GList *l; - + if (component_view->source_list) g_object_unref (component_view->source_list); if (component_view->source_selection) e_source_selector_free_selection (component_view->source_selection); - + for (l = component_view->notifications; l; l = l->next) calendar_config_remove_notification (GPOINTER_TO_UINT (l->data)); g_list_free (component_view->notifications); @@ -1181,12 +1181,12 @@ view_destroyed_cb (gpointer data, GObject *where_the_object_was) TasksComponent *tasks_component = data; TasksComponentPrivate *priv; GList *l; - + priv = tasks_component->priv; for (l = priv->views; l; l = l->next) { TasksComponentView *component_view = l->data; - + if (G_OBJECT (component_view->view_control) == where_the_object_was) { priv->views = g_list_remove (priv->views, component_view); destroy_component_view (component_view); @@ -1205,7 +1205,7 @@ impl_createView (PortableServer_Servant servant, TasksComponentPrivate *priv; TasksComponentView *component_view; EComponentView *ecv; - + priv = component->priv; /* Create the calendar component view */ @@ -1219,7 +1219,7 @@ impl_createView (PortableServer_Servant servant, g_object_weak_ref (G_OBJECT (component_view->view_control), view_destroyed_cb, component); priv->views = g_list_append (priv->views, component_view); - + /* TODO: Make TasksComponentView just subclass EComponentView */ ecv = e_component_view_new_controls (parent, "tasks", component_view->sidebar_control, component_view->view_control, component_view->statusbar_control); @@ -1257,17 +1257,17 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme if (p) { while (*p) { len = strcspn (p, "=&"); - + /* If it's malformed, give up. */ if (p[len] != '=') break; - + header = (char *) p; header[len] = '\0'; p += len + 1; - + clen = strcspn (p, "&"); - + content = g_strndup (p, clen); if (!g_ascii_strcasecmp (header, "source-uid")) { src_uid = g_strdup (content); @@ -1289,7 +1289,7 @@ impl_handleURI (PortableServer_Servant servant, const char *uri, CORBA_Environme if (uid && src_uid) { e_tasks_open_task_id (view->tasks, src_uid, uid, rid); } - + g_free (src_uid); g_free (uid); g_free (rid); @@ -1345,7 +1345,7 @@ impl_requestCreateItem (PortableServer_Servant servant, CORBA_Environment *ev) { TasksComponent *tasks_component = TASKS_COMPONENT (bonobo_object_from_servant (servant)); - + if (strcmp (item_type_name, CREATE_TASK_ID) == 0) { if (!create_new_todo (tasks_component, FALSE, NULL)) bonobo_exception_set (ev, ex_GNOME_Evolution_Component_Failed); @@ -1368,7 +1368,7 @@ impl_dispose (GObject *object) TasksComponent *tasks_component = TASKS_COMPONENT (object); TasksComponentPrivate *priv = tasks_component->priv; GList *l; - + if (priv->source_list != NULL) { g_object_unref (priv->source_list); priv->source_list = NULL; @@ -1385,7 +1385,7 @@ impl_dispose (GObject *object) for (l = priv->views; l; l = l->next) { TasksComponentView *component_view = l->data; - + g_object_weak_unref (G_OBJECT (component_view->view_control), view_destroyed_cb, tasks_component); } g_list_free (priv->views); @@ -1404,10 +1404,10 @@ impl_finalize (GObject *object) { TasksComponentPrivate *priv = TASKS_COMPONENT (object)->priv; GList *l; - + for (l = priv->views; l; l = l->next) { TasksComponentView *component_view = l->data; - + destroy_component_view (component_view); } g_list_free (priv->views); @@ -1448,7 +1448,7 @@ tasks_component_init (TasksComponent *component, TasksComponentClass *klass) priv->config_directory = g_build_filename (g_get_home_dir (), ".evolution", "tasks", "config", NULL); - + component->priv = priv; ensure_sources (component); } @@ -1489,7 +1489,7 @@ tasks_component_peek_config_directory (TasksComponent *component) ESourceList * tasks_component_peek_source_list (TasksComponent *component) { - return component->priv->source_list; + return component->priv->source_list; } BONOBO_TYPE_FUNC_FULL (TasksComponent, GNOME_Evolution_Component, PARENT_TYPE, tasks_component) diff --git a/calendar/gui/tasks-control.c b/calendar/gui/tasks-control.c index dda57aad74..5c0b89e3f8 100644 --- a/calendar/gui/tasks-control.c +++ b/calendar/gui/tasks-control.c @@ -97,12 +97,12 @@ static void tasks_control_forward_cmd (BonoboUIComponent *uic, gpointer data, const char *path); -static void tasks_control_view_preview (BonoboUIComponent *uic, - const char *path, - Bonobo_UIComponent_EventType type, - const char *state, +static void tasks_control_view_preview (BonoboUIComponent *uic, + const char *path, + Bonobo_UIComponent_EventType type, + const char *state, void *data); - + BonoboControl * tasks_control_new (void) { @@ -218,9 +218,9 @@ tasks_control_sensitize_commands (BonoboControl *control, ETasks *tasks, int n_s ecal = e_cal_model_get_default_client (model); - if (ecal) + if (ecal) e_cal_is_read_only (ecal, &read_only, NULL); - + sensitize_items (uic, tasks_sensitize_table, t->target.mask); e_menu_update_target ((EMenu *)menu, (EMenuTarget *)t); } @@ -266,7 +266,7 @@ static EPixmap pixmaps [] = { E_PIXMAP ("/Toolbar/Paste", "edit-paste", E_ICON_SIZE_LARGE_TOOLBAR), E_PIXMAP ("/Toolbar/Print", "document-print", E_ICON_SIZE_LARGE_TOOLBAR), E_PIXMAP ("/Toolbar/Delete", "edit-delete", E_ICON_SIZE_LARGE_TOOLBAR), - + E_PIXMAP_END }; void @@ -302,8 +302,8 @@ tasks_control_activate (BonoboControl *control, ETasks *tasks) NULL); g_free (xmlfile); - e_pixmaps_update (uic, pixmaps); - + e_pixmaps_update (uic, pixmaps); + e_tasks_setup_view_menus (tasks, uic); /* Signals from the tasks widget; also sensitize the menu items as appropriate */ @@ -320,7 +320,7 @@ tasks_control_activate (BonoboControl *control, ETasks *tasks) state = calendar_config_get_preview_state(); bonobo_ui_component_thaw (uic, NULL); - + bonobo_ui_component_add_listener(uic, "ViewPreview", tasks_control_view_preview, tasks); bonobo_ui_component_set_prop(uic, "/commands/ViewPreview", "state", state?"1":"0", NULL); /* Show the dialog for setting the timezone if the user hasn't chosen @@ -441,7 +441,7 @@ confirm_purge (ETasks *tasks) { GtkWidget *dialog, *checkbox, *parent; int button; - + if (!calendar_config_get_confirm_purge ()) return TRUE; @@ -457,12 +457,12 @@ confirm_purge (ETasks *tasks) checkbox = gtk_check_button_new_with_label (_("Do not ask me again.")); gtk_widget_show (checkbox); gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), checkbox, TRUE, TRUE, 6); - - button = gtk_dialog_run (GTK_DIALOG (dialog)); + + button = gtk_dialog_run (GTK_DIALOG (dialog)); if (button == GTK_RESPONSE_YES && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox))) calendar_config_set_confirm_purge (FALSE); gtk_widget_destroy (dialog); - + return button == GTK_RESPONSE_YES ? TRUE : FALSE; } @@ -535,7 +535,7 @@ tasks_control_forward_cmd (BonoboUIComponent *uic, ETasks *tasks; ECalendarTable *cal_table; ECalModelComponent *comp_data; - + tasks = E_TASKS (data); cal_table = e_tasks_get_calendar_table (tasks); comp_data = e_calendar_table_get_selected_comp (cal_table); @@ -555,7 +555,7 @@ tasks_control_view_preview (BonoboUIComponent *uic, const char *path, Bonobo_UIC if (type != Bonobo_UIComponent_STATE_CHANGED) return; - + tasks = E_TASKS (data); calendar_config_set_preview_state (state[0] != '0'); diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index cab6f9977d..166c5d5b26 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -109,7 +109,7 @@ weekday_picker_class_init (WeekdayPickerClass *class) class->changed = NULL; } -static void +static void day_clicked (WeekdayPicker *wp, int index) { WeekdayPickerPrivate *priv = wp->priv; @@ -324,7 +324,7 @@ get_day_text (int day_index) /* we use strlen because we actually want to count bytes */ if (day_index == 6) - char_size = strlen (day); + char_size = strlen (day); else char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL)); @@ -459,7 +459,7 @@ weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_style) pango_layout_set_text (layout, c, strlen (c)); pango_layout_get_pixel_size (layout, &w, NULL); g_free (c); - + if (w > max_width) max_width = w; } @@ -478,10 +478,10 @@ weekday_picker_style_set (GtkWidget *widget, GtkStyle *previous_style) /** * weekday_picker_new: - * @void: - * + * @void: + * * Creates a new weekday picker widget. - * + * * Return value: A newly-created weekday picker. **/ GtkWidget * @@ -494,7 +494,7 @@ weekday_picker_new (void) * weekday_picker_set_days: * @wp: A weekday picker. * @day_mask: Bitmask with the days to be selected. - * + * * Sets the days that are selected in a weekday picker. In the @day_mask, * Sunday is bit 0, Monday is bit 1, etc. **/ @@ -517,9 +517,9 @@ weekday_picker_set_days (WeekdayPicker *wp, guint8 day_mask) /** * weekday_picker_get_days: * @wp: A weekday picker. - * + * * Queries the days that are selected in a weekday picker. - * + * * Return value: Bit mask of selected days. Sunday is bit 0, Monday is bit 1, * etc. **/ @@ -539,7 +539,7 @@ weekday_picker_get_days (WeekdayPicker *wp) * weekday_picker_set_blocked_days: * @wp: A weekday picker. * @blocked_day_mask: Bitmask with the days to be blocked. - * + * * Sets the days that the weekday picker will prevent from being modified by the * user. The @blocked_day_mask is specified in the same way as in * weekday_picker_set_days(). @@ -559,10 +559,10 @@ weekday_picker_set_blocked_days (WeekdayPicker *wp, guint8 blocked_day_mask) /** * weekday_picker_get_blocked_days: * @wp: A weekday picker. - * + * * Queries the set of days that the weekday picker prevents from being modified * by the user. - * + * * Return value: Bit mask of blocked days, with the same format as that returned * by weekday_picker_get_days(). **/ @@ -583,7 +583,7 @@ weekday_picker_get_blocked_days (WeekdayPicker *wp) * @wp: A weekday picker. * @week_start_day: Index of the day that defines the start of the week; 0 is * Sunday, 1 is Monday, etc. - * + * * Sets the day that defines the start of the week for a weekday picker. **/ void @@ -604,9 +604,9 @@ weekday_picker_set_week_start_day (WeekdayPicker *wp, int week_start_day) /** * weekday_picker_get_week_start_day: * @wp: A weekday picker. - * + * * Queries the day that defines the start of the week in a weekday picker. - * + * * Return value: Index of the day that defines the start of the week. See * weekday_picker_set_week_start_day() to see how this is represented. **/ diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 5055e1a3ea..0b08fc893a 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -105,7 +105,7 @@ prepare_events (icalcomponent *icalcomp, GList **vtodos) if (vtodos) *vtodos = NULL; - + iter = icalcomponent_begin_component (icalcomp, ICAL_ANY_COMPONENT); while ((subcomp = icalcompiter_deref (&iter)) != NULL) { icalcomponent_kind child_kind = icalcomponent_isa (subcomp); @@ -218,7 +218,7 @@ ivcal_getwidget(EImport *ei, EImportTarget *target, EImportImporter *im) GtkWidget *nb; vbox = gtk_vbox_new (FALSE, FALSE); - + hbox = gtk_hbox_new (FALSE, FALSE); gtk_box_pack_start (GTK_BOX (vbox), hbox, FALSE, TRUE, 6); @@ -389,7 +389,7 @@ ical_supported(EImport *ei, EImportTarget *target, EImportImporter *im) if (icalcomp) { if (icalcomponent_is_valid (icalcomp)) ret = TRUE; - else + else ret = FALSE; icalcomponent_free (icalcomp); } @@ -487,7 +487,7 @@ vcal_supported(EImport *ei, EImportTarget *target, EImportImporter *im) icalcomponent *icalcomp; icalcomp = icalvcal_convert (vcal); - + if (icalcomp) { icalcomponent_free (icalcomp); ret = TRUE; |