From 26cc119630a45ea1cbe64420821b895caa508e35 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Fri, 24 Feb 2006 22:09:47 +0000 Subject: [PATCH] Don't allow placeholder be selected for importing transactions. Fixes bug#327891. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13381 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 4 ++++ src/import-export/import-account-matcher.c | 10 ++++++++++ 2 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index 67c3d0f0d6..c1b45f95d8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2006-02-24 Christian Stimming + * src/import-export/import-account-matcher.c: Don't allow + placeholder be selected for importing transactions. Fixes + bug#327891. + * src/import-export/mt940/gnc-mt940-import.c: Get MT940 importer compile again (experimental; requires aqbanking-1.9.7). It is not yet tested with actual files. Bug#325170. diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c index 9b51cdbc94..ed17885907 100644 --- a/src/import-export/import-account-matcher.c +++ b/src/import-export/import-account-matcher.c @@ -202,6 +202,16 @@ Account * gnc_import_select_account(const gchar * account_online_id_value, case GTK_RESPONSE_OK: retval = gnc_tree_view_account_get_selected_account(picker->account_tree); DEBUG("Selected account %p, %s", retval, xaccAccountGetName(retval)); + + /* See if the selected account is a placeholder. */ + if (xaccAccountGetPlaceholder (retval)) { + gnc_error_dialog (/* FIXME: add parent*/ NULL, + _("The account %s does not allow transactions."), + xaccAccountGetName (retval)); + response = GNC_RESPONSE_NEW; + break; + } + if( account_online_id_value != NULL) { gnc_import_set_acc_online_id(retval, account_online_id_value);