From 6642d01f14a95b02f2f5bd96d59bc7d1dc9bf835 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Tue, 11 Dec 2001 18:03:44 +0000 Subject: Add ETable magic for our new "Needs Reply" column. (The next few entries 2001-12-11 Jon Trowbridge * message-list.etspec: Add ETable magic for our new "Needs Reply" column. (The next few entries are for bug #90) * message-list.h: Add COL_NEED_REPLY. * message-list.c: Move mail_need_reply_xpm to the end of states_pixmaps. (ml_duplicate_value): Handle COL_NEED_REPLY. (ml_free_value): Handle COL_NEED_REPLY. (ml_initialize_value): Handle COL_NEED_REPLY. (ml_value_is_empty): Handle COL_NEED_REPLY. Added needs_reply_map[] array. (ml_value_to_string): Handle COL_NEED_REPLY. (ml_tree_value_at): Fix magic numbers, undoing my changes from the otehr day. Add handler for COL_NEED_REPLY. (message_list_create_extras): Attach icons for COL_NEED_REPLY. (on_click): Undo my previous changes to display need-reply status in COL_MESSAGE_STATUS. Add handing for COL_NEED_REPLY. * mail.h: Change mail_format_mime_message, mail_format_raw_message and the MailMimeHandlerFn typedef to take GtkHTML and GtkHTMLStream args, as per our changes in mail-format.c. * mail-format.c: Giant refactoring. Remove the assumption throughout that we will always want to render into the GtkHTML object contained in the MailDisplay. Instead, always pass in the GtkHTML and GtkHTMLStream that we want to write to. Also, ignore theme work-arounds if the printing flag is set. (This and what follows fixes bug #82) * mail-display.h: Remove GtkHTMLStream *stream from MailDisplay. We don't need it anymore. * mail-display.c (mail_display_render): Added. Breaks the code that renders the message into the GtkHTML object out of mail_display_redisplay. (mail_display_redisplay): Call mail_display_render. (mail_display_init): Remove reference to ->stream. (mail_display_new): Remove reference to ->stream. * mail-callbacks.c (do_mail_print): Create a new GtkHTML to render our printed version into (via the new function mail_display_render. Set the MailDisplay's printing flag to TRUE before we render, and set it back to FALSE afterwards. (do_mail_fetch_and_print): If the preview pane isn't open when we try to print, fetch the message before printing. (print_msg): Call do_mail_fetch_and_print. (print_preview_msg): Call do_mail_fetch_and_print. * folder-browser-ui.c: Remove "PrintMessage" and "PrintPreviewMessage" from message_pane_enables... these now work when the preview pane is closed. Disable printing if multiple messages are selected. svn path=/trunk/; revision=14981 --- mail/mail-display.c | 48 +++++++++++++++++++++++++++++++----------------- 1 file changed, 31 insertions(+), 17 deletions(-) (limited to 'mail/mail-display.c') diff --git a/mail/mail-display.c b/mail/mail-display.c index 4746c348aa..437f4bb11e 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1346,6 +1346,33 @@ clear_data (CamelObject *object, gpointer event_data, gpointer user_data) g_datalist_clear (&data); } +void +mail_display_render (MailDisplay *md, GtkHTML *html) +{ + GtkHTMLStream *stream; + + g_return_if_fail (IS_MAIL_DISPLAY (md)); + g_return_if_fail (GTK_IS_HTML (html)); + + stream = gtk_html_begin (html); + + mail_html_write (html, stream, + "\n" + "\n" + "\n\n\n"); + mail_html_write (html, stream, "\n"); + + if (md->current_message) { + if (md->display_style == MAIL_CONFIG_DISPLAY_SOURCE) + mail_format_raw_message (md->current_message, md, html, stream); + else + mail_format_mime_message (md->current_message, md, html, stream); + } + + mail_html_write (html, stream, "\n"); + gtk_html_end (html, stream, GTK_HTML_STREAM_OK); +} + /** * mail_display_redisplay: * @mail_display: the mail display object @@ -1363,25 +1390,12 @@ mail_display_redisplay (MailDisplay *md, gboolean unscroll) md->redisplay_counter++; /* printf ("md %p redisplay %d\n", md, md->redisplay_counter); */ - md->stream = gtk_html_begin (GTK_HTML (md->html)); if (!unscroll) { /* This is a hack until there's a clean way to do this. */ GTK_HTML (md->html)->engine->newPage = FALSE; } - - mail_html_write (md->html, md->stream, "\n\n\n\n\n"); - mail_html_write (md->html, md->stream, "\n"); - - if (md->current_message) { - if (md->display_style == MAIL_CONFIG_DISPLAY_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; + + mail_display_render (md, md->html); } @@ -1459,7 +1473,6 @@ mail_display_init (GtkObject *object) mail_display->scroll = NULL; mail_display->html = NULL; mail_display->redisplay_counter = 0; - mail_display->stream = NULL; mail_display->last_active = NULL; mail_display->idle_id = 0; mail_display->selection = NULL; @@ -1469,6 +1482,8 @@ mail_display_init (GtkObject *object) mail_display->invisible = gtk_invisible_new (); mail_display->display_style = mail_config_get_message_display_style (); + + mail_display->printing = FALSE; } static void @@ -2100,7 +2115,6 @@ mail_display_new (void) mail_display->scroll = E_SCROLL_FRAME (scroll); mail_display->html = GTK_HTML (html); - mail_display->stream = NULL; mail_display->last_active = NULL; mail_display->data = g_new0 (GData *, 1); g_datalist_init (mail_display->data); -- cgit v1.2.3