[evolution/wip/webkit2] Bug 759151 - Always preserve sign/encrypt settings in composer ][
- From: Milan Crha <mcrha src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution/wip/webkit2] Bug 759151 - Always preserve sign/encrypt settings in composer ][
- Date: Thu, 3 Mar 2016 13:44:54 +0000 (UTC)
commit 074a607b2c9294122bd55e9247c5a9a5bb2759c3
Author: Milan Crha <mcrha redhat com>
Date: Mon Jan 25 17:22:15 2016 +0100
Bug 759151 - Always preserve sign/encrypt settings in composer ][
composer/e-msg-composer.c | 14 ++++++++++----
1 files changed, 10 insertions(+), 4 deletions(-)
---
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 37ee344..d2b7ee9 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1636,6 +1636,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;
@@ -1669,23 +1670,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);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]