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



commit 049f9073d6e5414bc4edf25ac8a3003d0b74fc1b
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 aad1a31..525ab44 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);
 
@@ -1089,11 +1090,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 34f0edf..9921443 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 6cbdc52..5fa0969 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -3490,6 +3490,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]