diff options
author | Milan Crha <mcrha@redhat.com> | 2010-05-19 04:47:29 +0800 |
---|---|---|
committer | Milan Crha <mcrha@redhat.com> | 2010-05-19 04:47:29 +0800 |
commit | ef7690c3845e3c1cebcf3caba7f7667a10e7123d (patch) | |
tree | ab4a5bfa25bc5e25e0fed851c25226ce1930ec52 /modules/mail | |
parent | 0f92771be57383e5d6e7d0f3e05743d192066eb3 (diff) | |
download | gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar.gz gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.tar.zst gsoc2013-evolution-ef7690c3845e3c1cebcf3caba7f7667a10e7123d.zip |
Bug #499320 - Preview before import from command line
Diffstat (limited to 'modules/mail')
-rw-r--r-- | modules/mail/e-mail-shell-backend.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/modules/mail/e-mail-shell-backend.c b/modules/mail/e-mail-shell-backend.c index 105b55285a..5c16a34b21 100644 --- a/modules/mail/e-mail-shell-backend.c +++ b/modules/mail/e-mail-shell-backend.c @@ -31,6 +31,7 @@ #include "shell/e-shell-window.h" #include "composer/e-msg-composer.h" #include "widgets/misc/e-preferences-window.h" +#include "widgets/misc/e-web-view.h" #include "e-mail-shell-settings.h" #include "e-mail-shell-sidebar.h" @@ -70,6 +71,9 @@ struct _EMailShellBackendPrivate { static gpointer parent_class; static GType mail_shell_backend_type; +static void mbox_create_preview_cb (GObject *preview, GtkWidget **preview_widget); +static void mbox_fill_preview_cb (GObject *preview, CamelMimeMessage *msg); + static void mail_shell_backend_init_importers (void) { @@ -80,6 +84,7 @@ mail_shell_backend_init_importers (void) importer = mbox_importer_peek (); e_import_class_add_importer (import_class, importer, NULL, NULL); + mbox_importer_set_preview_funcs (mbox_create_preview_cb, mbox_fill_preview_cb); importer = elm_importer_peek (); e_import_class_add_importer (import_class, importer, NULL, NULL); @@ -770,3 +775,31 @@ e_mail_labels_get_filter_options (void) return g_slist_reverse (list); } + +/* utility functions for mbox importer */ +static void +mbox_create_preview_cb (GObject *preview, GtkWidget **preview_widget) +{ + EMFormatHTMLDisplay *format; + + g_return_if_fail (preview != NULL); + g_return_if_fail (preview_widget != NULL); + + format = em_format_html_display_new (); + g_object_set_data_full (preview, "mbox-imp-formatter", format, g_object_unref); + *preview_widget = GTK_WIDGET (EM_FORMAT_HTML (format)->html); +} + +static void +mbox_fill_preview_cb (GObject *preview, CamelMimeMessage *msg) +{ + EMFormatHTMLDisplay *format; + + g_return_if_fail (preview != NULL); + g_return_if_fail (msg != NULL); + + format = g_object_get_data (preview, "mbox-imp-formatter"); + g_return_if_fail (format != NULL); + + em_format_format (EM_FORMAT (format), NULL, NULL, msg); +} |