From 0fa1b87e9ee6b947b2706a44fc7429730655b3f9 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Tue, 21 Nov 2000 22:09:51 +0000 Subject: New function to return if user wants to view message source. 2000-11-21 Jeffrey Stedfast * mail-config.c (mail_config_view_source): New function to return if user wants to view message source. (mail_config_set_view_source): New function to set whether the view wants to view source. * mail-ops.c (mail_do_view_message_sources): Removed. We're not gonna view-source this way anymore. * folder-browser-factory.c: Removed the ViewSource bonobo verb from the Message menu. (control_activate): Added ViewSource. * folder-browser.c (on_right_click): Removed Message menu item to view message source. (folder_browser_toggle_view_source): New callback to set whether or not the MailDisplay shows the raw message or the pretty-ified message. * mail-callbacks.c: Removed view_source. * mail-display.c (redisplay): If toggle_raw is set then display the raw message else display the pretty formatted message. (mail_display_redisplay): New function to force the redisplay of a message. * mail-format.c (mail_format_raw_message): New function to write the raw message data. svn path=/trunk/; revision=6639 --- mail/mail-display.c | 27 +++++++++++++++++++++------ 1 file changed, 21 insertions(+), 6 deletions(-) (limited to 'mail/mail-display.c') diff --git a/mail/mail-display.c b/mail/mail-display.c index 6c72d35016..2934500f63 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -732,16 +732,19 @@ redisplay (MailDisplay *md, gboolean unscroll) adj = e_scroll_frame_get_vadjustment (md->scroll); oldv = adj->value; } - + md->stream = gtk_html_begin (md->html); mail_html_write (md->html, md->stream, "%s%s", HTML_HEADER, "\n"); - + if (md->current_message) { camel_object_ref (CAMEL_OBJECT (md->current_message)); - mail_format_mime_message (md->current_message, md); + if (mail_config_view_source ()) + mail_format_raw_message (md->current_message, md); + else + mail_format_mime_message (md->current_message, md); } - + mail_html_write (md->html, md->stream, "\n"); gtk_html_end (md->html, md->stream, GTK_HTML_STREAM_OK); md->stream = NULL; @@ -759,6 +762,20 @@ redisplay (MailDisplay *md, gboolean unscroll) } } + +/** + * mail_display_redisplay: + * @mail_display: the mail display object + * @unscroll: specifies whether or not to lose current scroll + * + * Force a redraw of the message display. + **/ +void +mail_display_redisplay (MailDisplay *mail_display, gboolean unscroll) +{ + redisplay (mail_display, unscroll); +} + /** * mail_display_set_message: * @mail_display: the mail display object @@ -861,6 +878,4 @@ mail_display_new (void) return GTK_WIDGET (mail_display); } - - E_MAKE_TYPE (mail_display, "MailDisplay", MailDisplay, mail_display_class_init, mail_display_init, PARENT_TYPE); -- cgit