aboutsummaryrefslogtreecommitdiffstats
path: root/mail/em-format-html.c
diff options
context:
space:
mode:
authorMichael Terry <mike@mterry.name>2004-04-19 23:20:48 +0800
committerRodney Dawes <dobey@src.gnome.org>2004-04-19 23:20:48 +0800
commit69bf3985321f43107a694855c764500c89b05deb (patch)
tree710f94bb8dd3378e397b94cf51a46d2f8dfbd293 /mail/em-format-html.c
parentcc309ba614fec0dca286fd20d97ab511654a331f (diff)
downloadgsoc2013-evolution-69bf3985321f43107a694855c764500c89b05deb.tar
gsoc2013-evolution-69bf3985321f43107a694855c764500c89b05deb.tar.gz
gsoc2013-evolution-69bf3985321f43107a694855c764500c89b05deb.tar.bz2
gsoc2013-evolution-69bf3985321f43107a694855c764500c89b05deb.tar.lz
gsoc2013-evolution-69bf3985321f43107a694855c764500c89b05deb.tar.xz
gsoc2013-evolution-69bf3985321f43107a694855c764500c89b05deb.tar.zst
gsoc2013-evolution-69bf3985321f43107a694855c764500c89b05deb.zip
mail-component.c
2004-04-19 Michael Terry <mike@mterry.name> * GNOME_Evolution_Mail.server.in.in: * em-account-prefs.[ch]: * em-composer-prefs.[ch]: * em-folder-browser.c: * em-folder-tree.c: * em-folder-view.c: * em-format-html-display.c: * em-format-html.[ch]: * em-popup.c: * mail-component.c * mail-config-druid.c: * mail-config.glade: * mail-mt.c: * mail-send-recv.c: * message-list.c: * message-tag-followup.c: * message-tags.glade: Update the mailer to use icon themes through the EIconFactory object in e-util svn path=/trunk/; revision=25517
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r--mail/em-format-html.c33
1 files changed, 18 insertions, 15 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c
index 2f6c25560f..67ca9d5b4d 100644
--- a/mail/em-format-html.c
+++ b/mail/em-format-html.c
@@ -36,6 +36,7 @@
#include <gal/util/e-iconv.h>
#include <gal/util/e-util.h> /* for e_utf8_strftime, what about e_time_format_time? */
#include "e-util/e-time-utils.h"
+#include "e-util/e-icon-factory.h"
#include <gtkhtml/gtkhtml.h>
#include <gtkhtml/gtkhtml-embedded.h>
@@ -291,16 +292,14 @@ em_format_html_set_xmailer_mask(EMFormatHTML *emfh, unsigned int xmailer_mask)
}
CamelMimePart *
-em_format_html_file_part(EMFormatHTML *efh, const char *mime_type, const char *path, const char *name)
+em_format_html_file_part(EMFormatHTML *efh, const char *mime_type, const char *filename)
{
CamelMimePart *part;
CamelStream *stream;
CamelDataWrapper *dw;
- char *filename;
+ gchar *basename;
- filename = g_build_filename(path, name, NULL);
stream = camel_stream_fs_new_with_name(filename, O_RDONLY, 0);
- g_free(filename);
if (stream == NULL)
return NULL;
@@ -313,7 +312,9 @@ em_format_html_file_part(EMFormatHTML *efh, const char *mime_type, const char *p
part = camel_mime_part_new();
camel_medium_set_content_object((CamelMedium *)part, dw);
camel_object_unref(dw);
- camel_mime_part_set_filename(part, name);
+ basename = g_path_get_basename (filename);
+ camel_mime_part_set_filename(part, basename);
+ g_free (basename);
return part;
}
@@ -565,19 +566,19 @@ efh_object_requested(GtkHTML *html, GtkHTMLEmbedded *eb, EMFormatHTML *efh)
static const struct {
const char *icon, *shortdesc;
} smime_sign_table[4] = {
- { "pgp-signature-nokey.png", N_("Unsigned") },
- { "pgp-signature-ok.png", N_("Valid signature") },
- { "pgp-signature-bad.png", N_("Invalid signature") },
- { "pgp-signature-nokey.png", N_("Valid signature, cannot verify sender") },
+ { NULL, N_("Unsigned") },
+ { "stock_signature-ok", N_("Valid signature") },
+ { "stock_signature-bad", N_("Invalid signature") },
+ { "stock_signature", N_("Valid signature, cannot verify sender") },
};
static const struct {
const char *icon, *shortdesc;
} smime_encrypt_table[4] = {
{ NULL, N_("Unencrypted") },
- { "pgp-signature-ok.png", N_("Encrypted, weak"),},
- { "pgp-signature-ok.png", N_("Encrypted") },
- { "pgp-signature-ok.png", N_("Encrypted, strong") },
+ { "stock_lock-ok", N_("Encrypted, weak"),},
+ { "stock_lock-ok", N_("Encrypted") },
+ { "stock_lock-ok", N_("Encrypted, strong") },
};
/* TODO: this could probably be virtual on em-format-html
@@ -595,6 +596,7 @@ efh_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, Camel
&& (valid->encrypt.status != CAMEL_CIPHER_VALIDITY_ENCRYPT_NONE
|| valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE)) {
char *classid;
+ gchar *iconpath;
CamelMimePart *iconpart;
camel_stream_printf(stream, "<table border=0 width=\"100%%\" cellpadding=3 cellspacing=0 bgcolor=%s><tr>",
@@ -602,12 +604,13 @@ efh_format_secure(EMFormat *emf, CamelStream *stream, CamelMimePart *part, Camel
classid = g_strdup_printf("smime:///em-format-html/%s/icon/signed", emf->part_id->str);
camel_stream_printf(stream, "<td valign=\"top\"><img src=\"%s\"></td><td valign=\"top\" width=\"100%%\">", classid);
- iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png",
- EVOLUTION_ICONSDIR, smime_sign_table[valid->sign.status].icon);
+ iconpath = e_icon_factory_get_icon_filename (smime_sign_table[valid->sign.status].icon, 48);
+ iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png", iconpath);
if (iconpart) {
(void)em_format_add_puri(emf, sizeof(EMFormatPURI), classid, iconpart, efh_write_image);
camel_object_unref(iconpart);
}
+ g_free (iconpath);
g_free(classid);
if (valid->sign.status != CAMEL_CIPHER_VALIDITY_SIGN_NONE) {
@@ -1679,7 +1682,7 @@ efh_format_headers(EMFormatHTML *efh, CamelStream *stream, CamelMedium *part)
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);
- iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png", EVOLUTION_ICONSDIR, "monkey-16.png");
+ iconpart = em_format_html_file_part((EMFormatHTML *)emf, "image/png", EVOLUTION_ICONSDIR "/monkey-16.png");
if (iconpart) {
em_format_add_puri(emf, sizeof(EMFormatPURI), classid, iconpart, efh_write_image);
camel_object_unref(iconpart);