From 051a2bf798525cc689c3b7dd115ff66b9b900c1b Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sun, 27 Oct 2002 22:11:35 +0000 Subject: [PATCH] 2002-10-27 Christian Stimming * src/import-export/hbci/*.c: add #include config.h for correct i18n. * src/app-utils/prefs.scm, src/import-export/hbci/hbci.scm: Move preference creation into hbci module. Renamed that preference tab into "Online Banking & Importing". git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7406 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 7 +++ src/app-utils/prefs.scm | 8 +--- src/import-export/hbci/gnc-hbci-gettrans.c | 1 + src/import-export/hbci/gnc-hbci-transfer.c | 1 + src/import-export/hbci/gnc-hbci-utils.c | 1 + src/import-export/hbci/gncmod-hbci.c | 2 +- src/import-export/hbci/hbci-interaction.c | 47 ++++++++----------- src/import-export/hbci/hbci-progressmon.c | 1 + src/import-export/hbci/hbci.scm | 19 +++----- .../qif-import/druid-qif-import.c | 2 +- 10 files changed, 41 insertions(+), 48 deletions(-) diff --git a/ChangeLog b/ChangeLog index 214bcea575..68423ad969 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,12 @@ 2002-10-27 Christian Stimming + * src/import-export/hbci/*.c: add #include config.h for correct + i18n. + + * src/app-utils/prefs.scm, src/import-export/hbci/hbci.scm: Move + preference creation into hbci module. Renamed that preference tab + into "Online Banking & Importing". + * src/import-export/hbci/*: Add Direct Debit HBCI action. More work on error handling and user feedback. Make the caching of the PIN a user preference. diff --git a/src/app-utils/prefs.scm b/src/app-utils/prefs.scm index a0dc733545..73568a02a1 100644 --- a/src/app-utils/prefs.scm +++ b/src/app-utils/prefs.scm @@ -521,16 +521,10 @@ without one.") (gnc:register-configuration-option (gnc:make-simple-boolean-option - (N_ "Importing/Online") (N_ "QIF Verbose documentation") + (N_ "Online Banking & Importing") (N_ "QIF Verbose documentation") "a" (N_ "Show some documentation-only pages in QIF Import druid") #t)) -(gnc:register-configuration-option - (gnc:make-simple-boolean-option - (N_ "Importing/Online") (N_ "HBCI Remember PIN in memory") - "b" (N_ "Remember the PIN for HBCI in memory during a session") - #f)) - ;; Network/security options (gnc:register-configuration-option diff --git a/src/import-export/hbci/gnc-hbci-gettrans.c b/src/import-export/hbci/gnc-hbci-gettrans.c index b847296cc2..e47704e03c 100644 --- a/src/import-export/hbci/gnc-hbci-gettrans.c +++ b/src/import-export/hbci/gnc-hbci-gettrans.c @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ +#include "config.h" #include "gnc-hbci-gettrans.h" #include diff --git a/src/import-export/hbci/gnc-hbci-transfer.c b/src/import-export/hbci/gnc-hbci-transfer.c index b674f4098e..b219f375b6 100644 --- a/src/import-export/hbci/gnc-hbci-transfer.c +++ b/src/import-export/hbci/gnc-hbci-transfer.c @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ +#include "config.h" #include "gnc-hbci-transfer.h" #include diff --git a/src/import-export/hbci/gnc-hbci-utils.c b/src/import-export/hbci/gnc-hbci-utils.c index 2c7d1d33cd..d2d4e6c9b0 100644 --- a/src/import-export/hbci/gnc-hbci-utils.c +++ b/src/import-export/hbci/gnc-hbci-utils.c @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA gnu@gnu.org * \********************************************************************/ +#include "config.h" #include "gnc-hbci-utils.h" #include diff --git a/src/import-export/hbci/gncmod-hbci.c b/src/import-export/hbci/gncmod-hbci.c index a6cb9e576d..909231be62 100644 --- a/src/import-export/hbci/gncmod-hbci.c +++ b/src/import-export/hbci/gncmod-hbci.c @@ -5,6 +5,7 @@ * Copyright (c) 2002 Christian *********************************************************************/ +#include "config.h" #include #include #include @@ -15,7 +16,6 @@ #include "gnc-hbci-cb.h" #include "druid-hbci-initial.h" -//#include "druid-hbci-final.h" /* version of the gnc module system interface we require */ int libgncmod_hbci_LTX_gnc_module_system_interface = 0; diff --git a/src/import-export/hbci/hbci-interaction.c b/src/import-export/hbci/hbci-interaction.c index 9e1dabaeb2..3f9bcdbf0d 100644 --- a/src/import-export/hbci/hbci-interaction.c +++ b/src/import-export/hbci/hbci-interaction.c @@ -20,6 +20,8 @@ * * ***************************************************************************/ +#include "config.h" + #include #include #include @@ -36,6 +38,8 @@ #include "dialog-pass.h" +#define PREF_TAB_ONLINE_BANKING "Online Banking & Importing" + /** Adds the interactor and progressmonitor classes to the api. */ GNCInteractor *gnc_hbci_api_interactors (HBCI_API *api, GtkWidget *parent) @@ -46,12 +50,10 @@ GNCInteractor *gnc_hbci_api_interactors (HBCI_API *api, GtkWidget *parent) data->parent = parent; data->keepAlive = TRUE; data->cache_pin = - gnc_lookup_boolean_option("Importing/Online", + gnc_lookup_boolean_option(PREF_TAB_ONLINE_BANKING, "HBCI Remember PIN in memory", FALSE); - /* setlocale (LC_ALL, ""); */ - // set HBCI_Interactor HBCI_Hbci_setInteractor(HBCI_API_Hbci(api), gnc_hbci_new_interactor(data), TRUE); @@ -69,7 +71,7 @@ gboolean GNCInteractor_aborted(const GNCInteractor *i) void GNCInteractor_show(GNCInteractor *i) { gboolean cache_pin = - gnc_lookup_boolean_option("Importing/Online", + gnc_lookup_boolean_option(PREF_TAB_ONLINE_BANKING, "HBCI Remember PIN in memory", FALSE); g_assert(i); @@ -137,10 +139,9 @@ static int msgInputPin(const HBCI_User *user, bank = HBCI_User_bank (user); if (bank != NULL) { /* xgettext:c-format */ - const char *format = _("Please enter and confirm new PIN for \n" - "user '%s' at bank '%s',\n" - "with at least %d characters."); - msgstr = g_strdup_printf (format, + msgstr = g_strdup_printf (_("Please enter and confirm new PIN for \n" + "user '%s' at bank '%s',\n" + "with at least %d characters."), username, HBCI_Bank_bankCode(bank), minsize); @@ -174,15 +175,16 @@ static int msgInputPin(const HBCI_User *user, if (user != NULL) { bank = HBCI_User_bank (user); if (bank != NULL) { - msgstr = g_strdup_printf ( data->format_pin_user_bank, - username, - HBCI_Bank_bankCode(bank)); + /* xgettext:c-format */ + msgstr = g_strdup_printf (_("Please enter PIN for \n" + "user '%s' at bank '%s'."), + username, + HBCI_Bank_bankCode(bank)); } else { /* xgettext:c-format */ - const char *format = _("Please enter PIN for \n" - "user '%s' at unknown bank."); - msgstr = g_strdup_printf ( format, + msgstr = g_strdup_printf ( _("Please enter PIN for \n" + "user '%s' at unknown bank."), username); } } @@ -203,7 +205,10 @@ static int msgInputPin(const HBCI_User *user, if (strlen(passwd) < minsize) { gboolean retval; - char *msg = g_strdup_printf (data->format_pin_min_char, minsize); + char *msg = + g_strdup_printf ( _("The PIN needs to be at least %d characters \n" + "long. Do you want to try again?"), + minsize); retval = gnc_verify_dialog_parented (GTK_WIDGET (data->parent), TRUE, msg); @@ -360,17 +365,5 @@ gnc_hbci_new_interactor(GNCInteractor *data) &keepAlive, data); - /* setlocale (LC_ALL, ""); */ - - /* xgettext:c-format */ - data->format_pin_user_bank = _("Please enter PIN for \n" - "user '%s' at bank '%s'."); - /* xgettext:c-format */ - data->format_pin_min_char = _("The PIN needs to be at least %d characters \n" - "long. Do you want to try again?"); - return HBCI_InteractorCB_Interactor(inter); } - - - diff --git a/src/import-export/hbci/hbci-progressmon.c b/src/import-export/hbci/hbci-progressmon.c index f5c215cb77..8f3e79f212 100644 --- a/src/import-export/hbci/hbci-progressmon.c +++ b/src/import-export/hbci/hbci-progressmon.c @@ -20,6 +20,7 @@ * * ***************************************************************************/ +#include "config.h" #include #include #include "hbci-interaction.h" diff --git a/src/import-export/hbci/hbci.scm b/src/import-export/hbci/hbci.scm index 2838e12316..da55861e92 100644 --- a/src/import-export/hbci/hbci.scm +++ b/src/import-export/hbci/hbci.scm @@ -16,6 +16,7 @@ (lambda () (gnc:hbci-initial-setup)))) + ; (gnc:add-extension ; (gnc:make-menu "Online" (list gnc:window-name-register "Actions" ""))) @@ -25,19 +26,13 @@ ; (list gnc:window-name-register "Actions" "Online" "") ; (lambda () ; (gnc:hbci-initial-setup)))) -; (gnc:add-extension -; (gnc:make-menu-item (N_ "Get Transactions") -; (N_ "Get Transactions") -; (list gnc:window-name-register "Actions" "Online" "") -; (lambda () -; (gnc:hbci-initial-setup)))) ) -; (gnc:add-extension -; (gnc:make-menu-item (N_ "Final HBCI Setup") -; (N_ "Finish the HBCI Setup") -; (list gnc:window-name-main "Tools" "HBCI" "") -; (lambda () -; (gnc:hbci-finish-setup))))) (gnc:hook-add-dangler gnc:*ui-startup-hook* add-hbci-menu-items) +;; Register Preferences +(gnc:register-configuration-option + (gnc:make-simple-boolean-option + (N_ "Online Banking & Importing") (N_ "HBCI Remember PIN in memory") + "b" (N_ "Remember the PIN for HBCI in memory during a session") + #f)) diff --git a/src/import-export/qif-import/druid-qif-import.c b/src/import-export/qif-import/druid-qif-import.c index 0bb0da3a12..328c116304 100644 --- a/src/import-export/qif-import/druid-qif-import.c +++ b/src/import-export/qif-import/druid-qif-import.c @@ -1887,7 +1887,7 @@ gnc_ui_qif_import_druid_make(void) { retval->commodity_pages = NULL; retval->show_doc_pages = - gnc_lookup_boolean_option("Importing/Online", + gnc_lookup_boolean_option("Online Banking & Importing", "QIF Verbose documentation", TRUE);