From d64941008cbddea7380ab5aae043e2c0fe6df259 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20K=C3=B6hler?= Date: Sun, 30 Dec 2007 19:59:06 +0000 Subject: [PATCH] Do not set active element of GncAccountSel to the first sometimes. In gas_populate_list, the currently selected account is searched in the new data, falling back to the first element in the list and selecting it afterwards. So, often "Assets" is activated, whereas the filtering happening later does not deselect it in any way (the user may have typed it in). This patch simply removes the fallback to element 1. To make the gas look better, it may help to set it initially, like to an entry that was used recently. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16773 57a11ea4-9604-0410-9ed3-97b8803252fd --- src/gnome-utils/gnc-account-sel.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gnome-utils/gnc-account-sel.c b/src/gnome-utils/gnc-account-sel.c index 6eb41d8092..8762ebc4ee 100644 --- a/src/gnome-utils/gnc-account-sel.c +++ b/src/gnome-utils/gnc-account-sel.c @@ -183,7 +183,7 @@ gas_populate_list( GNCAccountSel *gas ) Account *acc; GtkTreeIter iter; GtkEntry *entry; - gint i, active = 0; + gint i, active = -1; GList *accts, *ptr, *filteredAccts; gchar *currentSel, *name; @@ -218,7 +218,8 @@ gas_populate_list( GNCAccountSel *gas ) /* If the account which was in the text box before still exists, then * reset to it. */ - gtk_combo_box_set_active(GTK_COMBO_BOX(gas->combo), active); + if (active != -1) + gtk_combo_box_set_active(GTK_COMBO_BOX(gas->combo), active); g_list_free( filteredAccts ); if ( currentSel ) {