diff options
author | Dan Winship <danw@src.gnome.org> | 2001-05-31 05:41:42 +0800 |
---|---|---|
committer | Dan Winship <danw@src.gnome.org> | 2001-05-31 05:41:42 +0800 |
commit | 2bb495b6eb8e1e7e2c22691a5b3891879baa5f76 (patch) | |
tree | 4c9d5c1954d25335d1494a67358e1ef31487729c /mail/mail-config.c | |
parent | f40024c7265dcd7dbbb667647f05ed8a64fb83e7 (diff) | |
download | gsoc2013-evolution-2bb495b6eb8e1e7e2c22691a5b3891879baa5f76.tar.gz gsoc2013-evolution-2bb495b6eb8e1e7e2c22691a5b3891879baa5f76.tar.zst gsoc2013-evolution-2bb495b6eb8e1e7e2c22691a5b3891879baa5f76.zip |
Rename the "PGP" page back to "Other" and add a "default charset" option
* mail-config.glade: Rename the "PGP" page back to "Other" and add
a "default charset" option menu.
* mail-config.c (config_read, mail_config_write_on_exit,
mail_config_get_default_charset, mail_config_set_default_charset):
Handle "default charset".
* mail-accounts.c (construct): Fill in the "default_charset" menu
with an e_charset_picker menu.
(charset_menu_deactivate): Update the default charset.
svn path=/trunk/; revision=10057
Diffstat (limited to 'mail/mail-config.c')
-rw-r--r-- | mail/mail-config.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/mail/mail-config.c b/mail/mail-config.c index aba9a56220..af1667200f 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -68,6 +68,7 @@ typedef struct { MailConfigHTTPMode http_mode; MailConfigForwardStyle default_forward_style; MailConfigDisplayStyle message_display_style; + char *default_charset; } MailConfig; static const char GCONFPATH[] = "/apps/Evolution/Mail"; @@ -477,6 +478,19 @@ config_read (void) config->message_display_style = MAIL_CONFIG_DISPLAY_NORMAL; g_free (str); + /* Default charset */ + str = g_strdup_printf ("=%s/config/Mail=/Format/charset", evolution_dir); + config->default_charset = gnome_config_get_string (str); + g_free (str); + if (!config->default_charset) { + config->default_charset = g_get_charset (); + if (!config->default_charset || + !g_strcasecmp (config->default_charset, "US-ASCII")) + config->default_charset = g_strdup ("ISO-8859-1"); + else + config->default_charset = g_strdup (config->default_charset); + } + gnome_config_sync (); } @@ -671,6 +685,11 @@ mail_config_write_on_exit (void) gnome_config_set_int (str, config->message_display_style); g_free (str); + /* Default charset */ + str = g_strdup_printf ("=%s/config/Mail=/Format/default_charset", evolution_dir); + gnome_config_set_string (str, config->default_charset); + g_free (str); + /* Passwords */ gnome_config_private_clean_section ("/Evolution/Passwords"); sources = mail_config_get_sources (); @@ -927,6 +946,20 @@ mail_config_set_message_display_style (MailConfigDisplayStyle style) config->message_display_style = style; } +const char * +mail_config_get_default_charset (void) +{ + return config->default_charset; +} + +void +mail_config_set_default_charset (const char *charset) +{ + g_free (config->default_charset); + config->default_charset = g_strdup (charset); +} + + const MailConfigAccount * mail_config_get_default_account (void) { |