http://bugzilla.gnome.org/show_bug.cgi?id=337439 Workaround for misc GTKHTML bugs which keeps evolution from rendering message if rendered message size is greater than given in Preferences window. diff -Naur evolution-2.8.3.orig/mail/em-format.c evolution-2.8.3/mail/em-format.c --- evolution-2.8.3.orig/mail/em-format.c 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/em-format.c 2007-02-25 11:11:50.000000000 +0300 @@ -47,6 +47,7 @@ #include #include #include +#include #include #include #include @@ -80,7 +81,6 @@ static void emf_format_clone(EMFormat *emf, CamelFolder *folder, const char *uid, CamelMimeMessage *msg, EMFormat *emfsource); static void emf_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid); static gboolean emf_busy(EMFormat *emf); - enum { EMF_COMPLETE, EMF_LAST_SIGNAL, @@ -117,8 +117,10 @@ emf_init(GObject *o) { EMFormat *emf = (EMFormat *)o; - + char * asize; + emf->inline_table = g_hash_table_new(g_str_hash, g_str_equal); + emf->composer = FALSE; e_dlist_init(&emf->header_list); em_format_default_headers(emf); emf->part_id = g_string_new(""); @@ -469,6 +471,7 @@ * Return value: **/ EMFormatPURI * + em_format_find_puri(EMFormat *emf, const char *uri) { return g_hash_table_lookup(emf->pending_uri_table, uri); @@ -1016,7 +1019,7 @@ CamelDataWrapper *dw = camel_medium_get_content_object((CamelMedium *)part); if (camel_content_type_is (dw->mime_type, "text", "*")) - em_format_format_text(emf, stream, dw); + em_format_format_text(emf, stream, part); else camel_data_wrapper_decode_to_stream(dw, stream); } @@ -1036,6 +1039,9 @@ CamelMimeFilterCharset *filter; const char *charset = NULL; CamelMimeFilterWindows *windows = NULL; + CamelStream *mem_stream = NULL; + size_t size; + size_t max; if (emf->charset) { charset = emf->charset; @@ -1064,17 +1070,27 @@ } else if (charset == NULL) { charset = emf->default_charset; } - - filter_stream = camel_stream_filter_new_with_stream(stream); + + mem_stream = (CamelStreamMem *)camel_stream_mem_new (); + filter_stream = camel_stream_filter_new_with_stream(mem_stream); if ((filter = camel_mime_filter_charset_new_convert(charset, "UTF-8"))) { camel_stream_filter_add(filter_stream, (CamelMimeFilter *) filter); camel_object_unref(filter); } - - camel_data_wrapper_decode_to_stream(dw, (CamelStream *)filter_stream); + + max = mail_config_get_message_limit(); + size = camel_data_wrapper_decode_to_stream(emf->mode == EM_FORMAT_SOURCE ? (CamelDataWrapper *)dw: camel_medium_get_content_object((CamelMedium *)dw), (CamelStream *)filter_stream); camel_stream_flush((CamelStream *)filter_stream); camel_object_unref(filter_stream); + camel_stream_reset (mem_stream); + + if (max == -1 || size < (max * 1024) || emf->composer) { + camel_stream_write_to_stream(mem_stream, (CamelStream *)stream); + camel_stream_flush((CamelStream *)stream); + } else { + ((EMFormatClass *)G_OBJECT_GET_CLASS(emf))->format_optional(emf, stream, (CamelMimePart *)dw, mem_stream); + } if (windows) camel_object_unref(windows); @@ -1495,7 +1511,7 @@ static void emf_message_deliverystatus(EMFormat *emf, CamelStream *stream, CamelMimePart *part, const EMFormatHandler *info) { - em_format_format_text(emf, stream, camel_medium_get_content_object((CamelMedium *)part)); + em_format_format_text(emf, stream, part); } static void diff -Naur evolution-2.8.3.orig/mail/em-format.h evolution-2.8.3/mail/em-format.h --- evolution-2.8.3.orig/mail/em-format.h 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/em-format.h 2007-02-25 11:11:50.000000000 +0300 @@ -226,6 +226,7 @@ em_format_mode_t mode; /* source/headers/etc */ char *charset; /* charset override */ char *default_charset; /* charset fallback */ + gboolean composer; /* Formatting from composer ?*/ }; struct _EMFormatClass { @@ -257,6 +258,9 @@ /* returns true if the formatter is still busy with pending stuff */ gboolean (*busy)(EMFormat *); + /* Shows optional way to open messages */ + void (*format_optional)(EMFormat *, struct _CamelStream *, struct _CamelMimePart *, struct _CamelStream* ); + /* signals */ /* complete, alternative to polling busy, for asynchronous work */ void (*complete)(EMFormat *); diff -Naur evolution-2.8.3.orig/mail/em-format-html.c evolution-2.8.3/mail/em-format-html.c --- evolution-2.8.3.orig/mail/em-format-html.c 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/em-format-html.c 2007-02-25 11:11:50.000000000 +0300 @@ -767,7 +767,7 @@ "
\n", efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); camel_stream_write_string(stream, "\n"); - em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)newpart)); + em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, newpart); camel_stream_flush((CamelStream *)filtered_stream); camel_stream_write_string(stream, "\n"); camel_stream_write_string(stream, "
\n"); @@ -807,7 +807,7 @@ "
\n", efh->frame_colour & 0xffffff, efh->content_colour & 0xffffff); - em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, dw); + em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, part); camel_object_unref(filtered_stream); camel_stream_write_string(stream, "
"); @@ -829,7 +829,7 @@ camel_data_wrapper_write_to_stream(dw, out); camel_object_unref(out); #endif - em_format_format_text(emf, stream, camel_medium_get_content_object((CamelMedium *)puri->part)); + em_format_format_text(emf, stream, puri->part); } static void @@ -985,7 +985,7 @@ camel_object_unref(html_filter); camel_stream_write_string(stream, "\n"); - em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)part)); + em_format_format_text((EMFormat *)efh, (CamelStream *)filtered_stream, part); camel_stream_flush((CamelStream *)filtered_stream); camel_stream_write_string(stream, "\n"); diff -Naur evolution-2.8.3.orig/mail/em-format-html-display.c evolution-2.8.3/mail/em-format-html-display.c --- evolution-2.8.3.orig/mail/em-format-html-display.c 2007-02-25 11:09:58.000000000 +0300 +++ evolution-2.8.3/mail/em-format-html-display.c 2007-02-25 11:11:50.000000000 +0300 @@ -75,6 +75,7 @@ #include #include +#include #include #include #include @@ -184,6 +185,9 @@ GtkImage *image; GtkWidget *event_box; + /* Optional Text Mem Stream */ + CamelStreamMem *mstream; + /* Signed / Encrypted */ camel_cipher_validity_sign_t sign; camel_cipher_validity_encrypt_t encrypt; @@ -201,6 +205,7 @@ static void efhd_format_error(EMFormat *emf, CamelStream *stream, const char *txt); static void efhd_format_source(EMFormat *, CamelStream *, CamelMimePart *); static void efhd_format_attachment(EMFormat *, CamelStream *, CamelMimePart *, const char *, const EMFormatHandler *); +static void efhd_format_optional(EMFormat *, CamelStream *, CamelMimePart *, CamelStream *); static void efhd_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, CamelCipherValidity *valid); static void efhd_complete(EMFormat *); gboolean efhd_mnemonic_show_bar (GtkWidget *widget, gboolean focus, GtkWidget *efhd); @@ -355,6 +360,7 @@ ((EMFormatClass *)klass)->format_error = efhd_format_error; ((EMFormatClass *)klass)->format_source = efhd_format_source; ((EMFormatClass *)klass)->format_attachment = efhd_format_attachment; + ((EMFormatClass *)klass)->format_optional = efhd_format_optional; ((EMFormatClass *)klass)->format_secure = efhd_format_secure; ((EMFormatClass *)klass)->complete = efhd_complete; @@ -1511,7 +1517,7 @@ } e_popup_add_items((EPopup *)emp, menus, NULL, efhd_menu_items_free, info); - + menu = e_popup_create_menu_once((EPopup *)emp, (EPopupTarget *)target, 0); if (event) gtk_menu_popup(menu, NULL, NULL, NULL, NULL, event->button, event->time); @@ -2406,7 +2412,6 @@ if (handle) { if (info->shown) handle->handler(emf, stream, part, handle); - /*camel_stream_printf(stream, "\n", classid, _("Attachment content could not be loaded"));*/ } else if (efhd_use_component(mime_type)) { g_free(classid); /* messy */ @@ -2417,3 +2422,161 @@ g_free(classid); } + +static void +efhd_optional_button_show (GtkWidget *widget, GtkWidget *w) +{ + GtkWidget *label = g_object_get_data (widget, "text-label"); + + if (GTK_WIDGET_VISIBLE (w)) { + gtk_widget_hide (w); + gtk_label_set_text_with_mnemonic (label, _("View _Unformatted")); + } else { + gtk_label_set_text_with_mnemonic (label, _("Hide _Unformatted")); + gtk_widget_show (w); + } +} + +static void +efhd_resize (GtkWidget *w, GtkAllocation *event, EMFormatHTML *efh) +{ + gtk_widget_set_size_request (w, ((GtkWidget *)efh->html)->allocation.width-48, 250); +} + +/* optional render attachment button callback */ +static gboolean +efhd_attachment_optional(EMFormatHTML *efh, GtkHTMLEmbedded *eb, EMFormatHTMLPObject *pobject) +{ + EMFormatHTMLDisplay *efhd = (EMFormatHTMLDisplay *)efh; + EAttachment *new; + struct _attach_puri *info; + GtkWidget *hbox, *vbox, *w, *button, *mainbox, *scroll, *label, *img; + char *simple_type, *tmp, *new_file = NULL; + const char *file; + GdkPixbuf *pixbuf, *mini; + AtkObject *a11y; + GtkTextView *view; + GtkTextBuffer *buffer; + GtkTargetEntry drag_types[] = { + { NULL, 0, 0 }, + { "text/uri-list", 0, 1 }, + }; + + /* FIXME: handle default shown case */ + d(printf("adding attachment button/content for optional rendering\n")); + + info = (struct _attach_puri *)em_format_find_puri((EMFormat *)efh, pobject->classid); + g_assert(info != NULL); + g_assert(info->forward == NULL); + + scroll = gtk_scrolled_window_new (NULL, NULL); + mainbox = gtk_hbox_new(FALSE, 0); + + button = gtk_button_new(); + hbox = gtk_hbox_new (FALSE, 0); + img = e_icon_factory_get_image ("stock_show-all", E_ICON_SIZE_BUTTON); + label = gtk_label_new_with_mnemonic(_("View _Unformatted")); + g_object_set_data (button, "text-label", (gpointer)label); + gtk_box_pack_start ((GtkBox *)hbox, img, TRUE, TRUE, 2); + gtk_box_pack_start ((GtkBox *)hbox, label, TRUE, TRUE, 2); + gtk_widget_show_all (hbox); + gtk_container_add (button, hbox); + if (info->handle) + g_signal_connect(button, "clicked", G_CALLBACK(efhd_optional_button_show), scroll); + else { + gtk_widget_set_sensitive(button, FALSE); + GTK_WIDGET_UNSET_FLAGS(button, GTK_CAN_FOCUS); + } + + vbox = gtk_vbox_new (FALSE, 0); + gtk_box_pack_start((GtkBox *)mainbox, button, FALSE, FALSE, 6); + + button = gtk_button_new(); + hbox = gtk_hbox_new (FALSE, 0); + img = e_icon_factory_get_image ("stock_open", E_ICON_SIZE_BUTTON); + label = gtk_label_new_with_mnemonic(_("O_pen With")); + gtk_box_pack_start ((GtkBox *)hbox, img, TRUE, TRUE, 2); + gtk_box_pack_start ((GtkBox *)hbox, label, TRUE, TRUE, 2); + gtk_box_pack_start ((GtkBox *)hbox, gtk_arrow_new(GTK_ARROW_DOWN, GTK_SHADOW_NONE), TRUE, TRUE, 2); + gtk_widget_show_all (hbox); + gtk_container_add (button, hbox); + + a11y = gtk_widget_get_accessible (button); + atk_object_set_name (a11y, _("Attachment")); + + g_signal_connect(button, "button_press_event", G_CALLBACK(efhd_attachment_popup), info); + g_signal_connect(button, "popup_menu", G_CALLBACK(efhd_attachment_popup_menu), info); + g_signal_connect(button, "clicked", G_CALLBACK(efhd_attachment_popup_menu), info); + gtk_box_pack_start((GtkBox *)mainbox, button, FALSE, FALSE, 6); + + gtk_widget_show_all(mainbox); + + gtk_box_pack_start((GtkBox *)vbox, mainbox, FALSE, FALSE, 6); + + view = gtk_text_view_new (); + gtk_text_view_set_editable (view, FALSE); + gtk_text_view_set_cursor_visible (view, FALSE); + buffer = gtk_text_view_get_buffer(view); + gtk_text_buffer_set_text (buffer, info->mstream->buffer->data, info->mstream->buffer->len); + camel_object_unref(info->mstream); + info->mstream = NULL; + gtk_scrolled_window_set_policy (scroll, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scroll), GTK_SHADOW_IN); + gtk_container_add (scroll, view); + gtk_box_pack_start((GtkBox *)vbox, scroll, TRUE, TRUE, 6); + gtk_widget_show (view); + gtk_widget_set_size_request (scroll, ((GtkWidget *)efh->html)->allocation.width-48, 250); + g_signal_connect (scroll, "size_allocate", G_CALLBACK(efhd_resize), efh); + gtk_widget_show (scroll); + + if (!info->shown) + gtk_widget_hide (scroll); + + gtk_widget_show (vbox); + gtk_container_add((GtkContainer *)eb, vbox); + info->handle = NULL; + + return TRUE; +} + +static void +efhd_format_optional(EMFormat *emf, CamelStream *fstream, CamelMimePart *part, CamelStream *mstream) +{ + char *classid, *text, *html; + struct _attach_puri *info; + CamelStream *stream = ((CamelStreamFilter *) fstream)->source; + + classid = g_strdup_printf("optional%s", emf->part_id->str); + info = (struct _attach_puri *)em_format_add_puri(emf, sizeof(*info), classid, part, efhd_attachment_frame); + em_format_html_add_pobject((EMFormatHTML *)emf, sizeof(EMFormatHTMLPObject), classid, part, efhd_attachment_optional); + info->handle = em_format_find_handler(emf, "text/plain");; + info->shown = FALSE; + info->snoop_mime_type = g_strdup("text/plain"); + info->attachment = e_attachment_new_from_mime_part (info->puri.part); + info->mstream = mstream; + if (emf->valid) { + info->sign = emf->valid->sign.status; + info->encrypt = emf->valid->encrypt.status; + } + + camel_stream_write_string(stream, + EM_FORMAT_HTML_VPAD + "

"); + + html = camel_text_to_html(_("Evolution cannot render this email as it is too large to handle. You can view it unformatted or with an external text editor."), ((EMFormatHTML *)emf)->text_html_flags & CAMEL_MIME_FILTER_TOHTML_CONVERT_URLS, 0); + camel_stream_write_string(stream, html); + camel_stream_write_string(stream, + "

\n"); + camel_stream_write_string(stream, + "" + ""); + camel_stream_printf(stream, "
", classid); + + g_free(html); + + camel_stream_write_string(stream, +/* "\n" */ + EM_FORMAT_HTML_VPAD); + + g_free(classid); +} diff -Naur evolution-2.8.3.orig/mail/em-format-quote.c evolution-2.8.3/mail/em-format-quote.c --- evolution-2.8.3.orig/mail/em-format-quote.c 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/em-format-quote.c 2007-02-25 11:11:50.000000000 +0300 @@ -411,7 +411,7 @@ camel_stream_filter_add(filtered_stream, html_filter); camel_object_unref(html_filter); - em_format_format_text(emf, (CamelStream *)filtered_stream, dw); + em_format_format_text(emf, (CamelStream *)filtered_stream, part); camel_object_unref(filtered_stream); } @@ -473,7 +473,7 @@ camel_stream_filter_add(filtered_stream, html_filter); camel_object_unref(html_filter); - em_format_format_text((EMFormat *)emfq, (CamelStream *)filtered_stream, camel_medium_get_content_object((CamelMedium *)part)); + em_format_format_text((EMFormat *)emfq, (CamelStream *)filtered_stream, part); camel_stream_flush((CamelStream *)filtered_stream); camel_object_unref(filtered_stream); } @@ -501,7 +501,7 @@ camel_object_unref(enriched); camel_stream_write_string(stream, "


"); - em_format_format_text((EMFormat *)emfq, (CamelStream *)filtered_stream, dw); + em_format_format_text((EMFormat *)emfq, (CamelStream *)filtered_stream, part); camel_object_unref(filtered_stream); } @@ -509,7 +509,7 @@ emfq_text_html(EMFormat *emf, CamelStream *stream, CamelMimePart *part, EMFormatHandler *info) { camel_stream_write_string(stream, "\n\n"); - em_format_format_text(emf, stream, camel_medium_get_content_object((CamelMedium *)part)); + em_format_format_text(emf, stream, part); } static void diff -Naur evolution-2.8.3.orig/mail/em-mailer-prefs.c evolution-2.8.3/mail/em-mailer-prefs.c --- evolution-2.8.3.orig/mail/em-mailer-prefs.c 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/em-mailer-prefs.c 2007-02-25 11:11:50.000000000 +0300 @@ -459,6 +459,16 @@ } static void +mlimit_count_changed (GtkSpinButton *spin, EMMailerPrefs *prefs) +{ + int count; + + count = (int) gtk_spin_button_get_value (prefs->mlimit_count); + + gconf_client_set_int (prefs->gconf, "/apps/evolution/mail/display/message_text_part_limit", count, NULL); +} + +static void spin_button_init (EMMailerPrefs *prefs, GtkSpinButton *spin, const char *key, float div, GCallback value_changed) { GError *err = NULL; @@ -772,6 +782,16 @@ "/apps/evolution/mail/display/mark_seen_timeout", 1000.0, G_CALLBACK (mark_seen_timeout_changed)); + prefs->mlimit_toggle = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "mlimit_checkbutton")); + toggle_button_init (prefs, prefs->mlimit_toggle, FALSE, + "/apps/evolution/mail/display/force_message_limit", + G_CALLBACK (toggle_button_toggled)); + + prefs->mlimit_count = GTK_SPIN_BUTTON (glade_xml_get_widget (gui, "mlimit_spin")); + spin_button_init (prefs, prefs->mlimit_count, + "/apps/evolution/mail/display/message_text_part_limit", + 1, G_CALLBACK (mlimit_count_changed)); + prefs->address_toggle = GTK_TOGGLE_BUTTON (glade_xml_get_widget (gui, "address_checkbox")); toggle_button_init (prefs, prefs->address_toggle, FALSE, "/apps/evolution/mail/display/address_compress", diff -Naur evolution-2.8.3.orig/mail/em-mailer-prefs.h evolution-2.8.3/mail/em-mailer-prefs.h --- evolution-2.8.3.orig/mail/em-mailer-prefs.h 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/em-mailer-prefs.h 2007-02-25 11:11:50.000000000 +0300 @@ -75,7 +75,9 @@ struct _GtkToggleButton *timeout_toggle; struct _GtkSpinButton *timeout; struct _GtkToggleButton *address_toggle; - struct _GtkSpinButton *address_count; + struct _GtkSpinButton *address_count; + struct _GtkToggleButton *mlimit_toggle; + struct _GtkSpinButton *mlimit_count; struct _GtkOptionMenu *charset; struct _GtkToggleButton *citation_highlight; struct _GnomeColorPicker *citation_color; diff -Naur evolution-2.8.3.orig/mail/em-utils.c evolution-2.8.3/mail/em-utils.c --- evolution-2.8.3.orig/mail/em-utils.c 2007-02-25 11:09:58.000000000 +0300 +++ evolution-2.8.3/mail/em-utils.c 2007-02-25 11:11:50.000000000 +0300 @@ -1488,6 +1488,7 @@ camel_stream_mem_set_byte_array (mem, buf); emfq = em_format_quote_new(NULL, (CamelStream *)mem, 0); + ((EMFormat *) emfq)->composer = TRUE; em_format_set_session((EMFormat *)emfq, session); if (source) { /* copy over things we can, other things are internal, perhaps need different api than 'clone' */ @@ -1536,6 +1537,7 @@ camel_stream_mem_set_byte_array (mem, buf); emfq = em_format_quote_new(credits, (CamelStream *)mem, flags); + ((EMFormat *) emfq)->composer = TRUE; em_format_set_session((EMFormat *)emfq, session); if (!source) { diff -Naur evolution-2.8.3.orig/mail/evolution-mail.schemas.in.in evolution-2.8.3/mail/evolution-mail.schemas.in.in --- evolution-2.8.3.orig/mail/evolution-mail.schemas.in.in 2007-02-25 11:09:58.000000000 +0300 +++ evolution-2.8.3/mail/evolution-mail.schemas.in.in 2007-02-25 11:11:50.000000000 +0300 @@ -485,7 +485,36 @@ - + + + /schemas/apps/evolution/mail/display/force_message_limit + /apps/evolution/mail/display/force_message_limit + evolution-mail + bool + true + + Allows evolution to display text part of limited size + + Enable to render message text part of limited size. + + + + + + /schemas/apps/evolution/mail/display/message_text_part_limit + /apps/evolution/mail/display/message_text_part_limit + evolution-mail + int + 4096 + + Text message part limit + + This decides the max size of the text part that can be formatted under + evolution. The default is 4MB / 4096 KB and is specified interms of KB. + + + + /schemas/apps/evolution/mail/display/address_count /apps/evolution/mail/display/address_count diff -Naur evolution-2.8.3.orig/mail/mail-config.c evolution-2.8.3/mail/mail-config.c --- evolution-2.8.3.orig/mail/mail-config.c 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/mail-config.c 2007-02-25 11:11:50.000000000 +0300 @@ -110,6 +110,11 @@ guint address_compress_notify_id; gboolean address_compress; gint address_count; + guint mlimit_size_notify_id; + guint mlimit_notify_id; + gboolean mlimit; + gint mlimit_size; + GPtrArray *mime_types; guint mime_types_notify_id; @@ -339,6 +344,20 @@ } static void +gconf_mlimit_size_changed (GConfClient *client, guint cnxn_id, + GConfEntry *entry, gpointer user_data) +{ + config->mlimit_size = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/message_text_part_limit", NULL); +} + +static void +gconf_mlimit_changed (GConfClient *client, guint cnxn_id, + GConfEntry *entry, gpointer user_data) +{ + config->mlimit = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/force_message_limit", NULL); +} + +static void gconf_mime_types_changed (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) { @@ -373,7 +392,11 @@ config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/address_compress", gconf_address_compress_changed, NULL, NULL, NULL); config->font_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/address_count", - gconf_address_count_changed, NULL, NULL, NULL); + gconf_address_count_changed, NULL, NULL, NULL); + config->mlimit_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/force_message_limit", + gconf_mlimit_changed, NULL, NULL, NULL); + config->mlimit_size_notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/message_text_part_limit", + gconf_mlimit_size_changed, NULL, NULL, NULL); config->spell_notify_id = gconf_client_notify_add (config->gconf, "/GNOME/Spell", gconf_style_changed, NULL, NULL, NULL); config->mark_citations__notify_id = gconf_client_notify_add (config->gconf, "/apps/evolution/mail/display/mark_citations", @@ -397,6 +420,8 @@ config_cache_mime_types (); config->address_compress = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/address_compress", NULL); config->address_count = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/address_count", NULL); + config->mlimit = gconf_client_get_bool (config->gconf, "/apps/evolution/mail/display/force_message_limit", NULL); + config->mlimit_size = gconf_client_get_int (config->gconf, "/apps/evolution/mail/display/message_text_part_limit", NULL); config->accounts = e_account_list_new (config->gconf); config->signatures = e_signature_list_new (config->gconf); } @@ -538,6 +563,15 @@ return config->address_count; } +int +mail_config_get_message_limit (void) +{ + if (!config->mlimit) + return -1; + + return config->mlimit_size; +} + const char * mail_config_get_label_color_by_name (const char *name) { diff -Naur evolution-2.8.3.orig/mail/mail-config.glade evolution-2.8.3/mail/mail-config.glade --- evolution-2.8.3.orig/mail/mail-config.glade 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/mail-config.glade 2007-02-25 11:11:50.000000000 +0300 @@ -3342,7 +3342,7 @@ True - S_end message receipts: + S_end message receipts: True False GTK_JUSTIFY_LEFT @@ -3352,8 +3352,8 @@ 0.5 0 0 - PANGO_ELLIPSIZE_NONE receipt_policy_dropdown + PANGO_ELLIPSIZE_NONE -1 False 0 @@ -4962,6 +4962,82 @@ + + True + False + 4 + + + + True + True + Do not render text contents in mails if its si_ze exceeds + True + GTK_RELIEF_NORMAL + True + False + False + True + + + 0 + False + False + + + + + + True + True + 1 + 0 + False + GTK_UPDATE_ALWAYS + False + False + 0 0 30000 1 10 10 + + + 0 + False + True + + + + + + True + KB + False + False + GTK_JUSTIFY_LEFT + False + False + 0.5 + 0.5 + 0 + 0 + PANGO_ELLIPSIZE_NONE + -1 + False + 0 + + + 0 + False + False + + + + + 0 + False + False + + + + True False @@ -6572,7 +6648,7 @@ True - + False False GTK_JUSTIFY_LEFT @@ -6675,7 +6751,7 @@ True - + False False GTK_JUSTIFY_LEFT @@ -6731,7 +6807,7 @@ True - + False False GTK_JUSTIFY_LEFT diff -Naur evolution-2.8.3.orig/mail/mail-config.h evolution-2.8.3/mail/mail-config.h --- evolution-2.8.3.orig/mail/mail-config.h 2007-01-29 13:00:01.000000000 +0300 +++ evolution-2.8.3/mail/mail-config.h 2007-02-25 11:11:50.000000000 +0300 @@ -134,6 +134,7 @@ void mail_config_remove_account (struct _EAccount *account); void mail_config_set_default_account (struct _EAccount *account); int mail_config_get_address_count (void); +int mail_config_get_message_limit (void); void mail_config_remove_account_proxies (struct _EAccount *account); void mail_config_prune_proxies (void);