Commit 13d1fd99 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

(cherry picked from commit 22ed4a5f)

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
parent d6ddc21a
Pipeline #61169 failed with stages
in 45 minutes and 30 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