From a564daf71ca43349e8e2efcded6d1759b8e145e4 Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Fri, 29 Nov 2002 17:41:22 +0000 Subject: [PATCH] 2002-11-29 Christian Stimming * src/import-export/hbci/gnc-hbci-utils.c, gnc-hbci-*.c: Catch the condition gracefully when OpenHBCI config file does not exist. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7569 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 5 +++++ src/import-export/hbci/gnc-hbci-getbalance.c | 2 +- src/import-export/hbci/gnc-hbci-gettrans.c | 2 +- src/import-export/hbci/gnc-hbci-transfer.c | 2 +- src/import-export/hbci/gnc-hbci-utils.c | 11 ++++++++++- 5 files changed, 18 insertions(+), 4 deletions(-) diff --git a/ChangeLog b/ChangeLog index b461d994f7..e2ef1cb4c8 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2002-11-29 Christian Stimming + + * src/import-export/hbci/gnc-hbci-utils.c, gnc-hbci-*.c: Catch the + condition gracefully when OpenHBCI config file does not exist. + 2002-11-29 Derek Atkins * src/gnome-utils/dialog-exchange.h -- header for the exchange-rate dialog diff --git a/src/import-export/hbci/gnc-hbci-getbalance.c b/src/import-export/hbci/gnc-hbci-getbalance.c index 3a1b58f474..424d313faa 100644 --- a/src/import-export/hbci/gnc-hbci-getbalance.c +++ b/src/import-export/hbci/gnc-hbci-getbalance.c @@ -48,11 +48,11 @@ gnc_hbci_getbalance (GtkWidget *parent, Account *gnc_acc) return; api = gnc_hbci_api_new_currentbook (parent, &interactor); - g_assert (interactor); if (api == NULL) { printf("gnc_hbci_getbalance: Couldn't get HBCI API.\n"); return; } + g_assert (interactor); h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc); if (h_acc == NULL) { diff --git a/src/import-export/hbci/gnc-hbci-gettrans.c b/src/import-export/hbci/gnc-hbci-gettrans.c index e44ff3c1f2..3d4f197084 100644 --- a/src/import-export/hbci/gnc-hbci-gettrans.c +++ b/src/import-export/hbci/gnc-hbci-gettrans.c @@ -63,11 +63,11 @@ gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc) g_assert(gnc_acc); api = gnc_hbci_api_new_currentbook (parent, &interactor); - g_assert (interactor); if (api == NULL) { printf("gnc_hbci_gettrans: Couldn't get HBCI API.\n"); return; } + g_assert (interactor); h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc); if (h_acc == NULL) { diff --git a/src/import-export/hbci/gnc-hbci-transfer.c b/src/import-export/hbci/gnc-hbci-transfer.c index 1d75a4b7e6..eb6434bedf 100644 --- a/src/import-export/hbci/gnc-hbci-transfer.c +++ b/src/import-export/hbci/gnc-hbci-transfer.c @@ -50,11 +50,11 @@ gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc, g_assert(gnc_acc); api = gnc_hbci_api_new_currentbook (parent, &interactor); - g_assert (interactor); if (api == NULL) { printf("gnc_hbci_maketrans: Couldn't get HBCI API. Nothing will happen.\n"); return; } + g_assert (interactor); h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc); if (h_acc == NULL) { diff --git a/src/import-export/hbci/gnc-hbci-utils.c b/src/import-export/hbci/gnc-hbci-utils.c index 6360828ec8..9879f1361d 100644 --- a/src/import-export/hbci/gnc-hbci-utils.c +++ b/src/import-export/hbci/gnc-hbci-utils.c @@ -43,8 +43,17 @@ gnc_hbci_api_new (const char *filename, gboolean allowNewFile, if (!filename) return NULL; if (!allowNewFile && - (!g_file_test (filename, G_FILE_TEST_ISFILE | G_FILE_TEST_ISLINK))) + (!g_file_test (filename, G_FILE_TEST_ISFILE | G_FILE_TEST_ISLINK))) { + gnc_warning_dialog_parented + (parent, + /* Translators: Strings from this file are really only needed + * inside Germany (HBCI is not supported anywhere else). You + * may safely ignore strings from the import-export/hbci + * subdirectory in other countries. */ + _("Error while loading OpenHBCI config file:\n %s: No such file or directory.\n"), filename); return NULL; + } + api = HBCI_API_new (FALSE, TRUE);