From d6f174ad5110ce2b86f5a4eb45d658b13735b26d Mon Sep 17 00:00:00 2001 From: Dan Winship Date: Thu, 7 Mar 2002 18:34:14 +0000 Subject: Update for storage changes: explicitly create a root folder. * component-factory.c (add_storage): Update for storage changes: explicitly create a root folder. * mail-display.c (mail_display_render): Fix the "don't scroll back to the top of the HTML widget when opening an attachment" hack again by moving it here from mail_display_redisplay(). (It has to happen after the gtk_html_begin.) (mail_display_redisplay): Pass reset_scroll arg to mail_display_render. * mail-callbacks.c (do_mail_print): Pass reset_scroll (TRUE) to mail_display_render. svn path=/trunk/; revision=15967 --- mail/ChangeLog | 17 +++++++++++++++++ mail/component-factory.c | 3 ++- mail/mail-callbacks.c | 2 +- mail/mail-display.c | 19 +++++++++---------- mail/mail-display.h | 4 ++-- 5 files changed, 31 insertions(+), 14 deletions(-) (limited to 'mail') diff --git a/mail/ChangeLog b/mail/ChangeLog index d97ba77710..576ff81b2e 100644 --- a/mail/ChangeLog +++ b/mail/ChangeLog @@ -1,3 +1,20 @@ +2002-03-07 Dan Winship + + * component-factory.c (add_storage): Update for storage changes: + explicitly create a root folder. + +2002-03-06 Dan Winship + + * mail-display.c (mail_display_render): Fix the "don't scroll back + to the top of the HTML widget when opening an attachment" hack + again by moving it here from mail_display_redisplay(). (It has to + happen after the gtk_html_begin.) + (mail_display_redisplay): Pass reset_scroll arg to + mail_display_render. + + * mail-callbacks.c (do_mail_print): Pass reset_scroll (TRUE) to + mail_display_render. + 2002-03-05 Dan Winship * folder-browser-ui.c: Don't try to set pixmap for diff --git a/mail/component-factory.c b/mail/component-factory.c index aa664ded39..4f5c886e3d 100644 --- a/mail/component-factory.c +++ b/mail/component-factory.c @@ -1209,7 +1209,8 @@ add_storage (const char *name, const char *uri, CamelService *store, EvolutionStorage *storage; EvolutionStorageResult res; - storage = evolution_storage_new (name, uri, "mailstorage"); + storage = evolution_storage_new (name); + evolution_storage_new_folder (storage, "/", name, "mailstorage", uri, "", 0); gtk_signal_connect (GTK_OBJECT (storage), "create_folder", storage_create_folder, store); gtk_signal_connect (GTK_OBJECT (storage), "remove_folder", storage_remove_folder, store); gtk_signal_connect ((GtkObject *)storage, "xfer_folder", storage_xfer_folder, store); diff --git a/mail/mail-callbacks.c b/mail/mail-callbacks.c index 4ffc4e4c78..5cec76bafb 100644 --- a/mail/mail-callbacks.c +++ b/mail/mail-callbacks.c @@ -2871,7 +2871,7 @@ do_mail_print (FolderBrowser *fb, gboolean preview) user's theme. */ fb->mail_display->printing = TRUE; - mail_display_render (fb->mail_display, html); + mail_display_render (fb->mail_display, html, TRUE); gtk_html_print_set_master (html, print_master); info = footer_info_new (html, print_context, &line); diff --git a/mail/mail-display.c b/mail/mail-display.c index 69656c5d0f..3b82856107 100644 --- a/mail/mail-display.c +++ b/mail/mail-display.c @@ -1450,7 +1450,7 @@ clear_data (CamelObject *object, gpointer event_data, gpointer user_data) } void -mail_display_render (MailDisplay *md, GtkHTML *html) +mail_display_render (MailDisplay *md, GtkHTML *html, gboolean reset_scroll) { GtkHTMLStream *stream; @@ -1458,7 +1458,11 @@ mail_display_render (MailDisplay *md, GtkHTML *html) g_return_if_fail (GTK_IS_HTML (html)); stream = gtk_html_begin (html); - + if (!reset_scroll) { + /* This is a hack until there's a clean way to do this. */ + GTK_HTML (md->html)->engine->newPage = FALSE; + } + mail_html_write (html, stream, "\n" "\n" @@ -1479,12 +1483,12 @@ mail_display_render (MailDisplay *md, GtkHTML *html) /** * mail_display_redisplay: * @mail_display: the mail display object - * @unscroll: specifies whether or not to lose current scroll + * @reset_scroll: specifies whether or not to reset current scroll * * Force a redraw of the message display. **/ void -mail_display_redisplay (MailDisplay *md, gboolean unscroll) +mail_display_redisplay (MailDisplay *md, gboolean reset_scroll) { if (GTK_OBJECT_DESTROYED (md)) return; @@ -1493,12 +1497,7 @@ mail_display_redisplay (MailDisplay *md, gboolean unscroll) md->redisplay_counter++; /* printf ("md %p redisplay %d\n", md, md->redisplay_counter); */ - if (!unscroll) { - /* This is a hack until there's a clean way to do this. */ - GTK_HTML (md->html)->engine->newPage = FALSE; - } - - mail_display_render (md, md->html); + mail_display_render (md, md->html, reset_scroll); } diff --git a/mail/mail-display.h b/mail/mail-display.h index afdfe8b59b..aa1960fc8d 100644 --- a/mail/mail-display.h +++ b/mail/mail-display.h @@ -60,8 +60,8 @@ GtkWidget * mail_display_new (void); void mail_display_initialize_gtkhtml (MailDisplay *mail_display, GtkHTML *html); void mail_display_queue_redisplay (MailDisplay *mail_display); -void mail_display_render (MailDisplay *mail_display, GtkHTML *html); -void mail_display_redisplay (MailDisplay *mail_display, gboolean unscroll); +void mail_display_render (MailDisplay *mail_display, GtkHTML *html, gboolean reset_scroll); +void mail_display_redisplay (MailDisplay *mail_display, gboolean reset_scroll); void mail_display_redisplay_when_loaded (MailDisplay *md, gconstpointer key, void (*callback)(MailDisplay *, gpointer), -- cgit v1.2.3