[geary/bug/728002-webkit2: 90/140] Ensure draft is saved when envelope (from, to, etc) changes. Bug 726290.



commit f8957c4d7a5f43aad384102d3f90766149153ea7
Author: Michael James Gratton <mike vee net>
Date:   Mon Jan 16 15:40:29 2017 +1100

    Ensure draft is saved when envelope (from, to, etc) changes. Bug 726290.
    
    * src/client/composer/composer-widget.vala (ComposerWidget): Rename
      subject changed handler to something more generic, hook that up to the
      to/cc/bcc & reply_to entries.
    
    * ui/composer-widget.ui: Hook up multiple to on_envelope_changed, make
      subject entry use that as well.

 src/client/composer/composer-widget.vala |    6 +++++-
 ui/composer-widget.ui                    |    3 ++-
 2 files changed, 7 insertions(+), 2 deletions(-)
---
diff --git a/src/client/composer/composer-widget.vala b/src/client/composer/composer-widget.vala
index c880d45..da57498 100644
--- a/src/client/composer/composer-widget.vala
+++ b/src/client/composer/composer-widget.vala
@@ -408,12 +408,16 @@ public class ComposerWidget : Gtk.EventBox {
         bind_property("can-delete-quote", this, "toolbar-text", BindingFlags.SYNC_CREATE,
             set_toolbar_text);
         this.to_entry = new EmailEntry(this);
+        this.to_entry.changed.connect(on_envelope_changed);
         this.to_box.add(to_entry);
         this.cc_entry = new EmailEntry(this);
+        this.cc_entry.changed.connect(on_envelope_changed);
         this.cc_box.add(cc_entry);
         this.bcc_entry = new EmailEntry(this);
+        this.bcc_entry.changed.connect(on_envelope_changed);
         this.bcc_box.add(bcc_entry);
         this.reply_to_entry = new EmailEntry(this);
+        this.reply_to_entry.changed.connect(on_envelope_changed);
         this.reply_to_box.add(reply_to_entry);
 
         this.to_label.set_mnemonic_widget(this.to_entry);
@@ -1618,7 +1622,7 @@ public class ComposerWidget : Gtk.EventBox {
     }
 
     [GtkCallback]
-    private void on_subject_changed() {
+    private void on_envelope_changed() {
         draft_changed();
     }
 
diff --git a/ui/composer-widget.ui b/ui/composer-widget.ui
index df1bdba..1a0cbd7 100644
--- a/ui/composer-widget.ui
+++ b/ui/composer-widget.ui
@@ -113,7 +113,7 @@
                         <property name="margin_top">6</property>
                         <property name="hexpand">True</property>
                         <property name="invisible_char">•</property>
-                        <signal name="changed" handler="on_subject_changed" swapped="no"/>
+                        <signal name="changed" handler="on_envelope_changed" swapped="no"/>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
@@ -238,6 +238,7 @@
                           <object class="GtkComboBoxText" id="from_multiple">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <signal name="changed" handler="on_envelope_changed" swapped="no"/>
                           </object>
                           <packing>
                             <property name="expand">False</property>


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