aboutsummaryrefslogtreecommitdiffstats
path: root/mail
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2007-02-13 02:11:51 +0800
committerMatthew Barnes <mbarnes@src.gnome.org>2007-02-13 02:11:51 +0800
commit876e40f9057b0ef9948e58b7c2253c53d0388f10 (patch)
tree430dcd6afc4f069ea3ed60881baee763a5191579 /mail
parent650e7524ed23df43dbce67b7f9e54f3d2df936b5 (diff)
downloadgsoc2013-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')
-rw-r--r--mail/ChangeLog10
-rw-r--r--mail/em-format-html-print.c2
-rw-r--r--mail/em-format-html.c27
-rw-r--r--mail/em-format-html.h4
4 files changed, 29 insertions, 14 deletions
diff --git a/mail/ChangeLog b/mail/ChangeLog
index 8322bec8be..97aa1328aa 100644
--- a/mail/ChangeLog
+++ b/mail/ChangeLog
@@ -1,3 +1,13 @@
+2007-02-12 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes bug #350253
+
+ * em-format-html-print.h:
+ Rename show_rupert field to show_icon.
+
+ * em-format-html-print.c (efh_format_headers):
+ Lookup the evolution icon by name.
+
2007-02-12 Kjartan Maraas <kmaraas@gnome.org>
* em-folder-browser.c: (emfb_search_search_activated):
diff --git a/mail/em-format-html-print.c b/mail/em-format-html-print.c
index a527ded879..bc94f8aae5 100644
--- a/mail/em-format-html-print.c
+++ b/mail/em-format-html-print.c
@@ -56,7 +56,7 @@ efhp_init(GObject *o)
efhp->window = gtk_window_new(GTK_WINDOW_TOPLEVEL);
gtk_container_add((GtkContainer *)efhp->window, html);
gtk_widget_realize(html);
- efhp->formathtml.show_rupert = FALSE;
+ efhp->formathtml.show_icon = FALSE;
}
static void
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);
diff --git a/mail/em-format-html.h b/mail/em-format-html.h
index 383313b3bf..1f589755b9 100644
--- a/mail/em-format-html.h
+++ b/mail/em-format-html.h
@@ -162,7 +162,7 @@ struct _EMFormatHTMLPObject {
* @mark_citations:1:
* @simple_headers:1:
* @hide_headers:1:
- * @show_rupert:1:
+ * @show_icon:1:
*
* Most of these fields are private or read-only.
*
@@ -192,7 +192,7 @@ struct _EMFormatHTML {
unsigned int mark_citations:1;
unsigned int simple_headers:1; /* simple header format, no box/table */
unsigned int hide_headers:1; /* no headers at all */
- unsigned int show_rupert:1; /* whether we print rupert or not */
+ unsigned int show_icon:1; /* show an icon when the sender used Evo */
guint32 header_wrap_flags;
};