From a269411bacc7a7ce549db591204a868a7a8b2184 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dan=20Vr=C3=A1til?= Date: Wed, 28 Mar 2012 18:39:13 +0200 Subject: WebKit port - port addressbook, calendar and update composer to keep working with GtkHtml --- calendar/gui/Makefile.am | 1 + calendar/gui/e-cal-component-preview.c | 91 ++++++++++++++-------------------- 2 files changed, 39 insertions(+), 53 deletions(-) (limited to 'calendar/gui') diff --git a/calendar/gui/Makefile.am b/calendar/gui/Makefile.am index f280d3abdf..75991807df 100644 --- a/calendar/gui/Makefile.am +++ b/calendar/gui/Makefile.am @@ -66,6 +66,7 @@ libevolution_calendar_la_CPPFLAGS = \ -DEVOLUTION_GALVIEWSDIR=\""$(viewsdir)"\" \ -DEVOLUTION_LOCALEDIR=\""$(localedir)"\" \ -DEVOLUTION_UIDIR=\""$(uidir)"\" \ + -DEVOLUTION_PRIVDATADIR=\""${privdatadir}"\" \ -DPREFIX=\""$(prefix)"\" \ $(EVOLUTION_DATA_SERVER_CFLAGS) \ $(GNOME_PLATFORM_CFLAGS) \ diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index ce8cdeee2d..c96a9e0790 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -56,6 +56,14 @@ struct _ECalComponentPreviewPrivate { gint comp_sequence; }; +#define HTML_HEADER "\n\n" \ + "\n\n" \ + "\n" \ + "\n" \ + "" + static void clear_comp_info (ECalComponentPreview *preview) { @@ -191,20 +199,21 @@ cal_component_preview_write_html (GString *buffer, /* write document header */ e_cal_component_get_summary (comp, &text); + g_string_append (buffer, HTML_HEADER); + g_string_append (buffer, ""); + if (text.value) - g_string_append_printf ( - buffer, "

%s

", - text.value); + g_string_append_printf (buffer, "

%s

", text.value); else - g_string_append_printf ( - buffer, "

%s

", - _("Untitled")); + g_string_append_printf (buffer, "

%s

",_("Untitled")); + + g_string_append (buffer, ""); /* write icons for the categories */ string = g_string_new (NULL); e_cal_component_get_categories_list (comp, &list); if (list != NULL) - g_string_append_printf (buffer, "

%s ", _("Categories:")); + g_string_append_printf (buffer, "

"); e_cal_component_free_categories_list (list); g_string_free (string, TRUE); - /* Start table */ - g_string_append ( - buffer, "
%s", _("Categories:")); for (iter = list; iter != NULL; iter = iter->next) { const gchar *category = iter->data; const gchar *icon_file; @@ -215,7 +224,7 @@ cal_component_preview_write_html (GString *buffer, uri = g_filename_to_uri (icon_file, NULL, NULL); g_string_append_printf ( - buffer, "\"%s\"", + buffer, "\"%s\"", category, uri); g_free (uri); } else { @@ -227,22 +236,14 @@ cal_component_preview_write_html (GString *buffer, if (string->len > 0) g_string_append_printf (buffer, "%s", string->str); if (list != NULL) - g_string_append (buffer, ""); + g_string_append (buffer, "
" - ""); - /* write location */ e_cal_component_get_location (comp, &location); if (location) - g_string_append_printf ( - buffer, "", + g_string_append_printf (buffer, "", _("Summary:"), text.value); /* write start date */ @@ -250,11 +251,8 @@ cal_component_preview_write_html (GString *buffer, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf ( - buffer, "", + g_string_append_printf (buffer, "", _("Start Date:"), str); - g_free (str); } e_cal_component_free_datetime (&dt); @@ -264,11 +262,8 @@ cal_component_preview_write_html (GString *buffer, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf ( - buffer, "", - _("Start Date:"), str); - + g_string_append_printf (buffer,"", + _("End Date:"), str); g_free (str); } e_cal_component_free_datetime (&dt); @@ -278,11 +273,8 @@ cal_component_preview_write_html (GString *buffer, if (dt.value != NULL) { str = timet_to_str_with_zone ( &dt, client, default_zone, use_24_hour_format); - g_string_append_printf ( - buffer, "", + g_string_append_printf (buffer, "", _("Due Date:"), str); - g_free (str); } e_cal_component_free_datetime (&dt); @@ -292,9 +284,8 @@ cal_component_preview_write_html (GString *buffer, icalprop = icalcomponent_get_first_property ( icalcomp, ICAL_STATUS_PROPERTY); if (icalprop != NULL) { - g_string_append_printf ( - buffer, "", _("Status:")); + g_string_append_printf (buffer, "", + _("Status:")); e_cal_component_get_status (comp, &status); switch (status) { case ICAL_STATUS_INPROCESS : @@ -312,16 +303,15 @@ cal_component_preview_write_html (GString *buffer, break; } - g_string_append_printf (buffer, "", str); + g_string_append_printf (buffer, "", str); g_free (str); } /* write priority */ e_cal_component_get_priority (comp, &priority_value); if (priority_value && *priority_value != 0) { - g_string_append_printf ( - buffer, "", _("Priority:")); + g_string_append_printf (buffer, "", + _("Priority:")); if (*priority_value <= 4) str = g_strdup (_("High")); else if (*priority_value == 5) @@ -329,7 +319,7 @@ cal_component_preview_write_html (GString *buffer, else str = g_strdup (_("Low")); - g_string_append_printf (buffer, "", str); + g_string_append_printf (buffer, "", str); g_free (str); } @@ -338,17 +328,16 @@ cal_component_preview_write_html (GString *buffer, e_cal_component_free_priority (priority_value); /* write description and URL */ - g_string_append (buffer, ""); + g_string_append (buffer, ""); e_cal_component_get_description_list (comp, &list); if (list) { GSList *node; - g_string_append_printf ( - buffer, "", _("Description:")); + g_string_append_printf (buffer, "", + _("Description:")); - g_string_append (buffer, ""); + g_string_append (buffer, ""); e_cal_component_free_text_list (list); } @@ -375,18 +364,14 @@ cal_component_preview_write_html (GString *buffer, /* URL */ e_cal_component_get_url (comp, (const gchar **) &str); if (str) { - g_string_append_printf ( - buffer, "", _("Web Page:")); - g_string_append_printf ( - buffer, "", - str, str); + g_string_append_printf (buffer, "", + _("Web Page:"), str, str); } - g_string_append (buffer, "
" - "
%s%s
%s%s
" - "%s%s
%s%s
" - "%s%s
%s%s
" - "%s%s
%s%s
" - "%s
%s%s
%s
" - "%s
%s%s
%s


" - "%s
%s"); + g_string_append (buffer, ""); for (node = list; node != NULL; node = node->next) { gchar *html; @@ -367,7 +356,7 @@ cal_component_preview_write_html (GString *buffer, g_free (html); } - g_string_append (buffer, "
" - "%s%s
%s%s
"); + g_string_append (buffer, ""); /* close document */ - g_string_append (buffer, ""); + g_string_append (buffer, ""); } static void -- cgit v1.2.3