Commit 22ed4a5f authored by Michael Gratton's avatar Michael Gratton 🤞

Merge branch 'issue-226' into 'master'

Fix problems editing sender names in account editor

Closes #226

See merge request !123
parents 6d7c1657 843c31db
Pipeline #61168 failed with stages
in 38 minutes and 56 seconds
......@@ -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();
}
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment