Don't manage account list focus state when closing an account edit window,
authorwwp <wwp@free.fr>
Fri, 4 May 2018 07:04:04 +0000 (09:04 +0200)
committerwwp <wwp@free.fr>
Fri, 4 May 2018 07:04:04 +0000 (09:04 +0200)
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.

src/account.c
src/account.h
src/mainwindow.c

index be5967f..527b16d 100644 (file)
@@ -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();
        }               
 }
index e7c7760..4462f66 100644 (file)
@@ -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);
 
index 42de186..4f56588 100644 (file)
@@ -5073,7 +5073,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);
        }
 }