[geary/geary-0.13] Merge branch 'issue-226' into 'master'



commit 13d1fd99a1e7c49c20b21dac80db859d745465cd
Author: Michael Gratton <mike vee net>
Date:   Wed Feb 20 23:28:15 2019 +0000

    Merge branch 'issue-226' into 'master'
    
    Fix problems editing sender names in account editor
    
    Closes #226
    
    See merge request GNOME/geary!123
    
    (cherry picked from commit 22ed4a5fd03cebcc064293b1e4b7c5959b738250)
    
    cb6611ea Fix "Sender name" couldn't be changed without editing the address
    843c31db Fix UpdateMailboxCommand to work correctly when there is only a single mailbox

 src/client/accounts/accounts-editor-edit-pane.vala | 8 +++-----
 src/engine/api/geary-account-information.vala      | 7 +++++++
 2 files changed, 10 insertions(+), 5 deletions(-)
---
diff --git a/src/client/accounts/accounts-editor-edit-pane.vala 
b/src/client/accounts/accounts-editor-edit-pane.vala
index 7136e52a..3576a53d 100644
--- a/src/client/accounts/accounts-editor-edit-pane.vala
+++ b/src/client/accounts/accounts-editor-edit-pane.vala
@@ -532,7 +532,7 @@ internal class Accounts.MailboxEditorPopover : EditorPopover {
     }
 
     private void on_activate() {
-        if (this.address != "" && this.address_validator.is_valid) {
+        if (this.address_validator.state == Components.Validator.Validity.INDETERMINATE || 
this.address_validator.is_valid) {
             activated();
         }
     }
@@ -605,15 +605,13 @@ internal class Accounts.UpdateMailboxCommand : Application.Command {
 
     public async override void execute(GLib.Cancellable? cancellable) {
         this.row.mailbox = this.new_mailbox;
-        this.row.account.remove_sender(this.old_mailbox);
-        this.row.account.insert_sender(this.mailbox_index, this.new_mailbox);
+        this.row.account.replace_sender(this.mailbox_index, this.new_mailbox);
         this.row.account.changed();
     }
 
     public async override void undo(GLib.Cancellable? cancellable) {
         this.row.mailbox = this.old_mailbox;
-        this.row.account.remove_sender(this.new_mailbox);
-        this.row.account.insert_sender(this.mailbox_index, this.old_mailbox);
+        this.row.account.replace_sender(this.mailbox_index, this.old_mailbox);
         this.row.account.changed();
     }
 
diff --git a/src/engine/api/geary-account-information.vala b/src/engine/api/geary-account-information.vala
index a3e68016..4efeab59 100644
--- a/src/engine/api/geary-account-information.vala
+++ b/src/engine/api/geary-account-information.vala
@@ -356,6 +356,13 @@ public class Geary.AccountInformation : BaseObject {
     }
 
     /**
+     * Replace a mailbox at the specified index.
+     */
+    public void replace_sender(int index, Geary.RFC822.MailboxAddress mailbox) {
+        this.mailboxes.set(index, mailbox);
+    }
+
+     /**
      * Returns the configured path for a special folder type.
      *
      * This is used when Geary has found or created a special folder


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