summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMilan Crha <mcrha@redhat.com>2016-01-25 17:22:15 +0100
committerMilan Crha <mcrha@redhat.com>2016-01-25 17:22:51 +0100
commit61a914801b02a0a7b1d8355e2568f5a4aee0b97e (patch)
tree8f8479bed54b5b9b3a7aaa9819da8f31511782ae
parentf7fc79de693c4bfd594709d14660d7f4bc1e466f (diff)
downloadevolution-61a914801b02a0a7b1d8355e2568f5a4aee0b97e.tar.gz
Bug 759151 - Always preserve sign/encrypt settings in composer ][
-rw-r--r--composer/e-msg-composer.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 0966df72bd..deb22859fb 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1606,6 +1606,7 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
gboolean pgp_encrypt;
gboolean smime_sign;
gboolean smime_encrypt;
+ gboolean composer_realized;
const gchar *extension_name;
const gchar *uid, *active_signature_id;
@@ -1639,23 +1640,28 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
composer->priv->mime_type,
"text/calendar", 13) != 0);
+ /* Preserve options only if the composer was realized, otherwise an account
+ change according to current folder or similar reasons can cause the options
+ to be set, when the default account has it set, but the other not. */
+ composer_realized = gtk_widget_get_realized (GTK_WIDGET (composer));
+
action = GTK_TOGGLE_ACTION (ACTION (PGP_SIGN));
- active = gtk_toggle_action_get_active (action);
+ active = composer_realized && gtk_toggle_action_get_active (action);
active |= (can_sign && pgp_sign);
gtk_toggle_action_set_active (action, active);
action = GTK_TOGGLE_ACTION (ACTION (PGP_ENCRYPT));
- active = gtk_toggle_action_get_active (action);
+ active = composer_realized && gtk_toggle_action_get_active (action);
active |= pgp_encrypt;
gtk_toggle_action_set_active (action, active);
action = GTK_TOGGLE_ACTION (ACTION (SMIME_SIGN));
- active = gtk_toggle_action_get_active (action);
+ active = composer_realized && gtk_toggle_action_get_active (action);
active |= (can_sign && smime_sign);
gtk_toggle_action_set_active (action, active);
action = GTK_TOGGLE_ACTION (ACTION (SMIME_ENCRYPT));
- active = gtk_toggle_action_get_active (action);
+ active = composer_realized && gtk_toggle_action_get_active (action);
active |= smime_encrypt;
gtk_toggle_action_set_active (action, active);