diff options
author | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-02-12 07:30:03 +0000 |
---|---|---|
committer | hiro <hiro@ee746299-78ed-0310-b773-934348b2243d> | 2010-02-12 07:30:03 +0000 |
commit | 716006d0ec63efad9ca5d36950db9179f173ef31 (patch) | |
tree | 7b1633b5cd1d5ef53e32e841532058c19a864658 | |
parent | ca2cc6e6cb63c76769e98c47a023781baab88d4d (diff) |
Preserve PGP settings saving and loading drafts (thanks to Antonio).
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@2472 ee746299-78ed-0310-b773-934348b2243d
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | src/compose.c | 28 |
2 files changed, 33 insertions, 2 deletions
@@ -1,6 +1,11 @@ 2010-02-12 - * src/compose: Preserve spell-checking settings saving and loading + * src/compose.c: Preserve PGP settings saving and loading drafts + (thanks to Antonio). + +2010-02-12 + + * src/compose.c: Preserve spell-checking settings saving and loading drafts (thanks to Antonio). 2010-02-12 diff --git a/src/compose.c b/src/compose.c index 2381862b..84cd2a5f 100644 --- a/src/compose.c +++ b/src/compose.c @@ -1226,6 +1226,10 @@ void compose_reedit(MsgInfo *msginfo) menu_set_active(ifactory, "/Tools/Check spell", compose->check_spell); compose_change_spell_lang_menu(compose, compose->spell_lang); #endif +#if USE_GPGME + menu_set_active(ifactory, "/Tools/PGP Sign", compose->use_signing); + menu_set_active(ifactory, "/Tools/PGP Encrypt", compose->use_encryption); +#endif syl_plugin_signal_emit("compose-created", compose); @@ -1609,6 +1613,8 @@ static gint compose_parse_source_msg(Compose *compose, MsgInfo *msginfo) {"X-Sylpheed-Compose-AutoWrap:", NULL, FALSE}, {"X-Sylpheed-Compose-CheckSpell:", NULL, FALSE}, {"X-Sylpheed-Compose-SpellLang:", NULL, FALSE}, + {"X-Sylpheed-Compose-UseSigning:", NULL, FALSE}, + {"X-Sylpheed-Compose-UseEncryption:", NULL, FALSE}, {NULL, NULL, FALSE}}; enum @@ -1620,7 +1626,9 @@ static gint compose_parse_source_msg(Compose *compose, MsgInfo *msginfo) H_MDN = 4, H_X_SYLPHEED_COMPOSE_AUTOWRAP = 5, H_X_SYLPHEED_COMPOSE_CHECKSPELL = 6, - H_X_SYLPHEED_COMPOSE_SPELLLANG = 7 + H_X_SYLPHEED_COMPOSE_SPELLLANG = 7, + H_X_SYLPHEED_COMPOSE_USESIGNING = 8, + H_X_SYLPHEED_COMPOSE_USEENCRYPTION = 9 }; gchar *file; @@ -1666,6 +1674,18 @@ static gint compose_parse_source_msg(Compose *compose, MsgInfo *msginfo) g_free(compose->spell_lang); compose->spell_lang = g_strdup(str); #endif +#if USE_GPGME + } else if (hnum == H_X_SYLPHEED_COMPOSE_USESIGNING) { + if (g_ascii_strcasecmp(str, "TRUE") == 0) + compose->use_signing = TRUE; + else + compose->use_signing = FALSE; + } else if (hnum == H_X_SYLPHEED_COMPOSE_USEENCRYPTION) { + if (g_ascii_strcasecmp(str, "TRUE") == 0) + compose->use_encryption = TRUE; + else + compose->use_encryption = FALSE; +#endif } } @@ -4758,6 +4778,12 @@ static gint compose_write_headers(Compose *compose, FILE *fp, fprintf(fp, "X-Sylpheed-Compose-SpellLang: %s\n", compose->spell_lang); #endif +#if USE_GPGME + fprintf(fp, "X-Sylpheed-Compose-UseSigning: %s\n", + compose->use_signing ? "TRUE" : "FALSE"); + fprintf(fp, "X-Sylpheed-Compose-UseEncryption: %s\n", + compose->use_encryption ? "TRUE" : "FALSE"); +#endif } /* separator between header and body */ |