From 78a2a77d1079c4790eeef64aa42b034dab172292 Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Mon, 14 Nov 2011 15:24:33 +0100 Subject: Bug #662914 - Reply to gnupg signed mails should be signed --- mail/em-composer-utils.c | 10 ++++++++-- mail/evolution-mail.schemas.in | 15 +++++++++++++++ mail/mail-config.ui | 19 ++++++++++++++++++- modules/mail/e-mail-shell-settings.c | 4 ++++ modules/mail/em-composer-prefs.c | 7 +++++++ 5 files changed, 52 insertions(+), 3 deletions(-) diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index b09d3cd4e2..3f851c0991 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1413,17 +1413,23 @@ emu_update_composers_security (EMsgComposer *composer, guint32 validity_found) { GtkToggleAction *action; + EShell *shell; + EShellSettings *shell_settings; g_return_if_fail (composer != NULL); + shell = e_msg_composer_get_shell (composer); + shell_settings = e_shell_get_shell_settings (shell); + /* Pre-set only for encrypted messages, not for signed */ - /*if (validity_found & EM_FORMAT_VALIDITY_FOUND_SIGNED) { + if ((validity_found & EM_FORMAT_VALIDITY_FOUND_SIGNED) != 0 + && e_shell_settings_get_boolean (shell_settings, "composer-sign-reply-if-signed")) { if (validity_found & EM_FORMAT_VALIDITY_FOUND_SMIME) action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_SMIME_SIGN (composer)); else action = GTK_TOGGLE_ACTION (E_COMPOSER_ACTION_PGP_SIGN (composer)); gtk_toggle_action_set_active (action, TRUE); - }*/ + } if (validity_found & EM_FORMAT_VALIDITY_FOUND_ENCRYPTED) { if (validity_found & EM_FORMAT_VALIDITY_FOUND_SMIME) diff --git a/mail/evolution-mail.schemas.in b/mail/evolution-mail.schemas.in index c26c0feb96..f7c3844b8a 100644 --- a/mail/evolution-mail.schemas.in +++ b/mail/evolution-mail.schemas.in @@ -76,6 +76,21 @@ + + /schemas/apps/evolution/mail/composer/sign_reply_if_signed + /apps/evolution/mail/composer/sign_reply_if_signed + evolution-mail + bool + false + + Digitally sign messages when original message signed (PGP or S/MIME) + + Automatically enable PGP or S/MIME signatures when replying + to a message which is also PGP or S/MIME signed. + + + + /schemas/apps/evolution/mail/composer/reply_start_bottom /apps/evolution/mail/composer/reply_start_bottom diff --git a/mail/mail-config.ui b/mail/mail-config.ui index ca356814d2..0c4696b3bd 100644 --- a/mail/mail-config.ui +++ b/mail/mail-config.ui @@ -594,7 +594,7 @@ for display purposes only. True False - 6 + 7 2 6 6 @@ -696,6 +696,23 @@ for display purposes only. + + + Digitally _sign messages when original message signed (PGP or S/MIME) + True + True + False + False + True + True + + + 2 + 6 + 7 + + + True diff --git a/modules/mail/e-mail-shell-settings.c b/modules/mail/e-mail-shell-settings.c index b0d5f1eed8..6b0cee6826 100644 --- a/modules/mail/e-mail-shell-settings.c +++ b/modules/mail/e-mail-shell-settings.c @@ -277,6 +277,10 @@ e_mail_shell_settings_init (EShellBackend *shell_backend) "composer-group-reply-to-list", "/apps/evolution/mail/composer/group_reply_to_list"); + e_shell_settings_install_property_for_key ( + "composer-sign-reply-if-signed", + "/apps/evolution/mail/composer/sign_reply_if_signed"); + e_shell_settings_install_property_for_key ( "composer-prompt-only-bcc", "/apps/evolution/mail/prompts/only_bcc"); diff --git a/modules/mail/em-composer-prefs.c b/modules/mail/em-composer-prefs.c index 8453b88540..4f4c0d15ac 100644 --- a/modules/mail/em-composer-prefs.c +++ b/modules/mail/em-composer-prefs.c @@ -456,6 +456,13 @@ em_composer_prefs_construct (EMComposerPrefs *prefs, G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE); + widget = e_builder_get_widget (prefs->builder, "chkSignReplyIfSigned"); + g_object_bind_property ( + shell_settings, "composer-sign-reply-if-signed", + widget, "active", + G_BINDING_BIDIRECTIONAL | + G_BINDING_SYNC_CREATE); + widget = e_builder_get_widget (prefs->builder, "chkTopSignature"); g_object_bind_property ( shell_settings, "composer-top-signature", -- cgit v1.2.3