[evolution/wip/webkit-composer: 479/966] Bug #708731 - [webkit-composer] Cannot set signature to none on re-edit



commit 425231563937768a7b28a1948a448c9164142781
Author: Tomas Popela <tpopela redhat com>
Date:   Thu Jan 23 14:44:51 2014 +0100

    Bug #708731 - [webkit-composer] Cannot set signature to none on re-edit

 composer/e-composer-private.c |    7 +++++--
 composer/e-composer-private.h |    1 +
 composer/e-msg-composer.c     |    1 +
 3 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c
index 8ce6562..df18088 100644
--- a/composer/e-composer-private.c
+++ b/composer/e-composer-private.c
@@ -143,6 +143,7 @@ e_composer_private_constructed (EMsgComposer *composer)
 
        priv->is_from_message = FALSE;
        priv->is_from_new_message = FALSE;
+       priv->set_signature_from_message = FALSE;
 
        e_composer_actions_init (composer);
 
@@ -1087,11 +1088,13 @@ insert:
                id = webkit_dom_element_get_id (WEBKIT_DOM_ELEMENT (node));
 
                /* When we are editing a message with signature we need to set active
-                * signature id in signature combo box otherwise no signature will be added */
-               if (composer->priv->is_from_message) {
+                * signature id in signature combo box otherwise no signature will be
+                * added but we have to do it just once when the composer opens */
+               if (composer->priv->is_from_message && composer->priv->set_signature_from_message) {
                        gchar *name = webkit_dom_element_get_attribute (WEBKIT_DOM_ELEMENT (node), "name");
                        gtk_combo_box_set_active_id (GTK_COMBO_BOX (combo_box), name);
                        g_free (name);
+                       composer->priv->set_signature_from_message = FALSE;
                }
 
                if (id && (strlen (id) == 1) && (*id == '1')) {
diff --git a/composer/e-composer-private.h b/composer/e-composer-private.h
index 86343a8..e9b40c2 100644
--- a/composer/e-composer-private.h
+++ b/composer/e-composer-private.h
@@ -98,6 +98,7 @@ struct _EMsgComposerPrivate {
 
        gboolean is_from_message;
        gboolean is_from_new_message;
+       gboolean set_signature_from_message;
 };
 
 void           e_composer_private_constructed  (EMsgComposer *composer);
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 98db59f..63a02e3 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3492,6 +3492,7 @@ e_msg_composer_new_with_message (EShell *shell,
        }
 
        priv->is_from_message = TRUE;
+       priv->set_signature_from_message = TRUE;
 
        /* We wait until now to set the body text because we need to
         * ensure that the attachment bar has all the attachments before


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]