From d48f96dd9f5cb5e8837b5c42b416cfbdb5eecfb1 Mon Sep 17 00:00:00 2001 From: Srinivasa Ragavan Date: Mon, 21 Apr 2008 05:11:07 +0000 Subject: ** Fix for bug #334444 2008-04-20 Srinivasa Ragavan ** Fix for bug #334444 * em-format-html-display.c: (efhd_attachment_button), (efhd_update_bar), (efhd_message_update_bar), (efhd_message_add_bar): * em-format-html.c: (efh_format_exec): 2008-04-20 Srinivasa Ragavan ** Fix for bug #334444 * e-attachment-bar.c: (e_attachment_bar_add_attachment_silent), (e_attachment_bar_refresh): * e-attachment-bar.h: svn path=/trunk/; revision=35393 --- mail/ChangeLog | 9 +++++++++ mail/em-format-html-display.c | 32 +++++++++++++++++++++++++++++++- mail/em-format-html.c | 4 ++++ 3 files changed, 44 insertions(+), 1 deletion(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index 027e2b1fb8..aa09e8976c 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,12 @@ +2008-04-20 Srinivasa Ragavan + + ** Fix for bug #334444 + + * em-format-html-display.c: (efhd_attachment_button), + (efhd_update_bar), (efhd_message_update_bar), + (efhd_message_add_bar): + * em-format-html.c: (efh_format_exec): + 2008-04-17 Milan Crha ** Part of fix for bug #526739 diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c index be0bfa3c87..a81e6c13e6 100644 --- a/mail/em-format-html-display.c +++ b/mail/em-format-html-display.c @@ -147,6 +147,7 @@ struct _EMFormatHTMLDisplayPrivate { GtkWidget *attachment_area; gboolean show_bar; GHashTable *files; + gboolean updated; }; static int efhd_html_button_press_event (GtkWidget *widget, GdkEventButton *event, EMFormatHTMLDisplay *efh); @@ -156,6 +157,7 @@ static void efhd_html_on_url (GtkHTML *html, const char *url, EMFormatHTMLDispla static void efhd_attachment_frame(EMFormat *emf, CamelStream *stream, EMFormatPURI *puri); static gboolean efhd_attachment_image(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject); static void efhd_message_add_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info); +static void efhd_message_update_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info); static void efhd_attachment_bar_refresh (EMFormatHTMLDisplay *efhd); struct _attach_puri { @@ -1309,6 +1311,8 @@ static EMFormatHandler type_builtin_table[] = { { "x-evolution/message/prefix", (EMFormatFunc)efhd_message_prefix }, { "x-evolution/message/post-header", (EMFormatFunc)efhd_message_add_bar }, + { "x-evolution/message/post-header-closure", (EMFormatFunc)efhd_message_update_bar }, + }; static void @@ -1833,7 +1837,7 @@ efhd_attachment_button(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObje new->encrypt = info->encrypt; /* Add the attachment to the bar.*/ - e_attachment_bar_add_attachment(E_ATTACHMENT_BAR(efhd->priv->attachment_bar), new); + e_attachment_bar_add_attachment_silent (E_ATTACHMENT_BAR(efhd->priv->attachment_bar), new); efhd_attachment_bar_refresh(efhd); } @@ -2159,6 +2163,16 @@ efhd_mnemonic_show_bar (GtkWidget *widget, gboolean focus, GtkWidget *efhd) return TRUE; } +static gboolean +efhd_update_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) +{ + EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)efh; + struct _EMFormatHTMLDisplayPrivate *priv = efhd->priv; + + e_attachment_bar_refresh (priv->attachment_bar); + + return TRUE; +} static gboolean efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) { @@ -2231,6 +2245,21 @@ efhd_add_bar(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobjec return TRUE; } +static void +efhd_message_update_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) +{ + EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *) emf; + const char *classid = "attachment-bar-refresh"; + + if (efhd->nobar || efhd->priv->updated ) + return; + + efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + efhd->priv->updated = TRUE; + em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(EMFormatHTMLPObject), classid, part, efhd_update_bar); + camel_stream_printf(stream, "", classid); + +} static void efhd_message_add_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) @@ -2242,6 +2271,7 @@ efhd_message_add_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, co return; efhd->priv->files = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + efhd->priv->updated = FALSE; em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(EMFormatHTMLPObject), classid, part, efhd_add_bar); camel_stream_printf(stream, "", classid); diff --git a/mail/em-format-html.c b/mail/em-format-html.c index 96cf0ca27a..b4e8308cf7 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1262,6 +1262,10 @@ efh_format_exec (struct _format_msg *m) handle = em_format_find_handler((EMFormat *)m->format, "x-evolution/message/rfc822"); if (handle) handle->handler((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message, handle); + handle = em_format_find_handler((EMFormat *)m->format, "x-evolution/message/post-header-closure"); + if (handle) + handle->handler((EMFormat *)m->format, (CamelStream *)m->estream, (CamelMimePart *)m->message, handle); + } camel_stream_flush((CamelStream *)m->estream); -- cgit v1.2.3