diff options
Diffstat (limited to 'calendar')
70 files changed, 3552 insertions, 2620 deletions
diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c index cf94366ae9..e59080d14e 100644 --- a/calendar/alarm-notify/alarm-notify-dialog.c +++ b/calendar/alarm-notify/alarm-notify-dialog.c @@ -327,11 +327,13 @@ notified_alarms_dialog_new (void) gtk_window_set_keep_above (GTK_WINDOW (an->dialog), TRUE); - column = gtk_tree_view_column_new_with_attributes (_("Start time"), - renderer, "text", ALARM_DISPLAY_COLUMN, NULL); + column = gtk_tree_view_column_new_with_attributes ( + _("Start time"), + renderer, "text", ALARM_DISPLAY_COLUMN, NULL); - gtk_tree_view_column_set_attributes (column, renderer, - "markup", ALARM_DISPLAY_COLUMN, NULL); + gtk_tree_view_column_set_attributes ( + column, renderer, + "markup", ALARM_DISPLAY_COLUMN, NULL); gtk_tree_view_append_column (GTK_TREE_VIEW (an->treeview), column); @@ -458,11 +460,13 @@ add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, 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_markup_printf_escaped ("<big><b>%s</b></big>\n%s %s", + to_display = g_markup_printf_escaped ( + "<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); diff --git a/calendar/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c index dc588b726c..54242f2049 100644 --- a/calendar/alarm-notify/alarm-notify.c +++ b/calendar/alarm-notify/alarm-notify.c @@ -235,10 +235,17 @@ client_opened_cb (GObject *source_object, e_client_utils_open_new_finish (source, result, &client, &error); - if (client == NULL) { - debug (("Failed to open '%s' (%s): %s", e_source_get_display_name (source), - e_source_get_uid (source), error ? error->message : "Unknown error")); - g_clear_error (&error); + /* Sanity check. */ + g_return_if_fail ( + ((client != NULL) && (error == NULL)) || + ((client == NULL) && (error != NULL))); + + if (error != NULL) { + debug ( + ("Failed to open '%s' (%s): %s", + e_source_get_display_name (source), + e_source_get_uid (source), error->message)); + g_error_free (error); return; } diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c index 788988be72..7fc308f482 100644 --- a/calendar/alarm-notify/alarm-queue.c +++ b/calendar/alarm-notify/alarm-queue.c @@ -663,7 +663,7 @@ load_alarms_for_today (ClientAlarms *ca) from = MAX (from, day_start); /* Add one hour after midnight, just to cover the delay in 30 minutes - midnight checking. */ + * midnight checking. */ day_end = time_day_end_with_zone (now, zone) + (60 * 60); debug (("From %s to %s", e_ctime (&from), e_ctime (&day_end))); load_alarms (ca, from, day_end); @@ -1054,11 +1054,12 @@ static void print_component (ECalClient *cal_client, ECalComponent *comp) { - print_comp (comp, - cal_client, - config_data_get_timezone (), - config_data_get_24_hour_format (), - GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); + print_comp ( + comp, + cal_client, + config_data_get_timezone (), + config_data_get_24_hour_format (), + GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG); } typedef struct { @@ -1643,8 +1644,9 @@ display_notification (time_t trigger, end_str = timet_to_str_with_zone (qa->instance->occur_end, current_zone); time_str = calculate_time (qa->instance->occur_start, qa->instance->occur_end); - str = g_strdup_printf ("%s\n%s %s", - summary, start_str, time_str); + str = g_strdup_printf ( + "%s\n%s %s", + summary, start_str, time_str); /* create the private structure */ tray_data = g_new0 (TrayIconData, 1); @@ -1747,8 +1749,9 @@ popup_notification (time_t trigger, end_str = timet_to_str_with_zone (qa->instance->occur_end, current_zone); time_str = calculate_time (qa->instance->occur_start, qa->instance->occur_end); - str = g_strdup_printf ("%s %s", - start_str, time_str); + str = g_strdup_printf ( + "%s %s", + start_str, time_str); if (organiser.cn) { if (location) @@ -2075,7 +2078,7 @@ alarm_queue_init (gpointer data) g_timeout_add_seconds (1800, check_midnight_refresh, NULL); /* monotonic time doesn't change during hibernation, while the wall clock time does, - thus check for wall clock time changes and reschedule alarms when it changes */ + * thus check for wall clock time changes and reschedule alarms when it changes */ g_timeout_add_seconds (60, check_wall_clock_time_changed, NULL); #ifdef HAVE_LIBNOTIFY @@ -2319,8 +2322,9 @@ alarm_queue_remove_async (struct _alarm_client_msg *msg) if (ca->cal_client) { debug (("Disconnecting Client")); - g_signal_handlers_disconnect_matched (ca->cal_client, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, ca); + g_signal_handlers_disconnect_matched ( + ca->cal_client, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, ca); g_object_unref (ca->cal_client); ca->cal_client = NULL; } @@ -2328,8 +2332,9 @@ alarm_queue_remove_async (struct _alarm_client_msg *msg) if (ca->view) { debug (("Disconnecting Query")); - g_signal_handlers_disconnect_matched (ca->view, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, ca); + g_signal_handlers_disconnect_matched ( + ca->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, ca); g_object_unref (ca->view); ca->view = NULL; } @@ -2419,7 +2424,7 @@ update_cqa (CompQueuedAlarms *cqa, /* Update the actual component stored in CompQueuedAlarms structure */ g_object_unref (cqa->alarms->comp); cqa->alarms->comp = newcomp; - if (alarms != NULL ) + if (alarms != NULL) e_cal_component_alarms_free (alarms); } diff --git a/calendar/alarm-notify/alarm.c b/calendar/alarm-notify/alarm.c index cf586dfea2..99d3dd669b 100644 --- a/calendar/alarm-notify/alarm.c +++ b/calendar/alarm-notify/alarm.c @@ -152,8 +152,9 @@ setup_timeout (void) now = time (NULL); /* Add the time out */ - debug (("Setting timeout for %d.%2d (from now) %lu %lu", - diff / 60, diff % 60, ar->trigger, now)); + debug ( + ("Setting timeout for %d.%2d (from now) %lu %lu", + diff / 60, diff % 60, ar->trigger, now)); debug ((" %s", ctime (&ar->trigger))); debug ((" %s", ctime (&now))); timeout_id = g_timeout_add_seconds (diff, alarm_ready_cb, NULL); diff --git a/calendar/alarm-notify/config-data.c b/calendar/alarm-notify/config-data.c index b9f9b7a07d..84a2e38265 100644 --- a/calendar/alarm-notify/config-data.c +++ b/calendar/alarm-notify/config-data.c @@ -110,14 +110,18 @@ config_data_get_notify_with_tray (void) static void source_written_cb (GObject *source_object, - GAsyncResult *result, - gpointer user_data) + GAsyncResult *result, + gpointer user_data) { GError *error = NULL; - if (!e_source_write_finish (E_SOURCE (source_object), result, &error)) { - g_warning ("Failed to write source changes: %s", error ? error->message : "Unknown error"); - g_clear_error (&error); + e_source_write_finish (E_SOURCE (source_object), result, &error); + + if (error != NULL) { + g_warning ( + "Failed to write source changes: %s", + error->message); + g_error_free (error); } } diff --git a/calendar/gui/calendar-config.c b/calendar/gui/calendar-config.c index b7822da165..1bc62730ab 100644 --- a/calendar/gui/calendar-config.c +++ b/calendar/gui/calendar-config.c @@ -57,7 +57,8 @@ calendar_config_init (void) config = g_settings_new ("org.gnome.evolution.calendar"); /* will be freed together with EShell */ - g_object_set_data_full (G_OBJECT (e_shell_get_default ()), + g_object_set_data_full ( + G_OBJECT (e_shell_get_default ()), "calendar-config-config-cleanup", (gpointer) "1", (GDestroyNotify) do_cleanup); } @@ -68,7 +69,7 @@ calendar_config_remove_notification (CalendarConfigChangedFunc func, { calendar_config_init (); - g_signal_handlers_disconnect_by_func (G_OBJECT (config), G_CALLBACK (func), data); + g_signal_handlers_disconnect_by_func (config, G_CALLBACK (func), data); } /* Returns TRUE if the locale has 'am' and 'pm' strings defined, in which diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index 82f92e055a..c0935ca4e5 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -157,12 +157,14 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, goto out; if (start_datetime.value) { - offset1 = icaltimezone_get_utc_offset (start_zone, - start_datetime.value, - NULL); - offset2 = icaltimezone_get_utc_offset (zone, - start_datetime.value, - NULL); + offset1 = icaltimezone_get_utc_offset ( + start_zone, + start_datetime.value, + NULL); + offset2 = icaltimezone_get_utc_offset ( + zone, + start_datetime.value, + NULL); if (offset1 != offset2) goto out; } @@ -172,12 +174,14 @@ cal_comp_util_compare_event_timezones (ECalComponent *comp, goto out; if (end_datetime.value) { - offset1 = icaltimezone_get_utc_offset (end_zone, - end_datetime.value, - NULL); - offset2 = icaltimezone_get_utc_offset (zone, - end_datetime.value, - NULL); + offset1 = icaltimezone_get_utc_offset ( + end_zone, + end_datetime.value, + NULL); + offset2 = icaltimezone_get_utc_offset ( + zone, + end_datetime.value, + NULL); if (offset1 != offset2) goto out; } diff --git a/calendar/gui/dialogs/alarm-dialog.c b/calendar/gui/dialogs/alarm-dialog.c index d6fb07e91a..dda1d8548b 100644 --- a/calendar/gui/dialogs/alarm-dialog.c +++ b/calendar/gui/dialogs/alarm-dialog.c @@ -532,7 +532,7 @@ alarm_to_malarm_widgets (Dialog *dialog, e_destination_set_email (dest, a->value); } e_destination_store_append_destination (destination_store, dest); - g_object_unref (G_OBJECT (dest)); + g_object_unref (dest); } e_cal_component_free_attendee_list (attendee_list); } @@ -620,11 +620,11 @@ populate_widgets_from_alarm (Dialog *dialog) action = g_new0 (ECalComponentAlarmAction, 1); e_cal_component_alarm_get_action (dialog->alarm, action); - g_return_if_fail ( action != NULL ); + g_return_if_fail (action != NULL); trigger = g_new0 (ECalComponentAlarmTrigger, 1); e_cal_component_alarm_get_trigger (dialog->alarm, trigger); - g_return_if_fail ( trigger != NULL ); + g_return_if_fail (trigger != NULL); if (*action == E_CAL_COMPONENT_ALARM_NONE) return; @@ -842,10 +842,11 @@ get_widgets (Dialog *dialog) cell = gtk_cell_renderer_text_new (); gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); - gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, - "text", 0, - "sensitive", 1, - NULL); + gtk_cell_layout_set_attributes ( + GTK_CELL_LAYOUT (combo), cell, + "text", 0, + "sensitive", 1, + NULL); for (i = 0; i < G_N_ELEMENTS (actions); i++) { GtkTreeIter iter; diff --git a/calendar/gui/dialogs/changed-comp.c b/calendar/gui/dialogs/changed-comp.c index f8a98c9908..fdbc228ae2 100644 --- a/calendar/gui/dialogs/changed-comp.c +++ b/calendar/gui/dialogs/changed-comp.c @@ -69,8 +69,9 @@ changed_component_dialog (GtkWindow *parent, break; default: - g_message ("changed_component_dialog(): " - "Cannot handle object of type %d", vtype); + g_message ( + "changed_component_dialog(): " + "Cannot handle object of type %d", vtype); return FALSE; } if (changed) @@ -93,8 +94,9 @@ changed_component_dialog (GtkWindow *parent, break; default: - g_message ("changed_component_dialog(): " - "Cannot handle object of type %d", vtype); + g_message ( + "changed_component_dialog(): " + "Cannot handle object of type %d", vtype); return FALSE; } if (changed) @@ -103,9 +105,10 @@ changed_component_dialog (GtkWindow *parent, 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, "%s", str); + dialog = gtk_message_dialog_new ( + parent, GTK_DIALOG_MODAL, + GTK_MESSAGE_QUESTION, + GTK_BUTTONS_YES_NO, "%s", str); gtk_window_set_icon_name (GTK_WINDOW (dialog), "x-office-calendar"); diff --git a/calendar/gui/dialogs/comp-editor-page.c b/calendar/gui/dialogs/comp-editor-page.c index 356d4d78b2..3a6d67107b 100644 --- a/calendar/gui/dialogs/comp-editor-page.c +++ b/calendar/gui/dialogs/comp-editor-page.c @@ -154,14 +154,15 @@ comp_editor_page_class_init (CompEditorPageClass *class) FALSE, G_PARAM_READWRITE)); - comp_editor_page_signals[DATES_CHANGED] = - g_signal_new ("dates_changed", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (CompEditorPageClass, dates_changed), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); + comp_editor_page_signals[DATES_CHANGED] = g_signal_new ( + "dates_changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (CompEditorPageClass, dates_changed), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); } static void @@ -222,7 +223,7 @@ comp_editor_page_set_updating (CompEditorPage *page, { g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); - if ((page->priv->updating ? 1 : 0) == (updating ? 1 : 0)) + if (page->priv->updating == updating) return; page->priv->updating = updating; @@ -406,9 +407,10 @@ comp_editor_page_notify_dates_changed (CompEditorPage *page, { g_return_if_fail (IS_COMP_EDITOR_PAGE (page)); - g_signal_emit (page, - comp_editor_page_signals[DATES_CHANGED], 0, - dates); + g_signal_emit ( + page, + comp_editor_page_signals[DATES_CHANGED], 0, + dates); } /** diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 78505c2428..4eaf1bce75 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -500,10 +500,11 @@ save_comp (CompEditor *editor) /* Stop listening because we are about to change things */ if (priv->view) { - g_signal_handlers_disconnect_matched (G_OBJECT (priv->view), - G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, - editor); + g_signal_handlers_disconnect_matched ( + priv->view, + G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, + editor); g_object_unref (priv->view); priv->view = NULL; @@ -949,15 +950,17 @@ save_and_close_editor (CompEditor *editor, 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", - NULL); + 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", - NULL); + response = em_utils_prompt_user ( + (GtkWindow *) widget, + NULL, + "calendar:ask-send-task-pending-download", + NULL); #endif if (!response) return; @@ -1602,7 +1605,7 @@ comp_editor_dispose (GObject *object) if (priv->view) { g_signal_handlers_disconnect_matched ( - G_OBJECT (priv->view), G_SIGNAL_MATCH_DATA, + priv->view, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object); g_object_unref (priv->view); priv->view = NULL; @@ -1614,7 +1617,7 @@ comp_editor_dispose (GObject *object) store = e_attachment_view_get_store ( E_ATTACHMENT_VIEW (priv->attachment_view)); g_signal_handlers_disconnect_matched ( - G_OBJECT (store), G_SIGNAL_MATCH_DATA, + store, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, object); g_object_unref (priv->attachment_view); priv->attachment_view = NULL; @@ -1672,28 +1675,40 @@ comp_editor_bind_settings (CompEditor *editor) g_return_if_fail (editor != NULL); action = comp_editor_get_action (editor, "view-categories"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-categories", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-categories", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-role"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-role", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-role", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-rsvp"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-rsvp", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-rsvp", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-status"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-status", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-status", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-time-zone"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-timezone", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-timezone", + action, "active", + G_SETTINGS_BIND_DEFAULT); action = comp_editor_get_action (editor, "view-type"); - g_settings_bind (editor->priv->calendar_settings, "editor-show-type", - G_OBJECT (action), "active", G_SETTINGS_BIND_DEFAULT); + g_settings_bind ( + editor->priv->calendar_settings, "editor-show-type", + action, "active", + G_SETTINGS_BIND_DEFAULT); } static gboolean @@ -2327,8 +2342,9 @@ close_dialog (CompEditor *editor) * calls happen during destruction and we might get a change * 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_handlers_disconnect_matched ( + priv->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, editor); gtk_widget_destroy (GTK_WIDGET (editor)); } @@ -2461,7 +2477,7 @@ comp_editor_set_summary (CompEditor *editor, e_notice ( editor->priv->notebook, GTK_MESSAGE_INFO, _("Changes made to this item may be " - "discarded if an update arrives")); + "discarded if an update arrives")); editor->priv->warned = TRUE; } @@ -2514,7 +2530,7 @@ comp_editor_set_use_24_hour_format (CompEditor *editor, { g_return_if_fail (IS_COMP_EDITOR (editor)); - if ((editor->priv->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (editor->priv->use_24_hour_format == use_24_hour_format) return; editor->priv->use_24_hour_format = use_24_hour_format; @@ -2627,10 +2643,10 @@ comp_editor_set_changed (CompEditor *editor, g_return_if_fail (IS_COMP_EDITOR (editor)); /* always process below changes, because other parts of - the editor listen for 'changed' notifications to update - its widgets, thus do it even the value actually didn't change + * the editor listen for 'changed' notifications to update + * its widgets, thus do it even the value actually didn't change */ - if ((editor->priv->changed ? 1 : 0) != (changed ? 1 : 0)) { + if (editor->priv->changed != changed) { editor->priv->changed = changed; action = comp_editor_get_action (editor, "save"); @@ -2648,7 +2664,7 @@ comp_editor_set_changed (CompEditor *editor, e_notice ( editor->priv->notebook, GTK_MESSAGE_INFO, _("Changes made to this item may be " - "discarded if an update arrives")); + "discarded if an update arrives")); editor->priv->warned = TRUE; } @@ -2814,8 +2830,9 @@ page_mapped_cb (GtkWidget *page_widget, return; if (page->accel_group) { - gtk_window_add_accel_group (GTK_WINDOW (toplevel), - page->accel_group); + gtk_window_add_accel_group ( + GTK_WINDOW (toplevel), + page->accel_group); } } @@ -3353,8 +3370,9 @@ real_send_comp (CompEditor *editor, } if (!e_cal_component_has_attachments (priv->comp) || - e_client_check_capability (E_CLIENT (priv->cal_client), - CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { + e_client_check_capability ( + E_CLIENT (priv->cal_client), + CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { if (itip_send_comp ( registry, method, send_comp, priv->cal_client, NULL, NULL, users, strip_alarms, @@ -3652,7 +3670,7 @@ page_dates_changed_cb (CompEditor *editor, e_notice ( priv->notebook, GTK_MESSAGE_INFO, _("Changes made to this item may be discarded " - "if an update arrives")); + "if an update arrives")); priv->warned = TRUE; } } diff --git a/calendar/gui/dialogs/delete-comp.c b/calendar/gui/dialogs/delete-comp.c index d082551344..93e2df0d91 100644 --- a/calendar/gui/dialogs/delete-comp.c +++ b/calendar/gui/dialogs/delete-comp.c @@ -115,8 +115,9 @@ delete_component_dialog (ECalComponent *comp, break; default: - g_message ("delete_component_dialog(): Cannot handle object of type %d", - vtype); + g_message ( + "delete_component_dialog(): Cannot handle object of type %d", + vtype); g_free (arg0); return FALSE; } @@ -144,8 +145,9 @@ delete_component_dialog (ECalComponent *comp, break; default: - g_message ("delete_component_dialog(): Cannot handle objects of type %d", - vtype); + g_message ( + "delete_component_dialog(): Cannot handle objects of type %d", + vtype); return FALSE; } diff --git a/calendar/gui/dialogs/delete-error.c b/calendar/gui/dialogs/delete-error.c index 7dc53253fa..313bcea82f 100644 --- a/calendar/gui/dialogs/delete-error.c +++ b/calendar/gui/dialogs/delete-error.c @@ -109,9 +109,10 @@ delete_error_dialog (const GError *error, return; } - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, - GTK_MESSAGE_ERROR, - GTK_BUTTONS_OK, str, error->message); + dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL, + GTK_MESSAGE_ERROR, + GTK_BUTTONS_OK, str, error->message); if (vtype == E_CAL_COMPONENT_EVENT) icon_name = "x-office-calendar"; else if (vtype == E_CAL_COMPONENT_TODO) diff --git a/calendar/gui/dialogs/e-delegate-dialog.c b/calendar/gui/dialogs/e-delegate-dialog.c index a7016a4cdd..9ae253dc00 100644 --- a/calendar/gui/dialogs/e-delegate-dialog.c +++ b/calendar/gui/dialogs/e-delegate-dialog.c @@ -186,8 +186,9 @@ addressbook_clicked_cb (GtkWidget *widget, { EDelegateDialog *edd = data; - e_name_selector_show_dialog (edd->priv->name_selector, - e_delegate_dialog_get_toplevel (edd)); + e_name_selector_show_dialog ( + edd->priv->name_selector, + e_delegate_dialog_get_toplevel (edd)); } static void diff --git a/calendar/gui/dialogs/e-send-options-utils.c b/calendar/gui/dialogs/e-send-options-utils.c index 6f3d4034ab..8157e10fab 100644 --- a/calendar/gui/dialogs/e-send-options-utils.c +++ b/calendar/gui/dialogs/e-send-options-utils.c @@ -194,13 +194,13 @@ e_send_options_utils_fill_component (ESendOptionsDialog *sod, if (gopts->reply_convenient) prop = icalproperty_new_x ("convenient"); else - prop = icalproperty_new_x ((const gchar *) g_strdup_printf ( "%d", gopts->reply_within)); + prop = icalproperty_new_x ((const gchar *) 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 gchar *) g_strdup_printf ( "%d", gopts->expire_after)); + prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", gopts->expire_after)); icalproperty_set_x_name (prop, "X-EVOLUTION-OPTIONS-EXPIRE"); icalcomponent_add_property (icalcomp, prop); } @@ -220,7 +220,7 @@ e_send_options_utils_fill_component (ESendOptionsDialog *sod, } if (sopts->tracking_enabled) - prop = icalproperty_new_x ((const gchar *) g_strdup_printf ( "%d", sopts->track_when)); + prop = icalproperty_new_x ((const gchar *) g_strdup_printf ("%d", sopts->track_when)); else prop = icalproperty_new_x ("0"); diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 1460ff47db..0681aa4ed7 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -664,8 +664,8 @@ event_editor_edit_comp (CompEditor *editor, EMeetingAttendee *ia; gboolean addresses_match; - addresses_match = - g_str_equal (user_email, + addresses_match = g_str_equal ( + user_email, itip_strip_mailto (ca->value)); if (delegate && !addresses_match) diff --git a/calendar/gui/dialogs/event-page.c b/calendar/gui/dialogs/event-page.c index f590b9f37f..cb4698fcf3 100644 --- a/calendar/gui/dialogs/event-page.c +++ b/calendar/gui/dialogs/event-page.c @@ -204,10 +204,10 @@ static void notify_dates_changed (EventPage *epage, struct icaltimetype *start_t 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); -static void minute_sel_changed ( GtkSpinButton *widget, EventPage *epage); -static void hour_minute_changed ( EventPage *epage); -static void update_end_time_combo ( EventPage *epage); +static void hour_sel_changed (GtkSpinButton *widget, EventPage *epage); +static void minute_sel_changed (GtkSpinButton *widget, EventPage *epage); +static void hour_minute_changed (EventPage *epage); +static void update_end_time_combo (EventPage *epage); static void event_page_select_organizer (EventPage *epage, const gchar *backend_address); static void set_subscriber_info_string (EventPage *epage, const gchar *backend_address); @@ -755,11 +755,17 @@ update_time (EventPage *epage, if (!start_zone) { /* FIXME: Handle error better. */ GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, start_date->tzid, &start_zone, NULL, &error)) { - g_warning ("Couldn't get timezone '%s' from server: %s", - start_date->tzid ? start_date->tzid : "", error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + + e_cal_client_get_timezone_sync ( + client, start_date->tzid, + &start_zone, NULL, &error); + + if (error != NULL) { + g_warning ( + "Couldn't get timezone '%s' from server: %s", + start_date->tzid ? start_date->tzid : "", + error->message); + g_error_free (error); } } } @@ -1167,11 +1173,13 @@ event_page_fill_widgets (CompEditorPage *page, 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); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + dtext->value ? dtext->value : "", -1); } else { - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + "", 0); } e_cal_component_free_text_list (l); e_buffer_tagger_update_tags (GTK_TEXT_VIEW (priv->description)); @@ -1216,7 +1224,7 @@ event_page_fill_widgets (CompEditorPage *page, if (e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_ORGANIZER) && (flags & COMP_EDITOR_DELEGATE)) string = g_strdup (backend_addr); - else if ( organizer.cn != NULL) + else if (organizer.cn != NULL) string = g_strdup_printf ("%s <%s>", organizer.cn, strip); else string = g_strdup (strip); @@ -1477,20 +1485,22 @@ event_page_fill_component (CompEditorPage *page, comp_editor_page_display_validation_error (page, _("Start date is wrong"), priv->start_time); return FALSE; } - start_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); + start_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); g_return_val_if_fail (start_date_set, FALSE); if (!e_date_edit_date_is_valid (E_DATE_EDIT (priv->end_time))) { comp_editor_page_display_validation_error (page, _("End date is wrong"), priv->end_time); return FALSE; } - end_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); + end_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); g_return_val_if_fail (end_date_set, FALSE); /* If the all_day toggle is set, we use DATE values for DTSTART and @@ -1510,16 +1520,18 @@ event_page_fill_component (CompEditorPage *page, comp_editor_page_display_validation_error (page, _("Start time is wrong"), priv->start_time); return FALSE; } - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); if (!e_date_edit_time_is_valid (E_DATE_EDIT (priv->end_time))) { comp_editor_page_display_validation_error (page, _("End time is wrong"), priv->end_time); return FALSE; } - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->end_time), + &end_tt.hour, + &end_tt.minute); start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone)); start_date.tzid = icaltimezone_get_tzid (start_zone); end_date.tzid = icaltimezone_get_tzid (start_zone); @@ -1710,8 +1722,9 @@ event_page_fill_component (CompEditorPage *page, } if (e_meeting_store_count_actual_attendees (priv->meeting_store) < 1) { - e_notice (priv->main, GTK_MESSAGE_ERROR, - _("At least one attendee is required.")); + e_notice ( + priv->main, GTK_MESSAGE_ERROR, + _("At least one attendee is required.")); return FALSE; } @@ -1941,7 +1954,7 @@ time_sel_changed (GtkComboBox *combo, gtk_widget_show (priv->time_hour); gtk_widget_hide (priv->end_time); - update_end_time_combo ( epage); + update_end_time_combo (epage); } } @@ -1956,27 +1969,31 @@ void update_end_time_combo (EventPage *epage) priv = epage->priv; - e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); - e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); + 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); end_timet -= start_timet; - hours = end_timet / ( 60 * 60 ); - minutes = (end_timet / 60) - ( hours * 60 ); + hours = end_timet / (60 * 60); + minutes = (end_timet / 60) - (hours * 60); gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->hour_selector), hours); gtk_spin_button_set_value (GTK_SPIN_BUTTON (priv->minute_selector), minutes); @@ -2030,25 +2047,28 @@ hour_minute_changed (EventPage *epage) priv = epage->priv; - e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &end_tt.hour, + &end_tt.minute); for_hours = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->hour_selector)); for_minutes = gtk_spin_button_get_value (GTK_SPIN_BUTTON (priv->minute_selector)); icaltime_adjust (&end_tt, 0, for_hours, for_minutes, 0); - e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (priv->end_time), - end_tt.year, - end_tt.month, - end_tt.day, - end_tt.hour, - end_tt.minute); + e_date_edit_set_date_and_time_of_day ( + E_DATE_EDIT (priv->end_time), + end_tt.year, + end_tt.month, + end_tt.day, + end_tt.hour, + end_tt.minute); } static void @@ -2205,7 +2225,7 @@ remove_clicked_cb (GtkButton *btn, selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (priv->list_view)); model = GTK_TREE_MODEL (priv->meeting_store); - if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model ))) { + if (!(paths = gtk_tree_selection_get_selected_rows (selection, &model))) { g_warning ("Could not get a selection to delete."); return; } @@ -2354,22 +2374,26 @@ event_page_set_all_day_event (EventPage *epage, e_date_edit_set_show_time (E_DATE_EDIT (priv->start_time), !all_day); e_date_edit_set_show_time (E_DATE_EDIT (priv->end_time), !all_day); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); g_return_if_fail (date_set); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->end_time), + &end_tt.hour, + &end_tt.minute); g_return_if_fail (date_set); /* TODO implement the for portion in end time selector */ @@ -2434,15 +2458,19 @@ event_page_set_all_day_event (EventPage *epage, 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); - e_date_edit_set_date (E_DATE_EDIT (priv->start_time), start_tt.year, - start_tt.month, start_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time), - start_tt.hour, start_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_time), start_tt.year, + start_tt.month, start_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->start_time), + start_tt.hour, start_tt.minute); - e_date_edit_set_date (E_DATE_EDIT (priv->end_time), end_tt.year, - end_tt.month, end_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time), - end_tt.hour, end_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->end_time), end_tt.year, + end_tt.month, end_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->end_time), + end_tt.hour, end_tt.minute); g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); @@ -2651,7 +2679,7 @@ get_widgets (EventPage *epage) && priv->location && priv->start_time && priv->end_time - && priv->description ); + && priv->description); } static void @@ -2734,14 +2762,16 @@ check_start_before_end (struct icaltimetype *start_tt, /* Modify the end time, to be the start + 1 hour. */ *end_tt = *start_tt; icaltime_adjust (end_tt, 0, 1, 0, 0); - icaltimezone_convert_time (end_tt, start_zone, - end_zone); + icaltimezone_convert_time ( + end_tt, start_zone, + end_zone); } else { /* Modify the start time, to be the end - 1 hour. */ *start_tt = *end_tt; icaltime_adjust (start_tt, 0, -1, 0, 0); - icaltimezone_convert_time (start_tt, end_zone, - start_zone); + icaltimezone_convert_time ( + start_tt, end_zone, + start_zone); } return TRUE; } @@ -2777,16 +2807,18 @@ times_updated (EventPage *epage, /* Fetch the start and end times and timezones from the widgets. */ all_day_event = priv->all_day_event; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_time), - &start_tt.year, - &start_tt.month, - &start_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_time), + &start_tt.year, + &start_tt.month, + &start_tt.day); g_return_if_fail (date_set); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->end_time), - &end_tt.year, - &end_tt.month, - &end_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->end_time), + &end_tt.year, + &end_tt.month, + &end_tt.day); g_return_if_fail (date_set); if (all_day_event) { @@ -2808,12 +2840,14 @@ times_updated (EventPage *epage, } else { /* For DATE-TIME events, we have to convert to the same * timezone before comparing. */ - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->start_time), - &start_tt.hour, - &start_tt.minute); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->end_time), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->start_time), + &start_tt.hour, + &start_tt.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->end_time), + &end_tt.hour, + &end_tt.minute); start_zone = e_timezone_entry_get_timezone (E_TIMEZONE_ENTRY (priv->start_timezone)); @@ -2829,20 +2863,24 @@ times_updated (EventPage *epage, if (set_start_date) { g_signal_handlers_block_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - e_date_edit_set_date (E_DATE_EDIT (priv->start_time), - start_tt.year, start_tt.month, - start_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_time), - start_tt.hour, start_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_time), + start_tt.year, start_tt.month, + start_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->start_time), + start_tt.hour, start_tt.minute); g_signal_handlers_unblock_matched (priv->start_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); } if (set_end_date) { g_signal_handlers_block_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); - e_date_edit_set_date (E_DATE_EDIT (priv->end_time), - end_tt.year, end_tt.month, end_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->end_time), - end_tt.hour, end_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->end_time), + end_tt.year, end_tt.month, end_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->end_time), + end_tt.hour, end_tt.minute); g_signal_handlers_unblock_matched (priv->end_time, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, epage); } @@ -3393,10 +3431,10 @@ init_widgets (EventPage *epage) g_signal_connect ( priv->end_time_combo, "changed", G_CALLBACK (time_sel_changed), epage); - update_end_time_combo ( epage); + update_end_time_combo (epage); /* Hour and Minute selector */ - gtk_spin_button_set_range ( (GtkSpinButton *) priv->hour_selector, 0, G_MAXINT); + gtk_spin_button_set_range ((GtkSpinButton *) priv->hour_selector, 0, G_MAXINT); g_signal_connect ( priv->hour_selector, "value-changed", G_CALLBACK (hour_sel_changed), epage); @@ -3440,7 +3478,8 @@ init_widgets (EventPage *epage) store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->alarm_time_combo))); if (combo_label) { gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, combo_label, -1); g_free (combo_label); @@ -3450,12 +3489,14 @@ init_widgets (EventPage *epage) } gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, _("Customize"), -1); gtk_list_store_insert (store, &iter, 0); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, /* Translators: "None" for "No reminder set" */ 0, C_("cal-reminders", "None"), -1); @@ -3579,19 +3620,22 @@ event_page_construct (EventPage *epage, e_load_ui_builder_definition (priv->builder, "event-page.ui"); if (!get_widgets (epage)) { - g_message ("event_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "event_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } /* Create entry completion and attach it to the entry */ priv->location_completion = gtk_entry_completion_new (); - gtk_entry_set_completion (GTK_ENTRY (priv->location), + gtk_entry_set_completion ( + GTK_ENTRY (priv->location), priv->location_completion); /* Initialize completino model */ list_store = gtk_list_store_new (1, G_TYPE_STRING); - gtk_entry_completion_set_model (priv->location_completion, + gtk_entry_completion_set_model ( + priv->location_completion, GTK_TREE_MODEL (list_store)); gtk_entry_completion_set_text_column (priv->location_completion, 0); @@ -3618,8 +3662,9 @@ event_page_construct (EventPage *epage, G_CALLBACK (organizer_changed_cb), epage); if (!init_widgets (epage)) { - g_message ("event_page_construct(): " - "Could not initialize the widgets!"); + g_message ( + "event_page_construct(): " + "Could not initialize the widgets!"); return NULL; } diff --git a/calendar/gui/dialogs/goto-dialog.c b/calendar/gui/dialogs/goto-dialog.c index 4a77c87554..132438865c 100644 --- a/calendar/gui/dialogs/goto-dialog.c +++ b/calendar/gui/dialogs/goto-dialog.c @@ -164,17 +164,19 @@ create_ecal (GoToDialog *dlg) 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); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (calitem), + "move_selection_when_moving", FALSE, + NULL); e_calendar_item_set_display_popup (calitem, FALSE); gtk_widget_show (GTK_WIDGET (dlg->ecal)); gtk_box_pack_start (GTK_BOX (dlg->vbox), GTK_WIDGET (dlg->ecal), TRUE, TRUE, 0); e_calendar_item_set_first_month (calitem, dlg->year_val, dlg->month_val); - e_calendar_item_set_get_time_callback (calitem, - get_current_time, - dlg, NULL); + e_calendar_item_set_get_time_callback ( + calitem, + get_current_time, + dlg, NULL); ecal_date_range_changed (calitem, dlg); } diff --git a/calendar/gui/dialogs/memo-page.c b/calendar/gui/dialogs/memo-page.c index 57332a1e0c..01d3c9143c 100644 --- a/calendar/gui/dialogs/memo-page.c +++ b/calendar/gui/dialogs/memo-page.c @@ -300,11 +300,13 @@ memo_page_fill_widgets (CompEditorPage *page, 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); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), + dtext->value ? dtext->value : "", -1); } else { - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->memo_content)), + "", 0); } e_cal_component_free_text_list (l); e_buffer_tagger_update_tags (GTK_TEXT_VIEW (priv->memo_content)); @@ -313,9 +315,10 @@ memo_page_fill_widgets (CompEditorPage *page, e_cal_component_get_dtstart (comp, &d); if (d.value) { struct icaltimetype *start_tt = d.value; - e_date_edit_set_date (E_DATE_EDIT (priv->start_date), - start_tt->year, start_tt->month, - start_tt->day); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_date), + start_tt->year, start_tt->month, + start_tt->day); } else if (!(flags & COMP_EDITOR_NEW_ITEM)) e_date_edit_set_time (E_DATE_EDIT (priv->start_date), -1); e_cal_component_free_datetime (&d); @@ -342,7 +345,7 @@ memo_page_fill_widgets (CompEditorPage *page, const gchar *strip = itip_strip_mailto (organizer.value); gchar *string; - if ( organizer.cn != NULL) + if (organizer.cn != NULL) string = g_strdup_printf ("%s <%s>", organizer.cn, strip); else string = g_strdup (strip); @@ -536,8 +539,9 @@ fill_comp_with_recipients (ENameSelector *name_selector, icalcomponent *icalcomp; icalproperty *icalprop; - e_name_selector_model_peek_section (name_selector_model, "To", - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, "To", + NULL, &destination_store); destinations = e_destination_store_list_destinations (destination_store); for (l = destinations; l; l = g_list_next (l)) { @@ -581,8 +585,9 @@ fill_comp_with_recipients (ENameSelector *name_selector, EContact *n_con = NULL; gchar *query; - query = g_strdup_printf ("(is \"full_name\" \"%s\")", - (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); + query = g_strdup_printf ( + "(is \"full_name\" \"%s\")", + (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); if (!e_book_client_get_contacts_sync (book_client, query, &contacts, NULL, NULL)) { g_warning ("Could not get contact from the book \n"); @@ -966,7 +971,7 @@ mpage_client_opened_cb (GObject *source_object, editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (mpage)); priv = mpage->priv; - if (error) { + if (error != NULL) { GtkWidget *dialog; ECalClient *old_client; @@ -976,11 +981,12 @@ mpage_client_opened_cb (GObject *source_object, E_SOURCE_COMBO_BOX (priv->source_combo_box), e_client_get_source (E_CLIENT (old_client))); - dialog = gtk_message_dialog_new (NULL, GTK_DIALOG_MODAL, - GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, - _("Unable to open memos in '%s': %s"), - e_source_get_display_name (source), - error ? error->message : _("Unknown error")); + dialog = gtk_message_dialog_new ( + NULL, GTK_DIALOG_MODAL, + GTK_MESSAGE_WARNING, GTK_BUTTONS_OK, + _("Unable to open memos in '%s': %s"), + e_source_get_display_name (source), + error->message); gtk_dialog_run (GTK_DIALOG (dialog)); gtk_widget_destroy (dialog); @@ -1068,8 +1074,9 @@ static void to_button_clicked_cb (GtkButton *button, MemoPage *mpage) { - e_name_selector_show_dialog (mpage->priv->name_selector, - mpage->priv->main); + e_name_selector_show_dialog ( + mpage->priv->name_selector, + mpage->priv->main); } static void @@ -1248,8 +1255,9 @@ memo_page_construct (MemoPage *mpage) e_load_ui_builder_definition (priv->builder, "memo-page.ui"); if (!get_widgets (mpage)) { - g_message ("memo_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "memo_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } @@ -1295,7 +1303,7 @@ memo_page_construct (MemoPage *mpage) if (!init_widgets (mpage)) { g_message ("memo_page_construct(): " - "Could not initialize the widgets!"); + "Could not initialize the widgets!"); return NULL; } diff --git a/calendar/gui/dialogs/recurrence-page.c b/calendar/gui/dialogs/recurrence-page.c index 64bbb946c5..d04d490b3d 100644 --- a/calendar/gui/dialogs/recurrence-page.c +++ b/calendar/gui/dialogs/recurrence-page.c @@ -267,8 +267,9 @@ preview_recur (RecurrencePage *rpage) fill_component (rpage, comp); - tag_calendar_by_comp (E_CALENDAR (priv->preview_calendar), comp, - client, zone, TRUE, FALSE, FALSE, priv->cancellable); + tag_calendar_by_comp ( + E_CALENDAR (priv->preview_calendar), comp, + client, zone, TRUE, FALSE, FALSE, priv->cancellable); g_object_unref (comp); } @@ -440,18 +441,20 @@ clear_widgets (RecurrencePage *rpage) g_signal_handlers_unblock_matched (adj, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_DAILY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_DAILY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); priv->ending_date_tt = icaltime_today (); priv->ending_count = 2; g_signal_handlers_block_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->ending_combo, - priv->ending_count == -1 ? ENDING_FOREVER : ENDING_FOR, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + priv->ending_count == -1 ? ENDING_FOREVER : ENDING_FOR, + ending_types_map); g_signal_handlers_unblock_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); if (priv->ending_count == -1) priv->ending_count = 2; @@ -571,11 +574,13 @@ sensitize_recur_widgets (RecurrencePage *rpage) gtk_widget_set_sensitive (priv->params, FALSE); gtk_widget_hide (priv->params); - label = gtk_label_new (_("This appointment contains " - "recurrences that Evolution " - "cannot edit.")); - gtk_container_add (GTK_CONTAINER (priv->custom_warning_bin), - label); + label = gtk_label_new ( + _("This appointment contains " + "recurrences that Evolution " + "cannot edit.")); + gtk_container_add ( + GTK_CONTAINER (priv->custom_warning_bin), + label); gtk_widget_show_all (priv->custom_warning_bin); } else if (recurs) { gtk_widget_set_sensitive (priv->params, sens); @@ -801,10 +806,12 @@ simple_recur_to_comp (RecurrencePage *rpage, g_return_if_fail (priv->month_num_combo != NULL); g_return_if_fail (GTK_IS_COMBO_BOX (priv->month_num_combo)); - month_num = e_dialog_combo_box_get (priv->month_num_combo, - month_num_options_map ); - month_day = e_dialog_combo_box_get (priv->month_day_combo, - month_day_options_map); + month_num = e_dialog_combo_box_get ( + priv->month_num_combo, + month_num_options_map); + month_day = e_dialog_combo_box_get ( + priv->month_day_combo, + month_day_options_map); if (month_num == MONTH_NUM_LAST) month_num = -1; @@ -891,10 +898,11 @@ simple_recur_to_comp (RecurrencePage *rpage, /* We only allow a DATE value to be set for the UNTIL property, * since we don't support sub-day recurrences. */ - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->ending_date_edit), - &r.until.year, - &r.until.month, - &r.until.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->ending_date_edit), + &r.until.year, + &r.until.month, + &r.until.day); g_return_if_fail (date_set); r.until.is_date = 1; @@ -965,9 +973,10 @@ fill_component (RecurrencePage *rpage, g_return_val_if_fail (dt != NULL, FALSE); if (!icaltime_is_valid_time (*dt->value)) { - comp_editor_page_display_validation_error (COMP_EDITOR_PAGE (rpage), - _("Recurrence date is invalid"), - priv->exception_list); + comp_editor_page_display_validation_error ( + COMP_EDITOR_PAGE (rpage), + _("Recurrence date is invalid"), + priv->exception_list); return FALSE; } @@ -1180,10 +1189,11 @@ make_recur_month_num_combo (gint month_index) gtk_cell_layout_pack_start (GTK_CELL_LAYOUT (combo), cell, TRUE); gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo), cell, "text", 0, NULL); - gtk_cell_layout_set_cell_data_func (GTK_CELL_LAYOUT (combo), - cell, - only_leaf_sensitive, - NULL, NULL); + gtk_cell_layout_set_cell_data_func ( + GTK_CELL_LAYOUT (combo), + cell, + only_leaf_sensitive, + NULL, NULL); return combo; } @@ -1229,8 +1239,9 @@ month_num_combo_changed_cb (GtkComboBox *combo, priv = rpage->priv; - month_day = e_dialog_combo_box_get (priv->month_day_combo, - month_day_options_map); + month_day = e_dialog_combo_box_get ( + priv->month_day_combo, + month_day_options_map); if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (priv->month_num_combo), &iter)) { gint value; @@ -1264,13 +1275,15 @@ month_num_combo_changed_cb (GtkComboBox *combo, } if (month_num == MONTH_NUM_DAY && month_day != MONTH_DAY_NTH) - e_dialog_combo_box_set (priv->month_day_combo, - MONTH_DAY_NTH, - month_day_options_map); + e_dialog_combo_box_set ( + priv->month_day_combo, + MONTH_DAY_NTH, + month_day_options_map); else if (month_num != MONTH_NUM_DAY && month_num != MONTH_NUM_LAST && month_day == MONTH_DAY_NTH) - e_dialog_combo_box_set (priv->month_day_combo, - MONTH_DAY_MON, - month_num_options_map); + e_dialog_combo_box_set ( + priv->month_day_combo, + MONTH_DAY_MON, + month_num_options_map); comp_editor_page_changed (COMP_EDITOR_PAGE (rpage)); } @@ -1289,18 +1302,22 @@ month_day_combo_changed_cb (GtkComboBox *combo, priv = rpage->priv; - month_num = e_dialog_combo_box_get (priv->month_num_combo, - month_num_options_map); - month_day = e_dialog_combo_box_get (priv->month_day_combo, - month_day_options_map); + month_num = e_dialog_combo_box_get ( + priv->month_num_combo, + month_num_options_map); + month_day = e_dialog_combo_box_get ( + priv->month_day_combo, + month_day_options_map); if (month_day == MONTH_DAY_NTH && month_num != MONTH_NUM_LAST && month_num != MONTH_NUM_DAY) - e_dialog_combo_box_set (priv->month_num_combo, - MONTH_NUM_DAY, - month_num_options_map); + e_dialog_combo_box_set ( + priv->month_num_combo, + MONTH_NUM_DAY, + month_num_options_map); else if (month_day != MONTH_DAY_NTH && month_num == MONTH_NUM_DAY) - e_dialog_combo_box_set (priv->month_num_combo, - MONTH_NUM_FIRST, - month_num_options_map); + e_dialog_combo_box_set ( + priv->month_num_combo, + MONTH_NUM_FIRST, + month_num_options_map); comp_editor_page_changed (COMP_EDITOR_PAGE (rpage)); } @@ -1333,22 +1350,26 @@ make_monthly_special (RecurrencePage *rpage) adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 31, 1, 10, 10)); priv->month_num_combo = make_recur_month_num_combo (priv->month_index); - gtk_box_pack_start (GTK_BOX (hbox), priv->month_num_combo, - FALSE, FALSE, 6); + gtk_box_pack_start ( + GTK_BOX (hbox), priv->month_num_combo, + FALSE, FALSE, 6); priv->month_day_combo = make_recur_month_combobox (); - gtk_box_pack_start (GTK_BOX (hbox), priv->month_day_combo, - FALSE, FALSE, 6); + gtk_box_pack_start ( + GTK_BOX (hbox), priv->month_day_combo, + FALSE, FALSE, 6); gtk_widget_show_all (hbox); /* Set the options */ - e_dialog_combo_box_set (priv->month_num_combo, - priv->month_num, - month_num_options_map); - e_dialog_combo_box_set (priv->month_day_combo, - priv->month_day, - month_day_options_map); + e_dialog_combo_box_set ( + priv->month_num_combo, + priv->month_num, + month_num_options_map); + e_dialog_combo_box_set ( + priv->month_day_combo, + priv->month_day, + month_day_options_map); g_signal_connect_swapped ( adj, "value-changed", @@ -1452,8 +1473,9 @@ make_ending_until_special (RecurrencePage *rpage) priv->ending_date_edit = comp_editor_new_date_edit (TRUE, FALSE, FALSE); de = E_DATE_EDIT (priv->ending_date_edit); - gtk_container_add (GTK_CONTAINER (priv->ending_special), - GTK_WIDGET (de)); + gtk_container_add ( + GTK_CONTAINER (priv->ending_special), + GTK_WIDGET (de)); gtk_widget_show_all (GTK_WIDGET (de)); /* Set the value */ @@ -1503,8 +1525,9 @@ make_ending_count_special (RecurrencePage *rpage) adj = GTK_ADJUSTMENT (gtk_adjustment_new (1, 1, 10000, 1, 10, 0)); priv->ending_count_spin = gtk_spin_button_new (adj, 1, 0); gtk_spin_button_set_numeric ((GtkSpinButton *) priv->ending_count_spin, TRUE); - gtk_box_pack_start (GTK_BOX (hbox), priv->ending_count_spin, - FALSE, FALSE, 6); + gtk_box_pack_start ( + GTK_BOX (hbox), priv->ending_count_spin, + FALSE, FALSE, 6); label = gtk_label_new (_("occurrences")); gtk_box_pack_start (GTK_BOX (hbox), label, FALSE, FALSE, 6); @@ -1587,9 +1610,10 @@ fill_ending_date (RecurrencePage *rpage, if (r->until.year == 0) { /* Forever */ - e_dialog_combo_box_set (priv->ending_combo, - ENDING_FOREVER, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + ENDING_FOREVER, + ending_types_map); } else { /* Ending date */ @@ -1629,17 +1653,19 @@ fill_ending_date (RecurrencePage *rpage, } priv->ending_date_tt = r->until; - e_dialog_combo_box_set (priv->ending_combo, - ENDING_UNTIL, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + ENDING_UNTIL, + ending_types_map); } } else { /* Count of occurrences */ priv->ending_count = r->count; - e_dialog_combo_box_set (priv->ending_combo, - ENDING_FOR, - ending_types_map); + e_dialog_combo_box_set ( + priv->ending_combo, + ENDING_FOR, + ending_types_map); } g_signal_handlers_unblock_matched (priv->ending_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); @@ -1777,9 +1803,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, goto custom; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_DAILY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_DAILY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; @@ -1843,9 +1870,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, priv->weekday_day_mask = day_mask; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_WEEKLY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_WEEKLY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; } @@ -1942,9 +1970,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, goto custom; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_MONTHLY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_MONTHLY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; @@ -1958,9 +1987,10 @@ recurrence_page_fill_widgets (CompEditorPage *page, goto custom; g_signal_handlers_block_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); - e_dialog_combo_box_set (priv->interval_unit_combo, - ICAL_YEARLY_RECURRENCE, - freq_map); + e_dialog_combo_box_set ( + priv->interval_unit_combo, + ICAL_YEARLY_RECURRENCE, + freq_map); g_signal_handlers_unblock_matched (priv->interval_unit_combo, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, rpage); break; @@ -2061,10 +2091,12 @@ recurrence_page_set_dates (CompEditorPage *page, priv->weekday_blocked_day_mask = mask; if (priv->weekday_picker != NULL) { - weekday_picker_set_days (WEEKDAY_PICKER (priv->weekday_picker), - priv->weekday_day_mask); - weekday_picker_set_blocked_days (WEEKDAY_PICKER (priv->weekday_picker), - priv->weekday_blocked_day_mask); + weekday_picker_set_days ( + WEEKDAY_PICKER (priv->weekday_picker), + priv->weekday_day_mask); + weekday_picker_set_blocked_days ( + WEEKDAY_PICKER (priv->weekday_picker), + priv->weekday_blocked_day_mask); } } @@ -2200,11 +2232,12 @@ create_exception_dialog (RecurrencePage *rpage, priv = rpage->priv; toplevel = gtk_widget_get_toplevel (priv->main); - dialog = gtk_dialog_new_with_buttons (title, GTK_WINDOW (toplevel), - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, - GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, - NULL); + dialog = gtk_dialog_new_with_buttons ( + title, GTK_WINDOW (toplevel), + GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, + GTK_STOCK_CANCEL, GTK_RESPONSE_REJECT, + GTK_STOCK_OK, GTK_RESPONSE_ACCEPT, + NULL); *date_edit = comp_editor_new_date_edit (TRUE, FALSE, TRUE); gtk_widget_show (*date_edit); @@ -2234,10 +2267,11 @@ exception_add_cb (GtkWidget *widget, 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); + 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); @@ -2270,8 +2304,9 @@ exception_modify_cb (GtkWidget *widget, 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), - current_dt->value->year, current_dt->value->month, current_dt->value->day); + 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; @@ -2280,8 +2315,9 @@ exception_modify_cb (GtkWidget *widget, dt.value = &icaltime; tt = dt.value; - e_date_edit_get_date (E_DATE_EDIT (date_edit), - &tt->year, &tt->month, &tt->day); + 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; @@ -2382,8 +2418,9 @@ init_widgets (RecurrencePage *rpage) ecal->calitem, "date_range_changed", G_CALLBACK (preview_date_range_changed_cb), rpage); e_calendar_item_set_max_days_sel (ecal->calitem, 0); - gtk_container_add (GTK_CONTAINER (priv->preview_bin), - priv->preview_calendar); + gtk_container_add ( + GTK_CONTAINER (priv->preview_bin), + priv->preview_calendar); gtk_widget_show (priv->preview_calendar); e_calendar_item_set_get_time_callback ( @@ -2442,8 +2479,9 @@ init_widgets (RecurrencePage *rpage) /* Model */ priv->exception_list_store = e_date_time_list_new (); - gtk_tree_view_set_model (GTK_TREE_VIEW (priv->exception_list), - GTK_TREE_MODEL (priv->exception_list_store)); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (priv->exception_list), + GTK_TREE_MODEL (priv->exception_list_store)); g_object_bind_property ( editor, "use-24-hour-format", @@ -2489,8 +2527,9 @@ recurrence_page_construct (RecurrencePage *rpage, e_load_ui_builder_definition (priv->builder, "recurrence-page.ui"); if (!get_widgets (rpage)) { - g_message ("recurrence_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "recurrence_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } diff --git a/calendar/gui/dialogs/schedule-page.c b/calendar/gui/dialogs/schedule-page.c index 3fcf1749cc..eafdb91744 100644 --- a/calendar/gui/dialogs/schedule-page.c +++ b/calendar/gui/dialogs/schedule-page.c @@ -104,13 +104,17 @@ update_time (SchedulePage *spage, if (!start_zone) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, start_date->tzid, &start_zone, NULL, &error)) { + e_cal_client_get_timezone_sync ( + client, start_date->tzid, + &start_zone, NULL, &error); + + if (error != NULL) { /* FIXME: Handle error better. */ - g_warning ("Couldn't get timezone '%s' from server: %s", - start_date->tzid ? start_date->tzid : "", - error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + g_warning ( + "Couldn't get timezone '%s' from server: %s", + start_date->tzid ? start_date->tzid : "", + error->message); + g_error_free (error); } } } @@ -119,13 +123,18 @@ update_time (SchedulePage *spage, end_zone = icaltimezone_get_builtin_timezone_from_tzid (end_date->tzid); if (!end_zone) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, end_date->tzid, &end_zone, NULL, &error)) { + + e_cal_client_get_timezone_sync ( + client, end_date->tzid, + &end_zone, NULL, &error); + + if (error != NULL) { /* FIXME: Handle error better. */ - g_warning ("Couldn't get timezone '%s' from server: %s", - end_date->tzid ? end_date->tzid : "", - error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + g_warning ( + "Couldn't get timezone '%s' from server: %s", + end_date->tzid ? end_date->tzid : "", + error->message); + g_error_free (error); } } } @@ -155,15 +164,19 @@ update_time (SchedulePage *spage, } } - e_date_edit_set_date (E_DATE_EDIT (priv->sel->start_date_edit), start_tt.year, - start_tt.month, start_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->start_date_edit), - start_tt.hour, start_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->sel->start_date_edit), start_tt.year, + start_tt.month, start_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->sel->start_date_edit), + start_tt.hour, start_tt.minute); - e_date_edit_set_date (E_DATE_EDIT (priv->sel->end_date_edit), end_tt.year, - end_tt.month, end_tt.day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->sel->end_date_edit), - end_tt.hour, end_tt.minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->sel->end_date_edit), end_tt.year, + end_tt.month, end_tt.day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->sel->end_date_edit), + end_tt.hour, end_tt.minute); } @@ -387,8 +400,9 @@ schedule_page_construct (SchedulePage *spage, e_load_ui_builder_definition (priv->builder, "schedule-page.ui"); if (!get_widgets (spage)) { - g_message ("schedule_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "schedule_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } @@ -409,8 +423,9 @@ schedule_page_construct (SchedulePage *spage, gtk_box_pack_start (GTK_BOX (priv->main), GTK_WIDGET (priv->sel), TRUE, TRUE, 6); if (!init_widgets (spage)) { - g_message ("schedule_page_construct(): " - "Could not initialize the widgets!"); + g_message ( + "schedule_page_construct(): " + "Could not initialize the widgets!"); return NULL; } @@ -489,20 +504,24 @@ times_changed_cb (GtkWidget *widget, editor = comp_editor_page_get_editor (COMP_EDITOR_PAGE (spage)); - e_date_edit_get_date (E_DATE_EDIT (priv->sel->start_date_edit), - &start_tt.year, - &start_tt.month, - &start_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->sel->start_date_edit), - &start_tt.hour, - &start_tt.minute); - e_date_edit_get_date (E_DATE_EDIT (priv->sel->end_date_edit), - &end_tt.year, - &end_tt.month, - &end_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->sel->end_date_edit), - &end_tt.hour, - &end_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->sel->start_date_edit), + &start_tt.year, + &start_tt.month, + &start_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->sel->start_date_edit), + &start_tt.hour, + &start_tt.minute); + e_date_edit_get_date ( + E_DATE_EDIT (priv->sel->end_date_edit), + &end_tt.year, + &end_tt.month, + &end_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->sel->end_date_edit), + &end_tt.hour, + &end_tt.minute); start_dt.value = &start_tt; end_dt.value = &end_tt; diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index 5f11665bea..fa7640eae7 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -170,8 +170,9 @@ send_component_dialog (GtkWindow *parent, case E_CAL_COMPONENT_JOURNAL: return TRUE; default: - g_message ("send_component_dialog(): " - "Cannot handle object of type %d", vtype); + g_message ( + "send_component_dialog(): " + "Cannot handle object of type %d", vtype); return FALSE; } @@ -232,8 +233,9 @@ send_component_prompt_subject (GtkWindow *parent, break; default: - g_message ("send_component_prompt_subject(): " - "Cannot handle object of type %d", vtype); + g_message ( + "send_component_prompt_subject(): " + "Cannot handle object of type %d", vtype); return FALSE; } diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index c31fef6e23..2ada645842 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -279,12 +279,14 @@ task_details_page_fill_widgets (CompEditorPage *page, icaltimezone_convert_time (completed, utc_zone, zone); - e_date_edit_set_date (E_DATE_EDIT (priv->completed_date), - completed->year, completed->month, - completed->day); - e_date_edit_set_time_of_day (E_DATE_EDIT (priv->completed_date), - completed->hour, - completed->minute); + e_date_edit_set_date ( + E_DATE_EDIT (priv->completed_date), + completed->year, completed->month, + completed->day); + e_date_edit_set_time_of_day ( + E_DATE_EDIT (priv->completed_date), + completed->hour, + completed->minute); e_cal_component_free_icaltimetype (completed); } @@ -357,20 +359,23 @@ task_details_page_fill_component (CompEditorPage *page, return FALSE; } - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->completed_date), - &icalcomplete.year, - &icalcomplete.month, - &icalcomplete.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->completed_date), + &icalcomplete.year, + &icalcomplete.month, + &icalcomplete.day); if (date_set) { - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->completed_date), - &icalcomplete.hour, - &icalcomplete.minute); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->completed_date), + &icalcomplete.hour, + &icalcomplete.minute); /* COMPLETED today or before */ icaltoday = icaltime_current_time_with_zone (zone); - icaltimezone_convert_time (&icaltoday, zone, - icaltimezone_get_utc_timezone ()); + icaltimezone_convert_time ( + &icaltoday, zone, + icaltimezone_get_utc_timezone ()); if (icaltime_compare_date_only (icalcomplete, icaltoday) > 0) { comp_editor_page_display_validation_error ( @@ -385,7 +390,8 @@ task_details_page_fill_component (CompEditorPage *page, * entire time the dialog is shown. Otherwise if the user * changes the timezone, the COMPLETED date may get changed * as well. */ - icaltimezone_convert_time (&icalcomplete, zone, + icaltimezone_convert_time ( + &icalcomplete, zone, icaltimezone_get_utc_timezone ()); e_cal_component_set_completed (comp, &icalcomplete); } else { @@ -539,30 +545,34 @@ date_changed_cb (EDateEdit *dedit, comp_editor_page_set_updating (COMP_EDITOR_PAGE (tdpage), TRUE); - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->completed_date), - &completed_tt.year, - &completed_tt.month, - &completed_tt.day); - e_date_edit_get_time_of_day (E_DATE_EDIT (priv->completed_date), - &completed_tt.hour, - &completed_tt.minute); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->completed_date), + &completed_tt.year, + &completed_tt.month, + &completed_tt.day); + e_date_edit_get_time_of_day ( + E_DATE_EDIT (priv->completed_date), + &completed_tt.hour, + &completed_tt.minute); status = e_dialog_combo_box_get (priv->status_combo, status_map); if (!date_set) { completed_tt = icaltime_null_time (); if (status == ICAL_STATUS_COMPLETED) { - e_dialog_combo_box_set (priv->status_combo, - ICAL_STATUS_NONE, - status_map); + e_dialog_combo_box_set ( + priv->status_combo, + ICAL_STATUS_NONE, + status_map); gtk_spin_button_set_value ( GTK_SPIN_BUTTON (priv->percent_complete), 0); } } else { if (status != ICAL_STATUS_COMPLETED) { - e_dialog_combo_box_set (priv->status_combo, - ICAL_STATUS_COMPLETED, - status_map); + e_dialog_combo_box_set ( + priv->status_combo, + ICAL_STATUS_COMPLETED, + status_map); } gtk_spin_button_set_value ( GTK_SPIN_BUTTON (priv->percent_complete), 100); @@ -746,8 +756,9 @@ task_details_page_construct (TaskDetailsPage *tdpage) e_load_ui_builder_definition (priv->builder, "task-details-page.ui"); if (!get_widgets (tdpage)) { - g_message ("task_details_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "task_details_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } diff --git a/calendar/gui/dialogs/task-page.c b/calendar/gui/dialogs/task-page.c index 9f1542ced3..49f86212c0 100644 --- a/calendar/gui/dialogs/task-page.c +++ b/calendar/gui/dialogs/task-page.c @@ -256,7 +256,8 @@ check_starts_in_the_past (TaskPage *tpage) due_in_past = date_in_past (tpage, E_DATE_EDIT (priv->due_date)); if (start_in_past || due_in_past) { - gchar *tmp = g_strconcat ("<b>", start_in_past ? _("Task's start date is in the past") : "", + gchar *tmp = g_strconcat ( + "<b>", start_in_past ? _("Task's start date is in the past") : "", start_in_past && due_in_past ? "\n" : "", due_in_past ? _("Task's due date is in the past") : "", "</b>", NULL); task_page_set_info_string (tpage, GTK_STOCK_DIALOG_WARNING, tmp); g_free (tmp); @@ -544,11 +545,13 @@ task_page_fill_widgets (CompEditorPage *page, 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); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + dtext->value ? dtext->value : "", -1); } else { - gtk_text_buffer_set_text (gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), - "", 0); + gtk_text_buffer_set_text ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (priv->description)), + "", 0); } e_cal_component_free_text_list (l); e_buffer_tagger_update_tags (GTK_TEXT_VIEW (priv->description)); @@ -560,9 +563,10 @@ task_page_fill_widgets (CompEditorPage *page, zone = NULL; if (d.value) { struct icaltimetype *due_tt = d.value; - e_date_edit_set_date (E_DATE_EDIT (priv->due_date), - due_tt->year, due_tt->month, - due_tt->day); + e_date_edit_set_date ( + E_DATE_EDIT (priv->due_date), + due_tt->year, due_tt->month, + due_tt->day); e_date_edit_set_time_of_day (E_DATE_EDIT (priv->due_date), -1, -1); } else { e_date_edit_set_time (E_DATE_EDIT (priv->due_date), -1); @@ -578,16 +582,22 @@ task_page_fill_widgets (CompEditorPage *page, * first. */ if (!zone && d.tzid) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, d.tzid, &zone, NULL, &error)) + + e_cal_client_get_timezone_sync ( + client, d.tzid, &zone, NULL, &error); + + if (error != NULL) { /* FIXME: Handle error better. */ - g_warning ("Couldn't get timezone '%s' from server: %s", - d.tzid ? d.tzid : "", error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + g_warning ( + "Couldn't get timezone '%s' from server: %s", + d.tzid ? d.tzid : "", error->message); + g_error_free (error); + } } - e_timezone_entry_set_timezone (E_TIMEZONE_ENTRY (priv->timezone), - zone ? zone : default_zone); + e_timezone_entry_set_timezone ( + E_TIMEZONE_ENTRY (priv->timezone), + zone ? zone : default_zone); action = comp_editor_get_action (editor, "view-time-zone"); active = gtk_toggle_action_get_active (GTK_TOGGLE_ACTION (action)); @@ -608,9 +618,10 @@ task_page_fill_widgets (CompEditorPage *page, zone = NULL; if (d.value) { struct icaltimetype *start_tt = d.value; - e_date_edit_set_date (E_DATE_EDIT (priv->start_date), - start_tt->year, start_tt->month, - start_tt->day); + e_date_edit_set_date ( + E_DATE_EDIT (priv->start_date), + start_tt->year, start_tt->month, + start_tt->day); e_date_edit_set_time_of_day (E_DATE_EDIT (priv->start_date), -1, -1); } else { e_date_edit_set_time (E_DATE_EDIT (priv->start_date), -1); @@ -676,7 +687,7 @@ task_page_fill_widgets (CompEditorPage *page, if (e_client_check_capability (E_CLIENT (client), CAL_STATIC_CAPABILITY_NO_ORGANIZER) && (flags & COMP_EDITOR_DELEGATE)) string = g_strdup (priv->user_add); - else if ( organizer.cn != NULL) + else if (organizer.cn != NULL) string = g_strdup_printf ("%s <%s>", organizer.cn, strip); else string = g_strdup (strip); @@ -835,10 +846,11 @@ task_page_fill_component (CompEditorPage *page, return FALSE; } - due_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date), - &due_tt.year, - &due_tt.month, - &due_tt.day); + due_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->due_date), + &due_tt.year, + &due_tt.month, + &due_tt.day); if (due_date_set) { due_tt.is_date = TRUE; date.tzid = NULL; @@ -855,10 +867,11 @@ task_page_fill_component (CompEditorPage *page, start_tt = icaltime_null_time (); date.value = &start_tt; - start_date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date), - &start_tt.year, - &start_tt.month, - &start_tt.day); + start_date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_date), + &start_tt.year, + &start_tt.month, + &start_tt.day); if (start_date_set) { start_tt.is_date = TRUE; date.tzid = NULL; @@ -935,12 +948,13 @@ task_page_fill_component (CompEditorPage *page, } if (e_meeting_store_count_actual_attendees (priv->meeting_store) < 1) { - e_notice (priv->main, GTK_MESSAGE_ERROR, - _("At least one attendee is required.")); + e_notice ( + priv->main, GTK_MESSAGE_ERROR, + _("At least one attendee is required.")); return FALSE; } - if (flags & COMP_EDITOR_DELEGATE ) { + if (flags & COMP_EDITOR_DELEGATE) { GSList *attendee_list, *l; gint i; const GPtrArray *attendees = e_meeting_store_get_attendees (priv->meeting_store); @@ -1595,10 +1609,11 @@ date_changed_cb (EDateEdit *dedit, if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage))) return; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date), - &start_tt.year, - &start_tt.month, - &start_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_date), + &start_tt.year, + &start_tt.month, + &start_tt.day); if (date_set) { start_tt.is_date = TRUE; start_dt.tzid = NULL; @@ -1607,10 +1622,11 @@ date_changed_cb (EDateEdit *dedit, start_dt.tzid = NULL; } - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date), - &due_tt.year, - &due_tt.month, - &due_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->due_date), + &due_tt.year, + &due_tt.month, + &due_tt.day); if (date_set) { due_tt.is_date = TRUE; due_dt.tzid = NULL; @@ -1677,14 +1693,16 @@ check_start_before_end (struct icaltimetype *start_tt, /* Modify the end time, to be the start + 1 hour/day. */ *end_tt = *start_tt; icaltime_adjust (end_tt, 0, adjust_by_hour ? 1 : 24, 0, 0); - icaltimezone_convert_time (end_tt, start_zone, - end_zone); + icaltimezone_convert_time ( + end_tt, start_zone, + end_zone); } else { /* Modify the start time, to be the end - 1 hour/day. */ *start_tt = *end_tt; icaltime_adjust (start_tt, 0, adjust_by_hour ? -1 : -24, 0, 0); - icaltimezone_convert_time (start_tt, end_zone, - start_zone); + icaltimezone_convert_time ( + start_tt, end_zone, + start_zone); } return TRUE; } @@ -1720,17 +1738,19 @@ times_updated (TaskPage *tpage, if (comp_editor_page_get_updating (COMP_EDITOR_PAGE (tpage))) return; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->start_date), - &start_tt.year, - &start_tt.month, - &start_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->start_date), + &start_tt.year, + &start_tt.month, + &start_tt.day); if (!date_set) return; - date_set = e_date_edit_get_date (E_DATE_EDIT (priv->due_date), - &end_tt.year, - &end_tt.month, - &end_tt.day); + date_set = e_date_edit_get_date ( + E_DATE_EDIT (priv->due_date), + &end_tt.year, + &end_tt.month, + &end_tt.day); if (!date_set) return; @@ -2156,8 +2176,9 @@ task_page_construct (TaskPage *tpage, e_load_ui_builder_definition (priv->builder, "task-page.ui"); if (!get_widgets (tpage)) { - g_message ("task_page_construct(): " - "Could not find all widgets in the XML file!"); + g_message ( + "task_page_construct(): " + "Could not find all widgets in the XML file!"); return NULL; } @@ -2184,8 +2205,9 @@ task_page_construct (TaskPage *tpage, G_CALLBACK (organizer_changed_cb), tpage); if (!init_widgets (tpage)) { - g_message ("task_page_construct(): " - "Could not initialize the widgets!"); + g_message ( + "task_page_construct(): " + "Could not initialize the widgets!"); return NULL; } diff --git a/calendar/gui/e-alarm-list.c b/calendar/gui/e-alarm-list.c index bbfb66326d..95d2329ad4 100644 --- a/calendar/gui/e-alarm-list.c +++ b/calendar/gui/e-alarm-list.c @@ -437,13 +437,15 @@ get_alarm_string (ECalComponentAlarm *alarm) if (trigger.u.rel_duration.is_neg) /*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); + 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 * "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); + str = g_strdup_printf ( + _("%s %s after the start of the appointment"), + base, dur); g_free (dur); } else @@ -460,13 +462,15 @@ get_alarm_string (ECalComponentAlarm *alarm) if (trigger.u.rel_duration.is_neg) /* 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); + 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 * "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); + str = g_strdup_printf ( + _("%s %s after the end of the appointment"), + base, dur); g_free (dur); } else diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index 99263ff158..fe9870e1d8 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -272,7 +272,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, /* write location */ e_cal_component_get_location (comp, &location); if (location) - g_string_append_printf (buffer, "<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td>%s</td></tr>", _("Summary:"), text.value); /* write start date */ @@ -280,7 +281,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf (buffer, "<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td>%s</td></tr>", _("Start Date:"), str); g_free (str); } @@ -291,7 +293,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf (buffer,"<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer,"<tr><th>%s</th><td>%s</td></tr>", _("End Date:"), str); g_free (str); } @@ -302,7 +305,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf (buffer, "<tr><th>%s</th><td>%s</td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td>%s</td></tr>", _("Due Date:"), str); g_free (str); } @@ -313,7 +317,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, icalprop = icalcomponent_get_first_property ( icalcomp, ICAL_STATUS_PROPERTY); if (icalprop != NULL) { - g_string_append_printf (buffer, "<tr><th>%s</th>", + g_string_append_printf ( + buffer, "<tr><th>%s</th>", _("Status:")); e_cal_component_get_status (comp, &status); switch (status) { @@ -339,7 +344,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, /* write priority */ e_cal_component_get_priority (comp, &priority_value); if (priority_value && *priority_value != 0) { - g_string_append_printf (buffer, "<tr><th>%s</th>", + g_string_append_printf ( + buffer, "<tr><th>%s</th>", _("Priority:")); if (*priority_value <= 4) str = g_strdup (_("High")); @@ -363,7 +369,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, if (list) { GSList *node; - g_string_append_printf (buffer, "<tr><th>%s</th>", + g_string_append_printf ( + buffer, "<tr><th>%s</th>", _("Description:")); g_string_append (buffer, "<td class=\"description\">"); @@ -393,7 +400,8 @@ cal_component_preview_write_html (ECalComponentPreview *preview, /* URL */ e_cal_component_get_url (comp, (const gchar **) &str); if (str) { - g_string_append_printf (buffer, "<tr><th>%s</th><td><a href=\"%s\">%s</a></td></tr>", + g_string_append_printf ( + buffer, "<tr><th>%s</th><td><a href=\"%s\">%s</a></td></tr>", _("Web Page:"), str, str); } @@ -444,7 +452,8 @@ e_cal_component_preview_init (ECalComponentPreview *preview) { preview->priv = E_CAL_COMPONENT_PREVIEW_GET_PRIVATE (preview); - g_signal_connect (preview, "style-set", + g_signal_connect ( + preview, "style-set", G_CALLBACK (load_comp), NULL); } diff --git a/calendar/gui/e-cal-list-view.c b/calendar/gui/e-cal-list-view.c index 62e02b96ae..6427002904 100644 --- a/calendar/gui/e-cal-list-view.c +++ b/calendar/gui/e-cal-list-view.c @@ -178,9 +178,10 @@ setup_e_table (ECalListView *cal_list_view) /* Normal string fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - NULL); + g_object_set ( + cell, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + NULL); e_table_extras_add_cell (extras, "calstring", cell); g_object_unref (cell); @@ -188,9 +189,10 @@ setup_e_table (ECalListView *cal_list_view) /* Date fields */ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - NULL); + g_object_set ( + cell, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + NULL); g_object_bind_property ( model, "timezone", @@ -220,17 +222,19 @@ setup_e_table (ECalListView *cal_list_view) gtk_widget_hide (E_CELL_DATE_EDIT (popup_cell)->none_button); - e_cell_date_edit_set_get_time_callback (E_CELL_DATE_EDIT (popup_cell), - get_current_time_cb, - cal_list_view, NULL); + e_cell_date_edit_set_get_time_callback ( + E_CELL_DATE_EDIT (popup_cell), + get_current_time_cb, + cal_list_view, NULL); /* Combo fields */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - "editable", FALSE, - NULL); + g_object_set ( + cell, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -240,8 +244,9 @@ setup_e_table (ECalListView *cal_list_view) strings = g_list_append (strings, (gchar *) _("Public")); strings = g_list_append (strings, (gchar *) _("Private")); strings = g_list_append (strings, (gchar *) _("Confidential")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "classification", popup_cell); @@ -249,8 +254,9 @@ setup_e_table (ECalListView *cal_list_view) /* Sorting */ - e_table_extras_add_compare (extras, "date-compare", - e_cell_date_edit_compare_cb); + e_table_extras_add_compare ( + extras, "date-compare", + e_cell_date_edit_compare_cb); /* set proper format component for a default 'date' cell renderer */ cell = e_table_extras_get_cell (extras, "date"); @@ -474,8 +480,9 @@ e_cal_list_view_get_selected_events (ECalendarView *cal_view) event = E_CAL_LIST_VIEW (cal_view)->cursor_event = g_new0 (ECalendarViewEvent, 1); event->comp_data = - e_cal_model_get_component_at (e_calendar_view_get_model (cal_view), - cursor_row); + e_cal_model_get_component_at ( + e_calendar_view_get_model (cal_view), + cursor_row); event_list = g_list_prepend (event_list, event); } diff --git a/calendar/gui/e-cal-model-calendar.c b/calendar/gui/e-cal-model-calendar.c index dc72e1c67b..5759d3acb1 100644 --- a/calendar/gui/e-cal-model-calendar.c +++ b/calendar/gui/e-cal-model-calendar.c @@ -111,8 +111,9 @@ get_dtend (ECalModelCalendar *model, 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, - model_zone); + tt_end = icaltime_from_timet_with_zone ( + comp_data->instance_end, + tt_end.is_date, model_zone); } if (!icaltime_is_valid_time (tt_end) || icaltime_is_null_time (tt_end)) @@ -318,7 +319,10 @@ ecmc_set_value_at (ETableModel *etm, break; } - if (e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, mod, NULL, &error)) { + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, mod, NULL, &error); + + if (error == NULL) { gboolean strip_alarms = TRUE; if (itip_organizer_is_user (registry, comp, comp_data->client) && @@ -350,11 +354,12 @@ ecmc_set_value_at (ETableModel *etm, g_object_unref (send_comp); } } else { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* FIXME Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } g_object_unref (comp); @@ -513,12 +518,15 @@ ecmc_fill_component_from_model (ECalModel *model, g_return_if_fail (comp_data != NULL); g_return_if_fail (E_IS_TABLE_MODEL (source_model)); - set_dtend (model, comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_DTEND, row)); - set_location (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row)); - set_transparency (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row)); + set_dtend ( + model, comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_DTEND, row)); + set_location ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_LOCATION, row)); + set_transparency ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_CALENDAR_FIELD_TRANSPARENCY, row)); } /** diff --git a/calendar/gui/e-cal-model-memos.c b/calendar/gui/e-cal-model-memos.c index 09a58941e7..a6d3f1d612 100644 --- a/calendar/gui/e-cal-model-memos.c +++ b/calendar/gui/e-cal-model-memos.c @@ -131,12 +131,17 @@ ecmm_set_value_at (ETableModel *etm, } /* TODO ask about mod type */ - if (!e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL, &error)) { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, + CALOBJ_MOD_ALL, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* TODO Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } } diff --git a/calendar/gui/e-cal-model-tasks.c b/calendar/gui/e-cal-model-tasks.c index 54f95004cc..81c3cb3a45 100644 --- a/calendar/gui/e-cal-model-tasks.c +++ b/calendar/gui/e-cal-model-tasks.c @@ -278,9 +278,10 @@ ensure_task_complete (ECalModelComponent *comp_data, /* COMPLETED is stored in UTC. */ utc_zone = icaltimezone_get_utc_timezone (); - new_completed = icaltime_from_timet_with_zone (completed_date, - FALSE, - utc_zone); + new_completed = icaltime_from_timet_with_zone ( + completed_date, + FALSE, + utc_zone); if (prop) icalproperty_set_completed (prop, new_completed); else { @@ -430,11 +431,12 @@ get_geo (ECalModelComponent *comp_data) prop = icalcomponent_get_first_property (comp_data->icalcomp, ICAL_GEO_PROPERTY); if (prop) { geo = icalproperty_get_geo (prop); - g_snprintf (buf, sizeof (buf), "%g %s, %g %s", - fabs (geo.lat), - geo.lat >= 0.0 ? "N" : "S", - fabs (geo.lon), - geo.lon >= 0.0 ? "E" : "W"); + g_snprintf ( + buf, sizeof (buf), "%g %s, %g %s", + fabs (geo.lat), + geo.lat >= 0.0 ? "N" : "S", + fabs (geo.lon), + geo.lon >= 0.0 ? "E" : "W"); return buf; } @@ -716,9 +718,10 @@ show_geo_warning (void) { GtkWidget *dialog; - dialog = gtk_message_dialog_new (NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, - "%s", _("The geographical position must be entered " - "in the format: \n\n45.436845,125.862501")); + dialog = gtk_message_dialog_new ( + NULL, 0, GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, + "%s", _("The geographical position must be entered " + "in the format: \n\n45.436845,125.862501")); gtk_widget_show (dialog); } @@ -1212,14 +1215,18 @@ ecmt_fill_component_from_model (ECalModel *model, set_status (comp_data, e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_STATUS, row)); } - set_due (model, comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row)); - set_geo (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_GEO, row)); - set_priority (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PRIORITY, row)); - set_url (comp_data, - e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_URL, row)); + set_due ( + model, comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_DUE, row)); + set_geo ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_GEO, row)); + set_priority ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_PRIORITY, row)); + set_url ( + comp_data, + e_table_model_value_at (source_model, E_CAL_MODEL_TASKS_FIELD_URL, row)); } ECalModel * @@ -1246,7 +1253,7 @@ e_cal_model_tasks_set_highlight_due_today (ECalModelTasks *model, { g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); - if ((highlight ? 1 : 0) == (model->priv->highlight_due_today ? 1 : 0)) + if (model->priv->highlight_due_today == highlight) return; model->priv->highlight_due_today = highlight; @@ -1292,7 +1299,7 @@ e_cal_model_tasks_set_highlight_overdue (ECalModelTasks *model, { g_return_if_fail (E_IS_CAL_MODEL_TASKS (model)); - if ((highlight ? 1 : 0) == (model->priv->highlight_overdue ? 1 : 0)) + if (model->priv->highlight_overdue == highlight) return; model->priv->highlight_overdue = highlight; @@ -1403,12 +1410,17 @@ commit_component_changes (ECalModelComponent *comp_data) g_return_if_fail (comp_data != NULL); /* FIXME ask about mod type */ - if (!e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL, &error)) { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, + CALOBJ_MOD_ALL, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* FIXME Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } } diff --git a/calendar/gui/e-cal-model.c b/calendar/gui/e-cal-model.c index 3020a70300..b7c7145c05 100644 --- a/calendar/gui/e-cal-model.c +++ b/calendar/gui/e-cal-model.c @@ -433,11 +433,13 @@ cal_model_dispose (GObject *object) 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, object); + g_signal_handlers_disconnect_matched ( + client_data->client, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); if (client_data->view) - g_signal_handlers_disconnect_matched (client_data->view, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, object); + g_signal_handlers_disconnect_matched ( + client_data->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, object); priv->clients = g_list_remove (priv->clients, client_data); @@ -678,50 +680,58 @@ e_cal_model_class_init (ECalModelClass *class) 0, G_PARAM_READWRITE)); - signals[TIME_RANGE_CHANGED] = - g_signal_new ("time_range_changed", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, time_range_changed), - NULL, NULL, - e_marshal_VOID__LONG_LONG, - G_TYPE_NONE, 2, G_TYPE_LONG, G_TYPE_LONG); - - signals[ROW_APPENDED] = - g_signal_new ("row_appended", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, row_appended), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[COMPS_DELETED] = - g_signal_new ("comps_deleted", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, comps_deleted), - NULL, NULL, - g_cclosure_marshal_VOID__POINTER, - G_TYPE_NONE, 1, G_TYPE_POINTER); - - signals[CAL_VIEW_PROGRESS] = - g_signal_new ("cal_view_progress", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, cal_view_progress), - NULL, NULL, - e_marshal_VOID__STRING_INT_INT, - G_TYPE_NONE, 3, G_TYPE_STRING, G_TYPE_INT, G_TYPE_INT); - - signals[CAL_VIEW_COMPLETE] = - g_signal_new ("cal_view_complete", - G_TYPE_FROM_CLASS (class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (ECalModelClass, cal_view_complete), - NULL, NULL, - e_marshal_VOID__BOXED_INT, - G_TYPE_NONE, 2, G_TYPE_ERROR, G_TYPE_INT); + signals[TIME_RANGE_CHANGED] = g_signal_new ( + "time_range_changed", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, time_range_changed), + NULL, NULL, + e_marshal_VOID__LONG_LONG, + G_TYPE_NONE, 2, + G_TYPE_LONG, + G_TYPE_LONG); + + signals[ROW_APPENDED] = g_signal_new ( + "row_appended", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, row_appended), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[COMPS_DELETED] = g_signal_new ( + "comps_deleted", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, comps_deleted), + NULL, NULL, + g_cclosure_marshal_VOID__POINTER, + G_TYPE_NONE, 1, + G_TYPE_POINTER); + + signals[CAL_VIEW_PROGRESS] = g_signal_new ( + "cal_view_progress", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, cal_view_progress), + NULL, NULL, + e_marshal_VOID__STRING_INT_INT, + G_TYPE_NONE, 3, + G_TYPE_STRING, + G_TYPE_INT, + G_TYPE_INT); + + signals[CAL_VIEW_COMPLETE] = g_signal_new ( + "cal_view_complete", + G_TYPE_FROM_CLASS (class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (ECalModelClass, cal_view_complete), + NULL, NULL, + e_marshal_VOID__BOXED_INT, + G_TYPE_NONE, 2, + G_TYPE_ERROR, + G_TYPE_INT); signals[STATUS_MESSAGE] = g_signal_new ( "status-message", @@ -731,7 +741,9 @@ e_cal_model_class_init (ECalModelClass *class) NULL, NULL, e_marshal_VOID__STRING_DOUBLE, G_TYPE_NONE, 2, - G_TYPE_STRING, G_TYPE_DOUBLE); + G_TYPE_STRING, + G_TYPE_DOUBLE); + signals[TIMEZONE_CHANGED] = g_signal_new ( "timezone-changed", G_TYPE_FROM_CLASS (class), @@ -1021,12 +1033,18 @@ ecm_value_at (ETableModel *etm, case E_CAL_MODEL_FIELD_DTSTART : return (gpointer) get_dtstart (model, comp_data); case E_CAL_MODEL_FIELD_CREATED : - return (gpointer) get_datetime_from_utc (model, comp_data, ICAL_CREATED_PROPERTY, icalproperty_get_created, &comp_data->created); + return (gpointer) get_datetime_from_utc ( + model, comp_data, ICAL_CREATED_PROPERTY, + icalproperty_get_created, &comp_data->created); case E_CAL_MODEL_FIELD_LASTMODIFIED : - return (gpointer) get_datetime_from_utc (model, comp_data, ICAL_LASTMODIFIED_PROPERTY, icalproperty_get_lastmodified, &comp_data->lastmodified); + return (gpointer) get_datetime_from_utc ( + model, comp_data, ICAL_LASTMODIFIED_PROPERTY, + icalproperty_get_lastmodified, &comp_data->lastmodified); case E_CAL_MODEL_FIELD_HAS_ALARMS : - return GINT_TO_POINTER ((icalcomponent_get_first_component (comp_data->icalcomp, - ICAL_VALARM_COMPONENT) != NULL)); + return GINT_TO_POINTER ( + icalcomponent_get_first_component ( + comp_data->icalcomp, + ICAL_VALARM_COMPONENT) != NULL); case E_CAL_MODEL_FIELD_ICON : { ECalComponent *comp; @@ -1337,12 +1355,17 @@ ecm_set_value_at (ETableModel *etm, } /* FIXME ask about mod type */ - if (!e_cal_client_modify_object_sync (comp_data->client, comp_data->icalcomp, CALOBJ_MOD_ALL, NULL, &error)) { - g_warning (G_STRLOC ": Could not modify the object! %s", error ? error->message : "Unknown error"); + e_cal_client_modify_object_sync ( + comp_data->client, comp_data->icalcomp, + CALOBJ_MOD_ALL, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not modify the object! %s", + error->message); /* FIXME Show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } } @@ -1472,17 +1495,21 @@ ecm_append_row (ETableModel *etm, model_class->fill_component_from_model (model, comp_data, source, row); } - if (!e_cal_client_create_object_sync (comp_data->client, comp_data->icalcomp, &uid, NULL, &error)) { - g_warning (G_STRLOC ": Could not create the object! %s", error ? error->message : "Unknown error"); + e_cal_client_create_object_sync ( + comp_data->client, comp_data->icalcomp, &uid, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not create the object! %s", + error->message); /* FIXME: show error dialog */ - if (error) - g_error_free (error); + g_error_free (error); } else { if (uid) icalcomponent_set_uid (comp_data->icalcomp, uid); - g_signal_emit (G_OBJECT (model), signals[ROW_APPENDED], 0); + g_signal_emit (model, signals[ROW_APPENDED], 0); } g_free (uid); @@ -1760,7 +1787,7 @@ e_cal_model_set_confirm_delete (ECalModel *model, { g_return_if_fail (E_IS_CAL_MODEL (model)); - if ((model->priv->confirm_delete ? 1 : 0) == (confirm_delete ? 1 : 0)) + if (model->priv->confirm_delete == confirm_delete) return; model->priv->confirm_delete = confirm_delete; @@ -1838,8 +1865,9 @@ e_cal_model_set_timezone (ECalModel *model, redo_queries (model); g_object_notify (G_OBJECT (model), "timezone"); - g_signal_emit (G_OBJECT (model), signals[TIMEZONE_CHANGED], 0, - old_zone, zone); + g_signal_emit ( + model, signals[TIMEZONE_CHANGED], 0, + old_zone, zone); } gboolean @@ -1856,7 +1884,7 @@ e_cal_model_set_compress_weekend (ECalModel *model, { g_return_if_fail (E_IS_CAL_MODEL (model)); - if ((model->priv->compress_weekend ? 1 : 0) == (compress_weekend ? 1 : 0)) + if (model->priv->compress_weekend == compress_weekend) return; model->priv->compress_weekend = compress_weekend; @@ -1958,7 +1986,7 @@ e_cal_model_set_use_default_reminder (ECalModel *model, { g_return_if_fail (E_IS_CAL_MODEL (model)); - if ((model->priv->use_default_reminder ? 1 : 0) == (use_default_reminder ? 1 : 0)) + if (model->priv->use_default_reminder == use_default_reminder) return; model->priv->use_default_reminder = use_default_reminder; @@ -2272,7 +2300,7 @@ remove_all_for_id_and_client (ECalModel *model, continue; list = g_slist_append (list, comp_data); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, list); + g_signal_emit (model, signals[COMPS_DELETED], 0, list); g_slist_free (list); g_object_unref (comp_data); @@ -2595,7 +2623,7 @@ process_removed (ECalClientView *view, continue; l = g_slist_append (l, comp_data); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, l); + g_signal_emit (model, signals[COMPS_DELETED], 0, l); g_slist_free (l); g_object_unref (comp_data); @@ -2776,8 +2804,9 @@ client_view_complete_cb (ECalClientView *view, g_return_if_fail (E_IS_CAL_MODEL (model)); - g_signal_emit (G_OBJECT (model), signals[CAL_VIEW_COMPLETE], 0, error, - e_cal_client_get_source_type (client)); + g_signal_emit ( + model, signals[CAL_VIEW_COMPLETE], 0, error, + e_cal_client_get_source_type (client)); } struct get_view_data @@ -2815,25 +2844,29 @@ get_view_cb (GObject *source_object, g_return_if_fail (gvd->model != NULL); g_return_if_fail (gvd->client_data != NULL); - if (!e_cal_client_get_view_finish (E_CAL_CLIENT (source_object), result, &view, &error)) { - if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || - g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { - g_clear_error (&error); + e_cal_client_get_view_finish ( + E_CAL_CLIENT (source_object), result, &view, &error); - free_get_view_data (gvd); - return; - } + if (g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED) || + g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) { + free_get_view_data (gvd); + g_error_free (error); + return; + } + if (error != NULL) { if (gvd->tries < 10) { - g_clear_error (&error); gvd->tries++; g_timeout_add (500, retry_get_view_timeout_cb, gvd); + g_error_free (error); return; } - g_debug ("%s: Failed to get view: %s", G_STRFUNC, error ? error->message : "Unknown error"); + g_warning ( + "%s: Failed to get view: %s", + G_STRFUNC, error->message); + g_error_free (error); - g_clear_error (&error); } else { gvd->client_data->view = view; @@ -2855,8 +2888,10 @@ get_view_cb (GObject *source_object, e_cal_client_view_start (gvd->client_data->view, &error); - if (error) { - g_debug ("%s: Failed to start view: %s", G_STRFUNC, error->message); + if (error != NULL) { + g_warning ( + "%s: Failed to start view: %s", + G_STRFUNC, error->message); g_error_free (error); } } @@ -2894,8 +2929,9 @@ update_e_cal_view_for_client (ECalModel *model, /* free the previous view, if any */ if (client_data->view) { - g_signal_handlers_disconnect_matched (client_data->view, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, model); + g_signal_handlers_disconnect_matched ( + client_data->view, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, model); g_object_unref (client_data->view); client_data->view = NULL; } @@ -3154,7 +3190,7 @@ remove_client_objects (ECalModel *model, g_ptr_array_remove (model->priv->objects, comp_data); l = g_slist_append (l, comp_data); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, l); + g_signal_emit (model, signals[COMPS_DELETED], 0, l); g_slist_free (l); g_object_unref (comp_data); @@ -3285,7 +3321,7 @@ cleanup_content_cb (gpointer user_data) slist = get_objects_as_list (model); g_ptr_array_set_size (priv->objects, 0); - g_signal_emit (G_OBJECT (model), signals[COMPS_DELETED], 0, slist); + g_signal_emit (model, signals[COMPS_DELETED], 0, slist); e_table_model_rows_deleted (E_TABLE_MODEL (model), 0, len); @@ -3323,12 +3359,13 @@ redo_queries (ECalModel *model) if (priv->search_sexp) { priv->full_sexp = g_strdup_printf ( - "(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", - iso_start, iso_end, default_tzloc, - priv->search_sexp ? priv->search_sexp : ""); + "(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", + iso_start, iso_end, default_tzloc, + priv->search_sexp ? priv->search_sexp : ""); } else { - priv->full_sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", - iso_start, iso_end, default_tzloc); + priv->full_sexp = g_strdup_printf ( + "(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", + iso_start, iso_end, default_tzloc); } g_free (iso_start); @@ -3402,7 +3439,7 @@ e_cal_model_set_time_range (ECalModel *model, priv->start = start; priv->end = end; - g_signal_emit (G_OBJECT (model), signals[TIME_RANGE_CHANGED], 0, start, end); + g_signal_emit (model, signals[TIME_RANGE_CHANGED], 0, start, end); redo_queries (model); } @@ -3478,7 +3515,7 @@ e_cal_model_set_search_query_with_time_range (ECalModel *model, priv->end = end; do_query = TRUE; - g_signal_emit (G_OBJECT (model), signals[TIME_RANGE_CHANGED], 0, start, end); + g_signal_emit (model, signals[TIME_RANGE_CHANGED], 0, start, end); } if (do_query) @@ -3672,11 +3709,11 @@ e_cal_model_get_rgb_color_for_component (ECalModel *model, if (color && gdk_color_parse (color, &gdk_color)) { if (red) - *red = ((double) gdk_color.red)/0xffff; + *red = ((gdouble) gdk_color.red)/0xffff; if (green) - *green = ((double) gdk_color.green)/0xffff; + *green = ((gdouble) gdk_color.green)/0xffff; if (blue) - *blue = ((double) gdk_color.blue)/0xffff; + *blue = ((gdouble) gdk_color.blue)/0xffff; return TRUE; } diff --git a/calendar/gui/e-calendar-view.c b/calendar/gui/e-calendar-view.c index a2eb33cacd..88f8abc86c 100644 --- a/calendar/gui/e-calendar-view.c +++ b/calendar/gui/e-calendar-view.c @@ -240,7 +240,8 @@ calendar_view_delete_event (ECalendarView *cal_view, } rid = e_cal_component_get_recurid_as_string (comp); if (e_cal_util_component_is_instance (event->comp_data->icalcomp) || e_cal_util_component_has_recurrences (event->comp_data->icalcomp)) - e_cal_client_remove_object_sync (event->comp_data->client, uid, + e_cal_client_remove_object_sync ( + event->comp_data->client, uid, rid, CALOBJ_MOD_ALL, NULL, &error); else e_cal_client_remove_object_sync (event->comp_data->client, uid, NULL, CALOBJ_MOD_THIS, NULL, &error); @@ -1191,8 +1192,9 @@ e_calendar_view_set_timezone (ECalendarView *cal_view, return; e_cal_model_set_timezone (cal_view->priv->model, zone); - g_signal_emit (G_OBJECT (cal_view), signals[TIMEZONE_CHANGED], 0, - old_zone, zone); + g_signal_emit ( + cal_view, signals[TIMEZONE_CHANGED], 0, + old_zone, zone); } const gchar * @@ -1445,8 +1447,9 @@ 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, - TRUE, zone ? zone : icaltimezone_get_utc_timezone ()); + 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_client_modify_object_sync (event->comp_data->client, event->comp_data->icalcomp, CALOBJ_MOD_THIS, NULL, &error); } @@ -1583,8 +1586,8 @@ e_calendar_view_new_appointment_for (ECalendarView *cal_view, flags |= COMP_EDITOR_USER_ORG; } - e_calendar_view_open_event_with_flags (cal_view, default_client, - icalcomp, flags); + e_calendar_view_open_event_with_flags ( + cal_view, default_client, icalcomp, flags); g_object_unref (comp); } @@ -1780,7 +1783,11 @@ e_calendar_view_modify_and_send (ECalendarView *cal_view, e_cal_component_commit_sequence (comp); - if (e_cal_client_modify_object_sync (client, e_cal_component_get_icalcomponent (comp), mod, NULL, &error)) { + e_cal_client_modify_object_sync ( + client, e_cal_component_get_icalcomponent (comp), + mod, NULL, &error); + + if (error == NULL) { gboolean strip_alarms = TRUE; if ((itip_organizer_is_user (registry, comp, client) || @@ -1816,10 +1823,11 @@ e_calendar_view_modify_and_send (ECalendarView *cal_view, g_object_unref (send_comp); } } else { - g_message (G_STRLOC ": Could not update the object! %s", error ? error->message : "Unknown error"); + g_message ( + G_STRLOC ": Could not update the object! %s", + error->message); - if (error) - g_error_free (error); + g_error_free (error); } } diff --git a/calendar/gui/e-cell-date-edit-text.c b/calendar/gui/e-cell-date-edit-text.c index d6c2a32ca2..3076c537a0 100644 --- a/calendar/gui/e-cell-date-edit-text.c +++ b/calendar/gui/e-cell-date-edit-text.c @@ -334,7 +334,7 @@ e_cell_date_edit_text_set_use_24_hour_format (ECellDateEditText *ecd, { g_return_if_fail (E_IS_CELL_DATE_EDIT_TEXT (ecd)); - if ((ecd->priv->use_24_hour_format ? 1 : 0) == (use_24_hour ? 1 : 0)) + if (ecd->priv->use_24_hour_format == use_24_hour) return; ecd->priv->use_24_hour_format = use_24_hour; diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c index 4ca04a3f16..22e42fd964 100644 --- a/calendar/gui/e-date-time-list.c +++ b/calendar/gui/e-date-time-list.c @@ -171,9 +171,10 @@ get_exception_string (EDateTimeList *date_time_list, tmp_tm.tm_sec = dt->value->second; tmp_tm.tm_isdst = -1; - tmp_tm.tm_wday = time_day_of_week (dt->value->day, - dt->value->month - 1, - dt->value->year); + tmp_tm.tm_wday = time_day_of_week ( + dt->value->day, + dt->value->month - 1, + dt->value->year); e_time_format_date_and_time ( &tmp_tm, use_24_hour_format, @@ -525,7 +526,7 @@ e_date_time_list_set_use_24_hour_format (EDateTimeList *date_time_list, { g_return_if_fail (E_IS_DATE_TIME_LIST (date_time_list)); - if ((date_time_list->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (date_time_list->use_24_hour_format == use_24_hour_format) return; date_time_list->use_24_hour_format = use_24_hour_format; diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c index d1957b95e7..573a3b3ccd 100644 --- a/calendar/gui/e-day-view-layout.c +++ b/calendar/gui/e-day-view-layout.c @@ -78,9 +78,10 @@ e_day_view_layout_long_events (GArray *events, * them in the first free row available. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); - e_day_view_layout_long_event (event, grid, - days_shown, day_starts, - rows_in_top_display); + e_day_view_layout_long_event ( + event, grid, + days_shown, day_starts, + rows_in_top_display); } /* Free the grid. */ @@ -170,8 +171,9 @@ e_day_view_layout_day_events (GArray *events, for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); - e_day_view_layout_day_event (event, grid, group_starts, - cols_per_row, rows, mins_per_row, max_cols); + e_day_view_layout_day_event ( + event, grid, group_starts, + cols_per_row, rows, mins_per_row, max_cols); } /* Recalculate the number of columns needed in each row. */ @@ -181,8 +183,9 @@ e_day_view_layout_day_events (GArray *events, * if there is enough space. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EDayViewEvent, event_num); - e_day_view_expand_day_event (event, grid, cols_per_row, - mins_per_row); + e_day_view_expand_day_event ( + event, grid, cols_per_row, + mins_per_row); } /* Free the grid and compute maximum number of columns used. */ diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 32021b670a..61e238eaa4 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -238,14 +238,15 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (!can_draw_in_region (draw_region, item_x, item_y, item_w, item_h)) return; - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); if (!is_array_index_in_bounds (day_view->events[day], event_num)) return; - event = &g_array_index (day_view->events[day], EDayViewEvent, - event_num); + event = &g_array_index ( + day_view->events[day], EDayViewEvent, event_num); if (!is_comp_data_valid (event)) return; @@ -281,8 +282,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (MAX (0, item_w - 31.5) != 0) { /* Vertical Line */ cairo_save (cr); - pat = cairo_pattern_create_linear (item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 6.5, item_y + 13.75, - item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 13.75, item_y + 13.75); + pat = cairo_pattern_create_linear ( + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 6.5, item_y + 13.75, + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 13.75, item_y + 13.75); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); cairo_pattern_add_color_stop_rgba (pat, 0.7, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); @@ -292,8 +294,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_pattern_destroy (pat); /* 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); + 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); cairo_pattern_add_color_stop_rgba (pat, 0.25, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); @@ -309,8 +312,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_stroke (cr); /* Horizontal line */ - pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h, - item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h + 7); + pat = cairo_pattern_create_linear ( + item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h, + item_x + E_DAY_VIEW_BAR_WIDTH + 15, item_y + item_h + 7); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); cairo_pattern_add_color_stop_rgba (pat, 0.7, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); @@ -320,8 +324,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_pattern_destroy (pat); /* Bottom arc */ - pat = cairo_pattern_create_radial (item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 5.0, - item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 12.0); + pat = cairo_pattern_create_radial ( + item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 5.0, + item_x + E_DAY_VIEW_BAR_WIDTH + 12.5, item_y + item_h - 5, 12.0); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); cairo_pattern_add_color_stop_rgba (pat, 0.7, 0, 0, 0, 0.2); cairo_pattern_add_color_stop_rgba (pat, 0, 0, 0, 0, 1); @@ -341,7 +346,8 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_stroke (cr); /* Arc in middle */ - pat = cairo_pattern_create_radial (item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 1, item_y + item_h - 4.5, 1.0, + pat = cairo_pattern_create_radial ( + item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 1, item_y + item_h - 4.5, 1.0, item_x + item_w - E_DAY_VIEW_BAR_WIDTH + 1, item_y + item_h - 4.5, 12.0); cairo_pattern_add_color_stop_rgba (pat, 1, 1, 1, 1, 0.3); cairo_pattern_add_color_stop_rgba (pat, 0.8, 0, 0, 0, 0.2); @@ -393,7 +399,8 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, 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; @@ -475,8 +482,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (is_editing) short_event = TRUE; - pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 7.75, - item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + item_h - 7.75); + pat = cairo_pattern_create_linear ( + item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 7.75, + item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + item_h - 7.75); if (!short_event) { cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); cairo_pattern_add_color_stop_rgba (pat, 1 / (date_fraction + (rect_height / 18)), red / cc, green / cc, blue / cc, 0.8); @@ -497,16 +505,18 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, /* Draw the right edge of the vertical bar. */ cairo_save (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); + 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); cairo_line_to (cr, item_x + E_DAY_VIEW_BAR_WIDTH - 1, item_y + item_h - 2); cairo_stroke (cr); cairo_restore (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the vertical colored bar showing when the appointment * begins & ends. */ @@ -532,13 +542,15 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, end_hour = end_minute / 60; end_minute = end_minute % 60; - e_day_view_convert_time_to_display (day_view, end_hour, - &end_display_hour, - &end_resize_suffix, - &end_suffix_width); + e_day_view_convert_time_to_display ( + day_view, end_hour, + &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, + 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, item_h - 5.5); cairo_clip (cr); @@ -546,17 +558,19 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, if (e_cal_model_get_use_24_hour_format (model)) { cairo_translate (cr, item_x + item_w - E_DAY_VIEW_BAR_WIDTH - 32, item_y + item_h - 8); - end_regsizeime = g_strdup_printf ("%2i:%02i", - end_display_hour, end_minute); + end_regsizeime = 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_regsizeime = g_strdup_printf ("%2i:%02i%s", - end_display_hour, end_minute, - end_resize_suffix); + end_regsizeime = g_strdup_printf ( + "%2i:%02i%s", + end_display_hour, end_minute, + end_resize_suffix); } cairo_set_font_size (cr, 14); - if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7)) cairo_set_source_rgb (cr, 0, 0, 0); else cairo_set_source_rgb (cr, 1, 1, 1); @@ -578,14 +592,16 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, e_cal_component_get_transparency (comp, &transparency); if (transparency != E_CAL_COMPONENT_TRANSP_TRANSPARENT) { cairo_save (cr); - pat = cairo_pattern_create_linear (item_x + E_DAY_VIEW_BAR_WIDTH, item_y + 1, - item_x + E_DAY_VIEW_BAR_WIDTH, item_y + item_h - 1); + pat = cairo_pattern_create_linear ( + item_x + E_DAY_VIEW_BAR_WIDTH, item_y + 1, + item_x + E_DAY_VIEW_BAR_WIDTH, item_y + item_h - 1); cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.7); cairo_pattern_add_color_stop_rgba (pat, 0.5, red / cc, green / cc, blue / cc, 0.7); cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.2); - cairo_rectangle (cr, item_x + 1, bar_y1, - E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1); + cairo_rectangle ( + cr, item_x + 1, bar_y1, + E_DAY_VIEW_BAR_WIDTH - 2, bar_y2 - bar_y1); cairo_set_source (cr, pat); cairo_fill (cr); @@ -602,8 +618,9 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, } } - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); + gdk_cairo_set_source_color ( + cr, + &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR]); /* Draw the reminder & recurrence icons, if needed. */ if (!resize_flag && (!is_editing || text_x_offset > E_DAY_VIEW_ICON_X_PAD)) { @@ -734,14 +751,16 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, end_hour = end_minute / 60; end_minute = end_minute % 60; - e_day_view_convert_time_to_display (day_view, start_hour, - &start_display_hour, - &start_suffix, - &start_suffix_width); - e_day_view_convert_time_to_display (day_view, end_hour, - &end_display_hour, - &end_suffix, - &end_suffix_width); + e_day_view_convert_time_to_display ( + day_view, start_hour, + &start_display_hour, + &start_suffix, + &start_suffix_width); + e_day_view_convert_time_to_display ( + day_view, end_hour, + &end_display_hour, + &end_suffix, + &end_suffix_width); if (e_cal_model_get_use_24_hour_format (model)) { if (day_view->show_event_end_times && show_span) { @@ -776,7 +795,8 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, } cairo_save (cr); - cairo_rectangle (cr, item_x + E_DAY_VIEW_BAR_WIDTH + 1.75, item_y + 2.75, + 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, 14); @@ -790,7 +810,7 @@ day_view_main_item_draw_day_event (EDayViewMainItem *main_item, cairo_move_to (cr, item_x + E_DAY_VIEW_BAR_WIDTH + 10, item_y + 13); else cairo_move_to (cr, icon_x, item_y + 13); - if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7)) cairo_set_source_rgb (cr, 0, 0, 0); else cairo_set_source_rgb (cr, 1, 1, 1); @@ -1019,12 +1039,14 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, work_day_end_y = e_day_view_convert_time_to_position ( day_view, work_day_end_hour, work_day_end_minute) - y; - today_tt = icaltime_from_timet_with_zone (time (NULL), FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + today_tt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); for (day = 0; day < day_view->days_shown; day++) { - day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + 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); @@ -1111,7 +1133,8 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, 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; @@ -1137,13 +1160,15 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, continue; cairo_save (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_BG_GRID]); + 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); @@ -1152,8 +1177,9 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, 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_rectangle ( + cr, grid_x1 + 1, grid_y1, + E_DAY_VIEW_BAR_WIDTH - 2, grid_y2 - grid_y1); cairo_fill (cr); @@ -1184,8 +1210,9 @@ day_view_main_item_draw (GnomeCanvasItem *canvas_item, GdkColor mb_color; cairo_save (cr); - gdk_cairo_set_source_color (cr, - &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); + 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)) { gdk_cairo_set_source_color (cr, &mb_color); diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index 02600d0225..506292d80f 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -331,11 +331,13 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, short_line_x1 = 0; large_hour_x2 = 0; } else { - max_suffix_width = MAX (day_view->am_string_width, - day_view->pm_string_width); + max_suffix_width = MAX ( + day_view->am_string_width, + day_view->pm_string_width); - max_minute_or_suffix_width = MAX (max_suffix_width, - day_view->max_minute_width); + max_minute_or_suffix_width = MAX ( + max_suffix_width, + day_view->max_minute_width); /* The start of the short horizontal line between the periods * within each hour. */ @@ -367,9 +369,8 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, day_view->day_starts[0], 0, cal_zone); /* diff is number of minutes */ - diff = (icaltimezone_get_utc_offset (use_zone, &tt, NULL) - - icaltimezone_get_utc_offset (cal_zone, &tt, NULL) - ) / 60; + diff =(icaltimezone_get_utc_offset (use_zone, &tt, NULL) - + icaltimezone_get_utc_offset (cal_zone, &tt, NULL)) / 60; tt = icaltime_from_timet_with_zone (day_view->day_starts[0], 0, cal_zone); tt.is_date = FALSE; @@ -480,9 +481,10 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, /* Calculate the actual hour number to display. For 12-hour * format we convert 0-23 to 12-11am / 12 - 11pm. */ - e_day_view_convert_time_to_display (day_view, hour, - &display_hour, - &suffix, &suffix_width); + e_day_view_convert_time_to_display ( + day_view, hour, + &display_hour, + &suffix, &suffix_width); if (time_divisions == 60) { /* 60 minute intervals - draw a long horizontal line @@ -502,11 +504,13 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, strcat (buffer, " "); strcat (buffer, midnight_month); } else if (e_cal_model_get_use_24_hour_format (model)) { - g_snprintf (buffer, sizeof (buffer), "%i:%02i", - display_hour, minute); + g_snprintf ( + buffer, sizeof (buffer), "%i:%02i", + display_hour, minute); } else { - g_snprintf (buffer, sizeof (buffer), "%i %s", - display_hour, suffix); + g_snprintf ( + buffer, sizeof (buffer), "%i %s", + display_hour, suffix); } cairo_save (cr); @@ -538,8 +542,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, if (show_midnight_date) strcpy (buffer, midnight_day); else - g_snprintf (buffer, sizeof (buffer), "%i", - display_hour); + g_snprintf ( + buffer, sizeof (buffer), "%i", + display_hour); cairo_set_line_width (cr, 0.7); cairo_move_to (cr, long_line_x1, row_y); @@ -590,8 +595,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, && !e_cal_model_get_use_24_hour_format (model)) { strcpy (buffer, suffix); } else { - g_snprintf (buffer, sizeof (buffer), - "%02i", minute); + g_snprintf ( + buffer, sizeof (buffer), + "%02i", minute); } cairo_save (cr); @@ -616,8 +622,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, } } - e_day_view_time_item_increment_time (&hour, &minute, - time_divisions); + e_day_view_time_item_increment_time ( + &hour, &minute, + time_divisions); } pango_font_metrics_unref (large_font_metrics); @@ -695,8 +702,8 @@ e_day_view_time_item_event (GnomeCanvasItem *item, break; case GDK_BUTTON_RELEASE: if (event->button.button == 1) - e_day_view_time_item_on_button_release (time_item, - event); + e_day_view_time_item_on_button_release ( + time_item, event); break; case GDK_MOTION_NOTIFY: @@ -787,7 +794,7 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, * day view, e.g. a day is displayed in * 24 "60 minute divisions" or * 48 "30 minute divisions". */ - _("%02i minute divisions"), divisions[i]); + _("%02i minute divisions"), divisions[i]); item = gtk_radio_menu_item_new_with_label (group, buffer); group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item)); gtk_widget_show (item); @@ -871,8 +878,9 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, gtk_widget_show_all (submenu); - gtk_menu_popup (GTK_MENU (menu), NULL, NULL, NULL, NULL, - event->button.button, event->button.time); + gtk_menu_popup ( + GTK_MENU (menu), NULL, NULL, NULL, NULL, + event->button.button, event->button.time); } static void @@ -909,8 +917,9 @@ e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, canvas = GNOME_CANVAS_ITEM (time_item)->canvas; - row = e_day_view_time_item_convert_position_to_row (time_item, - event->button.y); + row = e_day_view_time_item_convert_position_to_row ( + time_item, + event->button.y); if (row == -1) return; @@ -968,8 +977,9 @@ e_day_view_time_item_on_motion_notify (EDayViewTimeItem *time_item, row = e_day_view_time_item_convert_position_to_row (time_item, y); if (row != -1) { - gnome_canvas_world_to_window (canvas, 0, event->motion.y, - NULL, &window_y); + gnome_canvas_world_to_window ( + canvas, 0, event->motion.y, + NULL, &window_y); e_day_view_update_selection (day_view, -1, row); e_day_view_check_auto_scroll (day_view, -1, (gint) window_y); } @@ -1056,18 +1066,21 @@ e_day_view_time_item_get_column_width (EDayViewTimeItem *time_item) g_object_unref (layout); - max_large_digit_width = MAX (max_large_digit_width, - large_digit_width); + max_large_digit_width = MAX ( + max_large_digit_width, + large_digit_width); } /* Calculate the width of each time column, using the maximum of the * default format with large hour numbers, and the 60-min divisions * format which uses small text. */ - max_suffix_width = MAX (day_view->am_string_width, - day_view->pm_string_width); + max_suffix_width = MAX ( + day_view->am_string_width, + day_view->pm_string_width); - max_minute_or_suffix_width = MAX (max_suffix_width, - day_view->max_minute_width); + max_minute_or_suffix_width = MAX ( + max_suffix_width, + day_view->max_minute_width); column_width_default = max_large_digit_width * 2 + max_minute_or_suffix_width diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 15cfc8079d..8d961ea6a5 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -248,8 +248,9 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, draw_curved_rectangle (cr, x0, y0, rect_width, rect_height, radius); - 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); + 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); cairo_pattern_add_color_stop_rgba (pat, 1, red / cc, green / cc, blue / cc, 0.8); cairo_pattern_add_color_stop_rgba (pat, 0, red / cc, green / cc, blue / cc, 0.4); cairo_set_source (cr, pat); @@ -318,22 +319,26 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, minute = offset % 60; /* Calculate the actual hour number to display. For 12-hour * format we convert 0-23 to 12-11am/12-11pm. */ - e_day_view_convert_time_to_display (day_view, hour, - &display_hour, - &suffix, &suffix_width); + e_day_view_convert_time_to_display ( + day_view, hour, + &display_hour, + &suffix, &suffix_width); if (e_cal_model_get_use_24_hour_format (model)) { - g_snprintf (buffer, sizeof (buffer), "%i:%02i", - display_hour, minute); + g_snprintf ( + buffer, sizeof (buffer), "%i:%02i", + display_hour, minute); } else { - g_snprintf (buffer, sizeof (buffer), "%i:%02i%s", - display_hour, minute, suffix); + g_snprintf ( + buffer, sizeof (buffer), "%i:%02i%s", + display_hour, minute, suffix); } cairo_save (cr); - cairo_rectangle (cr, - item_x - x, item_y - y, - item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH, item_h); + cairo_rectangle ( + cr, + item_x - x, item_y - y, + item_w - E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH, item_h); cairo_clip (cr); time_x = item_x + E_DAY_VIEW_LONG_EVENT_X_PAD - x; @@ -341,10 +346,11 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, time_x += day_view->digit_width; layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer); - cairo_move_to (cr, - time_x, - item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + - E_DAY_VIEW_LONG_EVENT_Y_PAD - y); + cairo_move_to ( + cr, + time_x, + item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + + E_DAY_VIEW_LONG_EVENT_Y_PAD - y); pango_cairo_show_layout (cr, layout); g_object_unref (layout); @@ -369,26 +375,30 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, if (time_x >= min_end_time_x) { /* Calculate the actual hour number to display. */ - e_day_view_convert_time_to_display (day_view, hour, - &display_hour, - &suffix, - &suffix_width); + e_day_view_convert_time_to_display ( + day_view, hour, + &display_hour, + &suffix, + &suffix_width); if (e_cal_model_get_use_24_hour_format (model)) { - g_snprintf (buffer, sizeof (buffer), - "%i:%02i", display_hour, minute); + g_snprintf ( + buffer, sizeof (buffer), + "%i:%02i", display_hour, minute); } else { - g_snprintf (buffer, sizeof (buffer), - "%i:%02i%s", display_hour, minute, - suffix); + g_snprintf ( + buffer, sizeof (buffer), + "%i:%02i%s", display_hour, minute, + suffix); } if (display_hour < 10) time_x += day_view->digit_width; layout = gtk_widget_create_pango_layout (GTK_WIDGET (day_view), buffer); - cairo_move_to (cr, - time_x, - item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD + 1 - y); + cairo_move_to ( + cr, + time_x, + item_y + E_DAY_VIEW_LONG_EVENT_Y_PAD + 1 - y); pango_cairo_show_layout (cr, layout); g_object_unref (layout); @@ -457,12 +467,14 @@ day_view_top_item_draw_long_event (EDayViewTopItem *top_item, continue; if (icon_x <= max_icon_x) { - gdk_cairo_set_source_pixbuf (cr, pixbuf, - icon_x, icon_y); - cairo_rectangle (cr, - icon_x, icon_y, - E_DAY_VIEW_ICON_WIDTH, - E_DAY_VIEW_ICON_HEIGHT); + gdk_cairo_set_source_pixbuf ( + cr, pixbuf, + icon_x, icon_y); + cairo_rectangle ( + cr, + icon_x, icon_y, + E_DAY_VIEW_ICON_WIDTH, + E_DAY_VIEW_ICON_HEIGHT); cairo_fill (cr); icon_x -= icon_x_inc; } @@ -616,9 +628,10 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, /* Draw the background for the dates. */ cairo_save (cr); gdk_cairo_set_source_color (cr, &bg); - cairo_rectangle (cr, left_edge + 2 - x, 2 - y, - canvas_width - left_edge - 3, - item_height - 3); + cairo_rectangle ( + cr, left_edge + 2 - x, 2 - y, + canvas_width - left_edge - 3, + item_height - 3); cairo_fill (cr); cairo_restore (cr); } @@ -628,9 +641,10 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); gdk_cairo_set_source_color ( cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS]); - cairo_rectangle (cr, left_edge - x, - y, - canvas_width - left_edge, - canvas_height); + cairo_rectangle ( + cr, left_edge - x, - y, + canvas_width - left_edge, + canvas_height); cairo_fill (cr); cairo_restore (cr); @@ -654,8 +668,9 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, gdk_cairo_set_source_color ( cr, &day_view->colors [E_DAY_VIEW_COLOR_BG_TOP_CANVAS_SELECTED]); - cairo_rectangle (cr, rect_x - x, rect_y - y, - rect_w, rect_h); + cairo_rectangle ( + cr, rect_x - x, rect_y - y, + rect_w, rect_h); cairo_fill (cr); cairo_restore (cr); } @@ -703,16 +718,20 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, if (day != 0) { cairo_save (cr); gdk_cairo_set_source_color (cr, &light); - cairo_move_to (cr, day_view->day_offsets[day] - x, - 4 - y); - cairo_line_to (cr, day_view->day_offsets[day] - x, - item_height - 4 - y); + cairo_move_to ( + cr, day_view->day_offsets[day] - x, + 4 - y); + cairo_line_to ( + cr, day_view->day_offsets[day] - x, + item_height - 4 - y); cairo_stroke (cr); gdk_cairo_set_source_color (cr, &dark); - cairo_move_to (cr, day_view->day_offsets[day] - 1 - x, - 4 - y); - cairo_line_to (cr, day_view->day_offsets[day] - 1 - x, - item_height - 4 - y); + cairo_move_to ( + cr, day_view->day_offsets[day] - 1 - x, + 4 - y); + cairo_line_to ( + cr, day_view->day_offsets[day] - 1 - x, + item_height - 4 - y); cairo_stroke (cr); cairo_restore (cr); } @@ -723,10 +742,12 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, gdk_cairo_set_source_color ( cr, &day_view->colors [E_DAY_VIEW_COLOR_BG_TOP_CANVAS_GRID]); - cairo_move_to (cr, day_view->day_offsets[day] - x, - item_height - y); - cairo_line_to (cr, day_view->day_offsets[day] - x, - canvas_height - y); + cairo_move_to ( + cr, day_view->day_offsets[day] - x, + item_height - y); + cairo_line_to ( + cr, day_view->day_offsets[day] - x, + canvas_height - y); cairo_stroke (cr); cairo_restore (cr); } @@ -883,7 +904,7 @@ e_day_view_top_item_set_show_dates (EDayViewTopItem *top_item, { g_return_if_fail (E_IS_DAY_VIEW_TOP_ITEM (top_item)); - if ((top_item->priv->show_dates ? 1 : 0) == (show_dates ? 1 : 0)) + if (top_item->priv->show_dates == show_dates) return; top_item->priv->show_dates = show_dates; diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index d6b3fbb05c..d029819d8a 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -926,8 +926,9 @@ timezone_changed_cb (ECalModel *cal_model, /* Recalculate the new start of the first day. We just use exactly * the same time, but with the new timezone. */ - tt = icaltime_from_timet_with_zone (day_view->lower, FALSE, - old_zone); + tt = icaltime_from_timet_with_zone ( + day_view->lower, FALSE, + old_zone); lower = icaltime_as_timet_with_zone (tt, new_zone); @@ -946,8 +947,9 @@ e_day_view_init (EDayView *day_view) gtk_widget_set_can_focus (GTK_WIDGET (day_view), TRUE); - day_view->long_events = g_array_new (FALSE, FALSE, - sizeof (EDayViewEvent)); + day_view->long_events = g_array_new ( + FALSE, FALSE, + sizeof (EDayViewEvent)); day_view->long_events_sorted = TRUE; day_view->long_events_need_layout = FALSE; day_view->long_events_need_reshape = FALSE; @@ -955,8 +957,9 @@ e_day_view_init (EDayView *day_view) day_view->layout_timeout_id = 0; for (day = 0; day < E_DAY_VIEW_MAX_DAYS; day++) { - day_view->events[day] = g_array_new (FALSE, FALSE, - sizeof (EDayViewEvent)); + day_view->events[day] = g_array_new ( + FALSE, FALSE, + sizeof (EDayViewEvent)); day_view->events_sorted[day] = TRUE; day_view->need_layout[day] = FALSE; day_view->need_reshape[day] = FALSE; @@ -1046,8 +1049,9 @@ e_day_view_init (EDayView *day_view) day_view->top_canvas = e_canvas_new (); gtk_box_pack_end (GTK_BOX (w), day_view->top_canvas, TRUE, TRUE, 0); - gtk_table_attach (GTK_TABLE (day_view), w, - 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), w, + 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show_all (w); g_signal_connect_after ( @@ -1085,47 +1089,52 @@ e_day_view_init (EDayView *day_view) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_dates_canvas)->root); day_view->top_dates_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_top_item_get_type (), - "EDayViewTopItem::day_view", day_view, - "EDayViewTopItem::show_dates", TRUE, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_top_item_get_type (), + "EDayViewTopItem::day_view", day_view, + "EDayViewTopItem::show_dates", TRUE, + NULL); gtk_widget_set_size_request (day_view->top_dates_canvas, -1, day_view->top_row_height); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root); day_view->top_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_top_item_get_type (), - "EDayViewTopItem::day_view", day_view, - "EDayViewTopItem::show_dates", FALSE, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_top_item_get_type (), + "EDayViewTopItem::day_view", day_view, + "EDayViewTopItem::show_dates", FALSE, + NULL); day_view->drag_long_event_rect_item = - gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), - "line_width", 1.0, - NULL); + gnome_canvas_item_new ( + canvas_group, + gnome_canvas_rect_get_type (), + "line_width", 1.0, + NULL); gnome_canvas_item_hide (day_view->drag_long_event_rect_item); day_view->drag_long_event_item = - gnome_canvas_item_new (canvas_group, - e_text_get_type (), - "line_wrap", TRUE, - "clip", TRUE, - "max_lines", 1, - "editable", TRUE, - "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), - NULL); + gnome_canvas_item_new ( + canvas_group, + e_text_get_type (), + "line_wrap", TRUE, + "clip", TRUE, + "max_lines", 1, + "editable", TRUE, + "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), + NULL); gnome_canvas_item_hide (day_view->drag_long_event_item); /* * Main Canvas */ day_view->main_canvas = e_canvas_new (); - gtk_table_attach (GTK_TABLE (day_view), day_view->main_canvas, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->main_canvas, + 1, 2, 1, 2, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (day_view->main_canvas); g_signal_connect ( day_view->main_canvas, "realize", @@ -1167,33 +1176,37 @@ e_day_view_init (EDayView *day_view) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root); day_view->main_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_main_item_get_type (), - "EDayViewMainItem::day_view", day_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_main_item_get_type (), + "EDayViewMainItem::day_view", day_view, + NULL); day_view->drag_rect_item = - gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), - "line_width", 1.0, - NULL); + gnome_canvas_item_new ( + canvas_group, + gnome_canvas_rect_get_type (), + "line_width", 1.0, + NULL); gnome_canvas_item_hide (day_view->drag_rect_item); day_view->drag_bar_item = - gnome_canvas_item_new (canvas_group, - gnome_canvas_rect_get_type (), - "line_width", 1.0, - NULL); + gnome_canvas_item_new ( + canvas_group, + gnome_canvas_rect_get_type (), + "line_width", 1.0, + NULL); gnome_canvas_item_hide (day_view->drag_bar_item); day_view->drag_item = - gnome_canvas_item_new (canvas_group, - e_text_get_type (), - "line_wrap", TRUE, - "clip", TRUE, - "editable", TRUE, - "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), - NULL); + gnome_canvas_item_new ( + canvas_group, + e_text_get_type (), + "line_wrap", TRUE, + "clip", TRUE, + "editable", TRUE, + "fill_color_rgba", GNOME_CANVAS_COLOR (0, 0, 0), + NULL); gnome_canvas_item_hide (day_view->drag_item); /* @@ -1204,9 +1217,10 @@ e_day_view_init (EDayView *day_view) adjustment = gtk_scrollable_get_vadjustment (scrollable); scrollable = GTK_SCROLLABLE (day_view->time_canvas); gtk_scrollable_set_vadjustment (scrollable, adjustment); - gtk_table_attach (GTK_TABLE (day_view), day_view->time_canvas, - 0, 1, 1, 2, - GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->time_canvas, + 0, 1, 1, 2, + GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (day_view->time_canvas); g_signal_connect_after ( day_view->time_canvas, "scroll_event", @@ -1215,10 +1229,11 @@ e_day_view_init (EDayView *day_view) canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->time_canvas)->root); day_view->time_canvas_item = - gnome_canvas_item_new (canvas_group, - e_day_view_time_item_get_type (), - "EDayViewTimeItem::day_view", day_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_day_view_time_item_get_type (), + "EDayViewTimeItem::day_view", day_view, + NULL); /* * Scrollbar. @@ -1232,15 +1247,17 @@ e_day_view_init (EDayView *day_view) scrollable = GTK_SCROLLABLE (day_view->top_canvas); adjustment = gtk_scrollable_get_vadjustment (scrollable); day_view->tc_vscrollbar = gtk_vscrollbar_new (adjustment); - gtk_table_attach (GTK_TABLE (day_view), day_view->tc_vscrollbar, - 2, 3, 0, 1, 0, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->tc_vscrollbar, + 2, 3, 0, 1, 0, GTK_FILL, 0, 0); /* gtk_widget_show (day_view->tc_vscrollbar); */ scrollable = GTK_SCROLLABLE (day_view->main_canvas); adjustment = gtk_scrollable_get_vadjustment (scrollable); day_view->vscrollbar = gtk_vscrollbar_new (adjustment); - gtk_table_attach (GTK_TABLE (day_view), day_view->vscrollbar, - 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (day_view), day_view->vscrollbar, + 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (day_view->vscrollbar); /* Create the cursors. */ @@ -1403,20 +1420,23 @@ e_day_view_realize (GtkWidget *widget) day_view->attach_icon = e_icon_factory_get_icon ("mail-attachment", GTK_ICON_SIZE_MENU); /* Set the canvas item colors. */ - gnome_canvas_item_set (day_view->drag_long_event_rect_item, - "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], - "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], - NULL); + gnome_canvas_item_set ( + day_view->drag_long_event_rect_item, + "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], + "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], + NULL); - gnome_canvas_item_set (day_view->drag_rect_item, - "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], - "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], - NULL); + gnome_canvas_item_set ( + day_view->drag_rect_item, + "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BACKGROUND], + "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], + NULL); - gnome_canvas_item_set (day_view->drag_bar_item, - "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR], - "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], - NULL); + gnome_canvas_item_set ( + day_view->drag_bar_item, + "fill_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_VBAR], + "outline_color_gdk", &day_view->colors[E_DAY_VIEW_COLOR_EVENT_BORDER], + NULL); } static void @@ -1489,7 +1509,7 @@ e_day_view_get_text_color (EDayView *day_view, style = gtk_widget_get_style (widget); - if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7)) return style->black; else return style->white; @@ -1516,14 +1536,16 @@ e_day_view_update_top_scroll (EDayView *day_view, } /* Set the scroll region of the top canvas */ - gnome_canvas_get_scroll_region (GNOME_CANVAS (day_view->top_canvas), - NULL, NULL, &old_x2, &old_y2); + gnome_canvas_get_scroll_region ( + GNOME_CANVAS (day_view->top_canvas), + NULL, NULL, &old_x2, &old_y2); gtk_widget_get_allocation (day_view->top_canvas, &allocation); new_x2 = allocation.width - 1; new_y2 = (MAX (1, day_view->rows_in_top_display) + 1) * day_view->top_row_height - 1; if (old_x2 != new_x2 || old_y2 != new_y2) { - gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->top_canvas), - 0, 0, new_x2, new_y2); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (day_view->top_canvas), + 0, 0, new_x2, new_y2); if (scroll_to_top) gnome_canvas_scroll_to (GNOME_CANVAS (day_view->top_canvas), 0, 0); @@ -1570,9 +1592,10 @@ e_day_view_style_set (GtkWidget *widget, event = &g_array_index (day_view->events[week_day], EDayViewEvent, event_num); if (event->canvas_item) { color = e_day_view_get_text_color (day_view, event, widget); - gnome_canvas_item_set (event->canvas_item, - "fill_color_gdk", &color, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "fill_color_gdk", &color, + NULL); } } } @@ -1580,17 +1603,19 @@ e_day_view_style_set (GtkWidget *widget, event = &g_array_index (day_view->long_events, EDayViewEvent, event_num); if (event->canvas_item) { color = e_day_view_get_text_color (day_view, event, widget); - gnome_canvas_item_set (event->canvas_item, - "fill_color_gdk", &color, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "fill_color_gdk", &color, + NULL); } } /* Set up Pango prerequisites */ font_desc = gtk_widget_get_style (widget)->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); /* Create the large font. */ @@ -1598,24 +1623,26 @@ e_day_view_style_set (GtkWidget *widget, 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); + 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); day_view->small_font_desc = pango_font_description_copy (font_desc); - pango_font_description_set_size (day_view->small_font_desc, - E_DAY_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); + pango_font_description_set_size ( + day_view->small_font_desc, + E_DAY_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); /* Recalculate the height of each row based on the font size. */ day_view->row_height = PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics)) + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD * 2 + 2 /* FIXME */; - day_view->row_height = - MAX (day_view->row_height, + day_view->row_height = MAX ( + day_view->row_height, E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2); adjustment = gtk_scrollable_get_vadjustment (GTK_SCROLLABLE (day_view->main_canvas)); @@ -1627,7 +1654,8 @@ e_day_view_style_set (GtkWidget *widget, E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT * 2 + E_DAY_VIEW_LONG_EVENT_Y_PAD * 2 + E_DAY_VIEW_TOP_CANVAS_Y_GAP; day_view->top_row_height = - MAX (day_view->top_row_height, + MAX ( + day_view->top_row_height, E_DAY_VIEW_ICON_HEIGHT + E_DAY_VIEW_ICON_Y_PAD + 2 + E_DAY_VIEW_TOP_CANVAS_Y_GAP); @@ -1748,8 +1776,8 @@ e_day_view_recalc_main_canvas_size (EDayView *day_view) if (day_view->scroll_to_work_day) { scroll_y = e_day_view_convert_time_to_position ( day_view, work_day_start_hour, work_day_start_minute); - gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), - 0, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (day_view->main_canvas), 0, scroll_y); day_view->scroll_to_work_day = FALSE; } @@ -2030,8 +2058,9 @@ e_day_view_remove_event_cb (EDayView *day_view, EDayViewEvent *event; #if 0 - g_print ("In e_day_view_remove_event_cb day:%i event_num:%i\n", - day, event_num); + g_print ( + "In e_day_view_remove_event_cb day:%i event_num:%i\n", + day, event_num); #endif if (day == E_DAY_VIEW_LONG_EVENT) { @@ -2185,9 +2214,10 @@ e_day_view_update_event_label (EDayView *day_view, } } - gnome_canvas_item_set (event->canvas_item, - "text", text, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "text", text, + NULL); if (e_client_check_capability (E_CLIENT (event->comp_data->client), CAL_STATIC_CAPABILITY_HAS_UNACCEPTED_MEETING) && e_cal_util_component_has_attendee (event->comp_data->icalcomp)) @@ -2225,9 +2255,10 @@ e_day_view_update_long_event_label (EDayView *day_view, summary = e_calendar_view_get_icalcomponent_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); - gnome_canvas_item_set (event->canvas_item, - "text", summary ? summary : "", - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "text", summary ? summary : "", + NULL); if (free_text) g_free ((gchar *) summary); @@ -2364,14 +2395,16 @@ e_day_view_set_selected_time_range_in_top_visible (EDayView *day_view, g_return_if_fail (E_IS_DAY_VIEW (day_view)); /* Set the selection. */ - start_in_grid = e_day_view_convert_time_to_grid_position (day_view, - start_time, - &start_col, - &start_row); - end_in_grid = e_day_view_convert_time_to_grid_position (day_view, - end_time - 60, - &end_col, - &end_row); + start_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + start_time, + &start_col, + &start_row); + end_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + end_time - 60, + &end_col, + &end_row); if (!start_in_grid) start_col = 0; @@ -2419,11 +2452,13 @@ e_day_view_set_selected_time_range_visible (EDayView *day_view, work_day_start_minute = e_cal_model_get_work_day_start_minute (model); /* Set the selection. */ - start_in_grid = e_day_view_convert_time_to_grid_position (day_view, - start_time, - &start_col, - &start_row); - end_in_grid = e_day_view_convert_time_to_grid_position (day_view, + start_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + start_time, + &start_col, + &start_row); + end_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, end_time - 60, &end_col, &end_row); @@ -2539,14 +2574,16 @@ e_day_view_set_selected_time_range (ECalendarView *cal_view, end_time += e_calendar_view_get_time_divisions (cal_view) * 60; /* Set the selection. */ - start_in_grid = e_day_view_convert_time_to_grid_position (day_view, - start_time, - &start_col, - &start_row); - end_in_grid = e_day_view_convert_time_to_grid_position (day_view, - end_time - 60, - &end_col, - &end_row); + start_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + start_time, + &start_col, + &start_row); + end_in_grid = e_day_view_convert_time_to_grid_position ( + day_view, + end_time - 60, + &end_col, + &end_row); /* If either of the times isn't in the grid, or the selection covers * an entire day, we set the selection to 1 row from the start of the @@ -2830,7 +2867,7 @@ e_day_view_marcus_bains_set_show_line (EDayView *day_view, { g_return_if_fail (E_IS_DAY_VIEW (day_view)); - if ((day_view->marcus_bains_show_line ? 1 : 0) == (show_line ? 1 : 0)) + if (day_view->marcus_bains_show_line == show_line) return; day_view->marcus_bains_show_line = show_line; @@ -2973,8 +3010,9 @@ e_day_view_update_scroll_regions (EDayView *day_view) GNOME_CANVAS (day_view->time_canvas), NULL, NULL, &old_x2, &old_y2); new_x2 = time_canvas_allocation.width - 1; - new_y2 = MAX (day_view->rows * day_view->row_height, - main_canvas_allocation.height) - 1; + new_y2 = MAX ( + day_view->rows * day_view->row_height, + main_canvas_allocation.height) - 1; if (old_x2 != new_x2 || old_y2 != new_y2) gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->time_canvas), 0, 0, new_x2, new_y2); @@ -2991,8 +3029,9 @@ e_day_view_update_scroll_regions (EDayView *day_view) if (old_x2 != new_x2 || old_y2 != new_y2) { need_reshape = TRUE; - gnome_canvas_set_scroll_region (GNOME_CANVAS (day_view->main_canvas), - 0, 0, new_x2, new_y2); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (day_view->main_canvas), + 0, 0, new_x2, new_y2); } if (new_x2 <= main_canvas_allocation.width - 1) @@ -3093,19 +3132,21 @@ e_day_view_on_top_canvas_button_press (GtkWidget *widget, day_view, (GdkEvent *) event, window, &event_x, &event_y)) return FALSE; - pos = e_day_view_convert_position_in_top_canvas (day_view, - event_x, event_y, - &day, &event_num); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + event_x, event_y, + &day, &event_num); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return FALSE; if (pos != E_CALENDAR_VIEW_POS_NONE) - return e_day_view_on_long_event_button_press (day_view, - event_num, - event, pos, - event_x, - event_y); + return e_day_view_on_long_event_button_press ( + day_view, + event_num, + event, pos, + event_x, + event_y); e_day_view_stop_editing_event (day_view); @@ -3233,18 +3274,20 @@ e_day_view_on_main_canvas_button_press (GtkWidget *widget, return FALSE; /* Find out where the mouse is. */ - pos = e_day_view_convert_position_in_main_canvas (day_view, - event_x, event_y, - &day, &row, - &event_num); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + event_x, event_y, + &day, &row, + &event_num); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return FALSE; if (pos != E_CALENDAR_VIEW_POS_NONE) - return e_day_view_on_event_button_press (day_view, day, - event_num, event, pos, - event_x, event_y); + return e_day_view_on_event_button_press ( + day_view, day, + event_num, event, pos, + event_x, event_y); e_day_view_stop_editing_event (day_view); @@ -3393,13 +3436,15 @@ e_day_view_on_long_event_button_press (EDayView *day_view, { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { - e_day_view_on_long_event_click (day_view, event_num, - event, pos, - event_x, event_y); + e_day_view_on_long_event_click ( + day_view, event_num, + event, pos, + event_x, event_y); return TRUE; } else if (event->type == GDK_2BUTTON_PRESS) { - e_day_view_on_event_double_click (day_view, -1, - event_num); + e_day_view_on_event_double_click ( + day_view, -1, + event_num); g_signal_stop_emission_by_name (day_view->top_canvas, "button_press_event"); return TRUE; } @@ -3413,9 +3458,10 @@ e_day_view_on_long_event_button_press (EDayView *day_view, 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); + e_day_view_on_event_right_click ( + day_view, event, + E_DAY_VIEW_LONG_EVENT, + event_num); return TRUE; } @@ -3433,13 +3479,15 @@ e_day_view_on_event_button_press (EDayView *day_view, { if (event->button == 1) { if (event->type == GDK_BUTTON_PRESS) { - e_day_view_on_event_click (day_view, day, event_num, - event, pos, - event_x, event_y); + e_day_view_on_event_click ( + day_view, day, event_num, + event, pos, + event_x, event_y); return TRUE; } else if (event->type == GDK_2BUTTON_PRESS) { - e_day_view_on_event_double_click (day_view, day, - event_num); + e_day_view_on_event_double_click ( + day_view, day, + event_num); g_signal_stop_emission_by_name (day_view->main_canvas, "button_press_event"); return TRUE; @@ -3454,8 +3502,9 @@ e_day_view_on_event_button_press (EDayView *day_view, 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); + e_day_view_on_event_right_click ( + day_view, event, + day, event_num); return TRUE; } @@ -3536,9 +3585,10 @@ e_day_view_on_long_event_click (EDayView *day_view, day_view->drag_event_x = event_x; day_view->drag_event_y = event_y; - e_day_view_convert_position_in_top_canvas (day_view, - event_x, event_y, - &day, NULL); + e_day_view_convert_position_in_top_canvas ( + day_view, + event_x, event_y, + &day, NULL); day_view->drag_event_offset = day - start_day; } } @@ -3625,10 +3675,11 @@ e_day_view_on_event_click (EDayView *day_view, day_view->drag_event_x = event_x; day_view->drag_event_y = event_y; - e_day_view_convert_position_in_main_canvas (day_view, - event_x, event_y, - &tmp_day, &row, - NULL); + e_day_view_convert_position_in_main_canvas ( + day_view, + event_x, event_y, + &tmp_day, &row, + NULL); start_row = event->start_minute / time_divisions; day_view->drag_event_offset = row - start_row; } @@ -3679,9 +3730,10 @@ static gboolean e_day_view_popup_menu (GtkWidget *widget) { EDayView *day_view = E_DAY_VIEW (widget); - e_day_view_show_popup_menu (day_view, NULL, - day_view->editing_event_day, - day_view->editing_event_num); + e_day_view_show_popup_menu ( + day_view, NULL, + day_view->editing_event_day, + day_view->editing_event_num); return TRUE; } @@ -3788,10 +3840,11 @@ e_day_view_on_top_canvas_button_release (GtkWidget *widget, gdk_pointer_ungrab (event->time); e_day_view_finish_long_event_resize (day_view); } else if (day_view->pressed_event_day != -1) { - e_day_view_start_editing_event (day_view, - day_view->pressed_event_day, - day_view->pressed_event_num, - NULL); + e_day_view_start_editing_event ( + day_view, + day_view->pressed_event_day, + day_view->pressed_event_num, + NULL); } day_view->pressed_event_day = -1; @@ -3817,7 +3870,8 @@ e_day_view_on_main_canvas_button_release (GtkWidget *widget, e_day_view_finish_resize (day_view); e_day_view_stop_auto_scroll (day_view); } else if (day_view->pressed_event_day != -1) { - e_day_view_start_editing_event (day_view, + e_day_view_start_editing_event ( + day_view, day_view->pressed_event_day, day_view->pressed_event_num, NULL); @@ -3876,9 +3930,10 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, canvas_x = event_x; canvas_y = event_y; - pos = e_day_view_convert_position_in_top_canvas (day_view, - canvas_x, canvas_y, - &day, &event_num); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + canvas_x, canvas_y, + &day, &event_num); if (event_num != -1) { if (!is_array_index_in_bounds (day_view->long_events, event_num)) return FALSE; @@ -3925,9 +3980,10 @@ e_day_view_on_top_canvas_motion (GtkWidget *widget, target_list = gtk_target_list_new ( target_table, G_N_ELEMENTS (target_table)); e_target_list_add_calendar_targets (target_list, 0); - gtk_drag_begin (widget, target_list, - GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent *) mevent); + gtk_drag_begin ( + widget, target_list, + GDK_ACTION_COPY | GDK_ACTION_MOVE, + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -3990,10 +4046,11 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, canvas_x = event_x; canvas_y = event_y; - pos = e_day_view_convert_position_in_main_canvas (day_view, - canvas_x, canvas_y, - &day, &row, - &event_num); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + canvas_x, canvas_y, + &day, &row, + &event_num); if (event_num != -1) { if (!is_array_index_in_bounds (day_view->events[day], event_num)) return FALSE; @@ -4005,15 +4062,17 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, if (day_view->selection_is_being_dragged) { if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { e_day_view_update_selection (day_view, day, row); - e_day_view_check_auto_scroll (day_view, - event_x, event_y); + e_day_view_check_auto_scroll ( + day_view, + event_x, event_y); return TRUE; } } else if (day_view->resize_drag_pos != E_CALENDAR_VIEW_POS_NONE) { if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { e_day_view_update_resize (day_view, row); - e_day_view_check_auto_scroll (day_view, - event_x, event_y); + e_day_view_check_auto_scroll ( + day_view, + event_x, event_y); return TRUE; } } else if (day_view->pressed_event_day != -1 @@ -4037,9 +4096,10 @@ e_day_view_on_main_canvas_motion (GtkWidget *widget, target_list = gtk_target_list_new ( target_table, G_N_ELEMENTS (target_table)); e_target_list_add_calendar_targets (target_list, 0); - gtk_drag_begin (widget, target_list, - GDK_ACTION_COPY | GDK_ACTION_MOVE, - 1, (GdkEvent *) mevent); + gtk_drag_begin ( + widget, target_list, + GDK_ACTION_COPY | GDK_ACTION_MOVE, + 1, (GdkEvent *) mevent); gtk_target_list_unref (target_list); } } else { @@ -4617,10 +4677,12 @@ e_day_view_add_event (ESourceRegistry *registry, g_return_val_if_fail (start < add_event_data->day_view->upper, TRUE); g_return_val_if_fail (end > add_event_data->day_view->lower, TRUE); - start_tt = icaltime_from_timet_with_zone (start, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); - end_tt = icaltime_from_timet_with_zone (end, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); + start_tt = icaltime_from_timet_with_zone ( + start, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); + end_tt = icaltime_from_timet_with_zone ( + end, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->day_view))); if (add_event_data->comp_data) { event.comp_data = g_object_ref (add_event_data->comp_data); @@ -4748,10 +4810,11 @@ e_day_view_check_layout (EDayView *day_view) } if (day_view->long_events_need_layout) { - e_day_view_layout_long_events (day_view->long_events, - day_view->days_shown, - day_view->day_starts, - &rows_in_top_display); + e_day_view_layout_long_events ( + day_view->long_events, + day_view->days_shown, + day_view->day_starts, + &rows_in_top_display); } if (day_view->long_events_need_layout @@ -4880,22 +4943,22 @@ e_day_view_reshape_long_event (EDayView *day_view, color = e_day_view_get_text_color (day_view, event, widget); event->canvas_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root), - e_text_get_type (), - "clip", TRUE, - "max_lines", 1, - "editable", TRUE, - "use_ellipsis", TRUE, - "fill_color_gdk", &color, - "im_context", E_CANVAS (day_view->top_canvas)->im_context, - NULL); + gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->top_canvas)->root), + e_text_get_type (), + "clip", TRUE, + "max_lines", 1, + "editable", TRUE, + "use_ellipsis", TRUE, + "fill_color_gdk", &color, + "im_context", E_CANVAS (day_view->top_canvas)->im_context, + NULL); g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num)); g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (E_DAY_VIEW_LONG_EVENT)); g_signal_connect ( event->canvas_item, "event", G_CALLBACK (e_day_view_on_text_item_event), day_view); - g_signal_emit_by_name (G_OBJECT (day_view), - "event_added", event); + g_signal_emit_by_name (day_view, "event_added", event); e_day_view_update_long_event_label (day_view, event_num); } @@ -4947,12 +5010,14 @@ e_day_view_reshape_long_event (EDayView *day_view, } text_w = MAX (text_w, 0); - gnome_canvas_item_set (event->canvas_item, - "clip_width", (gdouble) text_w, - "clip_height", (gdouble) item_h, - NULL); - e_canvas_item_move_absolute (event->canvas_item, - text_x, item_y); + gnome_canvas_item_set ( + event->canvas_item, + "clip_width", (gdouble) text_w, + "clip_height", (gdouble) item_h, + NULL); + e_canvas_item_move_absolute ( + event->canvas_item, + text_x, item_y); g_object_unref (layout); g_object_unref (comp); @@ -5065,35 +5130,36 @@ e_day_view_reshape_day_event (EDayView *day_view, color = e_day_view_get_text_color (day_view, event, widget); - event->canvas_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root), - e_text_get_type (), - "line_wrap", TRUE, - "editable", TRUE, - "clip", TRUE, - "use_ellipsis", TRUE, - "fill_color_gdk", &color, - "im_context", E_CANVAS (day_view->main_canvas)->im_context, - NULL); + event->canvas_item = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (day_view->main_canvas)->root), + e_text_get_type (), + "line_wrap", TRUE, + "editable", TRUE, + "clip", TRUE, + "use_ellipsis", TRUE, + "fill_color_gdk", &color, + "im_context", E_CANVAS (day_view->main_canvas)->im_context, + NULL); g_object_set_data (G_OBJECT (event->canvas_item), "event-num", GINT_TO_POINTER (event_num)); g_object_set_data (G_OBJECT (event->canvas_item), "event-day", GINT_TO_POINTER (day)); g_signal_connect ( event->canvas_item, "event", G_CALLBACK (e_day_view_on_text_item_event), day_view); - g_signal_emit_by_name (G_OBJECT (day_view), - "event_added", event); + g_signal_emit_by_name (day_view, "event_added", event); e_day_view_update_event_label (day_view, day, event_num); } item_w = MAX (item_w, 0); - gnome_canvas_item_set (event->canvas_item, - "clip_width", (gdouble) item_w, - "clip_height", (gdouble) item_h, - "x_offset", (gdouble) icons_offset, - NULL); - e_canvas_item_move_absolute (event->canvas_item, - item_x, item_y); + gnome_canvas_item_set ( + event->canvas_item, + "clip_width", (gdouble) item_w, + "clip_height", (gdouble) item_h, + "x_offset", (gdouble) icons_offset, + NULL); + e_canvas_item_move_absolute ( + event->canvas_item, + item_x, item_y); } } @@ -5113,12 +5179,13 @@ e_day_view_reshape_main_canvas_resize_bars (EDayView *day_view) * hide the resize bars. */ if (day != -1 && day == day_view->drag_event_day && event_num == day_view->drag_event_num) { - g_object_get (day_view->drag_rect_item, - "x1", &x, - "y1", &y, - "x2", &w, - "y2", &h, - NULL); + g_object_get ( + day_view->drag_rect_item, + "x1", &x, + "y1", &y, + "x2", &w, + "y2", &h, + NULL); w -= x; x++; h -= y; @@ -5144,20 +5211,22 @@ e_day_view_ensure_events_sorted (EDayView *day_view) /* Sort the long events. */ if (!day_view->long_events_sorted) { - qsort (day_view->long_events->data, - day_view->long_events->len, - sizeof (EDayViewEvent), - e_day_view_event_sort_func); + qsort ( + day_view->long_events->data, + day_view->long_events->len, + sizeof (EDayViewEvent), + e_day_view_event_sort_func); day_view->long_events_sorted = TRUE; } /* Sort the events for each day. */ for (day = 0; day < day_view->days_shown; day++) { if (!day_view->events_sorted[day]) { - qsort (day_view->events[day]->data, - day_view->events[day]->len, - sizeof (EDayViewEvent), - e_day_view_event_sort_func); + qsort ( + day_view->events[day]->data, + day_view->events[day]->len, + sizeof (EDayViewEvent), + e_day_view_event_sort_func); day_view->events_sorted[day] = TRUE; } } @@ -5221,11 +5290,13 @@ e_day_view_add_new_event_in_selected_range (EDayView *day_view, e_day_view_get_selected_time_range ((ECalendarView *) day_view, &dtstart, &dtend); - start_tt = icaltime_from_timet_with_zone (dtstart, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + start_tt = icaltime_from_timet_with_zone ( + dtstart, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - end_tt = icaltime_from_timet_with_zone (dtend, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + end_tt = icaltime_from_timet_with_zone ( + dtend, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); if (day_view->selection_in_top_canvas) { start_dt.tzid = NULL; @@ -5440,9 +5511,10 @@ e_day_view_goto_start_of_work_day (EDayView *day_view) day_view, work_day_start_hour, 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_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); @@ -5471,9 +5543,10 @@ e_day_view_goto_end_of_work_day (EDayView *day_view) day_view, work_day_end_hour - 1, 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); + 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); @@ -5510,9 +5583,10 @@ e_day_view_change_duration_to_start_of_work_day (EDayView *day_view) 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); + 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); @@ -5551,9 +5625,10 @@ 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_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); e_day_view_update_calendar_selection_time (day_view); @@ -5621,11 +5696,13 @@ e_day_view_focus (GtkWidget *widget, new_event_num, &start_row, &end_row)) /* ensure the event to be seen */ - e_day_view_ensure_rows_visible (day_view, - start_row, end_row); + e_day_view_ensure_rows_visible ( + day_view, + start_row, end_row); } - e_day_view_start_editing_event (day_view, new_day, - new_event_num, NULL); + e_day_view_start_editing_event ( + day_view, new_day, + new_event_num, NULL); return TRUE; } @@ -5777,9 +5854,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, /* no long event, set to first event if there is */ - e_day_view_get_extreme_event (day_view, 0, - days_shown - 1, TRUE, - day_out, event_num_out); + e_day_view_get_extreme_event ( + day_view, 0, + days_shown - 1, TRUE, + day_out, event_num_out); /* go to event if found, or day view widget */ return TRUE; @@ -5792,9 +5870,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, /* no event, set to last long event if there is */ - e_day_view_get_extreme_long_event (day_view, FALSE, - day_out, - event_num_out); + e_day_view_get_extreme_long_event ( + day_view, FALSE, + day_out, + event_num_out); /* go to long event if found, or day view widget */ @@ -5810,9 +5889,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, /* go forward from the last long event */ else if ((new_day == E_DAY_VIEW_LONG_EVENT) && (new_event_num >= day_view->long_events->len)) { - e_day_view_get_extreme_event (day_view, 0, - days_shown - 1, TRUE, - day_out, event_num_out); + e_day_view_get_extreme_event ( + day_view, 0, + days_shown - 1, TRUE, + day_out, event_num_out); /* go to the next main item event if found or day view widget */ return TRUE; @@ -5828,8 +5908,9 @@ e_day_view_get_next_tab_event (EDayView *day_view, return TRUE; /* try to find a long event */ - e_day_view_get_extreme_long_event (day_view, FALSE, - day_out, event_num_out); + e_day_view_get_extreme_long_event ( + day_view, FALSE, + day_out, event_num_out); /* go to a long event if found, or day view widget */ return TRUE; @@ -5839,9 +5920,10 @@ e_day_view_get_next_tab_event (EDayView *day_view, (new_event_num >= day_view->events[new_day]->len)) { /* try to find a event from the next day in days shown */ - e_day_view_get_extreme_event (day_view, (new_day + 1), - days_shown - 1, TRUE, - day_out, event_num_out); + e_day_view_get_extreme_event ( + day_view, (new_day + 1), + days_shown - 1, TRUE, + day_out, event_num_out); /* go to a event found, or day view widget */ return TRUE; @@ -5954,9 +6036,10 @@ e_day_view_cursor_key_up (EDayView *day_view, day_view->selection_end_row = day_view->selection_start_row; if (!day_view->selection_in_top_canvas) - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_row); + e_day_view_ensure_rows_visible ( + day_view, + day_view->selection_start_row, + day_view->selection_end_row); g_signal_emit_by_name (day_view, "selected_time_changed"); e_day_view_update_calendar_selection_time (day_view); @@ -5987,7 +6070,8 @@ e_day_view_cursor_key_down (EDayView *day_view, day_view->selection_end_row = day_view->selection_start_row; if (!day_view->selection_in_top_canvas) - e_day_view_ensure_rows_visible (day_view, + e_day_view_ensure_rows_visible ( + day_view, day_view->selection_start_row, day_view->selection_end_row); @@ -6177,23 +6261,26 @@ e_day_view_start_editing_event (EDayView *day_view, gchar *initial_text; initial_text = e_utf8_from_gtk_event_key (GTK_WIDGET (day_view), key_event->keyval, key_event->string); - gnome_canvas_item_set (event->canvas_item, - "text", initial_text, - NULL); + gnome_canvas_item_set ( + event->canvas_item, + "text", initial_text, + NULL); if (initial_text) g_free (initial_text); } } /* Try to move the cursor to the end of the text. */ - g_object_get (event->canvas_item, - "event_processor", &event_processor, - NULL); + g_object_get ( + event->canvas_item, + "event_processor", &event_processor, + NULL); if (event_processor) { command.action = E_TEP_MOVE; command.position = E_TEP_END_OF_BUFFER; - g_signal_emit_by_name (event_processor, - "command", &command); + g_signal_emit_by_name ( + event_processor, + "command", &command); } } @@ -6245,9 +6332,10 @@ cancel_editing (EDayView *day_view) /* Reset the text to what was in the component */ summary = icalcomponent_get_summary (event->comp_data->icalcomp); - g_object_set (event->canvas_item, - "text", summary ? summary : "", - NULL); + g_object_set ( + event->canvas_item, + "text", summary ? summary : "", + NULL); /* Stop editing */ e_day_view_stop_editing_event (day_view); @@ -6408,16 +6496,18 @@ e_day_view_on_text_item_event (GnomeCanvasItem *item, } /* Find out where the mouse is. */ if (main_canvas) { - pos = e_day_view_convert_position_in_main_canvas (day_view, - event_x, event_y, - &day, &row, - &event_num); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + event_x, event_y, + &day, &row, + &event_num); } else { gint tmp; - pos = e_day_view_convert_position_in_top_canvas (day_view, - event_x, event_y, - &tmp, &event_num); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + event_x, event_y, + &tmp, &event_num); day = E_DAY_VIEW_LONG_EVENT; } @@ -6755,8 +6845,9 @@ e_day_view_on_editing_started (EDayView *day_view, return; #if 0 - g_print ("In e_day_view_on_editing_started Day:%i Event:%i\n", - day, event_num); + g_print ( + "In e_day_view_on_editing_started Day:%i Event:%i\n", + day, event_num); #endif /* FIXME: This is a temporary workaround for a bug which seems to stop @@ -6823,8 +6914,9 @@ e_day_view_on_editing_stopped (EDayView *day_view, event_num = day_view->editing_event_num; #if 0 - g_print ("In e_day_view_on_editing_stopped Day:%i Event:%i\n", - day, event_num); + g_print ( + "In e_day_view_on_editing_stopped Day:%i Event:%i\n", + day, event_num); #endif /* If no item is being edited, just return. */ @@ -6857,9 +6949,10 @@ e_day_view_on_editing_stopped (EDayView *day_view, day_view->resize_bars_event_num = -1; g_object_set (event->canvas_item, "handle_popup", FALSE, NULL); - g_object_get (event->canvas_item, - "text", &text, - NULL); + g_object_get ( + event->canvas_item, + "text", &text, + NULL); g_return_if_fail (text != NULL); comp = e_cal_component_new (); @@ -6887,8 +6980,9 @@ e_day_view_on_editing_stopped (EDayView *day_view, if (day == E_DAY_VIEW_LONG_EVENT) e_day_view_reshape_long_event (day_view, event_num); else - e_day_view_update_event_label (day_view, day, - event_num); + e_day_view_update_event_label ( + day_view, day, + event_num); } else if (summary.value || !string_is_empty (text)) { icalcomponent *icalcomp = e_cal_component_get_icalcomponent (comp); @@ -7028,8 +7122,9 @@ e_day_view_convert_grid_position_to_time (EDayView *day_view, return day_view->day_starts[col + 1]; /* Create an icaltimetype and convert to a time_t. */ - tt = icaltime_from_timet_with_zone (day_view->day_starts[col], - FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + tt = icaltime_from_timet_with_zone ( + day_view->day_starts[col], + FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); tt.hour = minutes / 60; tt.minute = minutes % 60; tt.second = 0; @@ -7091,8 +7186,9 @@ e_day_view_check_auto_scroll (EDayView *day_view, GtkAllocation allocation; gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (day_view->main_canvas), + &scroll_x, &scroll_y); event_x -= scroll_x; event_y -= scroll_y; @@ -7151,8 +7247,9 @@ e_day_view_auto_scroll_handler (gpointer data) return TRUE; } - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (day_view->main_canvas), + &scroll_x, &scroll_y); scrollable = GTK_SCROLLABLE (day_view->main_canvas); adjustment = gtk_scrollable_get_vadjustment (scrollable); @@ -7164,14 +7261,16 @@ e_day_view_auto_scroll_handler (gpointer data) if (day_view->auto_scroll_up) new_scroll_y = MAX (scroll_y - step_increment, 0); else - new_scroll_y = MIN (scroll_y + step_increment, - upper - page_size); + new_scroll_y = MIN ( + scroll_y + step_increment, + upper - page_size); if (new_scroll_y != scroll_y) { /* NOTE: This reduces flicker, but only works if we don't use * canvas items which have X windows. */ - gnome_canvas_scroll_to (GNOME_CANVAS (day_view->main_canvas), - scroll_x, new_scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (day_view->main_canvas), + scroll_x, new_scroll_y); } canvas_x = day_view->last_mouse_x + scroll_x; @@ -7184,9 +7283,10 @@ e_day_view_auto_scroll_handler (gpointer data) canvas_x = 0; /* Update the selection/resize/drag if necessary. */ - pos = e_day_view_convert_position_in_main_canvas (day_view, - canvas_x, canvas_y, - &day, &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + canvas_x, canvas_y, + &day, &row, NULL); if (day_view->last_mouse_x == -1) day = -1; @@ -7532,8 +7632,9 @@ e_day_view_on_top_canvas_drag_motion (GtkWidget *widget, { gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (widget), + &scroll_x, &scroll_y); day_view->drag_event_x = x + scroll_x; day_view->drag_event_y = y + scroll_y; @@ -7552,8 +7653,9 @@ e_day_view_reshape_top_canvas_drag_item (EDayView *day_view) * the current mouse position. */ x = day_view->drag_event_x; y = day_view->drag_event_y; - pos = e_day_view_convert_position_in_top_canvas (day_view, x, y, - &day, NULL); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, x, y, + &day, NULL); /* This shouldn't really happen in a drag. */ if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return; @@ -7621,20 +7723,23 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, item_h = day_view->top_row_height - E_DAY_VIEW_TOP_CANVAS_Y_GAP; /* Set the positions of the event & associated items. */ - gnome_canvas_item_set (day_view->drag_long_event_rect_item, - "x1", item_x, - "y1", item_y, - "x2", item_x + item_w - 1, - "y2", item_y + item_h - 1, - NULL); - - gnome_canvas_item_set (day_view->drag_long_event_item, - "clip_width", item_w - (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2, - "clip_height", item_h - (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2, - NULL); - e_canvas_item_move_absolute (day_view->drag_long_event_item, - item_x + E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD, - item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD); + gnome_canvas_item_set ( + day_view->drag_long_event_rect_item, + "x1", item_x, + "y1", item_y, + "x2", item_x + item_w - 1, + "y2", item_y + item_h - 1, + NULL); + + gnome_canvas_item_set ( + day_view->drag_long_event_item, + "clip_width", item_w - (E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD) * 2, + "clip_height", item_h - (E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD) * 2, + NULL); + e_canvas_item_move_absolute ( + day_view->drag_long_event_item, + item_x + E_DAY_VIEW_LONG_EVENT_BORDER_WIDTH + E_DAY_VIEW_LONG_EVENT_X_PAD, + item_y + E_DAY_VIEW_LONG_EVENT_BORDER_HEIGHT + E_DAY_VIEW_LONG_EVENT_Y_PAD); if (!(day_view->drag_long_event_rect_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { gnome_canvas_item_raise_to_top (day_view->drag_long_event_rect_item); @@ -7654,9 +7759,10 @@ e_day_view_update_top_canvas_drag (EDayView *day_view, text = NULL; } - gnome_canvas_item_set (day_view->drag_long_event_item, - "text", text ? text : "", - NULL); + gnome_canvas_item_set ( + day_view->drag_long_event_item, + "text", text ? text : "", + NULL); gnome_canvas_item_raise_to_top (day_view->drag_long_event_item); gnome_canvas_item_show (day_view->drag_long_event_item); @@ -7674,8 +7780,9 @@ e_day_view_on_main_canvas_drag_motion (GtkWidget *widget, { gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (widget), + &scroll_x, &scroll_y); day_view->drag_event_x = x + scroll_x; day_view->drag_event_y = y + scroll_y; @@ -7698,8 +7805,9 @@ e_day_view_reshape_main_canvas_drag_item (EDayView *day_view) * the current mouse position. */ x = day_view->drag_event_x; y = day_view->drag_event_y; - pos = e_day_view_convert_position_in_main_canvas (day_view, x, y, - &day, &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, x, y, + &day, &row, NULL); /* This shouldn't really happen in a drag. */ if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) return; @@ -7779,27 +7887,31 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, item_h = num_rows * day_view->row_height; /* Set the positions of the event & associated items. */ - gnome_canvas_item_set (day_view->drag_rect_item, - "x1", item_x + E_DAY_VIEW_BAR_WIDTH - 1, - "y1", item_y, - "x2", item_x + item_w - 1, - "y2", item_y + item_h - 1, - NULL); - - gnome_canvas_item_set (day_view->drag_bar_item, - "x1", item_x, - "y1", item_y, - "x2", item_x + E_DAY_VIEW_BAR_WIDTH - 1, - "y2", item_y + item_h - 1, - NULL); - - gnome_canvas_item_set (day_view->drag_item, - "clip_width", item_w - E_DAY_VIEW_BAR_WIDTH - E_DAY_VIEW_EVENT_X_PAD * 2, - "clip_height", item_h - (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2, - NULL); - e_canvas_item_move_absolute (day_view->drag_item, - item_x + E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_EVENT_X_PAD, - item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD); + gnome_canvas_item_set ( + day_view->drag_rect_item, + "x1", item_x + E_DAY_VIEW_BAR_WIDTH - 1, + "y1", item_y, + "x2", item_x + item_w - 1, + "y2", item_y + item_h - 1, + NULL); + + gnome_canvas_item_set ( + day_view->drag_bar_item, + "x1", item_x, + "y1", item_y, + "x2", item_x + E_DAY_VIEW_BAR_WIDTH - 1, + "y2", item_y + item_h - 1, + NULL); + + gnome_canvas_item_set ( + day_view->drag_item, + "clip_width", item_w - E_DAY_VIEW_BAR_WIDTH - E_DAY_VIEW_EVENT_X_PAD * 2, + "clip_height", item_h - (E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD) * 2, + NULL); + e_canvas_item_move_absolute ( + day_view->drag_item, + item_x + E_DAY_VIEW_BAR_WIDTH + E_DAY_VIEW_EVENT_X_PAD, + item_y + E_DAY_VIEW_EVENT_BORDER_HEIGHT + E_DAY_VIEW_EVENT_Y_PAD); if (!(day_view->drag_bar_item->flags & GNOME_CANVAS_ITEM_VISIBLE)) { gnome_canvas_item_raise_to_top (day_view->drag_bar_item); @@ -7824,9 +7936,10 @@ e_day_view_update_main_canvas_drag (EDayView *day_view, text = NULL; } - gnome_canvas_item_set (day_view->drag_item, - "text", text ? text : "", - NULL); + gnome_canvas_item_set ( + day_view->drag_item, + "text", text ? text : "", + NULL); gnome_canvas_item_raise_to_top (day_view->drag_item); gnome_canvas_item_show (day_view->drag_item); @@ -8051,9 +8164,10 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, if (length >= 0 && format == 8 && day_view->drag_event_day != -1) { /* We are dragging in the same window */ - pos = e_day_view_convert_position_in_top_canvas (day_view, - x, y, &day, - NULL); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + x, y, &day, + NULL); if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; @@ -8075,11 +8189,12 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, day -= day_view->drag_event_offset; day = MAX (day, 0); - e_day_view_find_long_event_days (event, - day_view->days_shown, - day_view->day_starts, - &start_day, - &end_day); + e_day_view_find_long_event_days ( + event, + day_view->days_shown, + day_view->day_starts, + &start_day, + &end_day); num_days = end_day - start_day + 1; /* Make sure we don't go off the screen. */ day = MIN (day, day_view->days_shown - num_days); @@ -8122,8 +8237,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, date.value = &itt; dt = day_view->day_starts[day] + start_offset * 60; - itt = icaltime_from_timet_with_zone (dt, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + itt = icaltime_from_timet_with_zone ( + dt, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); if (all_day_event) { itt.is_date = TRUE; date.tzid = NULL; @@ -8138,8 +8254,9 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, dt = day_view->day_starts[day + num_days]; else dt = day_view->day_starts[day + num_days - 1] + end_offset * 60; - itt = icaltime_from_timet_with_zone (dt, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + itt = icaltime_from_timet_with_zone ( + dt, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); if (all_day_event) { itt.is_date = TRUE; date.tzid = NULL; @@ -8199,9 +8316,10 @@ e_day_view_on_top_canvas_drag_data_received (GtkWidget *widget, time_t dtstart; icaltimezone *default_zone; - pos = e_day_view_convert_position_in_top_canvas (day_view, - x, y, &day, - NULL); + pos = e_day_view_convert_position_in_top_canvas ( + day_view, + x, y, &day, + NULL); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) goto error; @@ -8226,8 +8344,9 @@ 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, - default_zone, subcomp, TRUE); + 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; @@ -8300,8 +8419,9 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, client = e_cal_model_get_default_client (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view))); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (widget), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (widget), + &scroll_x, &scroll_y); x += scroll_x; y += scroll_y; @@ -8309,9 +8429,10 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, if (length >= 0 && format == 8 && (day_view->drag_event_day != -1)) { /* We are dragging in the same window */ - pos = e_day_view_convert_position_in_main_canvas (day_view, - x, y, &day, - &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + x, y, &day, + &row, NULL); if (pos != E_CALENDAR_VIEW_POS_OUTSIDE) { CalObjModType mod = CALOBJ_MOD_ALL; GtkWindow *toplevel; @@ -8433,9 +8554,10 @@ e_day_view_on_main_canvas_drag_data_received (GtkWidget *widget, time_t dtstart; icaltimezone *default_zone; - pos = e_day_view_convert_position_in_main_canvas (day_view, - x, y, &day, - &row, NULL); + pos = e_day_view_convert_position_in_main_canvas ( + day_view, + x, y, &day, + &row, NULL); if (pos == E_CALENDAR_VIEW_POS_OUTSIDE) goto error; @@ -8460,8 +8582,9 @@ 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, - default_zone, subcomp, FALSE); + 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; diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index a7c4fff5d7..1059537b84 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -94,7 +94,7 @@ string_is_set (gchar *string) static void notify_changed (EMeetingAttendee *ia) { - g_signal_emit_by_name (G_OBJECT (ia), "changed"); + g_signal_emit_by_name (ia, "changed"); } static void @@ -657,8 +657,9 @@ compare_times (EMeetingTime *time1, { gint day_comparison; - day_comparison = g_date_compare (&time1->date, - &time2->date); + day_comparison = g_date_compare ( + &time1->date, + &time2->date); if (day_comparison != 0) return day_comparison; @@ -698,9 +699,10 @@ ensure_periods_sorted (EMeetingAttendee *ia) if (priv->busy_periods_sorted) return; - qsort (priv->busy_periods->data, priv->busy_periods->len, - sizeof (EMeetingFreeBusyPeriod), - compare_period_starts); + qsort ( + priv->busy_periods->data, priv->busy_periods->len, + sizeof (EMeetingFreeBusyPeriod), + compare_period_starts); priv->busy_periods_sorted = TRUE; } @@ -981,8 +983,9 @@ e_meeting_attendee_set_start_busy_range (EMeetingAttendee *ia, return FALSE; g_date_clear (&priv->busy_periods_start.date, 1); - g_date_set_dmy (&priv->busy_periods_start.date, - start_day, start_month, start_year); + g_date_set_dmy ( + &priv->busy_periods_start.date, + start_day, start_month, start_year); priv->busy_periods_start.hour = start_hour; priv->busy_periods_start.minute = start_minute; @@ -1014,8 +1017,9 @@ e_meeting_attendee_set_end_busy_range (EMeetingAttendee *ia, return FALSE; g_date_clear (&priv->busy_periods_end.date, 1); - g_date_set_dmy (&priv->busy_periods_end.date, - end_day, end_month, end_year); + g_date_set_dmy ( + &priv->busy_periods_end.date, + end_day, end_month, end_year); priv->busy_periods_end.hour = end_hour; priv->busy_periods_end.minute = end_minute; diff --git a/calendar/gui/e-meeting-list-view.c b/calendar/gui/e-meeting-list-view.c index 19358ef02a..59ffa099e0 100644 --- a/calendar/gui/e-meeting-list-view.c +++ b/calendar/gui/e-meeting-list-view.c @@ -272,8 +272,9 @@ e_meeting_list_view_add_attendee_to_name_selector (EMeetingListView *view, 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); + e_name_selector_model_peek_section ( + name_selector_model, sections[i], + NULL, &destination_store); des = e_destination_new (); e_destination_set_email (des, itip_strip_mailto (e_meeting_attendee_get_address (ma))); e_destination_set_name (des, e_meeting_attendee_get_cn (ma)); @@ -296,8 +297,9 @@ e_meeting_list_view_remove_attendee_from_name_selector (EMeetingListView *view, 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); + 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)); @@ -344,8 +346,9 @@ e_meeting_list_view_remove_all_attendees_from_name_selector (EMeetingListView *v EDestinationStore *destination_store = NULL; GList *destinations = NULL, *l = NULL; - e_name_selector_model_peek_section (name_selector_model, sections[i], - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, sections[i], + NULL, &destination_store); if (!destination_store) { g_warning ("destination store is NULL\n"); continue; @@ -416,7 +419,7 @@ attendee_edited_cb (GtkCellRenderer *renderer, e_meeting_attendee_set_delfrom (attendee, (gchar *) e_meeting_attendee_get_delfrom (existing_attendee)); } e_meeting_list_view_add_attendee_to_name_selector (E_MEETING_LIST_VIEW (view), attendee); - g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) attendee); + g_signal_emit_by_name (view, "attendee_added", (gpointer) attendee); } if (existing_attendee && can_remove) { @@ -461,7 +464,7 @@ attendee_edited_cb (GtkCellRenderer *renderer, if (address_changed) e_meeting_attendee_set_status (attendee, ICAL_PARTSTAT_NEEDSACTION); - g_signal_emit_by_name (G_OBJECT (view), "attendee_added", (gpointer) attendee); + g_signal_emit_by_name (view, "attendee_added", (gpointer) attendee); } } else if (existing_attendee) { const gchar *address = e_meeting_attendee_get_address (existing_attendee); @@ -585,7 +588,8 @@ create_combo_cell_renderer (GList *strings) renderer = gtk_cell_renderer_combo_new (); - g_object_set (G_OBJECT (renderer), + g_object_set ( + G_OBJECT (renderer), "has-entry", FALSE, "editable", TRUE, "model", GTK_TREE_MODEL (store), @@ -616,12 +620,13 @@ build_table (EMeetingListView *lview) renderer = e_select_names_renderer_new (); g_object_set (renderer, "editable", TRUE, NULL); /* The extra space is just a hack to occupy more space for Attendee */ - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Attendee "), renderer, - "text", E_MEETING_STORE_ATTENDEE_COL, - "name", E_MEETING_STORE_CN_COL, - "email", E_MEETING_STORE_ADDRESS_COL, - "underline", E_MEETING_STORE_ATTENDEE_UNDERLINE_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Attendee "), renderer, + "text", E_MEETING_STORE_ATTENDEE_COL, + "name", E_MEETING_STORE_CN_COL, + "email", E_MEETING_STORE_ADDRESS_COL, + "underline", E_MEETING_STORE_ATTENDEE_UNDERLINE_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -641,9 +646,10 @@ build_table (EMeetingListView *lview) g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_ATTENDEE_COL), renderer); renderer = create_combo_cell_renderer (get_type_strings ()); - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Type"), renderer, - "text", E_MEETING_STORE_TYPE_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Type"), renderer, + "text", E_MEETING_STORE_TYPE_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -654,9 +660,10 @@ build_table (EMeetingListView *lview) g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_TYPE_COL), renderer); renderer = create_combo_cell_renderer (get_role_strings ()); - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Role"), renderer, - "text", E_MEETING_STORE_ROLE_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Role"), renderer, + "text", E_MEETING_STORE_ROLE_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -668,9 +675,10 @@ build_table (EMeetingListView *lview) renderer = create_combo_cell_renderer (get_rsvp_strings ()); /* To translators: RSVP means "please reply" */ - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("RSVP"), renderer, - "text", E_MEETING_STORE_RSVP_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("RSVP"), renderer, + "text", E_MEETING_STORE_RSVP_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -681,9 +689,10 @@ build_table (EMeetingListView *lview) g_hash_table_insert (edit_table, GINT_TO_POINTER (E_MEETING_STORE_RSVP_COL), renderer); renderer = create_combo_cell_renderer (get_status_strings ()); - pos = gtk_tree_view_insert_column_with_attributes (view, -1, _("Status"), renderer, - "text", E_MEETING_STORE_STATUS_COL, - NULL); + pos = gtk_tree_view_insert_column_with_attributes ( + view, -1, _("Status"), renderer, + "text", E_MEETING_STORE_STATUS_COL, + NULL); col = gtk_tree_view_get_column (view, pos -1); gtk_tree_view_column_set_resizable (col, TRUE); gtk_tree_view_column_set_reorderable (col, TRUE); @@ -903,8 +912,9 @@ process_section (EMeetingListView *view, EContact *n_con = NULL; gchar *query; - query = g_strdup_printf ("(is \"full_name\" \"%s\")", - (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); + query = g_strdup_printf ( + "(is \"full_name\" \"%s\")", + (gchar *) e_contact_get (contact, E_CONTACT_FULL_NAME)); if (!e_book_client_get_contacts_sync (book_client, query, &contacts, NULL, NULL)) { g_warning ("Could not get contact from the book \n"); @@ -1010,8 +1020,9 @@ name_selector_dialog_close_cb (ENameSelectorDialog *dialog, EDestinationStore *destination_store; GList *destinations; - e_name_selector_model_peek_section (name_selector_model, sections[i], - NULL, &destination_store); + e_name_selector_model_peek_section ( + name_selector_model, sections[i], + NULL, &destination_store); if (!destination_store) { g_warning ("destination store is NULL\n"); continue; @@ -1045,8 +1056,9 @@ name_selector_dialog_close_cb (ENameSelectorDialog *dialog, void e_meeting_list_view_invite_others_dialog (EMeetingListView *view) { - e_name_selector_show_dialog (view->priv->name_selector, - GTK_WIDGET (view)); + e_name_selector_show_dialog ( + view->priv->name_selector, + GTK_WIDGET (view)); } void diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index c7f5fde71a..d215b2decc 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -1358,12 +1358,13 @@ process_free_busy_comp (EMeetingAttendee *attendee, else ds_zone = icaltimezone_get_utc_timezone (); icaltimezone_convert_time (&dtstart, ds_zone, zone); - e_meeting_attendee_set_start_busy_range (attendee, - dtstart.year, - dtstart.month, - dtstart.day, - dtstart.hour, - dtstart.minute); + e_meeting_attendee_set_start_busy_range ( + attendee, + dtstart.year, + dtstart.month, + dtstart.day, + dtstart.hour, + dtstart.minute); } ip = icalcomponent_get_first_property (fb_comp, ICAL_DTEND_PROPERTY); @@ -1377,12 +1378,13 @@ process_free_busy_comp (EMeetingAttendee *attendee, else de_zone = icaltimezone_get_utc_timezone (); icaltimezone_convert_time (&dtend, de_zone, zone); - e_meeting_attendee_set_end_busy_range (attendee, - dtend.year, - dtend.month, - dtend.day, - dtend.hour, - dtend.minute); + e_meeting_attendee_set_end_busy_range ( + attendee, + dtend.year, + dtend.month, + dtend.day, + dtend.hour, + dtend.minute); } ip = icalcomponent_get_first_property (fb_comp, ICAL_FREEBUSY_PROPERTY); @@ -1423,18 +1425,19 @@ process_free_busy_comp (EMeetingAttendee *attendee, icaltimezone_convert_time (&fb.start, utc_zone, zone); icaltimezone_convert_time (&fb.end, utc_zone, zone); - e_meeting_attendee_add_busy_period (attendee, - fb.start.year, - fb.start.month, - fb.start.day, - fb.start.hour, - fb.start.minute, - fb.end.year, - fb.end.month, - fb.end.day, - fb.end.hour, - fb.end.minute, - busy_type); + e_meeting_attendee_add_busy_period ( + attendee, + fb.start.year, + fb.start.month, + fb.start.day, + fb.start.hour, + fb.start.minute, + fb.end.year, + fb.end.month, + fb.end.day, + fb.end.hour, + fb.end.minute, + busy_type); } ip = icalcomponent_get_next_property (fb_comp, ICAL_FREEBUSY_PROPERTY); @@ -1955,9 +1958,10 @@ redirect_handler (SoupMessage *msg, new_uri = soup_uri_new_with_base (soup_message_get_uri (msg), new_loc); if (!new_uri) { - soup_message_set_status_full (msg, - SOUP_STATUS_MALFORMED, - "Invalid Redirect URL"); + soup_message_set_status_full ( + msg, + SOUP_STATUS_MALFORMED, + "Invalid Redirect URL"); return; } diff --git a/calendar/gui/e-meeting-time-sel-item.c b/calendar/gui/e-meeting-time-sel-item.c index 24a64f5799..52558e4f31 100644 --- a/calendar/gui/e-meeting-time-sel-item.c +++ b/calendar/gui/e-meeting-time-sel-item.c @@ -250,17 +250,20 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, ? TRUE : FALSE; /* Calculate the first and last visible days and positions. */ - e_meeting_time_selector_calculate_day_and_position (mts, x, - &date, &day_x); - e_meeting_time_selector_calculate_day_and_position (mts, x + width, - &last_date, NULL); + e_meeting_time_selector_calculate_day_and_position ( + mts, x, + &date, &day_x); + e_meeting_time_selector_calculate_day_and_position ( + mts, x + width, + &last_date, NULL); /* For the top display draw the 'All Attendees' row background. */ cairo_save (cr); if (is_display_top) { 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_rectangle ( + cr, 0, mts->row_height * 2 - y, + width, mts->row_height); cairo_fill (cr); } else { gdk_cairo_set_source_color (cr, &mts->bg_color); @@ -279,12 +282,14 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, cairo_save (cr); 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); + cairo_rectangle ( + cr, meeting_start_x + 1 - x, mts->row_height * 2 - y, + 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); + cairo_rectangle ( + cr, meeting_start_x + 1 - x, 0, + meeting_end_x - meeting_start_x - 2, height); cairo_fill (cr); } cairo_restore (cr); @@ -364,15 +369,17 @@ e_meeting_time_selector_item_draw (GnomeCanvasItem *item, if ((meeting_start_x + 2 >= x) && (meeting_start_x - 2 < x + width)) { - cairo_rectangle (cr, meeting_start_x - 2 - x, bar_y, - 5, bar_height); + cairo_rectangle ( + cr, meeting_start_x - 2 - x, bar_y, + 5, bar_height); cairo_fill (cr); } if ((meeting_end_x + 2 >= x) && (meeting_end_x - 2 < x + width)) { - cairo_rectangle (cr, meeting_end_x - 2 - x, bar_y, - 5, bar_height); + cairo_rectangle ( + cr, meeting_end_x - 2 - x, bar_y, + 5, bar_height); cairo_fill (cr); } @@ -587,9 +594,10 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, } cairo_stroke (cr); - cairo_rectangle (cr, - x + mts->day_width - 2, 0, - 2, unused_y); + cairo_rectangle ( + cr, + x + mts->day_width - 2, 0, + 2, unused_y); cairo_fill (cr); } @@ -604,9 +612,10 @@ e_meeting_time_selector_item_paint_day (EMeetingTimeSelectorItem *mts_item, } cairo_stroke (cr); - cairo_rectangle (cr, - x + mts->day_width - 2, unused_y, - 2, height - unused_y); + cairo_rectangle ( + cr, + x + mts->day_width - 2, unused_y, + 2, height - unused_y); cairo_fill (cr); } @@ -755,11 +764,13 @@ e_meeting_time_selector_item_paint_attendee_busy_periods (EMeetingTimeSelectorIt * the top/bottom line of each row. */ if (x2 - x1 > 0) { #if E_MEETING_TIME_SELECTOR_DRAW_GRID_LINES_AT_BOTTOM - cairo_rectangle (cr, x1 - x, y + 2, - x2 - x1, mts->row_height - 5); + cairo_rectangle ( + cr, x1 - x, y + 2, + x2 - x1, mts->row_height - 5); #else - cairo_rectangle (cr, x1 - x, y + 3, - x2 - x1, mts->row_height - 5); + cairo_rectangle ( + cr, x1 - x, y + 3, + x2 - x1, mts->row_height - 5); #endif cairo_fill (cr); } @@ -790,14 +801,17 @@ e_meeting_time_selector_item_event (GnomeCanvasItem *item, switch (event->type) { case GDK_BUTTON_PRESS: - return e_meeting_time_selector_item_button_press (mts_item, - event); + return e_meeting_time_selector_item_button_press ( + mts_item, + event); case GDK_BUTTON_RELEASE: - return e_meeting_time_selector_item_button_release (mts_item, - event); + return e_meeting_time_selector_item_button_release ( + mts_item, + event); case GDK_MOTION_NOTIFY: - return e_meeting_time_selector_item_motion_notify (mts_item, - event); + return e_meeting_time_selector_item_motion_notify ( + mts_item, + event); default: break; } @@ -825,8 +839,9 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, y = (gint) event->button.y; /* Check if we are starting a drag of the vertical meeting time bars.*/ - position = e_meeting_time_selector_item_get_drag_position (mts_item, - x, y); + position = e_meeting_time_selector_item_get_drag_position ( + mts_item, + x, y); if (position != E_MEETING_TIME_SELECTOR_POS_NONE) { if (gnome_canvas_item_grab (GNOME_CANVAS_ITEM (mts_item), GDK_POINTER_MOTION_MASK @@ -851,17 +866,18 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, gint hdiff, mdiff; GDate asdate, aedate; - e_meeting_time_selector_get_meeting_time (mts_item->mts, - &astart_year, - &astart_month, - &astart_day, - &astart_hour, - &astart_minute, - &aend_year, - &aend_month, - &aend_day, - &aend_hour, - &aend_minute); + e_meeting_time_selector_get_meeting_time ( + mts_item->mts, + &astart_year, + &astart_month, + &astart_day, + &astart_hour, + &astart_minute, + &aend_year, + &aend_month, + &aend_day, + &aend_hour, + &aend_minute); if (mts->zoomed_out) start_time.minute = 0; else @@ -901,17 +917,18 @@ e_meeting_time_selector_item_button_press (EMeetingTimeSelectorItem *mts_item, e_meeting_time_selector_fix_time_overflows (&end_time); /* Set the new meeting time. */ - e_meeting_time_selector_set_meeting_time (mts_item->mts, - g_date_get_year (start_date), - g_date_get_month (start_date), - g_date_get_day (start_date), - start_time.hour, - start_time.minute, - g_date_get_year (end_date), - g_date_get_month (end_date), - g_date_get_day (end_date), - end_time.hour, - end_time.minute); + e_meeting_time_selector_set_meeting_time ( + mts_item->mts, + g_date_get_year (start_date), + g_date_get_month (start_date), + g_date_get_day (start_date), + start_time.hour, + start_time.minute, + g_date_get_year (end_date), + g_date_get_month (end_date), + g_date_get_day (end_date), + end_time.hour, + end_time.minute); return FALSE; } @@ -930,8 +947,9 @@ e_meeting_time_selector_item_button_release (EMeetingTimeSelectorItem *mts_item, if (mts->dragging_position != E_MEETING_TIME_SELECTOR_POS_NONE) { mts->dragging_position = E_MEETING_TIME_SELECTOR_POS_NONE; e_meeting_time_selector_remove_timeout (mts); - gnome_canvas_item_ungrab (GNOME_CANVAS_ITEM (mts_item), - event->button.time); + gnome_canvas_item_ungrab ( + GNOME_CANVAS_ITEM (mts_item), + event->button.time); } return FALSE; @@ -959,8 +977,9 @@ e_meeting_time_selector_item_motion_notify (EMeetingTimeSelectorItem *mts_item, return TRUE; } - position = e_meeting_time_selector_item_get_drag_position (mts_item, - x, y); + position = e_meeting_time_selector_item_get_drag_position ( + mts_item, + x, y); /* Determine which cursor should be used. */ if (position != E_MEETING_TIME_SELECTOR_POS_NONE) diff --git a/calendar/gui/e-meeting-time-sel.c b/calendar/gui/e-meeting-time-sel.c index eb7a1fc67e..69d9e27ffb 100644 --- a/calendar/gui/e-meeting-time-sel.c +++ b/calendar/gui/e-meeting-time-sel.c @@ -413,9 +413,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->meeting_start_time.hour = meeting_start_tm->tm_hour; mts->meeting_start_time.minute = meeting_start_tm->tm_min; - e_meeting_time_selector_find_nearest_interval (mts, &mts->meeting_start_time, - &mts->meeting_end_time, - 0, 0, 30); + e_meeting_time_selector_find_nearest_interval ( + mts, &mts->meeting_start_time, + &mts->meeting_end_time, + 0, 0, 30); e_meeting_time_selector_update_dates_shown (mts); @@ -428,8 +429,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->auto_scroll_timeout_id = 0; vbox = gtk_vbox_new (FALSE, 0); - gtk_table_attach (GTK_TABLE (mts), - vbox, 0, 1, 0, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), + vbox, 0, 1, 0, 2, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); gtk_widget_show (vbox); mts->attendees_vbox_spacer = gtk_vbox_new (FALSE, 0); @@ -489,13 +491,15 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* The free/busy information */ mts->display_top = gnome_canvas_new (); gtk_widget_set_size_request (mts->display_top, -1, mts->row_height * 3); - gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_top), - 0, 0, - mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, - mts->row_height * 3); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (mts->display_top), + 0, 0, + mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, + mts->row_height * 3); /* Add some horizontal padding for the shadow around the display. */ - gtk_table_attach (GTK_TABLE (mts), mts->display_top, - 1, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), mts->display_top, + 1, 4, 0, 1, GTK_EXPAND | GTK_FILL, 0, 0, 0); gtk_widget_show (mts->display_top); g_signal_connect ( mts->display_top, "realize", @@ -504,9 +508,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->display_main = gnome_canvas_new (); e_meeting_time_selector_update_main_canvas_scroll_region (mts); /* Add some horizontal padding for the shadow around the display. */ - gtk_table_attach (GTK_TABLE (mts), mts->display_main, - 1, 4, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), mts->display_main, + 1, 4, 1, 2, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (mts->display_main); g_signal_connect ( mts->display_main, "realize", @@ -541,38 +546,44 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, gtk_widget_show (mts->vscrollbar); /* Create the item in the top canvas. */ - mts->item_top = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_top)->root), - e_meeting_time_selector_item_get_type (), - "EMeetingTimeSelectorItem::meeting_time_selector", mts, - NULL); + mts->item_top = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_top)->root), + e_meeting_time_selector_item_get_type (), + "EMeetingTimeSelectorItem::meeting_time_selector", mts, + NULL); /* Create the item in the main canvas. */ - mts->item_main = gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_main)->root), - e_meeting_time_selector_item_get_type (), - "EMeetingTimeSelectorItem::meeting_time_selector", mts, - NULL); + mts->item_main = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (mts->display_main)->root), + e_meeting_time_selector_item_get_type (), + "EMeetingTimeSelectorItem::meeting_time_selector", mts, + NULL); /* Create the hbox containing the color key. */ hbox = gtk_hbox_new (FALSE, 2); - gtk_table_attach (GTK_TABLE (mts), hbox, - 1, 4, 3, 4, GTK_FILL, 0, 0, 8); + gtk_table_attach ( + GTK_TABLE (mts), hbox, + 1, 4, 3, 4, GTK_FILL, 0, 0, 8); gtk_widget_show (hbox); e_meeting_time_selector_add_key_color (mts, hbox, _("Tentative"), &mts->busy_colors[E_MEETING_FREE_BUSY_TENTATIVE]); e_meeting_time_selector_add_key_color (mts, hbox, _("Busy"), &mts->busy_colors[E_MEETING_FREE_BUSY_BUSY]); e_meeting_time_selector_add_key_color (mts, hbox, _("Out of Office"), &mts->busy_colors[E_MEETING_FREE_BUSY_OUT_OF_OFFICE]); - e_meeting_time_selector_add_key_color (mts, hbox, _("No Information"), - NULL); + e_meeting_time_selector_add_key_color ( + mts, hbox, _("No Information"), + NULL); separator = gtk_hseparator_new (); - gtk_table_attach (GTK_TABLE (mts), separator, - 0, 5, 4, 5, GTK_FILL, 0, 6, 6); + gtk_table_attach ( + GTK_TABLE (mts), separator, + 0, 5, 4, 5, GTK_FILL, 0, 6, 6); gtk_widget_show (separator); /* Create the Invite Others & Options buttons on the left. */ hbox = gtk_hbox_new (FALSE, 4); - gtk_table_attach (GTK_TABLE (mts), hbox, - 0, 1, 3, 4, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), hbox, + 0, 1, 3, 4, GTK_FILL, 0, 0, 0); gtk_widget_show (hbox); mts->add_attendees_button = @@ -603,8 +614,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6); gtk_widget_show (label); - gtk_widget_add_accelerator (mts->options_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK, 0); + gtk_widget_add_accelerator ( + mts->options_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK, 0); arrow = gtk_arrow_new (GTK_ARROW_DOWN, GTK_SHADOW_NONE); gtk_box_pack_start (GTK_BOX (child_hbox), arrow, FALSE, FALSE, 6); @@ -612,15 +624,17 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the Options menu. */ mts->options_menu = gtk_menu_new (); - gtk_menu_attach_to_widget (GTK_MENU (mts->options_menu), mts->options_button, - e_meeting_time_selector_options_menu_detacher); + gtk_menu_attach_to_widget ( + GTK_MENU (mts->options_menu), mts->options_button, + e_meeting_time_selector_options_menu_detacher); menuitem = gtk_check_menu_item_new_with_label (""); child = gtk_bin_get_child (GTK_BIN (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("Show _only working hours")); gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), - mts->working_hours_only); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (menuitem), + mts->working_hours_only); g_signal_connect ( menuitem, "toggled", @@ -631,8 +645,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, child = gtk_bin_get_child (GTK_BIN (menuitem)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("Show _zoomed out")); gtk_menu_shell_append (GTK_MENU_SHELL (mts->options_menu), menuitem); - gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (menuitem), - mts->zoomed_out); + gtk_check_menu_item_set_active ( + GTK_CHECK_MENU_ITEM (menuitem), + mts->zoomed_out); g_signal_connect ( menuitem, "toggled", @@ -656,16 +671,18 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the 3 AutoPick buttons on the left. */ hbox = gtk_hbox_new (FALSE, 0); - gtk_table_attach (GTK_TABLE (mts), hbox, - 0, 1, 5, 6, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), hbox, + 0, 1, 5, 6, GTK_FILL, 0, 0, 0); gtk_widget_show (hbox); mts->autopick_down_button = gtk_button_new_with_label (""); child = gtk_bin_get_child (GTK_BIN (mts->autopick_down_button)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _("_<<")); accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (child)); - gtk_widget_add_accelerator (mts->autopick_down_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); + gtk_widget_add_accelerator ( + mts->autopick_down_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_down_button, TRUE, TRUE, 6); gtk_widget_show (mts->autopick_down_button); g_signal_connect ( @@ -685,8 +702,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (label)); gtk_box_pack_start (GTK_BOX (child_hbox), label, TRUE, TRUE, 6); gtk_widget_show (label); - gtk_widget_add_accelerator (mts->autopick_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK, 0); + gtk_widget_add_accelerator ( + mts->autopick_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK, 0); g_signal_connect ( mts->autopick_button, "clicked", G_CALLBACK (e_meeting_time_selector_on_autopick_button_clicked), mts); @@ -699,8 +717,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, child = gtk_bin_get_child (GTK_BIN (mts->autopick_up_button)); gtk_label_set_text_with_mnemonic (GTK_LABEL (child), _(">_>")); accel_key = gtk_label_get_mnemonic_keyval (GTK_LABEL (child)); - gtk_widget_add_accelerator (mts->autopick_up_button, "clicked", mts->accel_group, - accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); + gtk_widget_add_accelerator ( + mts->autopick_up_button, "clicked", mts->accel_group, + accel_key, GDK_MOD1_MASK | GDK_SHIFT_MASK, 0); gtk_box_pack_start (GTK_BOX (hbox), mts->autopick_up_button, TRUE, TRUE, 6); gtk_widget_show (mts->autopick_up_button); g_signal_connect ( @@ -709,8 +728,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the Autopick menu. */ mts->autopick_menu = gtk_menu_new (); - gtk_menu_attach_to_widget (GTK_MENU (mts->autopick_menu), mts->autopick_button, - e_meeting_time_selector_autopick_menu_detacher); + gtk_menu_attach_to_widget ( + GTK_MENU (mts->autopick_menu), mts->autopick_button, + e_meeting_time_selector_autopick_menu_detacher); menuitem = gtk_radio_menu_item_new_with_label (NULL, ""); mts->autopick_all_item = menuitem; @@ -757,8 +777,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, /* Create the date entry fields on the right. */ alignment = gtk_alignment_new (0.0, 0.5, 0, 0); - gtk_table_attach (GTK_TABLE (mts), alignment, - 1, 4, 5, 6, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (mts), alignment, + 1, 4, 5, 6, GTK_FILL, 0, 0, 0); gtk_widget_show (alignment); table = gtk_table_new (2, 2, FALSE); @@ -771,9 +792,10 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, a11y_label = gtk_widget_get_accessible (label); a11y_date_edit = gtk_widget_get_accessible (mts->start_date_edit); if (a11y_label != NULL && a11y_date_edit != NULL) { - atk_object_add_relationship (a11y_date_edit, - ATK_RELATION_LABELLED_BY, - a11y_label); + atk_object_add_relationship ( + a11y_date_edit, + ATK_RELATION_LABELLED_BY, + a11y_label); } e_date_edit_set_show_time (E_DATE_EDIT (mts->start_date_edit), TRUE); @@ -792,8 +814,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->start_date_edit, "week-start-day", G_BINDING_SYNC_CREATE); - gtk_table_attach (GTK_TABLE (table), mts->start_date_edit, - 1, 2, 0, 1, GTK_FILL, 0, 0, 0); + 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); g_signal_connect ( mts->start_date_edit, "changed", @@ -803,8 +826,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, gtk_label_set_mnemonic_widget (GTK_LABEL (label), (mts->start_date_edit)); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, 0, 1, GTK_FILL, 0, 4, 0); + gtk_table_attach ( + GTK_TABLE (table), label, + 0, 1, 0, 1, GTK_FILL, 0, 4, 0); gtk_widget_show (label); mts->end_date_edit = e_date_edit_new (); @@ -812,7 +836,8 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, a11y_label = gtk_widget_get_accessible (label); a11y_date_edit = gtk_widget_get_accessible (mts->end_date_edit); if (a11y_label != NULL && a11y_date_edit != NULL) { - atk_object_add_relationship (a11y_date_edit, + atk_object_add_relationship ( + a11y_date_edit, ATK_RELATION_LABELLED_BY, a11y_label); } @@ -833,8 +858,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, mts->end_date_edit, "week-start-day", G_BINDING_SYNC_CREATE); - gtk_table_attach (GTK_TABLE (table), mts->end_date_edit, - 1, 2, 1, 2, GTK_FILL, 0, 0, 0); + gtk_table_attach ( + GTK_TABLE (table), mts->end_date_edit, + 1, 2, 1, 2, GTK_FILL, 0, 0, 0); gtk_widget_show (mts->end_date_edit); g_signal_connect ( mts->end_date_edit, "changed", @@ -844,8 +870,9 @@ e_meeting_time_selector_construct (EMeetingTimeSelector *mts, gtk_label_set_mnemonic_widget (GTK_LABEL (label), (mts->end_date_edit)); gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.5); - gtk_table_attach (GTK_TABLE (table), label, - 0, 1, 1, 2, GTK_FILL, 0, 4, 0); + gtk_table_attach ( + GTK_TABLE (table), label, + 0, 1, 1, 2, GTK_FILL, 0, 4, 0); gtk_widget_show (label); gtk_table_set_col_spacing (GTK_TABLE (mts), 0, 4); @@ -942,9 +969,10 @@ e_meeting_time_selector_draw_key_color (GtkWidget *darea, } else { cairo_set_source (cr, mts->no_info_pattern); } - cairo_rectangle (cr, - 1, 1, - allocation.width - 2, allocation.height - 2); + cairo_rectangle ( + cr, + 1, 1, + allocation.width - 2, allocation.height - 2); cairo_fill (cr); return TRUE; @@ -958,7 +986,7 @@ e_meeting_time_selector_alloc_named_color (EMeetingTimeSelector *mts, g_return_if_fail (name != NULL); g_return_if_fail (c != NULL); - if ( !gdk_color_parse (name, c)) + if (!gdk_color_parse (name, c)) g_warning ("Failed to parse color: %s\n", name); } @@ -1018,7 +1046,7 @@ e_meeting_time_selector_set_show_week_numbers (EMeetingTimeSelector *mts, { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); - if ((mts->priv->show_week_numbers ? 1 : 0) == (show_week_numbers ? 1 : 0)) + if (mts->priv->show_week_numbers == show_week_numbers) return; mts->priv->show_week_numbers = show_week_numbers; @@ -1040,7 +1068,7 @@ e_meeting_time_selector_set_use_24_hour_format (EMeetingTimeSelector *mts, { g_return_if_fail (E_IS_MEETING_TIME_SELECTOR (mts)); - if ((mts->priv->use_24_hour_format ? 1 : 0) == (use_24_hour_format ? 1 : 0)) + if (mts->priv->use_24_hour_format == use_24_hour_format) return; mts->priv->use_24_hour_format = use_24_hour_format; @@ -1078,8 +1106,9 @@ e_meeting_time_selector_create_no_info_pattern (EMeetingTimeSelector *mts) GdkColor color; cairo_t *cr; - surface = gdk_window_create_similar_surface (gtk_widget_get_window (GTK_WIDGET (mts)), - CAIRO_CONTENT_COLOR, 8, 8); + surface = gdk_window_create_similar_surface ( + gtk_widget_get_window (GTK_WIDGET (mts)), + CAIRO_CONTENT_COLOR, 8, 8); cr = cairo_create (surface); gdk_color_parse ("white", &color); @@ -1138,9 +1167,10 @@ get_cell_height (GtkTreeView *tree) gint height = -1; column = gtk_tree_view_get_column (tree, 0); - gtk_tree_view_column_cell_get_size (column, NULL, - NULL, NULL, - NULL, &height); + gtk_tree_view_column_cell_get_size ( + column, NULL, + NULL, NULL, + NULL, &height); return height; } @@ -1162,8 +1192,9 @@ style_change_idle_func (EMeetingTimeSelector *mts) widget = GTK_WIDGET (mts); font_desc = gtk_widget_get_style (widget)->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + 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. */ @@ -1194,8 +1225,9 @@ style_change_idle_func (EMeetingTimeSelector *mts) * * gtk_widget_realize (mts->list_view); - gdk_window_get_position (gtk_tree_view_get_bin_window (GTK_TREE_VIEW (mts->list_view)), - NULL, &maxheight); + gdk_window_get_position ( + gtk_tree_view_get_bin_window (GTK_TREE_VIEW (mts->list_view)), + NULL, &maxheight); gtk_widget_set_size_request (mts->attendees_vbox_spacer, 1, mts->row_height * 3 - maxheight); * */ @@ -1356,12 +1388,14 @@ e_meeting_time_selector_set_meeting_time (EMeetingTimeSelector *mts, || end_minute < 0 || end_minute > 59) return FALSE; - g_date_set_dmy (&mts->meeting_start_time.date, start_day, start_month, + g_date_set_dmy ( + &mts->meeting_start_time.date, start_day, start_month, start_year); mts->meeting_start_time.hour = start_hour; mts->meeting_start_time.minute = start_minute; - g_date_set_dmy (&mts->meeting_end_time.date, end_day, end_month, - end_year); + g_date_set_dmy ( + &mts->meeting_end_time.date, + end_day, end_month, end_year); mts->meeting_end_time.hour = end_hour; mts->meeting_end_time.minute = end_minute; @@ -1387,10 +1421,12 @@ e_meeting_time_selector_set_all_day (EMeetingTimeSelector *mts, 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), - !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), + !all_day); e_meeting_time_selector_save_position (mts, &saved_time); e_meeting_time_selector_recalc_grid (mts); @@ -1508,7 +1544,7 @@ e_meeting_time_selector_refresh_cb (gpointer data) if (mts->display_main != NULL) gtk_widget_queue_draw (mts->display_main); - g_object_unref (G_OBJECT (mts)); + g_object_unref (mts); return FALSE; } @@ -1559,17 +1595,19 @@ e_meeting_time_selector_refresh_free_busy (EMeetingTimeSelector *mts, gint i; for (i = 0; i < e_meeting_store_count_actual_attendees (mts->model); i++) - g_object_ref (G_OBJECT (mts)); + g_object_ref (mts); } else { - g_object_ref (G_OBJECT (mts)); + g_object_ref (mts); } if (all) - e_meeting_store_refresh_all_busy_periods (mts->model, &start, &end, - e_meeting_time_selector_refresh_cb, mts); + 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_time_selector_refresh_cb, mts); + e_meeting_store_refresh_busy_periods ( + mts->model, row, &start, &end, + e_meeting_time_selector_refresh_cb, mts); } EMeetingTimeSelectorAutopickOption @@ -1653,8 +1691,9 @@ e_meeting_time_selector_dump (EMeetingTimeSelector *mts) attendee = &g_array_index (mts->attendees, EMeetingTimeSelectorAttendee, row); g_print ("Attendee: %s\n", attendee->name); - g_print (" Longest Busy Period: %i days\n", - attendee->longest_period_in_days); + g_print ( + " Longest Busy Period: %i days\n", + attendee->longest_period_in_days); e_meeting_time_selector_attendee_ensure_periods_sorted (mts, attendee); #if 1 @@ -1666,15 +1705,19 @@ e_meeting_time_selector_dump (EMeetingTimeSelector *mts) period_num); /* These are just for debugging so don't need i18n. */ - g_date_strftime (buffer, sizeof (buffer), - "%A, %B %d, %Y", &period->start.date); - g_print (" Start: %s %i:%02i\n", buffer, - period->start.hour, period->start.minute); - - g_date_strftime (buffer, sizeof (buffer), - "%A, %B %d, %Y", &period->end.date); - g_print (" End : %s %i:%02i\n", buffer, - period->end.hour, period->end.minute); + g_date_strftime ( + buffer, sizeof (buffer), + "%A, %B %d, %Y", &period->start.date); + g_print ( + " Start: %s %i:%02i\n", buffer, + period->start.hour, period->start.minute); + + g_date_strftime ( + buffer, sizeof (buffer), + "%A, %B %d, %Y", &period->end.date); + g_print ( + " End : %s %i:%02i\n", buffer, + period->end.hour, period->end.minute); } #endif } @@ -1691,10 +1734,12 @@ e_meeting_time_selector_dump_time (EMeetingTime *mtstime) gchar buffer2[128]; /* This is just for debugging so doesn't need i18n. */ - g_date_strftime (buffer, sizeof (buffer), "%A, %B %d, %Y", - &mtstime->date); - sprintf (buffer2, " at %i:%02i", (gint) mtstime->hour, - (gint) mtstime->minute); + g_date_strftime ( + buffer, sizeof (buffer), "%A, %B %d, %Y", + &mtstime->date); + sprintf ( + buffer2, " at %i:%02i", (gint) mtstime->hour, + (gint) mtstime->minute); strcat (buffer, buffer2); return buffer; @@ -1725,9 +1770,10 @@ static void e_meeting_time_selector_on_options_button_clicked (GtkWidget *button, EMeetingTimeSelector *mts) { - gtk_menu_popup (GTK_MENU (mts->options_menu), NULL, NULL, - e_meeting_time_selector_options_menu_position_callback, - mts, 1, GDK_CURRENT_TIME); + gtk_menu_popup ( + GTK_MENU (mts->options_menu), NULL, NULL, + e_meeting_time_selector_options_menu_position_callback, + mts, 1, GDK_CURRENT_TIME); } static void @@ -1778,9 +1824,10 @@ static void e_meeting_time_selector_on_autopick_button_clicked (GtkWidget *button, EMeetingTimeSelector *mts) { - gtk_menu_popup (GTK_MENU (mts->autopick_menu), NULL, NULL, - e_meeting_time_selector_autopick_menu_position_callback, - mts, 1, GDK_CURRENT_TIME); + gtk_menu_popup ( + GTK_MENU (mts->autopick_menu), NULL, NULL, + e_meeting_time_selector_autopick_menu_position_callback, + mts, 1, GDK_CURRENT_TIME); } static void @@ -2281,10 +2328,11 @@ e_meeting_time_selector_recalc_grid (EMeetingTimeSelector *mts) /* Add one pixel for the extra vertical grid line. */ mts->day_width++; - gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_top), - 0, 0, - mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, - mts->row_height * 3); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (mts->display_top), + 0, 0, + mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, + mts->row_height * 3); e_meeting_time_selector_update_main_canvas_scroll_region (mts); e_meeting_time_selector_recalc_date_format (mts); @@ -2298,8 +2346,9 @@ e_meeting_time_selector_save_position (EMeetingTimeSelector *mts, { gint scroll_x, scroll_y; - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); e_meeting_time_selector_calculate_time (mts, scroll_x, mtstime); } @@ -2310,12 +2359,14 @@ e_meeting_time_selector_restore_position (EMeetingTimeSelector *mts, { gint scroll_x, scroll_y, new_scroll_x; - new_scroll_x = e_meeting_time_selector_calculate_time_position (mts, - mtstime); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); - gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), - new_scroll_x, scroll_y); + new_scroll_x = e_meeting_time_selector_calculate_time_position ( + mts, mtstime); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_main), + new_scroll_x, scroll_y); } /* This returns the x pixel coords of the meeting time in the entire scroll @@ -2420,8 +2471,9 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } } - g_date_set_dmy (&date, days[longest_month - 1] + longest_weekday, - longest_month, 2000); + g_date_set_dmy ( + &date, days[longest_month - 1] + longest_weekday, + longest_month, 2000); g_date_to_struct_tm (&date, &tm_time); str = e_datetime_format_format_tm ("calendar", "table", DTFormatKindDate, &tm_time); @@ -2439,8 +2491,9 @@ e_meeting_time_selector_recalc_date_format (EMeetingTimeSelector *mts) } #if 0 - g_print ("longest_month: %i longest_weekday: %i date: %s\n", - longest_month, longest_weekday, str); + g_print ( + "longest_month: %i longest_weekday: %i date: %s\n", + longest_month, longest_weekday, str); #endif pango_layout_set_text (layout, str, -1); @@ -2620,10 +2673,11 @@ e_meeting_time_selector_update_main_canvas_scroll_region (EMeetingTimeSelector * height = mts->row_height * (e_meeting_store_count_actual_attendees (mts->model) + 2); height = MAX (height, allocation.height); - gnome_canvas_set_scroll_region (GNOME_CANVAS (mts->display_main), - 0, 0, - mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, - height); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (mts->display_main), + 0, 0, + mts->day_width * E_MEETING_TIME_SELECTOR_DAYS_SHOWN, + height); } /* This changes the meeting time based on the given x coordinate and whether @@ -2641,8 +2695,9 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, GtkAllocation allocation; /* Get the x coords of visible part of the canvas. */ - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); gtk_widget_get_allocation (mts->display_main, &allocation); canvas_width = allocation.width; @@ -2668,8 +2723,8 @@ e_meeting_time_selector_drag_meeting_time (EMeetingTimeSelector *mts, /* Calculate the minimum & maximum times we can use, based on the * scroll offsets and whether zoomed_out is set. */ e_meeting_time_selector_calculate_time (mts, scroll_x, &first_time); - e_meeting_time_selector_calculate_time (mts, scroll_x + canvas_width - 1, - &last_time); + e_meeting_time_selector_calculate_time ( + mts, scroll_x + canvas_width - 1, &last_time); if (!mts->all_day) { if (mts->zoomed_out) { if (first_time.minute > 30) @@ -2799,15 +2854,17 @@ e_meeting_time_selector_timeout_handler (gpointer data) return TRUE; /* Get the x coords of visible part of the canvas. */ - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (mts->display_main), - &scroll_x, &scroll_y); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); gtk_widget_get_allocation (mts->display_main, &allocation); canvas_width = allocation.width; /* Calculate the scroll delay, between 0 and MAX_SCROLL_SPEED. */ scroll_speed = abs (mts->last_drag_x / E_MEETING_TIME_SELECTOR_SCROLL_INCREMENT_WIDTH); - scroll_speed = MIN (scroll_speed, - E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED); + scroll_speed = MIN ( + scroll_speed, + E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED); /* Reset the scroll count. */ mts->scroll_count = E_MEETING_TIME_SELECTOR_MAX_SCROLL_SPEED - scroll_speed; @@ -2826,9 +2883,8 @@ e_meeting_time_selector_timeout_handler (gpointer data) /* Calculate the minimum or maximum visible time in the canvas, which * we will now set the dragged time to. */ if (scroll_offset > 0) { - e_meeting_time_selector_calculate_time (mts, - scroll_x + canvas_width - 1, - &drag_time); + e_meeting_time_selector_calculate_time ( + mts, scroll_x + canvas_width - 1, &drag_time); if (!mts->all_day) { if (mts->zoomed_out) { drag_time.minute = 0; @@ -2840,8 +2896,8 @@ e_meeting_time_selector_timeout_handler (gpointer data) drag_time.minute = 0; } } else { - e_meeting_time_selector_calculate_time (mts, scroll_x, - &drag_time); + e_meeting_time_selector_calculate_time ( + mts, scroll_x, &drag_time); if (!mts->all_day) { if (mts->zoomed_out) { if (drag_time.minute > 30) @@ -2918,10 +2974,12 @@ e_meeting_time_selector_timeout_handler (gpointer data) * get redrawn completely. Otherwise the pixels get scrolled left or * right which is not good for us (since our vertical bars have been * moved) and causes flicker. */ - gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), - scroll_x, scroll_y); - gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_top), - scroll_x, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_main), + scroll_x, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_top), + scroll_x, scroll_y); return TRUE; } @@ -2940,12 +2998,13 @@ e_meeting_time_selector_remove_timeout (EMeetingTimeSelector *mts) static void e_meeting_time_selector_update_start_date_edit (EMeetingTimeSelector *mts) { - e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (mts->start_date_edit), - g_date_get_year (&mts->meeting_start_time.date), - g_date_get_month (&mts->meeting_start_time.date), - g_date_get_day (&mts->meeting_start_time.date), - mts->meeting_start_time.hour, - mts->meeting_start_time.minute); + e_date_edit_set_date_and_time_of_day ( + E_DATE_EDIT (mts->start_date_edit), + g_date_get_year (&mts->meeting_start_time.date), + g_date_get_month (&mts->meeting_start_time.date), + g_date_get_day (&mts->meeting_start_time.date), + mts->meeting_start_time.hour, + mts->meeting_start_time.minute); } /* This updates the GnomeDateEdit widget displaying the meeting end time. */ @@ -2958,12 +3017,13 @@ e_meeting_time_selector_update_end_date_edit (EMeetingTimeSelector *mts) if (mts->all_day) g_date_subtract_days (&date, 1); - e_date_edit_set_date_and_time_of_day (E_DATE_EDIT (mts->end_date_edit), - g_date_get_year (&date), - g_date_get_month (&date), - g_date_get_day (&date), - mts->meeting_end_time.hour, - mts->meeting_end_time.minute); + e_date_edit_set_date_and_time_of_day ( + E_DATE_EDIT (mts->end_date_edit), + g_date_get_year (&date), + g_date_get_month (&date), + g_date_get_day (&date), + mts->meeting_end_time.hour, + mts->meeting_end_time.minute); } /* This ensures that the meeting time is shown on screen, by scrolling the @@ -2995,15 +3055,17 @@ e_meeting_time_selector_ensure_meeting_time_shown (EMeetingTimeSelector *mts) 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); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (mts->display_main), + &scroll_x, &scroll_y); gtk_widget_get_allocation (mts->display_main, &allocation); if (start_x > scroll_x && end_x <= scroll_x + allocation.width) return; new_scroll_x = start_x; - gnome_canvas_scroll_to (GNOME_CANVAS (mts->display_main), - new_scroll_x, scroll_y); + gnome_canvas_scroll_to ( + GNOME_CANVAS (mts->display_main), + new_scroll_x, scroll_y); } /* This updates the range of dates shown in the canvas, to make sure that the @@ -3012,12 +3074,14 @@ static void e_meeting_time_selector_update_dates_shown (EMeetingTimeSelector *mts) { mts->first_date_shown = mts->meeting_start_time.date; - g_date_subtract_days (&mts->first_date_shown, - E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE); + g_date_subtract_days ( + &mts->first_date_shown, + E_MEETING_TIME_SELECTOR_DAYS_START_BEFORE); mts->last_date_shown = mts->first_date_shown; - g_date_add_days (&mts->last_date_shown, - E_MEETING_TIME_SELECTOR_DAYS_SHOWN - 1); + g_date_add_days ( + &mts->last_date_shown, + E_MEETING_TIME_SELECTOR_DAYS_SHOWN - 1); } /* This checks if the time's hour is over 24 or its minute is over 60 and if @@ -3107,8 +3171,8 @@ e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, gint day_position; /* First get the day and the x position within the day. */ - e_meeting_time_selector_calculate_day_and_position (mts, x, &time->date, - NULL); + e_meeting_time_selector_calculate_day_and_position ( + mts, x, &time->date, NULL); /* Now convert the day_position into an hour and minute. */ if (x >= 0) @@ -3116,7 +3180,8 @@ e_meeting_time_selector_calculate_time (EMeetingTimeSelector *mts, else day_position = mts->day_width + x % mts->day_width; - e_meeting_time_selector_convert_day_position_to_hours_and_mins (mts, day_position, &time->hour, &time->minute); + e_meeting_time_selector_convert_day_position_to_hours_and_mins ( + mts, day_position, &time->hour, &time->minute); } /* This takes a EMeetingTime and calculates the x pixel coordinate @@ -3130,7 +3195,9 @@ e_meeting_time_selector_calculate_time_position (EMeetingTimeSelector *mts, /* Calculate the number of days since the first date shown in the * entire canvas scroll region. */ - date_offset = g_date_get_julian (&mtstime->date) - g_date_get_julian (&mts->first_date_shown); + date_offset = + g_date_get_julian (&mtstime->date) - + g_date_get_julian (&mts->first_date_shown); /* Calculate the x pixel coordinate of the start of the day. */ x = date_offset * mts->day_width; diff --git a/calendar/gui/e-meeting-utils.c b/calendar/gui/e-meeting-utils.c index 369e819fc3..89149e77e9 100644 --- a/calendar/gui/e-meeting-utils.c +++ b/calendar/gui/e-meeting-utils.c @@ -33,8 +33,8 @@ e_meeting_time_compare_times (EMeetingTime *time1, { gint day_comparison; - day_comparison = g_date_compare (&time1->date, - &time2->date); + day_comparison = g_date_compare (&time1->date, &time2->date); + if (day_comparison != 0) return day_comparison; diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index ab86209dd5..45d51b9060 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -542,7 +542,7 @@ memo_table_query_tooltip (GtkWidget *widget, e_cal_component_get_organizer (new_comp, &organizer); if (organizer.cn) { gchar *ptr; - ptr = strchr ( organizer.value, ':'); + ptr = strchr (organizer.value, ':'); if (ptr) { ptr++; diff --git a/calendar/gui/e-select-names-editable.c b/calendar/gui/e-select-names-editable.c index 9e18175b15..b45f7eb820 100644 --- a/calendar/gui/e-select-names-editable.c +++ b/calendar/gui/e-select-names-editable.c @@ -54,11 +54,12 @@ e_select_names_editable_new (void) EShell *shell; /* Might be cleaner to have 'registry' passed in, but the call chain - of this widget doesn't have access that low in the functions, thus - making the change without (private) API break. */ + * of this widget doesn't have access that low in the functions, thus + * making the change without (private) API break. */ shell = e_shell_get_default (); - return g_object_new (E_TYPE_SELECT_NAMES_EDITABLE, + return g_object_new ( + E_TYPE_SELECT_NAMES_EDITABLE, "registry", e_shell_get_registry (shell), NULL); } diff --git a/calendar/gui/e-select-names-renderer.c b/calendar/gui/e-select-names-renderer.c index b3a00d5d7e..311616dd80 100644 --- a/calendar/gui/e-select-names-renderer.c +++ b/calendar/gui/e-select-names-renderer.c @@ -79,7 +79,7 @@ e_select_names_renderer_editing_done (GtkCellEditable *editable, names = e_select_names_editable_get_names (E_SELECT_NAMES_EDITABLE (editable)); /* remove empty addresses */ - for (a = addresses, n = names; a && n; ) { + for (a = addresses, n = names; a && n;) { gchar *addr = a->data, *nm = n->data; if ((!addr || !*addr) && (!nm || !*nm)) { diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index 56c4304ee2..ed73cbe6ef 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -484,11 +484,12 @@ task_table_constructed (GObject *object) * Normal string fields. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, - "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - NULL); + g_object_set ( + cell, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, + "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + NULL); e_table_extras_add_cell (extras, "calstring", cell); g_object_unref (cell); @@ -497,11 +498,12 @@ task_table_constructed (GObject *object) * Date fields. */ cell = e_cell_date_edit_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, - "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - NULL); + g_object_set ( + cell, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, + "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + NULL); g_object_bind_property ( model, "timezone", @@ -540,12 +542,13 @@ task_table_constructed (GObject *object) /* Classification field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, - "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - "editable", FALSE, - NULL); + g_object_set ( + cell, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, + "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -555,8 +558,9 @@ task_table_constructed (GObject *object) strings = g_list_append (strings, (gchar *) _("Public")); strings = g_list_append (strings, (gchar *) _("Private")); strings = g_list_append (strings, (gchar *) _("Confidential")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "classification", popup_cell); @@ -564,12 +568,13 @@ task_table_constructed (GObject *object) /* Priority field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, - "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - "editable", FALSE, - NULL); + g_object_set ( + cell, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, + "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -580,8 +585,9 @@ task_table_constructed (GObject *object) strings = g_list_append (strings, (gchar *) _("Normal")); strings = g_list_append (strings, (gchar *) _("Low")); strings = g_list_append (strings, (gchar *) _("Undefined")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "priority", popup_cell); @@ -589,11 +595,12 @@ task_table_constructed (GObject *object) /* Percent field. */ cell = e_cell_percent_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, - "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - NULL); + g_object_set ( + cell, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, + "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -607,8 +614,9 @@ task_table_constructed (GObject *object) */ strings = g_list_append (strings, g_strdup_printf (_("%d%%"), percent)); } - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_foreach (strings, (GFunc) g_free, NULL); g_list_free (strings); @@ -618,12 +626,13 @@ task_table_constructed (GObject *object) /* Transparency field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, - "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - "editable", FALSE, - NULL); + g_object_set ( + cell, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, + "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -632,8 +641,9 @@ task_table_constructed (GObject *object) strings = NULL; strings = g_list_append (strings, (gchar *) _("Free")); strings = g_list_append (strings, (gchar *) _("Busy")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "transparency", popup_cell); @@ -641,12 +651,13 @@ task_table_constructed (GObject *object) /* Status field. */ cell = e_cell_text_new (NULL, GTK_JUSTIFY_LEFT); - g_object_set (cell, - "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, - "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, - "bg_color_column", E_CAL_MODEL_FIELD_COLOR, - "editable", FALSE, - NULL); + g_object_set ( + cell, + "strikeout_column", E_CAL_MODEL_TASKS_FIELD_STRIKEOUT, + "bold_column", E_CAL_MODEL_TASKS_FIELD_OVERDUE, + "bg_color_column", E_CAL_MODEL_FIELD_COLOR, + "editable", FALSE, + NULL); popup_cell = e_cell_combo_new (); e_cell_popup_set_child (E_CELL_POPUP (popup_cell), cell); @@ -657,21 +668,26 @@ task_table_constructed (GObject *object) strings = g_list_append (strings, (gchar *) _("In Progress")); strings = g_list_append (strings, (gchar *) _("Completed")); strings = g_list_append (strings, (gchar *) _("Canceled")); - e_cell_combo_set_popdown_strings (E_CELL_COMBO (popup_cell), - strings); + e_cell_combo_set_popdown_strings ( + E_CELL_COMBO (popup_cell), + strings); g_list_free (strings); e_table_extras_add_cell (extras, "calstatus", popup_cell); g_object_unref (popup_cell); - e_table_extras_add_compare (extras, "date-compare", - e_cell_date_edit_compare_cb); - e_table_extras_add_compare (extras, "percent-compare", - task_table_percent_compare_cb); - e_table_extras_add_compare (extras, "priority-compare", - task_table_priority_compare_cb); - e_table_extras_add_compare (extras, "status-compare", - task_table_status_compare_cb); + e_table_extras_add_compare ( + extras, "date-compare", + e_cell_date_edit_compare_cb); + e_table_extras_add_compare ( + extras, "percent-compare", + task_table_percent_compare_cb); + e_table_extras_add_compare ( + extras, "priority-compare", + task_table_priority_compare_cb); + e_table_extras_add_compare ( + extras, "status-compare", + task_table_status_compare_cb); /* Create pixmaps */ @@ -815,7 +831,7 @@ task_table_query_tooltip (GtkWidget *widget, e_cal_component_get_organizer (new_comp, &organizer); if (organizer.cn) { gchar *ptr; - ptr = strchr ( organizer.value, ':'); + ptr = strchr (organizer.value, ':'); if (ptr) { ptr++; @@ -1681,17 +1697,21 @@ hide_completed_rows_ready (GObject *source_object, GPtrArray *comp_objects; GError *error = NULL; - if (!e_cal_client_get_object_list_finish (E_CAL_CLIENT (source_object), result, &objects, &error)) { + e_cal_client_get_object_list_finish ( + E_CAL_CLIENT (source_object), result, &objects, &error); + + if (error != NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { ESource *source = e_client_get_source (E_CLIENT (source_object)); - g_debug ("%s: Could not get the objects from '%s': %s", + g_debug ( + "%s: Could not get the objects from '%s': %s", G_STRFUNC, e_source_get_display_name (source), - error ? error->message : "Unknown error"); + error->message); } - g_clear_error (&error); + g_error_free (error); return; } @@ -1743,17 +1763,21 @@ show_completed_rows_ready (GObject *source_object, GPtrArray *comp_objects; GError *error = NULL; - if (!e_cal_client_get_object_list_finish (E_CAL_CLIENT (source_object), result, &objects, &error)) { + e_cal_client_get_object_list_finish ( + E_CAL_CLIENT (source_object), result, &objects, &error); + + if (error != NULL) { if (!g_error_matches (error, G_IO_ERROR, G_IO_ERROR_CANCELLED) && !g_error_matches (error, E_CLIENT_ERROR, E_CLIENT_ERROR_CANCELLED)) { ESource *source = e_client_get_source (E_CLIENT (source_object)); - g_debug ("%s: Could not get the objects from '%s': %s", + g_debug ( + "%s: Could not get the objects from '%s': %s", G_STRFUNC, e_source_get_display_name (source), - error ? error->message : "Unknown error"); + error->message); } - g_clear_error (&error); + g_error_free (error); return; } @@ -1865,13 +1889,15 @@ e_task_table_process_completed_tasks (ETaskTable *task_table, /* Delete rows from model*/ if (hide_sexp) { - task_table_get_object_list_async (clients_list, hide_sexp, cancellable, + task_table_get_object_list_async ( + clients_list, hide_sexp, cancellable, hide_completed_rows_ready, model); } /* Insert rows into model */ if (config_changed) { - task_table_get_object_list_async (clients_list, show_sexp, cancellable, + task_table_get_object_list_async ( + clients_list, show_sexp, cancellable, show_completed_rows_ready, model); } diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 13de066ce5..6cd4a9048a 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -210,8 +210,9 @@ week_view_event_item_button_press (EWeekViewEventItem *event_item, span = &g_array_index (week_view->spans, EWeekViewEventSpan, event->spans_index + event_item->priv->span_num); - pos = week_view_event_item_get_position (event_item, bevent->button.x, - bevent->button.y); + pos = week_view_event_item_get_position ( + event_item, bevent->button.x, + bevent->button.y); if (pos == E_CALENDAR_VIEW_POS_NONE) return FALSE; @@ -275,10 +276,11 @@ week_view_event_item_button_release (EWeekViewEventItem *event_item, if (week_view->pressed_event_num != -1 && week_view->pressed_event_num == event_item->priv->event_num && week_view->pressed_span_num == event_item->priv->span_num) { - e_week_view_start_editing_event (week_view, - event_item->priv->event_num, - event_item->priv->span_num, - NULL); + e_week_view_start_editing_event ( + week_view, + event_item->priv->event_num, + event_item->priv->span_num, + NULL); week_view->pressed_event_num = -1; return TRUE; } @@ -320,25 +322,29 @@ week_view_draw_time (EWeekView *week_view, if (small_font_desc) time_y_small_font = time_y; - e_week_view_convert_time_to_display (week_view, hour, &hour_to_display, - &suffix, &suffix_width); + e_week_view_convert_time_to_display ( + week_view, hour, &hour_to_display, + &suffix, &suffix_width); if (week_view->use_small_font && week_view->small_font_desc) { - g_snprintf (buffer, sizeof (buffer), "%2i:%02i", - hour_to_display, minute); + g_snprintf ( + buffer, sizeof (buffer), "%2i:%02i", + hour_to_display, minute); /* Draw the hour. */ if (hour_to_display < 10) { pango_layout_set_text (layout, buffer + 1, 1); - cairo_move_to (cr, - time_x + week_view->digit_width, - time_y_normal_font); + cairo_move_to ( + cr, + time_x + week_view->digit_width, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } else { pango_layout_set_text (layout, buffer, 2); - cairo_move_to (cr, - time_x, - time_y_normal_font); + cairo_move_to ( + cr, + time_x, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } @@ -347,9 +353,10 @@ week_view_draw_time (EWeekView *week_view, /* Draw the start minute, in the small font. */ pango_layout_set_font_description (layout, week_view->small_font_desc); pango_layout_set_text (layout, buffer + 3, 2); - cairo_move_to (cr, - time_x, - time_y_small_font); + cairo_move_to ( + cr, + time_x, + time_y_small_font); pango_cairo_show_layout (cr, layout); pango_layout_set_font_description (layout, style->font_desc); @@ -360,26 +367,30 @@ week_view_draw_time (EWeekView *week_view, if (!e_cal_model_get_use_24_hour_format (model)) { pango_layout_set_text (layout, suffix, -1); - cairo_move_to (cr, - time_x, - time_y_normal_font); + cairo_move_to ( + cr, + time_x, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } } else { /* Draw the start time in one go. */ - g_snprintf (buffer, sizeof (buffer), "%2i:%02i%s", - hour_to_display, minute, suffix); + g_snprintf ( + buffer, sizeof (buffer), "%2i:%02i%s", + hour_to_display, minute, suffix); if (hour_to_display < 10) { pango_layout_set_text (layout, buffer + 1, -1); - cairo_move_to (cr, - time_x + week_view->digit_width, - time_y_normal_font); + cairo_move_to ( + cr, + time_x + week_view->digit_width, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } else { pango_layout_set_text (layout, buffer, -1); - cairo_move_to (cr, - time_x, - time_y_normal_font); + cairo_move_to ( + cr, + time_x, + time_y_normal_font); pango_cairo_show_layout (cr, layout); } @@ -1035,11 +1046,12 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); - cairo_rectangle (cr, - x1, y1, - x2 - x1 - E_WEEK_VIEW_EVENT_R_PAD - - E_WEEK_VIEW_EVENT_BORDER_WIDTH + 1, - y2 - y1 + 1); + cairo_rectangle ( + cr, + x1, y1, + x2 - x1 - E_WEEK_VIEW_EVENT_R_PAD + - E_WEEK_VIEW_EVENT_BORDER_WIDTH + 1, + y2 - y1 + 1); cairo_clip (cr); week_view_draw_time ( diff --git a/calendar/gui/e-week-view-layout.c b/calendar/gui/e-week-view-layout.c index 1e7f6366b1..67f3943aeb 100644 --- a/calendar/gui/e-week-view-layout.c +++ b/calendar/gui/e-week-view-layout.c @@ -83,11 +83,12 @@ e_week_view_layout_events (GArray *events, * them in the first free row available. */ for (event_num = 0; event_num < events->len; event_num++) { event = &g_array_index (events, EWeekViewEvent, event_num); - e_week_view_layout_event (event, grid, spans, old_spans, - multi_week_view, - weeks_shown, compress_weekend, - start_weekday, day_starts, - rows_per_day); + e_week_view_layout_event ( + event, grid, spans, old_spans, + multi_week_view, + weeks_shown, compress_weekend, + start_weekday, day_starts, + rows_per_day); } /* Free the grid. */ @@ -126,16 +127,19 @@ e_week_view_layout_event (EWeekViewEvent *event, EWeekViewEventSpan span, *old_span; days_shown = multi_week_view ? weeks_shown * 7 : 7; - start_day = e_week_view_find_day (event->start, FALSE, days_shown, - day_starts); - end_day = e_week_view_find_day (event->end, TRUE, days_shown, + start_day = e_week_view_find_day ( + event->start, FALSE, days_shown, + day_starts); + end_day = e_week_view_find_day ( + event->end, TRUE, days_shown, day_starts); start_day = CLAMP (start_day, 0, days_shown - 1); end_day = CLAMP (end_day, 0, days_shown - 1); #if 0 - g_print ("In e_week_view_layout_event Start:%i End: %i\n", - start_day, end_day); + g_print ( + "In e_week_view_layout_event Start:%i End: %i\n", + start_day, end_day); #endif /* Iterate through each of the spans of the event, where each span @@ -146,14 +150,16 @@ e_week_view_layout_event (EWeekViewEvent *event, spans_index = spans->len; num_spans = 0; while (span_start_day <= end_day) { - span_end_day = e_week_view_find_span_end (multi_week_view, - compress_weekend, - start_weekday, - span_start_day); + span_end_day = e_week_view_find_span_end ( + multi_week_view, + compress_weekend, + start_weekday, + span_start_day); span_end_day = MIN (span_end_day, end_day); #if 0 - g_print (" Span start:%i end:%i\n", span_start_day, - span_end_day); + g_print ( + " Span start:%i end:%i\n", span_start_day, + span_end_day); #endif /* Try each row until we find a free one or we fall off the * bottom of the available rows. */ @@ -176,12 +182,14 @@ e_week_view_layout_event (EWeekViewEvent *event, for (day = span_start_day; day <= span_end_day; day++) { grid[day * rows_per_cell + free_row] = 1; - rows_per_day[day] = MAX (rows_per_day[day], - free_row + 1); + rows_per_day[day] = MAX ( + rows_per_day[day], + free_row + 1); } #if 0 - g_print (" Span start:%i end:%i row:%i\n", - span_start_day, span_end_day, free_row); + g_print ( + " Span start:%i end:%i row:%i\n", + span_start_day, span_end_day, free_row); #endif /* Add the span to the array, and try to reuse any * canvas items from the old spans. */ diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index edf21ccaf6..7bbdbe1982 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -180,15 +180,17 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, } if (week_view->multi_week_view) { - cairo_rectangle (cr, x + 2, y + 1, - width - 5, - E_WEEK_VIEW_DATE_T_PAD - 1 + + cairo_rectangle ( + cr, x + 2, y + 1, + width - 5, + E_WEEK_VIEW_DATE_T_PAD - 1 + PANGO_PIXELS (pango_font_metrics_get_ascent (font_metrics)) + PANGO_PIXELS (pango_font_metrics_get_descent (font_metrics))); cairo_fill (cr); } else { - cairo_rectangle (cr, x + 2, y + 1, - width - 5, line_y - y); + cairo_rectangle ( + cr, x + 2, y + 1, + width - 5, line_y - y); cairo_fill (cr); } } @@ -265,15 +267,16 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, if (today) { g_date_strftime ( buffer, sizeof (buffer), - format_string ? format_string : "<b>%d</b>", date); + format_string ? format_string : "<b>%d</b>", date); pango_cairo_update_context (cr, pango_context); 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)); } else { - g_date_strftime (buffer, sizeof (buffer), - format_string ? format_string : "%d", date); + g_date_strftime ( + buffer, sizeof (buffer), + format_string ? format_string : "%d", date); pango_cairo_update_context (cr, pango_context); layout = pango_cairo_create_layout (cr); pango_layout_set_font_description (layout, font_desc); @@ -400,9 +403,10 @@ week_view_main_item_draw (GnomeCanvasItem *canvas_item, num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; for (day = 0; day < num_days; day++) { - e_week_view_get_day_position (week_view, day, - &day_x, &day_y, - &day_w, &day_h); + e_week_view_get_day_position ( + week_view, day, + &day_x, &day_y, + &day_w, &day_h); /* Skip any days which are outside the area. */ if (day_x < x + width && day_x + day_w >= x && day_y < y + height && day_y + day_h >= y) { diff --git a/calendar/gui/e-week-view-titles-item.c b/calendar/gui/e-week-view-titles-item.c index 0ad78e9cf7..1a1dc30d0f 100644 --- a/calendar/gui/e-week-view-titles-item.c +++ b/calendar/gui/e-week-view-titles-item.c @@ -184,9 +184,10 @@ week_view_titles_item_draw (GnomeCanvasItem *canvas_item, cairo_save (cr); - cairo_rectangle (cr, - week_view->col_offsets[col] - x, 2 - y, - week_view->col_widths[col], allocation.height - 2); + cairo_rectangle ( + cr, + week_view->col_offsets[col] - x, 2 - y, + week_view->col_widths[col], allocation.height - 2); cairo_clip (cr); if (weekday == 5 && week_view->compress_weekend) diff --git a/calendar/gui/e-week-view.c b/calendar/gui/e-week-view.c index 711c4b13c4..1b11a92c43 100644 --- a/calendar/gui/e-week-view.c +++ b/calendar/gui/e-week-view.c @@ -404,10 +404,12 @@ week_view_time_range_changed_cb (EWeekView *week_view, if (!g_date_valid (&week_view->first_day_shown) || g_date_compare (&week_view->first_day_shown, &base_date)) { week_view->first_day_shown = base_date; - start_time = time_add_day_with_zone (start_time, -day_offset, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - start_time = time_day_begin_with_zone (start_time, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + start_time = time_add_day_with_zone ( + start_time, -day_offset, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + start_time = time_day_begin_with_zone ( + start_time, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); e_week_view_recalc_day_starts (week_view, start_time); } @@ -726,8 +728,9 @@ e_week_view_init (EWeekView *week_view) gtk_widget_set_can_focus (GTK_WIDGET (week_view), TRUE); week_view->event_destroyed = FALSE; - week_view->events = g_array_new (FALSE, FALSE, - sizeof (EWeekViewEvent)); + week_view->events = g_array_new ( + FALSE, FALSE, + sizeof (EWeekViewEvent)); week_view->events_sorted = TRUE; week_view->events_need_layout = FALSE; week_view->events_need_reshape = FALSE; @@ -766,8 +769,9 @@ e_week_view_init (EWeekView *week_view) week_view->small_font_desc = pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc); - pango_font_description_set_size (week_view->small_font_desc, - E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); + pango_font_description_set_size ( + week_view->small_font_desc, + E_WEEK_VIEW_SMALL_FONT_PTSIZE * PANGO_SCALE); /* String to use in 12-hour time format for times in the morning. */ week_view->am_string = _("am"); @@ -784,33 +788,37 @@ e_week_view_init (EWeekView *week_view) * Month view. */ week_view->titles_canvas = e_canvas_new (); - gtk_table_attach (GTK_TABLE (week_view), week_view->titles_canvas, - 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (week_view), week_view->titles_canvas, + 1, 2, 0, 1, GTK_EXPAND | GTK_FILL, GTK_FILL, 0, 0); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->titles_canvas)->root); week_view->titles_canvas_item = - gnome_canvas_item_new (canvas_group, - e_week_view_titles_item_get_type (), - "EWeekViewTitlesItem::week_view", week_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_week_view_titles_item_get_type (), + "EWeekViewTitlesItem::week_view", week_view, + NULL); /* * Main Canvas */ week_view->main_canvas = e_canvas_new (); - gtk_table_attach (GTK_TABLE (week_view), week_view->main_canvas, - 1, 2, 1, 2, - GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 1, 1); + gtk_table_attach ( + GTK_TABLE (week_view), week_view->main_canvas, + 1, 2, 1, 2, + GTK_EXPAND | GTK_FILL, GTK_EXPAND | GTK_FILL, 1, 1); gtk_widget_show (week_view->main_canvas); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root); week_view->main_canvas_item = - gnome_canvas_item_new (canvas_group, - e_week_view_main_item_get_type (), - "EWeekViewMainItem::week_view", week_view, - NULL); + gnome_canvas_item_new ( + canvas_group, + e_week_view_main_item_get_type (), + "EWeekViewMainItem::week_view", week_view, + NULL); g_signal_connect_after ( week_view->main_canvas, "button_press_event", @@ -849,8 +857,9 @@ e_week_view_init (EWeekView *week_view) adjustment = GTK_ADJUSTMENT (gtk_adjustment_new (0, -52, 52, 1, 1, 1)); week_view->vscrollbar = gtk_vscrollbar_new (adjustment); - gtk_table_attach (GTK_TABLE (week_view), week_view->vscrollbar, - 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); + gtk_table_attach ( + GTK_TABLE (week_view), week_view->vscrollbar, + 2, 3, 1, 2, 0, GTK_EXPAND | GTK_FILL, 0, 0); gtk_widget_show (week_view->vscrollbar); /* Create the cursors. */ @@ -1068,7 +1077,7 @@ e_week_view_get_text_color (EWeekView *week_view, style = gtk_widget_get_style (widget); - if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7 )) + if ((red / cc > 0.7) || (green / cc > 0.7) || (blue / cc > 0.7)) return style->black; else return style->white; @@ -1114,8 +1123,9 @@ e_week_view_style_set (GtkWidget *widget, /* Set up Pango prerequisites */ font_desc = style->font_desc; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); /* Recalculate the height of each row based on the font size. */ @@ -1184,10 +1194,12 @@ e_week_view_style_set (GtkWidget *widget, week_view->max_month_width = max_month_width; week_view->max_abbr_month_width = max_abbr_month_width; - week_view->am_string_width = get_string_width (layout, - week_view->am_string); - week_view->pm_string_width = get_string_width (layout, - week_view->pm_string); + week_view->am_string_width = get_string_width ( + layout, + week_view->am_string); + week_view->pm_string_width = get_string_width ( + layout, + week_view->pm_string); g_object_unref (layout); pango_font_metrics_unref (font_metrics); @@ -1309,8 +1321,9 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) return; pango_context = gtk_widget_get_pango_context (widget); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); /* Calculate the number of rows of events in each cell, for the large * cells and the compressed weekend cells. */ @@ -1328,16 +1341,19 @@ e_week_view_recalc_cell_sizes (EWeekView *week_view) } height = week_view->row_heights[0]; - week_view->rows_per_cell = (height * 2 - week_view->events_y_offset) - / (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); - week_view->rows_per_cell = MIN (week_view->rows_per_cell, - E_WEEK_VIEW_MAX_ROWS_PER_CELL); + week_view->rows_per_cell = + (height * 2 - week_view->events_y_offset) / + (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); + week_view->rows_per_cell = MIN ( + week_view->rows_per_cell, + E_WEEK_VIEW_MAX_ROWS_PER_CELL); week_view->rows_per_compressed_cell = - (height - week_view->events_y_offset) - / (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); - week_view->rows_per_compressed_cell = MIN (week_view->rows_per_compressed_cell, - E_WEEK_VIEW_MAX_ROWS_PER_CELL); + (height - week_view->events_y_offset) / + (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); + week_view->rows_per_compressed_cell = MIN ( + week_view->rows_per_compressed_cell, + E_WEEK_VIEW_MAX_ROWS_PER_CELL); /* Determine which time format to use, based on the width of the cells. * We only allow the time to take up about half of the width. */ @@ -1526,10 +1542,11 @@ e_week_view_focus (GtkWidget *widget, return TRUE; } - editable = e_week_view_start_editing_event (week_view, - new_event_num, - new_span_num, - NULL); + editable = e_week_view_start_editing_event ( + week_view, + new_event_num, + new_span_num, + NULL); last_focus_event_num = new_event_num; last_focus_span_num = new_span_num; @@ -1667,11 +1684,12 @@ e_week_view_set_selected_time_range (ECalendarView *cal_view, /* Make sure the selection is valid. */ num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; num_days--; - week_view->selection_start_day = CLAMP (week_view->selection_start_day, - 0, num_days); - week_view->selection_end_day = CLAMP (week_view->selection_end_day, - week_view->selection_start_day, - num_days); + week_view->selection_start_day = CLAMP ( + week_view->selection_start_day, 0, num_days); + week_view->selection_end_day = CLAMP ( + week_view->selection_end_day, + week_view->selection_start_day, + num_days); /* 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 @@ -1716,11 +1734,13 @@ e_week_view_set_selected_time_range_visible (EWeekView *week_view, /* Make sure the selection is valid. */ num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; num_days--; - week_view->selection_start_day = CLAMP (week_view->selection_start_day, + week_view->selection_start_day = CLAMP ( + week_view->selection_start_day, 0, num_days); - week_view->selection_end_day = CLAMP (week_view->selection_end_day, - week_view->selection_start_day, - num_days); + week_view->selection_end_day = CLAMP ( + week_view->selection_end_day, + week_view->selection_start_day, + num_days); gtk_widget_queue_draw (week_view->main_canvas); } @@ -1831,8 +1851,9 @@ e_week_view_set_first_day_shown (EWeekView *week_view, start_tt.month = g_date_get_month (&base_date); start_tt.day = g_date_get_day (&base_date); - start_time = icaltime_as_timet_with_zone (start_tt, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + start_time = icaltime_as_timet_with_zone ( + start_tt, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); e_week_view_recalc_day_starts (week_view, start_time); e_week_view_update_query (week_view); @@ -1850,12 +1871,12 @@ e_week_view_set_first_day_shown (EWeekView *week_view, num_days = week_view->multi_week_view ? week_view->weeks_shown * 7 : 7; num_days--; - week_view->selection_start_day = - CLAMP (week_view->selection_start_day, 0, num_days); - week_view->selection_end_day = - CLAMP (week_view->selection_end_day, - week_view->selection_start_day, - num_days); + week_view->selection_start_day = CLAMP ( + week_view->selection_start_day, 0, num_days); + week_view->selection_end_day = CLAMP ( + week_view->selection_end_day, + week_view->selection_start_day, + num_days); } /* Reset the adjustment value to 0 if the base address has changed. @@ -1887,8 +1908,9 @@ e_week_view_recalc_day_starts (EWeekView *week_view, tmp_time = lower; week_view->day_starts[0] = tmp_time; for (day = 1; day <= num_days; day++) { - tmp_time = time_add_day_with_zone (tmp_time, 1, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + tmp_time = time_add_day_with_zone ( + tmp_time, 1, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); week_view->day_starts[day] = tmp_time; } } @@ -1948,8 +1970,9 @@ e_week_view_set_multi_week_view (EWeekView *week_view, e_week_view_recalc_cell_sizes (week_view); if (g_date_valid (&week_view->first_day_shown)) - e_week_view_set_first_day_shown (week_view, - &week_view->first_day_shown); + e_week_view_set_first_day_shown ( + week_view, + &week_view->first_day_shown); } gboolean @@ -2033,7 +2056,7 @@ e_week_view_set_compress_weekend (EWeekView *week_view, g_return_if_fail (E_IS_WEEK_VIEW (week_view)); - if ((week_view->compress_weekend ? 1 : 0) == (compress_weekend ? 1 : 0)) + if (week_view->compress_weekend == compress_weekend) return; week_view->compress_weekend = compress_weekend; @@ -2079,7 +2102,7 @@ e_week_view_set_show_event_end_times (EWeekView *week_view, { g_return_if_fail (E_IS_WEEK_VIEW (week_view)); - if ((week_view->show_event_end_times ? 1 : 0) == (show_event_end_times ? 1 : 0)) + if (week_view->show_event_end_times == show_event_end_times) return; week_view->show_event_end_times = show_event_end_times; @@ -2274,12 +2297,13 @@ e_week_view_get_day_position (EWeekView *week_view, { gint cell_x, cell_y, cell_h; - e_week_view_layout_get_day_position (day, - week_view->multi_week_view, - week_view->weeks_shown, - week_view->display_start_day, - week_view->compress_weekend, - &cell_x, &cell_y, &cell_h); + e_week_view_layout_get_day_position ( + day, + week_view->multi_week_view, + week_view->weeks_shown, + week_view->display_start_day, + week_view->compress_weekend, + &cell_x, &cell_y, &cell_h); *day_x = week_view->col_offsets[cell_x]; *day_y = week_view->row_offsets[cell_y]; @@ -2339,8 +2363,9 @@ e_week_view_get_span_position (EWeekView *week_view, return FALSE; } - e_week_view_get_day_position (week_view, span->start_day, - &start_x, &start_y, &start_w, &start_h); + e_week_view_get_day_position ( + week_view, span->start_day, + &start_x, &start_y, &start_w, &start_h); *span_y = start_y + week_view->events_y_offset + span->row * (week_view->row_height + E_WEEK_VIEW_EVENT_Y_SPACING); @@ -2348,9 +2373,10 @@ e_week_view_get_span_position (EWeekView *week_view, *span_x = start_x; *span_w = start_w - 1; } else { - e_week_view_get_day_position (week_view, - span->start_day + num_days - 1, - &end_x, &end_y, &end_w, &end_h); + e_week_view_get_day_position ( + week_view, + span->start_day + num_days - 1, + &end_x, &end_y, &end_w, &end_h); *span_x = start_x; *span_w = end_x + end_w - start_x - 1; } @@ -2624,8 +2650,11 @@ e_week_view_convert_position_to_day (EWeekView *week_view, for (day = 0; day < 7; day++) { gint day_x = 0, day_y = 0, rows = 0; - e_week_view_layout_get_day_position (day, FALSE, 1, week_view->display_start_day, week_view->compress_weekend, - &day_x, &day_y, &rows); + e_week_view_layout_get_day_position ( + day, FALSE, 1, + week_view->display_start_day, + week_view->compress_weekend, + &day_x, &day_y, &rows); if (grid_x == day_x && grid_y >= day_y && grid_y < day_y + rows) break; @@ -2760,9 +2789,11 @@ e_week_view_add_event (ECalComponent *comp, g_return_val_if_fail (start < add_event_data->week_view->day_starts[num_days], TRUE); g_return_val_if_fail (end > add_event_data->week_view->day_starts[0], TRUE); - start_tt = icaltime_from_timet_with_zone (start, FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view))); - end_tt = icaltime_from_timet_with_zone (end, FALSE, + start_tt = icaltime_from_timet_with_zone ( + start, FALSE, + e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view))); + end_tt = icaltime_from_timet_with_zone ( + end, FALSE, e_calendar_view_get_timezone (E_CALENDAR_VIEW (add_event_data->week_view))); if (add_event_data->comp_data) { @@ -2841,10 +2872,11 @@ static void e_week_view_ensure_events_sorted (EWeekView *week_view) { if (!week_view->events_sorted) { - qsort (week_view->events->data, - week_view->events->len, - sizeof (EWeekViewEvent), - e_week_view_event_sort_func); + qsort ( + week_view->events->data, + week_view->events->len, + sizeof (EWeekViewEvent), + e_week_view_event_sort_func); week_view->events_sorted = TRUE; } } @@ -2888,8 +2920,8 @@ e_week_view_reshape_events (EWeekView *week_view) for (span_num = 0; span_num < event->num_spans; span_num++) { gchar *current_comp_string; - e_week_view_reshape_event_span (week_view, event_num, - span_num); + e_week_view_reshape_event_span ( + week_view, event_num, span_num); if (week_view->last_edited_comp_string == NULL) continue; current_comp_string = icalcomponent_as_ical_string_r (event->comp_data->icalcomp); @@ -2927,13 +2959,15 @@ e_week_view_reshape_events (EWeekView *week_view) } else { cairo_matrix_t matrix; - e_week_view_get_day_position (week_view, day, - &day_x, &day_y, - &day_w, &day_h); + e_week_view_get_day_position ( + week_view, day, + &day_x, &day_y, + &day_w, &day_h); - cairo_matrix_init_translate (&matrix, - day_x + day_w - E_WEEK_VIEW_JUMP_BUTTON_X_PAD - E_WEEK_VIEW_JUMP_BUTTON_WIDTH, - day_y + day_h - E_WEEK_VIEW_JUMP_BUTTON_Y_PAD - E_WEEK_VIEW_JUMP_BUTTON_HEIGHT); + cairo_matrix_init_translate ( + &matrix, + day_x + day_w - E_WEEK_VIEW_JUMP_BUTTON_X_PAD - E_WEEK_VIEW_JUMP_BUTTON_WIDTH, + day_y + day_h - E_WEEK_VIEW_JUMP_BUTTON_Y_PAD - E_WEEK_VIEW_JUMP_BUTTON_HEIGHT); gnome_canvas_item_set_matrix (week_view->jump_buttons[day], &matrix); gnome_canvas_item_show (week_view->jump_buttons[day]); @@ -3132,8 +3166,9 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Set up Pango prerequisites */ font_desc = gtk_widget_get_style (GTK_WIDGET (week_view))->font_desc; pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); layout = pango_layout_new (pango_context); /* If we are editing a long event we don't show the icons and the EText @@ -3163,9 +3198,10 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Create the background canvas item if necessary. */ if (!span->background_item) { span->background_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), - e_week_view_event_item_get_type (), - NULL); + gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), + e_week_view_event_item_get_type (), + NULL); } g_object_set_data ((GObject *) span->background_item, "event-num", GINT_TO_POINTER (event_num)); @@ -3173,10 +3209,11 @@ e_week_view_reshape_event_span (EWeekView *week_view, 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, - NULL); + gnome_canvas_item_set ( + span->background_item, + "event_num", event_num, + "span_num", span_num, + NULL); /* Create the text item if necessary. */ if (!span->text_item) { @@ -3191,16 +3228,17 @@ e_week_view_reshape_event_span (EWeekView *week_view, summary = get_comp_summary (event->comp_data->client, event->comp_data->icalcomp, &free_text); span->text_item = - gnome_canvas_item_new (GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), - e_text_get_type (), - "clip", TRUE, - "max_lines", 1, - "editable", TRUE, - "text", summary ? summary : "", - "use_ellipsis", TRUE, - "fill_color_gdk", &color, - "im_context", E_CANVAS (week_view->main_canvas)->im_context, - NULL); + gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (GNOME_CANVAS (week_view->main_canvas)->root), + e_text_get_type (), + "clip", TRUE, + "max_lines", 1, + "editable", TRUE, + "text", summary ? summary : "", + "use_ellipsis", TRUE, + "fill_color_gdk", &color, + "im_context", E_CANVAS (week_view->main_canvas)->im_context, + NULL); if (free_text) g_free ((gchar *) summary); @@ -3213,8 +3251,9 @@ e_week_view_reshape_event_span (EWeekView *week_view, g_signal_connect ( span->text_item, "event", G_CALLBACK (e_week_view_on_text_item_event), week_view); - g_signal_emit_by_name (G_OBJECT (week_view), - "event_added", event); + g_signal_emit_by_name ( + G_OBJECT (week_view), + "event_added", event); } @@ -3347,10 +3386,11 @@ e_week_view_reshape_event_span (EWeekView *week_view, /* Make sure we don't try to use a negative width. */ text_w = MAX (text_w, 0); - gnome_canvas_item_set (span->text_item, - "clip_width", (gdouble) text_w, - "clip_height", (gdouble) text_h, - NULL); + gnome_canvas_item_set ( + span->text_item, + "clip_width", (gdouble) text_w, + "clip_height", (gdouble) text_h, + NULL); e_canvas_item_move_absolute (span->text_item, text_x, text_y); g_object_unref (comp); @@ -3409,9 +3449,10 @@ e_week_view_start_editing_event (EWeekView *week_view, return FALSE; } - gnome_canvas_item_set (span->text_item, - "text", initial_text ? initial_text : icalcomponent_get_summary (event->comp_data->icalcomp), - NULL); + gnome_canvas_item_set ( + span->text_item, + "text", initial_text ? initial_text : icalcomponent_get_summary (event->comp_data->icalcomp), + NULL); /* Save the comp_data value because we use that as our invariant */ comp_data = event->comp_data; @@ -3448,8 +3489,9 @@ e_week_view_start_editing_event (EWeekView *week_view, if (event_processor) { command.action = E_TEP_MOVE; command.position = E_TEP_END_OF_BUFFER; - g_signal_emit_by_name (event_processor, - "command", &command); + g_signal_emit_by_name ( + event_processor, + "command", &command); } return TRUE; } @@ -3532,11 +3574,11 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, /* Stop the signal last or we will also stop any * other events getting to the EText item. */ - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); return TRUE; } else if (gdkevent->key.keyval == GDK_KEY_Escape) { cancel_editing (week_view); - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); /* focus should go to week view when stop editing */ gtk_widget_grab_focus (GTK_WIDGET (week_view)); return TRUE; @@ -3561,11 +3603,12 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, if (!is_icalcomp_on_the_server (event->comp_data->icalcomp, event->comp_data->client)) return TRUE; - e_calendar_view_edit_appointment (E_CALENDAR_VIEW (week_view), - event->comp_data->client, - event->comp_data->icalcomp, EDIT_EVENT_AUTODETECT); + e_calendar_view_edit_appointment ( + E_CALENDAR_VIEW (week_view), + event->comp_data->client, + event->comp_data->icalcomp, EDIT_EVENT_AUTODETECT); - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); return TRUE; case GDK_BUTTON_PRESS: tooltip_destroy (week_view, item); @@ -3592,12 +3635,13 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, e_week_view_set_selected_time_range_visible (week_view, e->start, e->end); - e_week_view_show_popup_menu (week_view, - (GdkEventButton *) gdkevent, - event_num); + e_week_view_show_popup_menu ( + week_view, + (GdkEventButton *) gdkevent, + event_num); - g_signal_stop_emission_by_name (G_OBJECT (item->canvas), - "button_press_event"); + g_signal_stop_emission_by_name ( + item->canvas, "button_press_event"); return TRUE; } @@ -3608,7 +3652,7 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, /* Only let the EText handle the event while editing. */ if (!E_TEXT (item)->editing) { - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); if (gdkevent) { week_view->drag_event_x = gdkevent->button.x; @@ -3634,16 +3678,17 @@ e_week_view_on_text_item_event (GnomeCanvasItem *item, if (week_view->pressed_event_num != -1 && week_view->pressed_event_num == event_num && week_view->pressed_span_num == span_num) { - e_week_view_start_editing_event (week_view, - event_num, - span_num, - NULL); + e_week_view_start_editing_event ( + week_view, + event_num, + span_num, + NULL); week_view->pressed_event_num = -1; } /* Stop the signal last or we will also stop any * other events getting to the EText item. */ - g_signal_stop_emission_by_name (G_OBJECT (item), "event"); + g_signal_stop_emission_by_name (item, "event"); return TRUE; } week_view->pressed_event_num = -1; @@ -3759,9 +3804,11 @@ static gboolean e_week_view_event_move (ECalendarView *cal_view, ECalViewMoveDir 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, + start_dt = icaltime_as_timet_with_zone ( + start_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); - end_dt = icaltime_as_timet_with_zone (end_time, + end_dt = icaltime_as_timet_with_zone ( + end_time, e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); current_start_day = e_week_view_get_day_offset_of_event (week_view,start_dt); @@ -3948,8 +3995,8 @@ e_week_view_on_editing_started (EWeekView *week_view, /* We need to reshape long events so the whole width is used while * editing. */ if (!e_week_view_is_one_day_event (week_view, event_num)) { - e_week_view_reshape_event_span (week_view, event_num, - span_num); + e_week_view_reshape_event_span ( + week_view, event_num, span_num); } g_signal_emit_by_name (week_view, "selection_changed"); @@ -4048,8 +4095,13 @@ e_week_view_on_editing_stopped (EWeekView *week_view, gchar *uid = NULL; GError *error = NULL; - if (!e_cal_client_create_object_sync (client, icalcomp, &uid, NULL, &error)) { - g_message (G_STRLOC ": Could not create the object! %s", error ? error->message : "Unknown error"); + e_cal_client_create_object_sync ( + client, icalcomp, &uid, NULL, &error); + + if (error != NULL) { + g_warning ( + G_STRLOC ": Could not create the object! %s", + error->message); uid = NULL; } else { if (uid) @@ -4399,8 +4451,9 @@ e_week_view_add_new_event_in_selected_range (EWeekView *week_view, g_object_unref (comp); return FALSE; } else { - e_week_view_start_editing_event (week_view, event_num, 0, - (gchar *) initial_text); + e_week_view_start_editing_event ( + week_view, event_num, 0, + (gchar *) initial_text); } g_object_unref (comp); @@ -4571,8 +4624,9 @@ static gboolean e_week_view_popup_menu (GtkWidget *widget) { EWeekView *week_view = E_WEEK_VIEW (widget); - e_week_view_show_popup_menu (week_view, NULL, - week_view->editing_event_num); + e_week_view_show_popup_menu ( + week_view, NULL, + week_view->editing_event_num); return TRUE; } @@ -4635,16 +4689,18 @@ e_week_view_on_jump_button_event (GnomeCanvasItem *item, if (focus_event->in) { week_view->focused_jump_button = day; pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm_focused); - gnome_canvas_item_set (week_view->jump_buttons[day], - "GnomeCanvasPixbuf::pixbuf", - pixbuf, NULL); + gnome_canvas_item_set ( + week_view->jump_buttons[day], + "GnomeCanvasPixbuf::pixbuf", + pixbuf, NULL); } else { week_view->focused_jump_button = E_WEEK_VIEW_JUMP_BUTTON_NO_FOCUS; pixbuf = gdk_pixbuf_new_from_xpm_data ((const gchar **) jump_xpm); - gnome_canvas_item_set (week_view->jump_buttons[day], - "GnomeCanvasPixbuf::pixbuf", - pixbuf, NULL); + gnome_canvas_item_set ( + week_view->jump_buttons[day], + "GnomeCanvasPixbuf::pixbuf", + pixbuf, NULL); } if (pixbuf) g_object_unref (pixbuf); diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c index 220e4415eb..35c3819062 100644 --- a/calendar/gui/ea-cal-view-event.c +++ b/calendar/gui/ea-cal-view-event.c @@ -111,8 +111,9 @@ ea_cal_view_event_get_type (void) * we are run-time deriving from (atk object for E_TEXT, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - E_TYPE_TEXT); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + E_TYPE_TEXT); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); @@ -120,12 +121,15 @@ ea_cal_view_event_get_type (void) tinfo.instance_size = query.instance_size; /* we inherit the component, text and other interfaces from E_TEXT */ - type = g_type_register_static (derived_atk_type, - "EaCalViewEvent", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); + type = g_type_register_static ( + derived_atk_type, + "EaCalViewEvent", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); + g_type_add_interface_static ( + type, ATK_TYPE_ACTION, + &atk_action_info); } @@ -171,7 +175,8 @@ static void ea_cal_view_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_cal_view_event_destroyed; - printf ("ACC_DEBUG: n_ea_cal_view_event_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_cal_view_event_destroyed = %d\n", n_ea_cal_view_event_destroyed); } #endif @@ -227,15 +232,17 @@ ea_cal_view_event_new (GObject *obj) if (!atk_obj) { static AtkRole event_role = ATK_ROLE_INVALID; - atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_CAL_VIEW_EVENT, - NULL)); + atk_obj = ATK_OBJECT ( + g_object_new (EA_TYPE_CAL_VIEW_EVENT, + NULL)); atk_object_initialize (atk_obj, target_obj); if (event_role == ATK_ROLE_INVALID) event_role = atk_role_register ("Calendar Event"); atk_obj->role = event_role; #ifdef ACC_DEBUG ++n_ea_cal_view_event_created; - printf ("ACC_DEBUG: n_ea_cal_view_event_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_cal_view_event_created = %d\n", n_ea_cal_view_event_created); #endif } @@ -313,8 +320,9 @@ ea_cal_view_event_get_name (AtkObject *accessible) ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name_string); #ifdef ACC_DEBUG - printf ("EvoAcc: name for event accobj=%p, is %s\n", - (gpointer) accessible, new_name); + printf ( + "EvoAcc: name for event accobj=%p, is %s\n", + (gpointer) accessible, new_name); #endif g_free (name_string); return accessible->name; diff --git a/calendar/gui/ea-cal-view.c b/calendar/gui/ea-cal-view.c index d7c700893e..1777a45790 100644 --- a/calendar/gui/ea-cal-view.c +++ b/calendar/gui/ea-cal-view.c @@ -97,18 +97,21 @@ ea_cal_view_get_type (void) * we are run-time deriving from (GailWidget, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GTK_TYPE_WIDGET); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GTK_TYPE_WIDGET); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaCalView", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_ACTION, - &atk_action_info); + type = g_type_register_static ( + derived_atk_type, + "EaCalView", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_ACTION, + &atk_action_info); } return type; @@ -276,8 +279,9 @@ ea_cal_view_event_added_cb (ECalendarView *cal_view, #ifdef ACC_DEBUG printf ("AccDebug: event=%p added\n", (gpointer) event); #endif - g_signal_emit_by_name (atk_obj, "children_changed::add", - index, event_atk_obj, NULL); + g_signal_emit_by_name ( + atk_obj, "children_changed::add", + index, event_atk_obj, NULL); } } diff --git a/calendar/gui/ea-calendar-helpers.c b/calendar/gui/ea-calendar-helpers.c index 2ec6d93656..e0234d0a08 100644 --- a/calendar/gui/ea-calendar-helpers.c +++ b/calendar/gui/ea-calendar-helpers.c @@ -123,8 +123,9 @@ ea_calendar_helpers_get_cal_view_event_from (GnomeCanvasItem *canvas_item) gint event_day, event_num; EDayViewEvent *day_view_event; EDayView *day_view = E_DAY_VIEW (cal_view); - event_found = e_day_view_find_event_from_item (day_view, canvas_item, - &event_day, &event_num); + event_found = e_day_view_find_event_from_item ( + day_view, canvas_item, + &event_day, &event_num); if (!event_found) return NULL; if (event_day == E_DAY_VIEW_LONG_EVENT) { @@ -143,15 +144,16 @@ ea_calendar_helpers_get_cal_view_event_from (GnomeCanvasItem *canvas_item) gint event_num, span_num; EWeekViewEvent *week_view_event; EWeekView *week_view = E_WEEK_VIEW (cal_view); - event_found = e_week_view_find_event_from_item (week_view, - canvas_item, - &event_num, - &span_num); + event_found = e_week_view_find_event_from_item ( + week_view, + canvas_item, + &event_num, + &span_num); if (!event_found) return NULL; - week_view_event = &g_array_index (week_view->events, EWeekViewEvent, - event_num); + week_view_event = &g_array_index ( + week_view->events, EWeekViewEvent, event_num); cal_view_event = (ECalendarViewEvent *) week_view_event; } diff --git a/calendar/gui/ea-day-view-cell.c b/calendar/gui/ea-day-view-cell.c index 8410e00a92..5e25a2aae1 100644 --- a/calendar/gui/ea-day-view-cell.c +++ b/calendar/gui/ea-day-view-cell.c @@ -55,8 +55,9 @@ e_day_view_cell_get_type (void) NULL /* value table */ }; - type = g_type_register_static (G_TYPE_OBJECT, - "EDayViewCell", &tinfo, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "EDayViewCell", &tinfo, 0); } return type; @@ -141,10 +142,12 @@ ea_day_view_cell_get_type (void) NULL }; - type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE, - "EaDayViewCell", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); + type = g_type_register_static ( + ATK_TYPE_GOBJECT_ACCESSIBLE, + "EaDayViewCell", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); } return type; @@ -185,7 +188,8 @@ ea_day_view_cell_new (GObject *obj) #ifdef ACC_DEBUG ++n_ea_day_view_cell_created; - printf ("ACC_DEBUG: n_ea_day_view_cell_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_cell_created = %d\n", n_ea_day_view_cell_created); #endif return atk_object; @@ -197,7 +201,8 @@ static void ea_day_view_cell_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_day_view_cell_destroyed; - printf ("ACC_DEBUG: n_ea_day_view_cell_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_cell_destroyed = %d\n", n_ea_day_view_cell_destroyed); } #endif @@ -225,10 +230,12 @@ ea_day_view_cell_get_name (AtkObject *accessible) cell = E_DAY_VIEW_CELL (g_obj); main_item = cell->day_view->main_canvas_item; ea_main_item = atk_gobject_accessible_for_object (G_OBJECT (main_item)); - column_label = atk_table_get_column_description (ATK_TABLE (ea_main_item), - cell->column); - row_label = atk_table_get_row_description (ATK_TABLE (ea_main_item), - cell->row); + column_label = atk_table_get_column_description ( + ATK_TABLE (ea_main_item), + cell->column); + row_label = atk_table_get_row_description ( + ATK_TABLE (ea_main_item), + cell->row); new_name = g_strconcat (column_label, " ", row_label, NULL); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, new_name); g_free (new_name); @@ -311,8 +318,9 @@ ea_day_view_cell_get_index_in_parent (AtkObject *accessible) cell = E_DAY_VIEW_CELL (g_obj); parent = atk_object_get_parent (accessible); - return atk_table_get_index_at (ATK_TABLE (parent), - cell->row, cell->column); + return atk_table_get_index_at ( + ATK_TABLE (parent), + cell->row, cell->column); } /* Atk Component Interface */ @@ -356,12 +364,14 @@ component_interface_get_extents (AtkComponent *component, main_canvas = cell->day_view->main_canvas; atk_obj = atk_gobject_accessible_for_object (G_OBJECT (main_canvas)); - atk_component_get_extents (ATK_COMPONENT (atk_obj), - x, y, - &day_view_width, &day_view_height, - coord_type); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (day_view->main_canvas), - &scroll_x, &scroll_y); + atk_component_get_extents ( + ATK_COMPONENT (atk_obj), + x, y, + &day_view_width, &day_view_height, + coord_type); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (day_view->main_canvas), + &scroll_x, &scroll_y); *x += day_view->day_offsets[cell->column] - scroll_x; *y += day_view->row_height * cell->row - scroll_y; @@ -391,9 +401,10 @@ component_interface_grab_focus (AtkComponent *comp) day_view->selection_start_row = cell->row; day_view->selection_end_row = cell->row; - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_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->main_canvas); diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c index 19c91384da..3367833a4f 100644 --- a/calendar/gui/ea-day-view-main-item.c +++ b/calendar/gui/ea-day-view-main-item.c @@ -200,22 +200,27 @@ ea_day_view_main_item_get_type (void) * */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_day_view_main_item_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_day_view_main_item_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaDayViewMainItem", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); - g_type_add_interface_static (type, ATK_TYPE_TABLE, - &atk_table_info); - g_type_add_interface_static (type, ATK_TYPE_SELECTION, - &atk_selection_info); + type = g_type_register_static ( + derived_atk_type, + "EaDayViewMainItem", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); + g_type_add_interface_static ( + type, ATK_TYPE_TABLE, + &atk_table_info); + g_type_add_interface_static ( + type, ATK_TYPE_SELECTION, + &atk_selection_info); } return type; @@ -249,15 +254,17 @@ ea_day_view_main_item_new (GObject *obj) g_return_val_if_fail (E_IS_DAY_VIEW_MAIN_ITEM (obj), NULL); - accessible = ATK_OBJECT (g_object_new (EA_TYPE_DAY_VIEW_MAIN_ITEM, - NULL)); + accessible = ATK_OBJECT ( + g_object_new (EA_TYPE_DAY_VIEW_MAIN_ITEM, + NULL)); atk_object_initialize (accessible, obj); accessible->role = ATK_ROLE_TABLE; #ifdef ACC_DEBUG ++n_ea_day_view_main_item_created; - printf ("ACC_DEBUG: n_ea_day_view_main_item_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_main_item_created = %d\n", n_ea_day_view_main_item_created); #endif @@ -295,7 +302,8 @@ ea_day_view_main_item_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); #ifdef ACC_DEBUG ++n_ea_day_view_main_item_destroyed; - printf ("ACC_DEBUG: n_ea_day_view_main_item_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_day_view_main_item_destroyed = %d\n", n_ea_day_view_main_item_destroyed); #endif } @@ -461,17 +469,18 @@ ea_day_view_main_item_time_change_cb (EDayView *day_view, printf ("EvoAcc: ea_day_view_main_item time changed cb\n"); #endif /* only deal with the first selected child, for now */ - item_cell = atk_selection_ref_selection (ATK_SELECTION (ea_main_item), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (ea_main_item), 0); if (item_cell) { AtkStateSet *state_set; state_set = atk_object_ref_state_set (item_cell); atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); g_object_unref (state_set); - g_signal_emit_by_name (ea_main_item, - "active-descendant-changed", - item_cell); + g_signal_emit_by_name ( + ea_main_item, + "active-descendant-changed", + item_cell); g_signal_emit_by_name (data, "selection_changed"); atk_focus_tracker_notify (item_cell); @@ -594,10 +603,12 @@ ea_day_view_main_item_get_row_label (EaDayViewMainItem *ea_main_item, hour = (hour + minute / 60) % 24; minute %= 60; - e_day_view_convert_time_to_display (day_view, hour, &hour, - &suffix, &suffix_width); - return g_snprintf (buffer, buffer_size, "%i:%02i %s", - hour, minute, suffix); + e_day_view_convert_time_to_display ( + day_view, hour, &hour, + &suffix, &suffix_width); + return g_snprintf ( + buffer, buffer_size, "%i:%02i %s", + hour, minute, suffix); } static EaCellTable * @@ -619,13 +630,16 @@ ea_day_view_main_item_get_cell_data (EaDayViewMainItem *ea_main_item) main_item = E_DAY_VIEW_MAIN_ITEM (g_obj); day_view = e_day_view_main_item_get_day_view (main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table"); if (!cell_data) { - cell_data = ea_cell_table_create (day_view->rows, - day_view->days_shown, TRUE); - g_object_set_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table", cell_data); + cell_data = ea_cell_table_create ( + day_view->rows, + day_view->days_shown, TRUE); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table", cell_data); } return cell_data; } @@ -637,11 +651,13 @@ ea_day_view_main_item_destory_cell_data (EaDayViewMainItem *ea_main_item) g_return_if_fail (ea_main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table"); if (cell_data) { - g_object_set_data (G_OBJECT (ea_main_item), - "ea-day-view-cell-table", NULL); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-day-view-cell-table", NULL); ea_cell_table_destroy (cell_data); } } @@ -681,8 +697,9 @@ component_interface_get_extents (AtkComponent *component, day_view = e_day_view_main_item_get_day_view (main_item); ea_canvas = gtk_widget_get_accessible (day_view->main_canvas); - atk_component_get_extents (ATK_COMPONENT (ea_canvas), x, y, - width, height, coord_type); + atk_component_get_extents ( + ATK_COMPONENT (ea_canvas), x, y, + width, height, coord_type); } /* atk table interface */ @@ -728,8 +745,9 @@ table_interface_ref_at (AtkTable *table, gint index; EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); - index = ea_day_view_main_item_get_child_index_at (ea_main_item, - row, column); + index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + row, column); return ea_day_view_main_item_ref_child (ATK_OBJECT (ea_main_item), index); } @@ -779,8 +797,9 @@ table_interface_get_index_at (AtkTable *table, gint column) { EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); - return ea_day_view_main_item_get_child_index_at (ea_main_item, - row, column); + return ea_day_view_main_item_get_child_index_at ( + ea_main_item, + row, column); } static gint @@ -809,13 +828,15 @@ table_interface_get_column_extent_at (AtkTable *table, AtkObject *child; EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); - index = ea_day_view_main_item_get_child_index_at (ea_main_item, - row, column); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), + index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return width; } @@ -830,13 +851,15 @@ table_interface_get_row_extent_at (AtkTable *table, AtkObject *child; EaDayViewMainItem * ea_main_item = EA_DAY_VIEW_MAIN_ITEM (table); - index = ea_day_view_main_item_get_child_index_at (ea_main_item, - row, column); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), + index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return height; } @@ -1004,9 +1027,10 @@ table_interface_add_row_selection (AtkTable *table, day_view->selection_start_row = row; day_view->selection_end_row = row; - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_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->main_canvas); return TRUE; @@ -1143,8 +1167,7 @@ table_interface_get_row_description (AtkTable *table, ea_day_view_main_item_get_row_label ( ea_main_item, row, buffer, sizeof (buffer)); ea_cell_table_set_row_label (cell_data, row, buffer); - description = ea_cell_table_get_row_label (cell_data, - row); + description = ea_cell_table_get_row_label (cell_data, row); } return description; } @@ -1201,9 +1224,10 @@ selection_interface_add_selection (AtkSelection *selection, day_view->selection_start_row = row; day_view->selection_end_row = row; - e_day_view_ensure_rows_visible (day_view, - day_view->selection_start_row, - day_view->selection_end_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->main_canvas); return TRUE; @@ -1257,9 +1281,10 @@ selection_interface_ref_selection (AtkSelection *selection, main_item = E_DAY_VIEW_MAIN_ITEM (g_obj); day_view = e_day_view_main_item_get_day_view (main_item); - start_index = ea_day_view_main_item_get_child_index_at (ea_main_item, - day_view->selection_start_row, - day_view->selection_start_day); + start_index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + day_view->selection_start_row, + day_view->selection_start_day); return ea_day_view_main_item_ref_child (ATK_OBJECT (selection), start_index + i); } @@ -1285,12 +1310,14 @@ selection_interface_get_selection_count (AtkSelection *selection) if (day_view->selection_start_day == -1 || day_view->selection_start_row == -1) return 0; - start_index = ea_day_view_main_item_get_child_index_at (ea_main_item, - day_view->selection_start_row, - day_view->selection_start_day); - end_index = ea_day_view_main_item_get_child_index_at (ea_main_item, - day_view->selection_end_row, - day_view->selection_end_day); + start_index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + day_view->selection_start_row, + day_view->selection_start_day); + end_index = ea_day_view_main_item_get_child_index_at ( + ea_main_item, + day_view->selection_end_row, + day_view->selection_end_day); return end_index - start_index + 1; } diff --git a/calendar/gui/ea-day-view.c b/calendar/gui/ea-day-view.c index c053258531..66f5cb3942 100644 --- a/calendar/gui/ea-day-view.c +++ b/calendar/gui/ea-day-view.c @@ -70,16 +70,18 @@ ea_day_view_get_type (void) * our parent class EaCalView is run-time deriving. */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_calendar_view_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_calendar_view_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaDayView", &tinfo, 0); + type = g_type_register_static ( + derived_atk_type, + "EaDayView", &tinfo, 0); } return type; @@ -148,8 +150,11 @@ ea_day_view_get_name (AtkObject *accessible) /* To translators: Here, "It" is either like "Work Week View: July 10th - July 14th, 2006." or "Day View: Thursday July 13th, 2006." */ event_str = g_strdup_printf ( - ngettext ("It has %d event.", - "It has %d events.", n_events), n_events); + ngettext ( + "It has %d event.", + "It has %d events.", + n_events), + n_events); else /* To translators: Here, "It" is either like "Work Week View: July 10th - July 14th, 2006." or "Day View: Thursday July 13th, 2006." */ @@ -160,14 +165,16 @@ ea_day_view_get_name (AtkObject *accessible) /* To translators: First %s is the week, for example "July 10th - July 14th, 2006". Second %s is the number of events in this work week, for example "It has %d event/events." or "It has no events." */ - name_str = g_strdup_printf (_("Work Week View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Work Week View: %s. %s"), + label_text, event_str); else /* To translators: First %s is the day, for example "Thursday July 13th, 2006". Second %s is the number of events on this day, for example "It has %d event/events." or "It has no events." */ - name_str = g_strdup_printf (_("Day View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Day View: %s. %s"), + label_text, event_str); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name_str); g_free (name_str); diff --git a/calendar/gui/ea-gnome-calendar.c b/calendar/gui/ea-gnome-calendar.c index b7ffb20597..7edf52de7d 100644 --- a/calendar/gui/ea-gnome-calendar.c +++ b/calendar/gui/ea-gnome-calendar.c @@ -83,15 +83,17 @@ ea_gnome_calendar_get_type (void) * we are run-time deriving from (GailWidget, in this case) */ - factory = atk_registry_get_factory (atk_get_default_registry (), - GTK_TYPE_WIDGET); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GTK_TYPE_WIDGET); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaGnomeCalendar", &tinfo, 0); + type = g_type_register_static ( + derived_atk_type, + "EaGnomeCalendar", &tinfo, 0); } @@ -171,8 +173,9 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) start_tm.tm_min = start_tt.minute; start_tm.tm_sec = start_tt.second; start_tm.tm_isdst = -1; - start_tm.tm_wday = time_day_of_week (start_tt.day, start_tt.month - 1, - start_tt.year); + start_tm.tm_wday = time_day_of_week ( + start_tt.day, start_tt.month - 1, + start_tt.year); /* Take one off end_time so we don't get an extra day. */ end_tt = icaltime_from_timet_with_zone (end_time - 1, FALSE, zone); @@ -183,8 +186,9 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) end_tm.tm_min = end_tt.minute; end_tm.tm_sec = end_tt.second; end_tm.tm_isdst = -1; - end_tm.tm_wday = time_day_of_week (end_tt.day, end_tt.month - 1, - end_tt.year); + end_tm.tm_wday = time_day_of_week ( + end_tt.day, end_tt.month - 1, + end_tt.year); view = gnome_calendar_get_view (gcal); @@ -195,20 +199,25 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) if (start_tm.tm_year == end_tm.tm_year && start_tm.tm_mon == end_tm.tm_mon && start_tm.tm_mday == end_tm.tm_mday) { - e_utf8_strftime (buffer, sizeof (buffer), - _("%A %d %b %Y"), &start_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%A %d %b %Y"), &start_tm); } else if (start_tm.tm_year == end_tm.tm_year) { - e_utf8_strftime (buffer, sizeof (buffer), - _("%a %d %b"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%a %d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%a %d %b"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%a %d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } else { - e_utf8_strftime (buffer, sizeof (buffer), - _("%a %d %b %Y"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%a %d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%a %d %b %Y"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%a %d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } @@ -220,26 +229,32 @@ ea_gnome_calendar_get_label_description (GnomeCalendar *gcal) if (start_tm.tm_mday == end_tm.tm_mday) { buffer[0] = '\0'; } else { - e_utf8_strftime (buffer, sizeof (buffer), - "%d", &start_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + "%d", &start_tm); strcat (buffer, " - "); } - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%d %b %Y"), &end_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%d %b %Y"), &end_tm); strcat (buffer, end_buffer); } else { - e_utf8_strftime (buffer, sizeof (buffer), - _("%d %b"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%d %b"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } } else { - e_utf8_strftime (buffer, sizeof (buffer), - _("%d %b %Y"), &start_tm); - e_utf8_strftime (end_buffer, sizeof (end_buffer), - _("%d %b %Y"), &end_tm); + e_utf8_strftime ( + buffer, sizeof (buffer), + _("%d %b %Y"), &start_tm); + e_utf8_strftime ( + end_buffer, sizeof (end_buffer), + _("%d %b %Y"), &end_tm); strcat (buffer, " - "); strcat (buffer, end_buffer); } @@ -275,7 +290,7 @@ ea_gnome_calendar_ref_child (AtkObject *obj, g_return_val_if_fail (EA_IS_GNOME_CALENDAR (obj), NULL); /* valid child index range is [0-3] */ - if (i < 0 || i >3 ) + if (i < 0 || i >3) return NULL; widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (obj)); diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c index 11a36df54a..4b201d57a9 100644 --- a/calendar/gui/ea-jump-button.c +++ b/calendar/gui/ea-jump-button.c @@ -126,8 +126,8 @@ ea_jump_button_new (GObject *obj) if (!atk_obj) { static AtkRole event_role = ATK_ROLE_INVALID; - atk_obj = ATK_OBJECT (g_object_new (EA_TYPE_JUMP_BUTTON, - NULL)); + atk_obj = ATK_OBJECT ( + g_object_new (EA_TYPE_JUMP_BUTTON, NULL)); atk_object_initialize (atk_obj, target_obj); if (event_role == ATK_ROLE_INVALID) event_role = atk_role_register ("Jump Button"); diff --git a/calendar/gui/ea-week-view-cell.c b/calendar/gui/ea-week-view-cell.c index e8fffd8500..2ceb8e17bc 100644 --- a/calendar/gui/ea-week-view-cell.c +++ b/calendar/gui/ea-week-view-cell.c @@ -55,8 +55,9 @@ e_week_view_cell_get_type (void) NULL /* value table */ }; - type = g_type_register_static (G_TYPE_OBJECT, - "EWeekViewCell", &tinfo, 0); + type = g_type_register_static ( + G_TYPE_OBJECT, + "EWeekViewCell", &tinfo, 0); } return type; @@ -140,10 +141,12 @@ ea_week_view_cell_get_type (void) (GInterfaceFinalizeFunc) NULL, NULL }; - type = g_type_register_static (ATK_TYPE_GOBJECT_ACCESSIBLE, - "EaWeekViewCell", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); + type = g_type_register_static ( + ATK_TYPE_GOBJECT_ACCESSIBLE, + "EaWeekViewCell", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); } @@ -185,7 +188,8 @@ ea_week_view_cell_new (GObject *obj) #ifdef ACC_DEBUG ++n_ea_week_view_cell_created; - printf ("ACC_DEBUG: n_ea_week_view_cell_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_cell_created = %d\n", n_ea_week_view_cell_created); #endif return atk_object; @@ -197,7 +201,8 @@ static void ea_week_view_cell_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); ++n_ea_week_view_cell_destroyed; - printf ("ACC_DEBUG: n_ea_week_view_cell_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_cell_destroyed = %d\n", n_ea_week_view_cell_destroyed); } #endif @@ -237,10 +242,12 @@ ea_week_view_cell_get_name (AtkObject *accessible) new_row = cell->row; } - column_label = atk_table_get_column_description (ATK_TABLE (ea_main_item), - new_column); - row_label = atk_table_get_row_description (ATK_TABLE (ea_main_item), - new_row); + column_label = atk_table_get_column_description ( + ATK_TABLE (ea_main_item), + new_column); + row_label = atk_table_get_row_description ( + ATK_TABLE (ea_main_item), + new_row); new_name = g_strconcat (column_label, " ", row_label, NULL); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, new_name); g_free (new_name); @@ -321,8 +328,9 @@ ea_week_view_cell_get_index_in_parent (AtkObject *accessible) cell = E_WEEK_VIEW_CELL (g_obj); parent = atk_object_get_parent (accessible); - return atk_table_get_index_at (ATK_TABLE (parent), - cell->row, cell->column); + return atk_table_get_index_at ( + ATK_TABLE (parent), + cell->row, cell->column); } /* Atk Component Interface */ @@ -367,12 +375,14 @@ component_interface_get_extents (AtkComponent *component, main_canvas = cell->week_view->main_canvas; atk_obj = atk_gobject_accessible_for_object (G_OBJECT (main_canvas)); - atk_component_get_extents (ATK_COMPONENT (atk_obj), - x, y, - &week_view_width, &week_view_height, - coord_type); - gnome_canvas_get_scroll_offsets (GNOME_CANVAS (week_view->main_canvas), - &scroll_x, &scroll_y); + atk_component_get_extents ( + ATK_COMPONENT (atk_obj), + x, y, + &week_view_width, &week_view_height, + coord_type); + gnome_canvas_get_scroll_offsets ( + GNOME_CANVAS (week_view->main_canvas), + &scroll_x, &scroll_y); start_day = week_view->display_start_day; if (week_view->multi_week_view) { if (week_view->compress_weekend && (cell->column == (5 - start_day))) { diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c index 2fe8b239c4..d4597d8fdd 100644 --- a/calendar/gui/ea-week-view-main-item.c +++ b/calendar/gui/ea-week-view-main-item.c @@ -229,22 +229,27 @@ ea_week_view_main_item_get_type (void) * */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_week_view_main_item_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_week_view_main_item_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaWeekViewMainItem", &tinfo, 0); - g_type_add_interface_static (type, ATK_TYPE_COMPONENT, - &atk_component_info); - g_type_add_interface_static (type, ATK_TYPE_TABLE, - &atk_table_info); - g_type_add_interface_static (type, ATK_TYPE_SELECTION, - &atk_selection_info); + type = g_type_register_static ( + derived_atk_type, + "EaWeekViewMainItem", &tinfo, 0); + g_type_add_interface_static ( + type, ATK_TYPE_COMPONENT, + &atk_component_info); + g_type_add_interface_static ( + type, ATK_TYPE_TABLE, + &atk_table_info); + g_type_add_interface_static ( + type, ATK_TYPE_SELECTION, + &atk_selection_info); } return type; @@ -278,15 +283,17 @@ ea_week_view_main_item_new (GObject *obj) g_return_val_if_fail (E_IS_WEEK_VIEW_MAIN_ITEM (obj), NULL); - accessible = ATK_OBJECT (g_object_new (EA_TYPE_WEEK_VIEW_MAIN_ITEM, - NULL)); + accessible = ATK_OBJECT ( + g_object_new (EA_TYPE_WEEK_VIEW_MAIN_ITEM, + NULL)); atk_object_initialize (accessible, obj); accessible->role = ATK_ROLE_TABLE; #ifdef ACC_DEBUG ++n_ea_week_view_main_item_created; - printf ("ACC_DEBUG: n_ea_week_view_main_item_created = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_main_item_created = %d\n", n_ea_week_view_main_item_created); #endif @@ -324,7 +331,8 @@ ea_week_view_main_item_finalize (GObject *object) G_OBJECT_CLASS (parent_class)->finalize (object); #ifdef ACC_DEBUG ++n_ea_week_view_main_item_destroyed; - printf ("ACC_DEBUG: n_ea_week_view_main_item_destroyed = %d\n", + printf ( + "ACC_DEBUG: n_ea_week_view_main_item_destroyed = %d\n", n_ea_week_view_main_item_destroyed); #endif } @@ -490,17 +498,19 @@ ea_week_view_main_item_time_change_cb (EWeekView *week_view, printf ("EvoAcc: ea_week_view_main_item time changed cb\n"); #endif /* only deal with the first selected child, for now */ - item_cell = atk_selection_ref_selection (ATK_SELECTION (ea_main_item), - 0); + item_cell = atk_selection_ref_selection ( + ATK_SELECTION (ea_main_item), + 0); if (item_cell) { AtkStateSet *state_set; state_set = atk_object_ref_state_set (item_cell); atk_state_set_add_state (state_set, ATK_STATE_FOCUSED); g_object_unref (state_set); - g_signal_emit_by_name (ea_main_item, - "active-descendant-changed", - item_cell); + g_signal_emit_by_name ( + ea_main_item, + "active-descendant-changed", + item_cell); g_signal_emit_by_name (data, "selection_changed"); atk_focus_tracker_notify (item_cell); g_object_unref (item_cell); @@ -594,8 +604,9 @@ ea_week_view_main_item_get_row_label (EaWeekViewMainItem *ea_main_item, if (!g_obj) return 0; - return g_snprintf (buffer, buffer_size, "the %i week", - row + 1); + return g_snprintf ( + buffer, buffer_size, "the %i week", + row + 1); } @@ -618,12 +629,14 @@ ea_week_view_main_item_get_cell_data (EaWeekViewMainItem *ea_main_item) main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table"); if (!cell_data) { cell_data = ea_cell_table_create (week_view->weeks_shown, 7, TRUE); - g_object_set_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table", cell_data); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table", cell_data); } return cell_data; } @@ -635,11 +648,13 @@ ea_week_view_main_item_destory_cell_data (EaWeekViewMainItem *ea_main_item) g_return_if_fail (ea_main_item); - cell_data = g_object_get_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table"); + cell_data = g_object_get_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table"); if (cell_data) { - g_object_set_data (G_OBJECT (ea_main_item), - "ea-week-view-cell-table", NULL); + g_object_set_data ( + G_OBJECT (ea_main_item), + "ea-week-view-cell-table", NULL); ea_cell_table_destroy (cell_data); } } @@ -679,8 +694,9 @@ component_interface_get_extents (AtkComponent *component, week_view = e_week_view_main_item_get_week_view (main_item); ea_canvas = gtk_widget_get_accessible (week_view->main_canvas); - atk_component_get_extents (ATK_COMPONENT (ea_canvas), x, y, - width, height, coord_type); + atk_component_get_extents ( + ATK_COMPONENT (ea_canvas), x, y, + width, height, coord_type); } /* atk table interface */ @@ -726,8 +742,9 @@ table_interface_ref_at (AtkTable *table, gint index; EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); - index = ea_week_view_main_item_get_child_index_at (ea_main_item, - row, column); + index = ea_week_view_main_item_get_child_index_at ( + ea_main_item, + row, column); return ea_week_view_main_item_ref_child (ATK_OBJECT (ea_main_item), index); } @@ -772,8 +789,9 @@ table_interface_get_index_at (AtkTable *table, gint column) { EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); - return ea_week_view_main_item_get_child_index_at (ea_main_item, - row, column); + return ea_week_view_main_item_get_child_index_at ( + ea_main_item, + row, column); } static gint @@ -802,13 +820,13 @@ table_interface_get_column_extent_at (AtkTable *table, AtkObject *child; EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); - index = ea_week_view_main_item_get_child_index_at (ea_main_item, - row, column); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_week_view_main_item_get_child_index_at ( + ea_main_item, row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return width; } @@ -823,13 +841,13 @@ table_interface_get_row_extent_at (AtkTable *table, AtkObject *child; EaWeekViewMainItem * ea_main_item = EA_WEEK_VIEW_MAIN_ITEM (table); - index = ea_week_view_main_item_get_child_index_at (ea_main_item, - row, column); - child = atk_object_ref_accessible_child (ATK_OBJECT (ea_main_item), - index); + index = ea_week_view_main_item_get_child_index_at ( + ea_main_item, row, column); + child = atk_object_ref_accessible_child ( + ATK_OBJECT (ea_main_item), index); if (child) - atk_component_get_size (ATK_COMPONENT (child), - &width, &height); + atk_component_get_size ( + ATK_COMPONENT (child), &width, &height); return height; } @@ -855,7 +873,7 @@ table_interface_is_row_selected (AtkTable *table, if (week_view->selection_start_day == -1) /* no selection */ return FALSE; - if ((row < 0) && (row + 1 > week_view->weeks_shown )) + if ((row < 0) && (row + 1 > week_view->weeks_shown)) return FALSE; if (((week_view->selection_start_day < row * 7) && (week_view->selection_end_day < row * 7)) || @@ -898,7 +916,7 @@ table_interface_is_column_selected (AtkTable *table, else { gint i; for (i = 0; i < week_view->weeks_shown; i++) - if ((column + i *7>= week_view->selection_start_day ) && + if ((column + i *7>= week_view->selection_start_day) && (column + i *7<= week_view->selection_end_day)) return TRUE; return FALSE; @@ -961,7 +979,7 @@ table_interface_get_selected_columns (AtkTable *table, if (week_view->selection_start_day == -1) return 0; - if (week_view->selection_end_day - week_view->selection_start_day >= 6 ) { + if (week_view->selection_end_day - week_view->selection_start_day >= 6) { start_column = 0; n_columns =7; } else { @@ -1159,8 +1177,7 @@ table_interface_get_row_description (AtkTable *table, ea_week_view_main_item_get_row_label ( ea_main_item, row, buffer, sizeof (buffer)); ea_cell_table_set_row_label (cell_data, row, buffer); - description = ea_cell_table_get_row_label (cell_data, - row); + description = ea_cell_table_get_row_label (cell_data, row); } return description; } @@ -1260,9 +1277,10 @@ selection_interface_ref_selection (AtkSelection *selection, main_item = E_WEEK_VIEW_MAIN_ITEM (g_obj); week_view = e_week_view_main_item_get_week_view (main_item); - start_index = ea_week_view_main_item_get_child_index_at (ea_main_item, - week_view->selection_start_day / 7, - week_view->selection_start_day % 7); + start_index = ea_week_view_main_item_get_child_index_at ( + ea_main_item, + week_view->selection_start_day / 7, + week_view->selection_start_day % 7); return ea_week_view_main_item_ref_child (ATK_OBJECT (selection), start_index + i); } diff --git a/calendar/gui/ea-week-view.c b/calendar/gui/ea-week-view.c index fad264888d..26cdcf2eed 100644 --- a/calendar/gui/ea-week-view.c +++ b/calendar/gui/ea-week-view.c @@ -71,16 +71,18 @@ ea_week_view_get_type (void) * our parent class EaCalView is run-time deriving. */ - factory = atk_registry_get_factory (atk_get_default_registry (), - e_calendar_view_get_type ()); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + e_calendar_view_get_type ()); derived_atk_type = atk_object_factory_get_accessible_type (factory); g_type_query (derived_atk_type, &query); tinfo.class_size = query.class_size; tinfo.instance_size = query.instance_size; - type = g_type_register_static (derived_atk_type, - "EaWeekView", &tinfo, 0); + type = g_type_register_static ( + derived_atk_type, + "EaWeekView", &tinfo, 0); } @@ -156,12 +158,14 @@ ea_week_view_get_name (AtkObject *accessible) view_type = gnome_calendar_get_view (gcal); if (view_type == GNOME_CAL_MONTH_VIEW) - name_str = g_strdup_printf (_("Month View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Month View: %s. %s"), + label_text, event_str); else - name_str = g_strdup_printf (_("Week View: %s. %s"), - label_text, event_str); + name_str = g_strdup_printf ( + _("Week View: %s. %s"), + label_text, event_str); ATK_OBJECT_CLASS (parent_class)->set_name (accessible, name_str); g_free (name_str); @@ -337,7 +341,8 @@ ea_week_view_ref_child (AtkObject *accessible, } #ifdef ACC_DEBUG - printf ("EvoAcc: ea_week_view_ref_child [%d]=%p\n", + printf ( + "EvoAcc: ea_week_view_ref_child [%d]=%p\n", index, (gpointer) atk_object); #endif return atk_object; diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index b98857e717..0ea1008701 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -596,67 +596,65 @@ gnome_calendar_class_init (GnomeCalendarClass *class) GNOME_CAL_DAY_VIEW, G_PARAM_READWRITE)); - signals[DATES_SHOWN_CHANGED] = - g_signal_new ("dates_shown_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GnomeCalendarClass, dates_shown_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[CALENDAR_SELECTION_CHANGED] = - g_signal_new ("calendar_selection_changed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_LAST, - G_STRUCT_OFFSET (GnomeCalendarClass, calendar_selection_changed), - NULL, NULL, - g_cclosure_marshal_VOID__VOID, - G_TYPE_NONE, 0); - - signals[SOURCE_ADDED] = - g_signal_new ("source_added", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GnomeCalendarClass, source_added), - NULL, NULL, - e_marshal_VOID__INT_OBJECT, - G_TYPE_NONE, - 2, - G_TYPE_INT, G_TYPE_OBJECT); - - signals[SOURCE_REMOVED] = - g_signal_new ("source_removed", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST, - G_STRUCT_OFFSET (GnomeCalendarClass, source_removed), - NULL, NULL, - e_marshal_VOID__INT_OBJECT, - G_TYPE_NONE, - 2, - G_TYPE_INT, G_TYPE_OBJECT); - - signals[GOTO_DATE] = - g_signal_new ("goto_date", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GnomeCalendarClass, goto_date), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, - 1, - G_TYPE_INT); - - signals[CHANGE_VIEW] = - g_signal_new ("change_view", - G_TYPE_FROM_CLASS (object_class), - G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, - G_STRUCT_OFFSET (GnomeCalendarClass, change_view), - NULL, NULL, - g_cclosure_marshal_VOID__INT, - G_TYPE_NONE, - 1, - G_TYPE_INT); + signals[DATES_SHOWN_CHANGED] = g_signal_new ( + "dates_shown_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GnomeCalendarClass, dates_shown_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[CALENDAR_SELECTION_CHANGED] = g_signal_new ( + "calendar_selection_changed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_LAST, + G_STRUCT_OFFSET (GnomeCalendarClass, calendar_selection_changed), + NULL, NULL, + g_cclosure_marshal_VOID__VOID, + G_TYPE_NONE, 0); + + signals[SOURCE_ADDED] = g_signal_new ( + "source_added", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GnomeCalendarClass, source_added), + NULL, NULL, + e_marshal_VOID__INT_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_OBJECT); + + signals[SOURCE_REMOVED] = g_signal_new ( + "source_removed", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST, + G_STRUCT_OFFSET (GnomeCalendarClass, source_removed), + NULL, NULL, + e_marshal_VOID__INT_OBJECT, + G_TYPE_NONE, 2, + G_TYPE_INT, + G_TYPE_OBJECT); + + signals[GOTO_DATE] = g_signal_new ( + "goto_date", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GnomeCalendarClass, goto_date), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); + + signals[CHANGE_VIEW] = g_signal_new ( + "change_view", + G_TYPE_FROM_CLASS (object_class), + G_SIGNAL_RUN_FIRST | G_SIGNAL_ACTION, + G_STRUCT_OFFSET (GnomeCalendarClass, change_view), + NULL, NULL, + g_cclosure_marshal_VOID__INT, + G_TYPE_NONE, 1, + G_TYPE_INT); /* * Key bindings @@ -665,98 +663,115 @@ gnome_calendar_class_init (GnomeCalendarClass *class) binding_set = gtk_binding_set_new (G_OBJECT_CLASS_NAME (class)); /* Alt+PageUp/PageDown, go to the first/last day of the month */ - gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Up, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Up, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_Page_Down, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Page_Down, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_Page_Up, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_Page_Up, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_Page_Down, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_Page_Down, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_MONTH); /* Alt+Home/End, go to the first/last day of the week */ - gtk_binding_entry_add_signal (binding_set, GDK_KEY_Home, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_End, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_Home, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_KP_End, - GDK_MOD1_MASK, - "goto_date", 1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_Home, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_End, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_Home, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_FIRST_DAY_OF_WEEK); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_KP_End, + GDK_MOD1_MASK, + "goto_date", 1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_LAST_DAY_OF_WEEK); /*Alt+Left/Right, go to the same day of the previous/next week*/ - gtk_binding_entry_add_signal (binding_set,GDK_KEY_Left, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KEY_KP_Left, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KEY_Right, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); - gtk_binding_entry_add_signal (binding_set,GDK_KEY_KP_Right, - GDK_MOD1_MASK, - "goto_date",1, - G_TYPE_ENUM, - GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_Left, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_KP_Left, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_PREVIOUS_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_Right, + GDK_MOD1_MASK, + "goto_date",1, + G_TYPE_ENUM, + GNOME_CAL_GOTO_SAME_DAY_OF_NEXT_WEEK); + gtk_binding_entry_add_signal ( + binding_set,GDK_KEY_KP_Right, + GDK_MOD1_MASK, + "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_KEY_y, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_DAY_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_j, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_WORK_WEEK_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_k, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_WEEK_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_m, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_MONTH_VIEW); - gtk_binding_entry_add_signal (binding_set, GDK_KEY_l, - GDK_CONTROL_MASK, - "change_view", 1, - G_TYPE_ENUM, - GNOME_CAL_LIST_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_y, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_DAY_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_j, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_WORK_WEEK_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_k, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_WEEK_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_m, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_MONTH_VIEW); + gtk_binding_entry_add_signal ( + binding_set, GDK_KEY_l, + GDK_CONTROL_MASK, + "change_view", 1, + G_TYPE_ENUM, + GNOME_CAL_LIST_VIEW); /* init the accessibility support for gnome_calendar */ gnome_calendar_a11y_init (); @@ -1091,12 +1106,13 @@ adjust_client_view_sexp (GnomeCalendar *gcal, end = isodate_from_time_t (end_time); if (sexp) { - new_sexp = g_strdup_printf ("(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", - start, end, gcal_get_default_tzloc (gcal), - sexp); + new_sexp = g_strdup_printf ( + "(and (occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\") %s)", + start, end, gcal_get_default_tzloc (gcal), sexp); } else { - new_sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", - start, end, gcal_get_default_tzloc (gcal)); + new_sexp = g_strdup_printf ( + "(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", + start, end, gcal_get_default_tzloc (gcal)); } g_free (start); @@ -1326,8 +1342,9 @@ update_todo_view_async (struct _mupdate_todo_msg *msg) model = e_task_table_get_model (E_TASK_TABLE (priv->task_table)); if ((sexp = calendar_config_get_hide_completed_tasks_sexp (FALSE)) != NULL) { - priv->todo_sexp = g_strdup_printf ("(and %s %s)", sexp, - priv->sexp ? priv->sexp : ""); + priv->todo_sexp = g_strdup_printf ( + "(and %s %s)", sexp, + priv->sexp ? priv->sexp : ""); e_cal_model_set_search_query (model, priv->todo_sexp); g_free (sexp); } else { @@ -2221,8 +2238,9 @@ gnome_calendar_update_date_navigator (GnomeCalendar *gcal) time_to_gdate_with_zone (&end_date, end, timezone); g_date_subtract_days (&end_date, 1); - e_calendar_item_set_selection (priv->date_navigator->calitem, - &start_date, &end_date); + e_calendar_item_set_selection ( + priv->date_navigator->calitem, + &start_date, &end_date); } void @@ -2312,8 +2330,9 @@ gnome_calendar_purge (GnomeCalendar *gcal, start = isodate_from_time_t (0); end = isodate_from_time_t (older_than); - sexp = g_strdup_printf ("(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", - start, end, gcal_get_default_tzloc (gcal)); + sexp = g_strdup_printf ( + "(occur-in-time-range? (make-time \"%s\") (make-time \"%s\") \"%s\")", + start, end, gcal_get_default_tzloc (gcal)); gcal_update_status_message (gcal, _("Purging"), -1); @@ -2370,7 +2389,7 @@ gnome_calendar_purge (GnomeCalendar *gcal, recur_id = icalcomponent_get_recurrenceid (m->data); - if (!icaltime_is_null_time (recur_id) ) + if (!icaltime_is_null_time (recur_id)) rid = icaltime_as_ical_string_r (recur_id); e_cal_client_remove_object_sync ( diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 738baa3654..e77f88aa24 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -646,8 +646,9 @@ comp_from (ECalComponentItipMethod method, e_cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("An organizer must be set.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("An organizer must be set.")); return NULL; } return g_strdup (itip_strip_mailto (organizer.value)); @@ -694,16 +695,18 @@ comp_to_list (ESourceRegistry *registry, e_cal_component_get_attendee_list (comp, &attendees); len = g_slist_length (attendees); if (len <= 0) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("At least one attendee is necessary")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("At least one attendee is necessary")); e_cal_component_free_attendee_list (attendees); return NULL; } e_cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("An organizer must be set.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("An organizer must be set.")); return NULL; } @@ -753,9 +756,6 @@ comp_to_list (ESourceRegistry *registry, e_destination_set_email ( destination, itip_strip_mailto (att->value)); g_ptr_array_add (array, destination); - d (printf ("itip-utils.c: comp_to_list: name: %s, email: %s\n", - e_destination_get_name (destination), - e_destination_get_email (destination))); } g_free (sender); e_cal_component_free_attendee_list (attendees); @@ -815,8 +815,9 @@ comp_to_list (ESourceRegistry *registry, case E_CAL_COMPONENT_METHOD_DECLINECOUNTER: e_cal_component_get_organizer (comp, &organizer); if (organizer.value == NULL) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("An organizer must be set.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("An organizer must be set.")); return NULL; } @@ -1121,9 +1122,10 @@ comp_server_send (ECalComponentItipMethod method, e_notice ( NULL, GTK_MESSAGE_ERROR, _("Unable to book a resource, the " - "new event collides with some other.")); + "new event collides with some other.")); } else { - e_notice (NULL, GTK_MESSAGE_ERROR, + e_notice ( + NULL, GTK_MESSAGE_ERROR, _("Unable to book a resource, error: %s"), error->message); } @@ -1299,14 +1301,16 @@ comp_minimal (ESourceRegistry *registry, e_cal_component_set_attendee_list (clone, attendees); if (!comp_limit_attendees (registry, clone)) { - e_notice (NULL, GTK_MESSAGE_ERROR, - _("You must be an attendee of the event.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("You must be an attendee of the event.")); goto error; } } - itt = icaltime_from_timet_with_zone (time (NULL), FALSE, - icaltimezone_get_utc_timezone ()); + itt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + icaltimezone_get_utc_timezone ()); e_cal_component_set_dtstamp (clone, &itt); e_cal_component_get_organizer (comp, &organizer); @@ -1397,8 +1401,9 @@ comp_compliant (ESourceRegistry *registry, struct icaltimetype itt; clone = e_cal_component_clone (comp); - itt = icaltime_from_timet_with_zone (time (NULL), FALSE, - icaltimezone_get_utc_timezone ()); + itt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + icaltimezone_get_utc_timezone ()); e_cal_component_set_dtstamp (clone, &itt); /* Make UNTIL date a datetime in a simple recurrence */ @@ -1694,7 +1699,8 @@ itip_send_comp (ESourceRegistry *registry, /* check whether backend could handle sending requests/updates */ if (method != E_CAL_COMPONENT_METHOD_PUBLISH && - e_client_check_capability (E_CLIENT (cal_client), + e_client_check_capability ( + E_CLIENT (cal_client), CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { if (users) { g_slist_foreach (users, (GFunc) g_free, NULL); @@ -1932,23 +1938,27 @@ reply_to_calendar_comp (ESourceRegistry *registry, "</b><br><br><table>"); if (orig_from && *orig_from) - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>From</b></td>" "<td>:</td><td>%s</td></tr>", orig_from); g_free (orig_from); if (subject) - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>Subject</b></td>" "<td>:</td><td>%s</td></tr>", subject); g_free (subject); - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>Location</b></td>" "<td>:</td><td>%s</td></tr>", location); if (time) - g_string_append_printf (body, + g_string_append_printf ( + body, "<tr><td><b>Time</b></td>" "<td>:</td><td>%s</td></tr>", time); g_free (time); @@ -2004,8 +2014,9 @@ itip_publish_begin (ECalComponent *pub_comp, for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); prop != NULL; - prop = icalcomponent_get_next_property (icomp, - ICAL_FREEBUSY_PROPERTY)) + prop = icalcomponent_get_next_property ( + icomp, + ICAL_FREEBUSY_PROPERTY)) { icalproperty *p; @@ -2058,8 +2069,8 @@ comp_fb_normalize (icalcomponent *icomp) iclone = icalcomponent_new (ICAL_VFREEBUSY_COMPONENT); - prop = icalcomponent_get_first_property (icomp, - ICAL_ORGANIZER_PROPERTY); + prop = icalcomponent_get_first_property ( + icomp, ICAL_ORGANIZER_PROPERTY); if (prop) { p = icalproperty_new_clone (prop); icalcomponent_add_property (iclone, p); @@ -2071,15 +2082,13 @@ comp_fb_normalize (icalcomponent *icomp) itt = icalcomponent_get_dtend (icomp); icalcomponent_set_dtend (iclone, itt); - fb_count = icalcomponent_count_properties (icomp, - ICAL_FREEBUSY_PROPERTY); + fb_count = icalcomponent_count_properties ( + icomp, ICAL_FREEBUSY_PROPERTY); ipt = g_new0 (struct icalperiodtype, fb_count + 1); - for (prop = icalcomponent_get_first_property (icomp, - ICAL_FREEBUSY_PROPERTY); + for (prop = icalcomponent_get_first_property (icomp, ICAL_FREEBUSY_PROPERTY); prop != NULL; - prop = icalcomponent_get_next_property (icomp, - ICAL_FREEBUSY_PROPERTY)) + prop = icalcomponent_get_next_property (icomp, ICAL_FREEBUSY_PROPERTY)) { ipt[i] = icalproperty_get_freebusy (prop); i++; @@ -2103,8 +2112,9 @@ comp_fb_normalize (icalcomponent *icomp) if (uid) icalcomponent_set_uid (iclone, uid); - itt = icaltime_from_timet_with_zone (time (NULL), FALSE, - icaltimezone_get_utc_timezone ()); + itt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, + icaltimezone_get_utc_timezone ()); icalcomponent_set_dtstamp (iclone, itt); prop = icalcomponent_get_first_property (icomp, ICAL_URL_PROPERTY); @@ -2178,15 +2188,17 @@ itip_publish_comp (ECalClient *cal_client, soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); ical_string = icalcomponent_as_ical_string_r (toplevel); - soup_message_set_request (msg, "text/calendar", SOUP_MEMORY_TEMPORARY, - ical_string, strlen (ical_string)); + soup_message_set_request ( + msg, "text/calendar", SOUP_MEMORY_TEMPORARY, + 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, - msg->reason_phrase); + g_warning ( + G_STRLOC ": Could not publish Free/Busy: %d: %s", + msg->status_code, + msg->reason_phrase); g_object_unref (msg); g_object_unref (session); g_free (ical_string); diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 9f4bb7b9c9..85a293e6fa 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -355,8 +355,9 @@ print_border_with_triangles (GtkPrintContext *pc, 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 - left_triangle_width, + (y1 + y2) / 2); cairo_line_to (cr, x1, y2); cairo_line_to (cr, x2, y2); @@ -379,15 +380,17 @@ print_border_with_triangles (GtkPrintContext *pc, 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 - 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); + cairo_line_to ( + cr, x2 + right_triangle_width, + (y1 + y2) / 2); cairo_line_to (cr, x2, y1); cairo_close_path (cr); @@ -458,16 +461,16 @@ print_rectangle (GtkPrintContext *context, */ static PangoLayout * shrink_text_to_line (PangoLayout *layout, - gint layout_width, - gint layout_height, - GtkPrintContext *context, - PangoFontDescription *desc, - const gchar *text, - PangoAlignment alignment, - gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2) + gint layout_width, + gint layout_height, + GtkPrintContext *context, + PangoFontDescription *desc, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { gint new_length; @@ -477,7 +480,7 @@ shrink_text_to_line (PangoLayout *layout, new_length = (gint) floor (pango_units_from_double (x2 - x1) / (gdouble) layout_width * (gdouble) strlen (text)); - if (new_length < strlen(text)) { + if (new_length < strlen (text)) { g_object_unref (layout); /* Destroy old layout */ layout = gtk_print_context_create_pango_layout (context); @@ -494,14 +497,14 @@ shrink_text_to_line (PangoLayout *layout, * or PANGO_ALIGN_CENTER. Text is truncated if too long for cell. */ static gdouble print_text_line (GtkPrintContext *context, - PangoFontDescription *desc, - const gchar *text, - PangoAlignment alignment, - gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2, - gboolean shrink) + PangoFontDescription *desc, + const gchar *text, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2, + gboolean shrink) { PangoLayout *layout; gint layout_width, layout_height; @@ -518,7 +521,8 @@ print_text_line (GtkPrintContext *context, pango_layout_get_size (layout, &layout_width, &layout_height); if (shrink && layout_width > pango_units_from_double (x2 - x1)) /* Too wide */ - layout = shrink_text_to_line (layout, layout_width, layout_height, + layout = shrink_text_to_line ( + layout, layout_width, layout_height, context, desc, text, alignment, x1, x2, y1, y2); @@ -547,19 +551,20 @@ print_text_line (GtkPrintContext *context, } /* Prints 1 or more lines of aligned text in a box. It is centered vertically, and - the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT, - or PANGO_ALIGN_CENTER. */ + * the horizontal alignment can be either PANGO_ALIGN_LEFT, PANGO_ALIGN_RIGHT, + * or PANGO_ALIGN_CENTER. */ static double print_text (GtkPrintContext *context, - PangoFontDescription *desc, + PangoFontDescription *desc, const gchar *text, - PangoAlignment alignment, + PangoAlignment alignment, gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2) + gdouble x2, + gdouble y1, + gdouble y2) { - return print_text_line (context, desc, + return print_text_line ( + context, desc, text, alignment, x1, x2, y1, y2, FALSE); } @@ -587,13 +592,13 @@ print_text_size_bold (GtkPrintContext *context, /* gets/frees the font for you, as a bold font - absolute size parameter */ static double print_text_abs_bold (GtkPrintContext *context, - const gchar *text, - gdouble font_size, - PangoAlignment alignment, - gdouble x1, - gdouble x2, - gdouble y1, - gdouble y2) + const gchar *text, + gdouble font_size, + PangoAlignment alignment, + gdouble x1, + gdouble x2, + gdouble y1, + gdouble y2) { PangoFontDescription *font; gdouble w; @@ -789,8 +794,9 @@ print_month_small (GtkPrintContext *context, font = get_font_for_size (header_size, PANGO_WEIGHT_BOLD); if (bordertitle) print_border (context, x1, x2, y1, y1 + header_size, 1.0, 0.9); - print_text (context, font, buf, PANGO_ALIGN_CENTER, x1, x2, - y1, y1 + header_size); + print_text ( + context, font, buf, PANGO_ALIGN_CENTER, x1, x2, + y1, y1 + header_size); pango_font_description_free (font); y1 += header_size; @@ -898,23 +904,26 @@ print_month_small (GtkPrintContext *context, sprintf (buf, "%d", day); /* this is a slow messy way to do this ... but easy ... */ - e_cal_model_generate_instances_sync (gnome_calendar_get_model (gcal), now, - time_day_end_with_zone (now, zone), - instance_cb, &found); + e_cal_model_generate_instances_sync ( + gnome_calendar_get_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) || (greystart >= now && greystart < next)) { - print_border (context, - cell_left, cell_right, - cell_top, cell_bottom, - -1.0, 0.75); + print_border ( + context, + cell_left, cell_right, + cell_top, cell_bottom, + -1.0, 0.75); } - print_text (context, font, buf, PANGO_ALIGN_RIGHT, - cell_left, text_right, - cell_top, cell_bottom); + print_text ( + context, font, buf, PANGO_ALIGN_RIGHT, + cell_left, text_right, + cell_top, cell_bottom); now = next; } @@ -1047,10 +1056,10 @@ print_day_background (GtkPrintContext *context, hour_minute_width = evo_calendar_print_renderer_get_width ( context, font_minute, use_24_hour ? "00" : _("am")); if (!use_24_hour) - hour_minute_width = - MAX (hour_minute_width, + hour_minute_width = MAX ( + hour_minute_width, evo_calendar_print_renderer_get_width ( - context, font_minute, _("pm"))); + context, font_minute, _("pm"))); row = 0; hour_minute_x = left + width - hour_minute_width - 3; @@ -1075,12 +1084,14 @@ print_day_background (GtkPrintContext *context, /* the hour label/minute */ sprintf (buf, "%d", hour); - print_text (context, font_hour, buf, PANGO_ALIGN_RIGHT, - left, hour_minute_x, - y - yinc, y - yinc + hour_font_size); - print_text (context, font_minute, minute, PANGO_ALIGN_LEFT, - hour_minute_x, left + width - 3, - y - yinc, y - yinc + minute_font_size); + print_text ( + context, font_hour, buf, PANGO_ALIGN_RIGHT, + left, hour_minute_x, + y - yinc, y - yinc + hour_font_size); + print_text ( + context, font_minute, minute, PANGO_ALIGN_LEFT, + hour_minute_x, left + width - 3, + y - yinc, y - yinc + minute_font_size); /* Draw the horizontal line between hours, across the entire width of the day view. */ @@ -1186,9 +1197,10 @@ print_day_details_cb (ECalComponent *comp, ECalModelGenerateInstancesData *mdata = (ECalModelGenerateInstancesData *) data; struct pdinfo *pdi = (struct pdinfo *) mdata->cb_data; - print_day_add_event (mdata->comp_data, istart, iend, - pdi->zone, pdi->days_shown, pdi->day_starts, - pdi->long_events, pdi->events); + print_day_add_event ( + mdata->comp_data, istart, iend, + pdi->zone, pdi->days_shown, pdi->day_starts, + pdi->long_events, pdi->events); return TRUE; } @@ -1370,9 +1382,10 @@ print_day_long_event (GtkPrintContext *context, red = green = blue = 0.95; e_cal_model_get_rgb_color_for_component ( model, event->comp_data, &red, &green, &blue); - print_border_with_triangles (context, x1, x2, y1, y2, 0.5, red, green, blue, - left_triangle_width, - right_triangle_width); + print_border_with_triangles ( + context, x1, x2, y1, y2, 0.5, red, green, blue, + left_triangle_width, + right_triangle_width); /* If the event starts after the first day being printed, we need to * print the start time. */ @@ -1466,8 +1479,9 @@ print_day_event (GtkPrintContext *context, y1 = top + start_row * row_height; y2 = top + (end_row + 1) * row_height; #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); + 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 red = green = blue = 0.95; @@ -1498,8 +1512,9 @@ print_day_event (GtkPrintContext *context, end_buffer, sizeof (end_buffer)); t = text; - text = g_strdup_printf ("%s - %s %s ", start_buffer, - end_buffer, text); + text = g_strdup_printf ( + "%s - %s %s ", + start_buffer, end_buffer, text); g_free (t); } @@ -1555,10 +1570,12 @@ print_day_details (GtkPrintContext *context, /* Get the events from the server. */ e_cal_model_generate_instances_sync (model, start, end, print_day_details_cb, &pdi); - qsort (pdi.long_events->data, pdi.long_events->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); - qsort (pdi.events[0]->data, pdi.events[0]->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.long_events->data, pdi.long_events->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.events[0]->data, pdi.events[0]->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); /* Also print events outside of work hours */ if (pdi.events[0]->len > 0) { @@ -1583,8 +1600,9 @@ print_day_details (GtkPrintContext *context, } /* 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); + e_day_view_layout_long_events ( + pdi.long_events, pdi.days_shown, + pdi.day_starts, &rows_in_top_display); /*Print the long events. */ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); @@ -1593,9 +1611,10 @@ print_day_details (GtkPrintContext *context, * top display, but we may have more rows than that, in which case * the main display area will be compressed. */ /* Limit long day event to half the height of the panel */ - rows_in_top_display = MIN (MAX (rows_in_top_display, - DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), - (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); + rows_in_top_display = MIN ( + MAX (rows_in_top_display, + DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), + (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -1658,30 +1677,33 @@ print_day_details (GtkPrintContext *context, + LONG_DAY_EVENTS_BOTTOM_SPACING; /* Draw the borders, lines, and times down the left. */ - print_day_background (context, gcal, whence, &pdi, - left, right, top, bottom); + 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], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), - pdi.mins_per_row, pdi.cols_per_row, -1); + e_day_view_layout_day_events ( + pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), + pdi.mins_per_row, pdi.cols_per_row, -1); /* use font like with 30 minutes time division */ rows_with_30_mins = (pdi.end_hour - pdi.start_hour) * (60 / 30); /* print the short events. */ - if (top > bottom ) + if (top > bottom) max_font_size = ((top - bottom) / rows_with_30_mins) - 4; else - max_font_size = ((bottom - top ) / rows_with_30_mins) - 4; + max_font_size = ((bottom - top) / rows_with_30_mins) - 4; font_size = MIN (DAY_NORMAL_FONT_SIZE, max_font_size); font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL); for (i = 0; i < pdi.events[0]->len; i++) { event = &g_array_index (pdi.events[0], EDayViewEvent, i); - print_day_event (context, font, left, right, top, bottom, - event, &pdi, model); + print_day_event ( + context, font, left, right, top, bottom, + event, &pdi, model); } /* Free everything. */ @@ -1916,13 +1938,15 @@ print_week_event (GtkPrintContext *context, model, event->comp_data, &red, &green, &blue); if (print_is_one_day_week_event (event, span, psi->day_starts)) { - print_week_day_event (context, font, psi, - x1, x2, y1, psi->row_height, - event, span, text, red, green, blue); + print_week_day_event ( + context, font, psi, + x1, x2, y1, psi->row_height, + event, span, text, red, green, blue); } else { - print_week_long_event (context, font, psi, - x1, x2, y1, psi->row_height, - event, span, text, red, green, blue); + print_week_long_event ( + context, font, psi, + x1, x2, y1, psi->row_height, + event, span, text, red, green, blue); } } else { cairo_t *cr = gtk_print_context_get_cairo_context (context); @@ -2028,10 +2052,12 @@ print_week_view_background (GtkPrintContext *context, } else { cr = gtk_print_context_get_cairo_context (context); - cairo_move_to (cr, x1 + 0.1 * cell_width, - y1 + psi->header_row_height - 4); - cairo_line_to (cr, x2, - y1 + psi->header_row_height - 4); + cairo_move_to ( + cr, x1 + 0.1 * cell_width, + y1 + psi->header_row_height - 4); + cairo_line_to ( + cr, x2, + y1 + psi->header_row_height - 4); cairo_set_source_rgb (cr, 0, 0, 0); cairo_set_line_width (cr, 0.5); @@ -2047,8 +2073,9 @@ print_week_view_background (GtkPrintContext *context, e_utf8_strftime (buffer, sizeof (buffer), format_string, &tm); - print_text_line (context, font, buffer, PANGO_ALIGN_RIGHT, - x1, x2 - 4, y1 + 2, y1 + 2 + font_size, TRUE); + print_text_line ( + context, font, buffer, PANGO_ALIGN_RIGHT, + x1, x2 - 4, y1 + 2, y1 + 2 + font_size, TRUE); } } @@ -2068,9 +2095,10 @@ print_week_summary_cb (ECalComponent *comp, /* Check that the event times are valid. */ #if 0 - g_print ("View start:%li end:%li Event start:%li end:%li\n", - psi->day_starts[0], psi->day_starts[psi->days_shown], - start, end); + g_print ( + "View start:%li end:%li Event start:%li end:%li\n", + psi->day_starts[0], psi->day_starts[psi->days_shown], + start, end); #endif g_return_val_if_fail (start <= end, TRUE); @@ -2105,7 +2133,7 @@ print_week_summary (GtkPrintContext *context, gint weeks_shown, gint month, gdouble font_size, - gdouble font_size_background, + gdouble font_size_background, gdouble left, gdouble right, gdouble top, @@ -2153,19 +2181,22 @@ print_week_summary (GtkPrintContext *context, } /* Get the events from the server. */ - e_cal_model_generate_instances_sync (model, + e_cal_model_generate_instances_sync ( + model, psi.day_starts[0], psi.day_starts[psi.days_shown], print_week_summary_cb, &psi); - qsort (psi.events->data, psi.events->len, - sizeof (EWeekViewEvent), e_week_view_event_sort_func); + qsort ( + psi.events->data, psi.events->len, + sizeof (EWeekViewEvent), e_week_view_event_sort_func); /* Layout the events. */ - spans = e_week_view_layout_events (psi.events, NULL, - psi.multi_week_view, - psi.weeks_shown, - psi.compress_weekend, - psi.display_start_weekday, - psi.day_starts, rows_per_day); + spans = e_week_view_layout_events ( + psi.events, NULL, + psi.multi_week_view, + psi.weeks_shown, + psi.compress_weekend, + psi.display_start_weekday, + psi.day_starts, rows_per_day); /* Calculate the size of the cells. */ if (multi_week_view) { @@ -2189,16 +2220,18 @@ print_week_summary (GtkPrintContext *context, /* Draw the grid and the day names/numbers. */ font_background = get_font_for_size (font_size_background, PANGO_WEIGHT_NORMAL); - print_week_view_background (context, font_background, &psi, left, top, - cell_width, cell_height); + print_week_view_background ( + context, font_background, &psi, left, top, + cell_width, cell_height); pango_font_description_free (font_background); /* Print the events. */ font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL); for (event_num = 0; event_num < psi.events->len; event_num++) { event = &g_array_index (psi.events, EWeekViewEvent, event_num); - print_week_event (context, font, &psi, left, top, - cell_width, cell_height, model, event, spans); + print_week_event ( + context, font, &psi, left, top, + cell_width, cell_height, model, event, spans); } pango_font_description_free (font); @@ -2311,9 +2344,10 @@ print_month_summary (GtkPrintContext *context, pango_font_description_free (font); top = y2; - print_week_summary (context, gcal, date, TRUE, weeks, month, - MONTH_NORMAL_FONT_SIZE, MONTH_NORMAL_FONT_SIZE, - left, right, top, bottom); + print_week_summary ( + context, gcal, date, TRUE, weeks, month, + MONTH_NORMAL_FONT_SIZE, MONTH_NORMAL_FONT_SIZE, + left, right, top, bottom); } static void @@ -2350,8 +2384,9 @@ print_todo_details (GtkPrintContext *context, cairo_set_line_width (cr, 0.0); top +=2; - titled_box (context, _("Tasks"), font_summary, PANGO_ALIGN_CENTER, - &left, &top, &right, &bottom, 1.0); + titled_box ( + context, _("Tasks"), font_summary, PANGO_ALIGN_CENTER, + &left, &top, &right, &bottom, 1.0); y = top; yend = bottom - 2; @@ -2402,8 +2437,9 @@ print_todo_details (GtkPrintContext *context, cairo_stroke (cr); } - y = bound_text (context, font_summary, summary.value, -1, - x + 14, y + 4, xend, yend, FALSE, NULL, NULL); + y = bound_text ( + context, font_summary, summary.value, -1, + x + 14, y + 4, xend, yend, FALSE, NULL, NULL); y += get_font_size (font_summary) - 5; cr = gtk_print_context_get_cairo_context (context); @@ -2446,50 +2482,57 @@ print_day_view (GtkPrintContext *context, todo = width * 0.75; /* Print the main view with all the events in. */ - print_day_details (context, gcal, date, - 0.0, todo - 2.0, HEADER_HEIGHT + 4, - height); + print_day_details ( + context, gcal, date, + 0.0, todo - 2.0, HEADER_HEIGHT + 4, + height); /* Print the TaskPad down the right. */ - print_todo_details (context, gcal, 0, INT_MAX, - todo, width, HEADER_HEIGHT + 4, - height); + print_todo_details ( + context, gcal, 0, INT_MAX, + todo, width, HEADER_HEIGHT + 4, + height); /* Print the filled border around the header. */ - print_border (context, 0.0, width, - 0.0, HEADER_HEIGHT + 4, 1.0, 0.9); + print_border ( + context, 0.0, width, + 0.0, HEADER_HEIGHT + 4, 1.0, 0.9); /* Print the 2 mini calendar-months. */ l = width - SMALL_MONTH_PAD - (small_month_width + week_numbers_inc) * 2 - SMALL_MONTH_SPACING; - print_month_small (context, gcal, date, - l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, - DATE_MONTH | DATE_YEAR, date, date, FALSE); + print_month_small ( + context, gcal, date, + l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, + DATE_MONTH | DATE_YEAR, date, date, FALSE); l += SMALL_MONTH_SPACING + small_month_width + week_numbers_inc; - print_month_small (context, gcal, - time_add_month_with_zone (date, 1, zone), - l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (date, 1, zone), + l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); /* Print the date, e.g. '8th May, 2001'. */ convert_timet_to_struct_tm (date, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 4, todo, 4, - 4 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 4, todo, 4, + 4 + 24); /* Print the day, e.g. 'Tuesday'. */ format_date (&tm, DATE_DAYNAME, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 4, todo, - HEADER_HEIGHT + 9, - HEADER_HEIGHT + 9 + 18); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 4, todo, + HEADER_HEIGHT + 9, + HEADER_HEIGHT + 9 + 18); date = time_add_day_with_zone (date, 1, zone); } @@ -2563,10 +2606,10 @@ print_work_week_background (GtkPrintContext *context, hour_minute_xr = evo_calendar_print_renderer_get_width ( context, font_minute, use_24_hour ? "00" : _("am")); if (!use_24_hour) - hour_minute_xr = - MAX (hour_minute_xr, + hour_minute_xr = MAX ( + hour_minute_xr, evo_calendar_print_renderer_get_width ( - context, font_minute, _("pm"))); + context, font_minute, _("pm"))); row = 0; hour_minute_xl = left + width - hour_minute_xr - 3; @@ -2592,20 +2635,24 @@ print_work_week_background (GtkPrintContext *context, /* the hour label/minute */ sprintf (buf, "%d", hour); - print_text (context, font_hour, buf, PANGO_ALIGN_RIGHT, - left, hour_minute_xl, - y - yinc, y - yinc + hour_font_size); - print_text (context, font_minute, minute, PANGO_ALIGN_LEFT, - hour_minute_xl, left + width - 3, - y - yinc, y - yinc + minute_font_size); + print_text ( + context, font_hour, buf, PANGO_ALIGN_RIGHT, + left, hour_minute_xl, + y - yinc, y - yinc + hour_font_size); + print_text ( + context, font_minute, minute, PANGO_ALIGN_LEFT, + hour_minute_xl, left + width - 3, + y - yinc, y - yinc + minute_font_size); /* To the right */ - print_text (context, font_hour, buf, PANGO_ALIGN_RIGHT, - right - width, hour_minute_xr, - y - yinc, y - yinc + hour_font_size); - print_text (context, font_minute, minute, PANGO_ALIGN_LEFT, - hour_minute_xr, right - 3, - y - yinc, y - yinc + minute_font_size); + print_text ( + context, font_hour, buf, PANGO_ALIGN_RIGHT, + right - width, hour_minute_xr, + y - yinc, y - yinc + hour_font_size); + print_text ( + context, font_minute, minute, PANGO_ALIGN_LEFT, + hour_minute_xr, right - 3, + y - yinc, y - yinc + minute_font_size); /* Draw the horizontal line between hours, across the entire width of the day view. */ @@ -2694,10 +2741,12 @@ print_work_week_day_details (GtkPrintContext *context, /* Get the events from the server. */ e_cal_model_generate_instances_sync (model, start, end, print_day_details_cb, &pdi); - qsort (pdi.long_events->data, pdi.long_events->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); - qsort (pdi.events[0]->data, pdi.events[0]->len, - sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.long_events->data, pdi.long_events->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); + qsort ( + pdi.events[0]->data, pdi.events[0]->len, + sizeof (EDayViewEvent), e_day_view_event_sort_func); pdi.start_hour = MIN (pdi.start_hour, _pdi->start_hour); pdi.end_hour = MAX (pdi.end_hour, _pdi->end_hour); @@ -2726,8 +2775,9 @@ print_work_week_day_details (GtkPrintContext *context, } /* 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); + e_day_view_layout_long_events ( + pdi.long_events, pdi.days_shown, + pdi.day_starts, &rows_in_top_display); /*Print the long events. */ font = get_font_for_size (12, PANGO_WEIGHT_NORMAL); @@ -2736,9 +2786,10 @@ print_work_week_day_details (GtkPrintContext *context, * top display, but we may have more rows than that, in which case * the main display area will be compressed. */ /* Limit long day event to half the height of the panel */ - rows_in_top_display = MIN (MAX (rows_in_top_display, - DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), - (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); + rows_in_top_display = MIN ( + MAX (rows_in_top_display, + DAY_VIEW_MIN_ROWS_IN_TOP_DISPLAY), + (bottom - top) * 0.5 / DAY_VIEW_ROW_HEIGHT); if (rows_in_top_display > pdi.long_events->len) rows_in_top_display = pdi.long_events->len; @@ -2801,24 +2852,26 @@ print_work_week_day_details (GtkPrintContext *context, + LONG_DAY_EVENTS_BOTTOM_SPACING; /* lay out the short events, within the day. */ - e_day_view_layout_day_events (pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), - pdi.mins_per_row, pdi.cols_per_row, -1); + e_day_view_layout_day_events ( + pdi.events[0], CALC_DAY_VIEW_ROWS (pdi.mins_per_row), + pdi.mins_per_row, pdi.cols_per_row, -1); /* use font like with 30 minutes time division */ rows_with_30_mins = (pdi.end_hour - pdi.start_hour) * (60 / 30); /* print the short events. */ - if (top > bottom ) + if (top > bottom) max_font_size = ((top - bottom) / rows_with_30_mins) - 4; else - max_font_size = ((bottom - top ) / rows_with_30_mins) - 4; + max_font_size = ((bottom - top) / rows_with_30_mins) - 4; font_size = MIN (DAY_NORMAL_FONT_SIZE, max_font_size); font = get_font_for_size (font_size, PANGO_WEIGHT_NORMAL); for (i = 0; i < pdi.events[0]->len; i++) { event = &g_array_index (pdi.events[0], EDayViewEvent, i); - print_day_event (context, font, left, - right, top, bottom, event, &pdi, model); + print_day_event ( + context, font, left, + right, top, bottom, event, &pdi, model); } /* Free everything. */ @@ -2893,9 +2946,10 @@ print_work_week_view (GtkPrintContext *context, e_cal_model_generate_instances_sync (model, start, end, print_work_week_view_cb, &pdi); - print_work_week_background (context, gcal, date, &pdi, 0.0, width, - HEADER_HEIGHT + DAY_VIEW_ROW_HEIGHT + LONG_EVENT_OFFSET, - height); + print_work_week_background ( + context, gcal, date, &pdi, 0.0, width, + HEADER_HEIGHT + DAY_VIEW_ROW_HEIGHT + LONG_EVENT_OFFSET, + height); print_border (context, 0.0, width, 0.0, HEADER_HEIGHT, 1.0, 0.9); @@ -2903,31 +2957,35 @@ print_work_week_view (GtkPrintContext *context, l = width - SMALL_MONTH_PAD - (small_month_width + weeknum_inc) * 2 - SMALL_MONTH_SPACING; - print_month_small (context, gcal, start, - l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, start, end, FALSE); + print_month_small ( + context, gcal, start, + l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, start, end, FALSE); l += SMALL_MONTH_SPACING + small_month_width + weeknum_inc; - print_month_small (context, gcal, - time_add_month_with_zone (start, 1, zone), - l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (start, 1, zone), + l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); /* Print the start day of the week, e.g. '7th May 2001'. */ convert_timet_to_struct_tm (start, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 3, width, - 4, 4 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 3, width, + 4, 4 + 24); /* Print the end day of the week, e.g. '13th May 2001'. */ /* We need to substract one or the wrong day will be printed */ convert_timet_to_struct_tm ( time_add_day_with_zone (end, -1, zone), zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - 3, width, - 24 + 3, 24 + 3 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + 3, width, + 24 + 3, 24 + 3 + 24); /* Now print each days' events */ day_width = (width - 2 *DAY_VIEW_TIME_COLUMN_WIDTH) / days; @@ -2939,13 +2997,15 @@ print_work_week_view (GtkPrintContext *context, convert_timet_to_struct_tm (when, zone, &tm); format_date (&tm, DATE_DAYNAME, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_LEFT, - day_x + 4, day_x + day_width, - HEADER_HEIGHT + 4, HEADER_HEIGHT + 4 + 18); + print_text_size_bold ( + context, buf, PANGO_ALIGN_LEFT, + day_x + 4, day_x + day_width, + HEADER_HEIGHT + 4, HEADER_HEIGHT + 4 + 18); - print_work_week_day_details (context, gcal, when, - day_x, day_x + day_width, - HEADER_HEIGHT, height, &pdi); + print_work_week_day_details ( + context, gcal, when, + day_x, day_x + day_width, + HEADER_HEIGHT, height, &pdi); when = time_add_day_with_zone (when, 1, zone); } } @@ -2989,46 +3049,53 @@ print_week_view (GtkPrintContext *context, } /* Print the main week view. */ - print_week_summary (context, gcal, when, FALSE, 1, 0, - WEEK_EVENT_FONT_SIZE, WEEK_SMALL_FONT_SIZE, - 0.0, width, - HEADER_HEIGHT + 20, height); + print_week_summary ( + context, gcal, when, FALSE, 1, 0, + WEEK_EVENT_FONT_SIZE, WEEK_SMALL_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); + print_border ( + context, 0.0, width, HEADER_HEIGHT , + height, 1.0, -1.0); /* Print the border around the header area. */ - print_border (context, 0.0, width, - 0.0, HEADER_HEIGHT + 2.0 + 20, 1.0, 0.9); + print_border ( + context, 0.0, width, + 0.0, HEADER_HEIGHT + 2.0 + 20, 1.0, 0.9); /* Print the 2 mini calendar-months. */ l = width - SMALL_MONTH_PAD - (small_month_width + week_numbers_inc) * 2 - SMALL_MONTH_SPACING; - print_month_small (context, gcal, when, - l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, - DATE_MONTH | DATE_YEAR, when, - time_add_week_with_zone (when, 1, zone), FALSE); + print_month_small ( + context, gcal, when, + l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, + DATE_MONTH | DATE_YEAR, when, + time_add_week_with_zone (when, 1, zone), FALSE); l += SMALL_MONTH_SPACING + small_month_width + week_numbers_inc; - print_month_small (context, gcal, - time_add_month_with_zone (when, 1, zone), - l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, - DATE_MONTH | DATE_YEAR, when, - time_add_week_with_zone (when, 1, zone), FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (when, 1, zone), + l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 10, + DATE_MONTH | DATE_YEAR, when, + time_add_week_with_zone (when, 1, zone), FALSE); /* Print the start day of the week, e.g. '7th May 2001'. */ convert_timet_to_struct_tm (when, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_abs_bold (context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, - 3, width, 4, 4 + 24); + print_text_abs_bold ( + context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, + 3, width, 4, 4 + 24); /* Print the end day of the week, e.g. '13th May 2001'. */ when = time_add_day_with_zone (when, 6, zone); convert_timet_to_struct_tm (when, zone, &tm); format_date (&tm, DATE_DAY | DATE_MONTH | DATE_YEAR, buf, 100); - print_text_abs_bold (context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, - 3, width, 24 + 3, 24 + 3 + 24); + print_text_abs_bold ( + context, buf, WEEK_NORMAL_FONT_SIZE, PANGO_ALIGN_LEFT, + 3, width, 24 + 3, 24 + 3 + 24); } static void @@ -3063,22 +3130,25 @@ print_month_view (GtkPrintContext *context, l = width - SMALL_MONTH_PAD - small_month_width - week_numbers_inc; /* Print the 2 mini calendar-months. */ - print_month_small (context, gcal, - time_add_month_with_zone (date, 1, zone), - l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); - - print_month_small (context, gcal, - time_add_month_with_zone (date, -1, zone), - SMALL_MONTH_PAD, 4, SMALL_MONTH_PAD + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, - DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + print_month_small ( + context, gcal, + time_add_month_with_zone (date, 1, zone), + l, 4, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); + + print_month_small ( + context, gcal, + time_add_month_with_zone (date, -1, zone), + SMALL_MONTH_PAD, 4, SMALL_MONTH_PAD + small_month_width + week_numbers_inc, HEADER_HEIGHT + 4, + DATE_MONTH | DATE_YEAR, 0, 0, FALSE); /* Print the month, e.g. 'May 2001'. */ convert_timet_to_struct_tm (date, zone, &tm); format_date (&tm, DATE_MONTH | DATE_YEAR, buf, 100); - print_text_size_bold (context, buf, PANGO_ALIGN_CENTER, - 3, width - 3, - 3, 3 + 24); + print_text_size_bold ( + context, buf, PANGO_ALIGN_CENTER, + 3, width - 3, + 3, 3 + 24); } @@ -3140,11 +3210,14 @@ get_zone_from_tzid (ECalClient *client, if (!zone && tzid) { GError *error = NULL; - if (!e_cal_client_get_timezone_sync (client, tzid, &zone, NULL, &error)) { - g_warning ("Couldn't get timezone '%s' from server: %s", - tzid ? tzid : "", error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + e_cal_client_get_timezone_sync ( + client, tzid, &zone, NULL, &error); + + if (error != NULL) { + g_warning ( + "Couldn't get timezone '%s' from server: %s", + tzid ? tzid : "", error->message); + g_error_free (error); } } @@ -3172,8 +3245,9 @@ print_date_label (GtkPrintContext *context, start_zone = get_zone_from_tzid (client, datetime.tzid); if (!start_zone || datetime.value->is_date) start_zone = zone; - start = icaltime_as_timet_with_zone (*datetime.value, - start_zone); + start = icaltime_as_timet_with_zone ( + *datetime.value, + start_zone); } e_cal_component_free_datetime (&datetime); @@ -3182,8 +3256,9 @@ print_date_label (GtkPrintContext *context, end_zone = get_zone_from_tzid (client, datetime.tzid); if (!end_zone || datetime.value->is_date) end_zone = zone; - end = icaltime_as_timet_with_zone (*datetime.value, - end_zone); + end = icaltime_as_timet_with_zone ( + *datetime.value, + end_zone); } e_cal_component_free_datetime (&datetime); @@ -3192,16 +3267,16 @@ print_date_label (GtkPrintContext *context, due_zone = get_zone_from_tzid (client, datetime.tzid); if (!due_zone || datetime.value->is_date) due_zone = zone; - due = icaltime_as_timet_with_zone (*datetime.value, - due_zone); + due = icaltime_as_timet_with_zone ( + *datetime.value, due_zone); } e_cal_component_free_datetime (&datetime); e_cal_component_get_completed (comp, &datetime.value); if (datetime.value) { completed_zone = icaltimezone_get_utc_timezone (); - complete = icaltime_as_timet_with_zone (*datetime.value, - completed_zone); + complete = icaltime_as_timet_with_zone ( + *datetime.value, completed_zone); e_cal_component_free_icaltimetype (datetime.value); } @@ -3254,8 +3329,9 @@ print_date_label (GtkPrintContext *context, } } - print_text_size_bold (context, buffer, PANGO_ALIGN_LEFT, - left, right, top, top + 24); + print_text_size_bold ( + context, buffer, PANGO_ALIGN_LEFT, + left, right, top, top + 24); } static void @@ -3403,9 +3479,11 @@ print_comp_draw_real (GtkPrintOperation *operation, header_size = 40; if (page_nr == 0) { - print_border (context, 0.0, width, 0.0, header_size, + print_border ( + context, 0.0, width, 0.0, header_size, 1.0, 0.9); - print_text (context, font, title, PANGO_ALIGN_CENTER, 0.0, width, + print_text ( + context, font, title, PANGO_ALIGN_CENTER, 0.0, width, 0.1, header_size - 0.1); pango_font_description_free (font); } @@ -3416,18 +3494,21 @@ print_comp_draw_real (GtkPrintOperation *operation, 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, -1, 0.0, top, width, - height, FALSE, &page_start, &pages); + top = bound_text ( + context, font, summary_string, -1, 0.0, top, width, + height, FALSE, &page_start, &pages); g_free (summary_string); /* Location */ e_cal_component_get_location (comp, &location); if (location && location[0]) { - location_string = g_strdup_printf (_("Location: %s"), - location); - top = bound_text (context, font, location_string, -1, 0.0, - top + 3, width, height, FALSE, &page_start, &pages); + location_string = g_strdup_printf ( + _("Location: %s"), + location); + top = bound_text ( + context, font, location_string, -1, 0.0, + top + 3, width, height, FALSE, &page_start, &pages); g_free (location_string); } @@ -3485,10 +3566,12 @@ print_comp_draw_real (GtkPrintOperation *operation, } if (status_string) { - gchar *status_text = g_strdup_printf (_("Status: %s"), - status_string); - top = bound_text (context, font, status_text, -1, - 0.0, top, width, height, FALSE, &page_start, &pages); + gchar *status_text = g_strdup_printf ( + _("Status: %s"), + status_string); + top = bound_text ( + context, font, status_text, -1, + 0.0, top, width, height, FALSE, &page_start, &pages); top += get_font_size (font) - 6; g_free (status_text); } @@ -3521,19 +3604,22 @@ print_comp_draw_real (GtkPrintOperation *operation, percent_string = g_strdup_printf (_("Percent Complete: %i"), *percent); e_cal_component_free_percent (percent); - top = bound_text (context, font, percent_string, -1, - 0.0, top, width, height, FALSE, &page_start, &pages); + top = bound_text ( + context, font, percent_string, -1, + 0.0, top, width, height, FALSE, &page_start, &pages); top += get_font_size (font) - 6; } /* URL */ e_cal_component_get_url (comp, &url); if (url && url[0]) { - gchar *url_string = g_strdup_printf (_("URL: %s"), - url); + gchar *url_string; + + url_string = g_strdup_printf (_("URL: %s"), url); - top = bound_text (context, font, url_string, -1, - 0.0, top, width, height, TRUE, &page_start, &pages); + top = bound_text ( + context, font, url_string, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_free (url_string); } @@ -3542,10 +3628,11 @@ print_comp_draw_real (GtkPrintOperation *operation, /* Categories */ e_cal_component_get_categories (comp, &categories); if (categories && categories[0]) { - categories_string = g_strdup_printf (_("Categories: %s"), - categories); - top = bound_text (context, font, categories_string, -1, - 0.0, top, width, height, TRUE, &page_start, &pages); + categories_string = g_strdup_printf ( + _("Categories: %s"), categories); + top = bound_text ( + context, font, categories_string, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_free (categories_string); } @@ -3563,8 +3650,9 @@ print_comp_draw_real (GtkPrintOperation *operation, } e_cal_component_free_text_list (contact_list); - top = bound_text (context, font, contacts->str, -1, - 0.0, top, width, height, TRUE, &page_start, &pages); + top = bound_text ( + context, font, contacts->str, -1, + 0.0, top, width, height, TRUE, &page_start, &pages); top += get_font_size (font) - 6; g_string_free (contacts, TRUE); } diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 7c5f49d472..a37b4b7320 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -130,14 +130,16 @@ colorize_items (WeekdayPicker *wp) else o = outline; - gnome_canvas_item_set (priv->boxes[i], - "fill_color_gdk", f, - "outline_color_gdk", o, - NULL); - - gnome_canvas_item_set (priv->labels[i], - "fill_color_gdk", t, - NULL); + gnome_canvas_item_set ( + priv->boxes[i], + "fill_color_gdk", f, + "outline_color_gdk", o, + NULL); + + gnome_canvas_item_set ( + priv->labels[i], + "fill_color_gdk", t, + NULL); } } @@ -167,20 +169,22 @@ configure_items (WeekdayPicker *wp) if (day >= 7) day -= 7; - gnome_canvas_item_set (priv->boxes[i], - "x1", (double) (i * box_width), - "y1", (double) 0, - "x2", (double) ((i + 1) * box_width), - "y2", (double) (height - 1), - "line_width", 0.0, - NULL); + gnome_canvas_item_set ( + priv->boxes[i], + "x1", (gdouble) (i * box_width), + "y1", (gdouble) 0, + "x2", (gdouble) ((i + 1) * box_width), + "y2", (gdouble) (height - 1), + "line_width", 0.0, + NULL); c = get_day_text (day); - gnome_canvas_item_set (priv->labels[i], - "text", c, - "x", (double) (i * box_width) + PADDING, - "y", (double) (1 + PADDING), - NULL); + gnome_canvas_item_set ( + priv->labels[i], + "text", c, + "x", (gdouble) (i * box_width) + PADDING, + "y", (gdouble) (1 + PADDING), + NULL); g_free (c); } @@ -467,16 +471,18 @@ create_items (WeekdayPicker *wp) parent = gnome_canvas_root (GNOME_CANVAS (wp)); for (i = 0; i < 7; i++) { - priv->boxes[i] = gnome_canvas_item_new (parent, - GNOME_TYPE_CANVAS_RECT, - NULL); + priv->boxes[i] = gnome_canvas_item_new ( + parent, + GNOME_TYPE_CANVAS_RECT, + NULL); g_signal_connect ( priv->boxes[i], "event", G_CALLBACK (day_event_cb), wp); - priv->labels[i] = gnome_canvas_item_new (parent, - GNOME_TYPE_CANVAS_TEXT, - NULL); + priv->labels[i] = gnome_canvas_item_new ( + parent, + GNOME_TYPE_CANVAS_TEXT, + NULL); g_signal_connect ( priv->labels[i], "event", G_CALLBACK (day_event_cb), wp); @@ -523,7 +529,7 @@ weekday_picker_set_days (WeekdayPicker *wp, wp->priv->day_mask = day_mask; colorize_items (wp); - g_signal_emit (G_OBJECT (wp), wp_signals[CHANGED], 0); + g_signal_emit (wp, wp_signals[CHANGED], 0); } /** diff --git a/calendar/importers/icalendar-importer.c b/calendar/importers/icalendar-importer.c index 4f2a345de2..89e5f0ccfc 100644 --- a/calendar/importers/icalendar-importer.c +++ b/calendar/importers/icalendar-importer.c @@ -697,11 +697,13 @@ load_vcalendar_file (const gchar *filename) gchar *contents; gchar *default_alarm_filename; - default_alarm_filename = g_build_filename (EVOLUTION_SOUNDDIR, - "default_alarm.wav", - NULL); - defaults.alarm_audio_url = g_filename_to_uri (default_alarm_filename, - NULL, NULL); + default_alarm_filename = g_build_filename ( + EVOLUTION_SOUNDDIR, + "default_alarm.wav", + NULL); + defaults.alarm_audio_url = g_filename_to_uri ( + default_alarm_filename, + NULL, NULL); g_free (default_alarm_filename); defaults.alarm_audio_fmttype = (gchar *) "audio/x-wav"; defaults.alarm_description = (gchar *) _("Reminder!"); @@ -714,8 +716,8 @@ load_vcalendar_file (const gchar *filename) g_free (contents); if (vcal) { - icalcomp = icalvcal_convert_with_defaults (vcal, - &defaults); + icalcomp = icalvcal_convert_with_defaults ( + vcal, &defaults); cleanVObject (vcal); } } @@ -1501,10 +1503,11 @@ ical_get_preview (icalcomponent *icalcomp) formatted_dt = format_dt (&dt, timezones, users_zone); gtk_list_store_append (store, &iter); - gtk_list_store_set (store, &iter, + gtk_list_store_set ( + store, &iter, 0, kind == ICAL_VEVENT_COMPONENT ? (e_cal_component_has_attendees (comp) ? C_("iCalImp", "Meeting") : C_("iCalImp", "Event")) : - kind == ICAL_VTODO_COMPONENT ? C_("iCalImp", "Task") : - kind == ICAL_VJOURNAL_COMPONENT ? C_("iCalImp", "Memo") : "??? Other ???", + kind == ICAL_VTODO_COMPONENT ? C_("iCalImp", "Task") : + kind == ICAL_VJOURNAL_COMPONENT ? C_("iCalImp", "Memo") : "??? Other ???", 1, formatted_dt ? formatted_dt : "", 2, summary.value && *summary.value ? summary.value : summary.altrep && *summary.altrep ? summary.altrep : "", 3, comp, @@ -1535,15 +1538,18 @@ ical_get_preview (icalcomponent *icalcomp) g_object_unref (store); /* Translators: Column header for a component type; it can be Event, Task or Memo */ - gtk_tree_view_insert_column_with_attributes (tree_view, -1, C_("iCalImp", "Type"), + gtk_tree_view_insert_column_with_attributes ( + tree_view, -1, C_("iCalImp", "Type"), gtk_cell_renderer_text_new (), "text", 0, NULL); /* Translators: Column header for a component start date/time */ - gtk_tree_view_insert_column_with_attributes (tree_view, -1, C_("iCalImp", "Start"), + gtk_tree_view_insert_column_with_attributes ( + tree_view, -1, C_("iCalImp", "Start"), gtk_cell_renderer_text_new (), "text", 1, NULL); /* Translators: Column header for a component summary */ - gtk_tree_view_insert_column_with_attributes (tree_view, -1, C_("iCalImp", "Summary"), + gtk_tree_view_insert_column_with_attributes ( + tree_view, -1, C_("iCalImp", "Summary"), gtk_cell_renderer_text_new (), "text", 2, NULL); if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL (store), NULL) > 1) |