diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2007-02-13 02:11:51 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@src.gnome.org> | 2007-02-13 02:11:51 +0800 |
commit | 876e40f9057b0ef9948e58b7c2253c53d0388f10 (patch) | |
tree | 430dcd6afc4f069ea3ed60881baee763a5191579 /mail/em-format-html.c | |
parent | 650e7524ed23df43dbce67b7f9e54f3d2df936b5 (diff) | |
download | gsoc2013-evolution-876e40f9057b0ef9948e58b7c2253c53d0388f10.tar.gz gsoc2013-evolution-876e40f9057b0ef9948e58b7c2253c53d0388f10.tar.zst gsoc2013-evolution-876e40f9057b0ef9948e58b7c2253c53d0388f10.zip |
** Fixes bug #350253
2007-02-12 Matthew Barnes <mbarnes@redhat.com>
** Fixes bug #350253
* Add new evolution icons:
art/16x16/evolution.png
art/22x22/evolution.png
art/24x24/evolution.png
art/32x32/evolution.png
art/scalable/evolution.svg
* Remove obsolete icons:
art/about-box.png
art/bcg.png
art/evolution.png
art/monkey-16.png
* art/Makefile.am: Ship our own named icons.
* mail/em-format-html-print.h:
Rename show_rupert field to show_icon.
* mail/em-format-html-print.c (efh_format_headers):
Lookup the evolution icon by name.
svn path=/trunk/; revision=33211
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r-- | mail/em-format-html.c | 27 |
1 files changed, 16 insertions, 11 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c index dc55d03134..603ec21044 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -32,6 +32,7 @@ #include <ctype.h> #include <glib.h> +#include <gtk/gtk.h> #ifdef G_OS_WIN32 /* Work around 'DATADIR' and 'interface' lossage in <windows.h> */ #define DATADIR crap_DATADIR @@ -156,7 +157,7 @@ efh_init(GObject *o) efh->content_colour = 0xffffff; efh->text_html_flags = CAMEL_MIME_FILTER_TOHTML_CONVERT_NL | CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES | CAMEL_MIME_FILTER_TOHTML_MARK_CITATION; - efh->show_rupert = TRUE; + efh->show_icon = TRUE; } static void @@ -1747,7 +1748,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) const char *charset; CamelContentType *ct; struct _camel_header_raw *header; - int rupert = FALSE; + gboolean have_icon = FALSE; ct = camel_mime_part_get_content_type((CamelMimePart *)part); charset = camel_content_type_param (ct, "charset"); @@ -1788,7 +1789,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) efh_format_header (emf, stream, part, &xmailer, h->flags, charset); if (strstr(header->value, "Evolution")) - rupert = TRUE; + have_icon = TRUE; } else if (!g_ascii_strcasecmp (header->name, h->name)) { efh_format_header(emf, stream, part, header, h->flags, charset); } @@ -1801,19 +1802,23 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part) if (!efh->simple_headers) { camel_stream_printf(stream, "</table></td>"); - if (rupert && efh->show_rupert) { + if (have_icon && efh->show_icon) { + GtkIconInfo *icon_info; char *classid; - CamelMimePart *iconpart; - char *pngfile; + CamelMimePart *iconpart = NULL; classid = g_strdup_printf("icon:///em-format-html/%s/icon/header", emf->part_id->str); camel_stream_printf(stream, "<td align=\"right\" valign=\"top\"><img width=16 height=16 src=\"%s\"></td>", classid); - pngfile = g_build_filename (EVOLUTION_ICONSDIR, - "monkey-16.png", - NULL); - iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png", pngfile); - g_free (pngfile); + icon_info = gtk_icon_theme_lookup_icon ( + gtk_icon_theme_get_default (), + "evolution", 16, GTK_ICON_LOOKUP_NO_SVG); + if (icon_info != NULL) { + iconpart = em_format_html_file_part ( + (EMFormatHTML *) emf, "image/png", + gtk_icon_info_get_filename (icon_info)); + gtk_icon_info_free (icon_info); + } if (iconpart) { em_format_add_puri(emf, sizeof(EMFormatPURI), classid, iconpart, efh_write_image); |