diff --git a/gnucash/gnome-utils/gnc-account-sel.c b/gnucash/gnome-utils/gnc-account-sel.c index f3a2916428..cd69f2c62f 100644 --- a/gnucash/gnome-utils/gnc-account-sel.c +++ b/gnucash/gnome-utils/gnc-account-sel.c @@ -139,6 +139,11 @@ gnc_account_sel_class_init (GNCAccountSelClass *klass) static void combo_changed_cb(GNCAccountSel *gas, gpointer combo) { + gint selected = gtk_combo_box_get_active (GTK_COMBO_BOX (combo)); + if (selected == gas->currentSelection) + return; + + gas->currentSelection = selected; g_signal_emit_by_name(gas, "account_sel_changed"); } @@ -152,6 +157,7 @@ gnc_account_sel_init (GNCAccountSel *gas) gas->initDone = FALSE; gas->acctTypeFilters = FALSE; gas->newAccountButton = NULL; + gas->currentSelection = -1; g_object_set(gas, "spacing", 2, (gchar*)NULL); diff --git a/gnucash/gnome-utils/gnc-account-sel.h b/gnucash/gnome-utils/gnc-account-sel.h index 49d837f57d..7cfe25124c 100644 --- a/gnucash/gnome-utils/gnc-account-sel.h +++ b/gnucash/gnome-utils/gnc-account-sel.h @@ -51,6 +51,7 @@ typedef struct /* The state of this pointer also serves as a flag about what state * the widget is in WRT the new-account-button ability. */ GtkWidget *newAccountButton; + gint currentSelection; #if 0 /* completion not implemented. */ GCompletion *completion; diff --git a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp index abdc54b94c..373c4633e8 100644 --- a/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp +++ b/gnucash/import-export/csv-imp/assistant-csv-trans-import.cpp @@ -1596,10 +1596,14 @@ void CsvImpTransAssist::preview_refresh_table () g_object_unref (combostore); /* Also reset the base account combo box as it's value may have changed due to column changes here */ - g_signal_handlers_block_by_func (acct_selector, (gpointer) csv_tximp_preview_acct_sel_cb, this); - gnc_account_sel_set_account(GNC_ACCOUNT_SEL(acct_selector), - tx_imp->base_account() , false); - g_signal_handlers_unblock_by_func (acct_selector, (gpointer) csv_tximp_preview_acct_sel_cb, this); + auto base_acct = gnc_account_sel_get_account(GNC_ACCOUNT_SEL(acct_selector)); + if (tx_imp->base_account() != base_acct) + { + g_signal_handlers_block_by_func (acct_selector, (gpointer) csv_tximp_preview_acct_sel_cb, this); + gnc_account_sel_set_account(GNC_ACCOUNT_SEL(acct_selector), + tx_imp->base_account() , false); + g_signal_handlers_unblock_by_func (acct_selector, (gpointer) csv_tximp_preview_acct_sel_cb, this); + } /* Make the things actually appear. */ gtk_widget_show_all (GTK_WIDGET(treeview));