aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSrinivasa Ragavan <sragavan@novell.com>2008-04-21 13:06:46 +0800
committerSrinivasa Ragavan <sragavan@src.gnome.org>2008-04-21 13:06:46 +0800
commitb30d69cd55f6d68c6bfdefb1b951d818f06750fa (patch)
treeb3982a117ddb7e1a184e7114124776d09df21a6d
parent8c2243649d8f2664325406e860f9ac22dfec647d (diff)
downloadgsoc2013-evolution-b30d69cd55f6d68c6bfdefb1b951d818f06750fa.tar.gz
gsoc2013-evolution-b30d69cd55f6d68c6bfdefb1b951d818f06750fa.tar.zst
gsoc2013-evolution-b30d69cd55f6d68c6bfdefb1b951d818f06750fa.zip
** Fix for bug #334444
2008-04-20 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bug #334444 * em-format-html-display.c: (efhd_attachment_button), (efhd_update_bar), (efhd_message_update_bar), (efhd_message_add_bar): Add the attachments and draw the bar. * em-format-html.c: (efh_format_exec): 2008-04-20 Srinivasa Ragavan <sragavan@novell.com> ** Fix for bug #334444 * e-attachment-bar.c: (e_attachment_bar_add_attachment_silent), (e_attachment_bar_refresh): * e-attachment-bar.h: svn path=/branches/gnome-2-22/; revision=35391
-rw-r--r--mail/ChangeLog9
-rw-r--r--mail/em-format-html-display.c32
-rw-r--r--mail/em-format-html.c4
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-attachment-bar.c21
-rw-r--r--widgets/misc/e-attachment-bar.h2
6 files changed, 75 insertions, 1 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index c88c152999..d32f80849a 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,12 @@
+2008-04-20 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #334444
+
+ * em-format-html-display.c: (efhd_attachment_button),
+ (efhd_update_bar), (efhd_message_update_bar),
+ (efhd_message_add_bar): Add the attachments and draw the bar.
+ * em-format-html.c: (efh_format_exec):
+
2008-03-27 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #523271
diff --git a/mail/em-format-html-display.c b/mail/em-format-html-display.c
index fa0c4fe620..9827880d89 100644
--- a/mail/em-format-html-display.c
+++ b/mail/em-format-html-display.c
@@ -148,6 +148,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);
@@ -157,6 +158,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 {
@@ -1327,6 +1329,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
@@ -1879,7 +1883,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);
}
@@ -2352,6 +2356,16 @@ efhd_mnemonic_show_bar (GtkWidget *widget, gboolean focus, GtkWidget *efhd)
}
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)
{
EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)efh;
@@ -2423,6 +2437,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, "<td><object classid=\"%s\"></object></td>", classid);
+
+}
static void
efhd_message_add_bar(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info)
@@ -2434,6 +2463,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, "<td><object classid=\"%s\"></object></td>", classid);
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index a1faece46a..cad78362de 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -1258,6 +1258,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);
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index ef7e6526c8..da741d086a 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,11 @@
+2008-04-20 Srinivasa Ragavan <sragavan@novell.com>
+
+ ** Fix for bug #334444
+
+ * e-attachment-bar.c: (e_attachment_bar_add_attachment_silent),
+ (e_attachment_bar_refresh):
+ * e-attachment-bar.h:
+
2008-03-13 Milan Crha <mcrha@redhat.com>
** Fix for bug #460204
diff --git a/widgets/misc/e-attachment-bar.c b/widgets/misc/e-attachment-bar.c
index 33bff284f7..801c27e4a2 100644
--- a/widgets/misc/e-attachment-bar.c
+++ b/widgets/misc/e-attachment-bar.c
@@ -1177,6 +1177,27 @@ e_attachment_bar_add_attachment (EAttachmentBar *bar, EAttachment *attachment)
add_common (bar, attachment);
}
+void
+e_attachment_bar_add_attachment_silent (EAttachmentBar *bar, EAttachment *attachment)
+{
+ g_return_if_fail (E_IS_ATTACHMENT_BAR (bar));
+ g_return_if_fail (attachment != NULL);
+
+ g_ptr_array_add (bar->priv->attachments, attachment);
+ g_object_weak_ref ((GObject *) attachment, (GWeakNotify) attachment_destroy, bar);
+ g_signal_connect (attachment, "changed", G_CALLBACK (attachment_changed_cb), bar);
+
+
+ g_signal_emit (bar, signals[CHANGED], 0);
+}
+
+void
+e_attachment_bar_refresh (EAttachmentBar *bar)
+{
+ update (bar);
+
+}
+
int
e_attachment_bar_get_download_count (EAttachmentBar *bar)
{
diff --git a/widgets/misc/e-attachment-bar.h b/widgets/misc/e-attachment-bar.h
index 84b1331b3b..6884e9131f 100644
--- a/widgets/misc/e-attachment-bar.h
+++ b/widgets/misc/e-attachment-bar.h
@@ -83,6 +83,8 @@ GSList *e_attachment_bar_get_selected (EAttachmentBar *bar);
void e_attachment_bar_set_width(EAttachmentBar *bar, int bar_width);
GSList * e_attachment_bar_get_all_attachments (EAttachmentBar *bar);
void e_attachment_bar_create_attachment_cache (EAttachment *attachment);
+void e_attachment_bar_add_attachment_silent (EAttachmentBar *bar, EAttachment *attachment);
+void e_attachment_bar_refresh (EAttachmentBar *bar);
#ifdef __cplusplus
}