evolution r35393 - in trunk: mail widgets/misc



Author: sragavan
Date: Mon Apr 21 05:11:07 2008
New Revision: 35393
URL: http://svn.gnome.org/viewvc/evolution?rev=35393&view=rev

Log:
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):
	* 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:





Modified:
   trunk/mail/ChangeLog
   trunk/mail/em-format-html-display.c
   trunk/mail/em-format-html.c
   trunk/widgets/misc/ChangeLog
   trunk/widgets/misc/e-attachment-bar.c
   trunk/widgets/misc/e-attachment-bar.h

Modified: trunk/mail/em-format-html-display.c
==============================================================================
--- trunk/mail/em-format-html-display.c	(original)
+++ trunk/mail/em-format-html-display.c	Mon Apr 21 05:11:07 2008
@@ -147,6 +147,7 @@
 	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_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 @@
 
 	{ "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 @@
 		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);
 	}
 
@@ -2160,6 +2164,16 @@
 }
 
 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;
@@ -2231,6 +2245,21 @@
 
 	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)
@@ -2242,6 +2271,7 @@
 		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);

Modified: trunk/mail/em-format-html.c
==============================================================================
--- trunk/mail/em-format-html.c	(original)
+++ trunk/mail/em-format-html.c	Mon Apr 21 05:11:07 2008
@@ -1262,6 +1262,10 @@
 		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);

Modified: trunk/widgets/misc/e-attachment-bar.c
==============================================================================
--- trunk/widgets/misc/e-attachment-bar.c	(original)
+++ trunk/widgets/misc/e-attachment-bar.c	Mon Apr 21 05:11:07 2008
@@ -1207,6 +1207,27 @@
 	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)
 {

Modified: trunk/widgets/misc/e-attachment-bar.h
==============================================================================
--- trunk/widgets/misc/e-attachment-bar.h	(original)
+++ trunk/widgets/misc/e-attachment-bar.h	Mon Apr 21 05:11:07 2008
@@ -94,6 +94,10 @@
 e_attachment_bar_recent_action_new (EAttachmentBar *bar, 
 				const gchar *action_name,
 				const gchar *action_label);
+void 
+e_attachment_bar_add_attachment_silent (EAttachmentBar *bar, EAttachment *attachment);
+void 
+e_attachment_bar_refresh (EAttachmentBar *bar);
 
 #ifdef __cplusplus
 }



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]