Fix editing additional email addresses from account prefs. Bug 778364.
* src/client/accounts/account-dialog-add-edit-pane.vala (AccountDialogAddEditPane): Pass an account id to edit_alternate_emails signal, not an email addess. * src/client/accounts/account-dialog.vala (AccountDialog::get_account_info_for_email): Rename method to "get_account_info" and param since it actually accepts an account id. Update call sites. * src/client/accounts/add-edit-page.vala (AddEditPage::id): Make RO access public, so the AddEditPane can access it.
This commit is contained in:
parent
c1fb400e24
commit
4e27949d87
3 changed files with 15 additions and 15 deletions
|
|
@ -17,7 +17,7 @@ public class AccountDialogAddEditPane : AccountDialogPane {
|
|||
|
||||
public signal void size_changed();
|
||||
|
||||
public signal void edit_alternate_emails(string email_address);
|
||||
public signal void edit_alternate_emails(string id);
|
||||
|
||||
public AccountDialogAddEditPane(Gtk.Stack stack) {
|
||||
base(stack);
|
||||
|
|
@ -38,7 +38,7 @@ public class AccountDialogAddEditPane : AccountDialogPane {
|
|||
cancel_button.clicked.connect(() => { cancel(); });
|
||||
|
||||
add_edit_page.size_changed.connect(() => { size_changed(); });
|
||||
add_edit_page.edit_alternate_emails.connect(() => { edit_alternate_emails(add_edit_page.email_address); });
|
||||
add_edit_page.edit_alternate_emails.connect(() => { edit_alternate_emails(add_edit_page.id); });
|
||||
|
||||
pack_start(add_edit_page);
|
||||
pack_start(button_box, false, false);
|
||||
|
|
|
|||
|
|
@ -66,7 +66,7 @@ public class AccountDialog : Gtk.Dialog {
|
|||
|
||||
// Grab the account info. While the addresses passed into this method should *always* be
|
||||
// available in Geary, we double-check to be defensive.
|
||||
private Geary.AccountInformation? get_account_info_for_email(string email_address) {
|
||||
private Geary.AccountInformation? get_account_info(string id) {
|
||||
Gee.Map<string, Geary.AccountInformation> accounts;
|
||||
try {
|
||||
accounts = Geary.Engine.instance.get_accounts();
|
||||
|
|
@ -76,21 +76,21 @@ public class AccountDialog : Gtk.Dialog {
|
|||
return null;
|
||||
}
|
||||
|
||||
if (!accounts.has_key(email_address)) {
|
||||
debug("Unable to get account info for: %s", email_address);
|
||||
if (!accounts.has_key(id)) {
|
||||
debug("No such account: %s", id);
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
return accounts.get(email_address);
|
||||
return accounts.get(id);
|
||||
}
|
||||
|
||||
private void on_edit_account(string email_address) {
|
||||
on_edit_account_async.begin(email_address);
|
||||
private void on_edit_account(string id) {
|
||||
on_edit_account_async.begin(id);
|
||||
}
|
||||
|
||||
private async void on_edit_account_async(string email_address) {
|
||||
Geary.AccountInformation? account = get_account_info_for_email(email_address);
|
||||
private async void on_edit_account_async(string id) {
|
||||
Geary.AccountInformation? account = get_account_info(id);
|
||||
if (account == null)
|
||||
return;
|
||||
|
||||
|
|
@ -105,8 +105,8 @@ public class AccountDialog : Gtk.Dialog {
|
|||
add_edit_pane.present();
|
||||
}
|
||||
|
||||
private void on_delete_account(string email_address) {
|
||||
Geary.AccountInformation? account = get_account_info_for_email(email_address);
|
||||
private void on_delete_account(string id) {
|
||||
Geary.AccountInformation? account = get_account_info(id);
|
||||
if (account == null)
|
||||
return;
|
||||
|
||||
|
|
@ -136,8 +136,8 @@ public class AccountDialog : Gtk.Dialog {
|
|||
}
|
||||
}
|
||||
|
||||
private void on_edit_alternate_emails(string email_address) {
|
||||
Geary.AccountInformation? account_info = get_account_info_for_email(email_address);
|
||||
private void on_edit_alternate_emails(string id) {
|
||||
Geary.AccountInformation? account_info = get_account_info(id);
|
||||
if (account_info == null)
|
||||
return;
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ public class AddEditPage : Gtk.Box {
|
|||
EDIT
|
||||
}
|
||||
|
||||
private string? id = null;
|
||||
public string? id { get; private set; default = null; }
|
||||
|
||||
public string real_name {
|
||||
get { return entry_real_name.text; }
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue