commit 46661cf493424841e4c38688beab2a8791c748cc
parent 87bce1bef54f09d67ebf77e45b5c7bc06cf66aa1
Author: wwp <wwp@free.fr>
Date: Fri, 4 May 2018 09:04:04 +0200
Don't manage account list focus state when closing an account edit window,
when this window has been called from main window's "Preferences for
current account" menu item.
Closes bug #4022: Closing "Account Preferences" window opens "Edit Accounts"
window if "Edit Accounts" window has been opened before at least once.
Diffstat:
3 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/src/account.c b/src/account.c
@@ -450,7 +450,7 @@ void account_add(void)
}
}
-void account_open(PrefsAccount *ac_prefs)
+void account_open(PrefsAccount *ac_prefs, gboolean called_from_acc_list)
{
gboolean prev_default;
gchar *ac_name, *old_prefix, *new_prefix;
@@ -471,7 +471,8 @@ void account_open(PrefsAccount *ac_prefs)
prefs_account_open(ac_prefs, &account_dirty);
- account_edit_focus();
+ if (called_from_acc_list)
+ account_edit_focus();
if (account_dirty) {
if (!prev_default && ac_prefs->is_default)
@@ -862,7 +863,7 @@ static void account_edit_prefs(GtkWidget *widget, gpointer data)
ac_prefs = account_list_view_get_selected_account(edit_account.list_view);
if (ac_prefs) {
- account_open(ac_prefs);
+ account_open(ac_prefs, TRUE);
account_list_view_set();
}
}
diff --git a/src/account.h b/src/account.h
@@ -60,7 +60,7 @@ GList *account_get_list (void);
void account_edit_open (gpointer a, gpointer b);
void account_add (void);
-void account_open (PrefsAccount *ac_prefs);
+void account_open (PrefsAccount *ac_prefs, gboolean called_from_acc_list);
void account_set_as_recv_at_get_all (PrefsAccount *ac_prefs);
PrefsAccount *account_get_default (void);
diff --git a/src/mainwindow.c b/src/mainwindow.c
@@ -5075,7 +5075,7 @@ static void prefs_account_open_cb(GtkAction *action, gpointer data)
if (!cur_account) {
new_account_cb(NULL, mainwin);
} else {
- account_open(cur_account);
+ account_open(cur_account, FALSE);
}
}