[Gnucash-changes] r12916 - gnucash/trunk/src/import-export/hbci -
String cleanup: remove unnecessary linefeeds. Remove old
unused code.
Christian Stimming
cstim at cvs.gnucash.org
Sat Jan 21 09:38:37 EST 2006
Author: cstim
Date: 2006-01-21 09:38:36 -0500 (Sat, 21 Jan 2006)
New Revision: 12916
Trac: http://svn.gnucash.org/trac/changeset/12916
Modified:
gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c
gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
gnucash/trunk/src/import-export/hbci/hbci-interaction.c
Log:
String cleanup: remove unnecessary linefeeds. Remove old unused code.
Modified: gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c 2006-01-21 14:19:25 UTC (rev 12915)
+++ gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c 2006-01-21 14:38:36 UTC (rev 12916)
@@ -535,11 +535,11 @@
(td->dialog,
TRUE,
"%s",
- _("The amount is zero or the amount field could not be \n"
- "interpreted correctly. You might have mixed up decimal \n"
- "point and comma, compared to your locale settings. \n"
+ _("The amount is zero or the amount field could not be "
+ "interpreted correctly. You might have mixed up decimal "
+ "point and comma, compared to your locale settings. "
+ "This does not result in a valid online transfer job. \n"
"\n"
- "This does not result in a valid online transfer job.\n"
"Do you want to enter the job again?"));
if (values_ok) {
AB_Transaction_free (td->hbci_trans);
@@ -557,7 +557,7 @@
(GTK_WIDGET (td->dialog),
TRUE,
"%s",
- _("You did not enter any transaction purpose. A purpose is \n"
+ _("You did not enter any transaction purpose. A purpose is "
"required for an online transfer.\n"
"\n"
"Do you want to enter the job again?"));
@@ -692,9 +692,9 @@
values_ok = gnc_verify_dialog
(parent,
TRUE,
- _("The internal check of the destination account number '%s' \n"
- "at the specified bank with bank code '%s' failed. This means \n"
- "the account number might contain an error. Should the online \n"
+ _("The internal check of the destination account number '%s' "
+ "at the specified bank with bank code '%s' failed. This means "
+ "the account number might contain an error. Should the online "
"transfer job be sent with this account number anyway?"),
AB_Transaction_GetRemoteAccountNumber (trans),
AB_Transaction_GetRemoteBankCode (trans));
@@ -798,10 +798,10 @@
(td->parent,
FALSE,
"%s",
- _("The job was sent to the bank successfully, but the \n"
- "bank is refusing to execute the job. Please check \n"
- "the log window for the exact error message of the \n"
- "bank. The line with the error message contains a \n"
+ _("The job was sent to the bank successfully, but the "
+ "bank is refusing to execute the job. Please check "
+ "the log window for the exact error message of the "
+ "bank. The line with the error message contains a "
"code number that is greater than 9000.\n"
"\n"
"Do you want to enter the job again?"));
Modified: gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2006-01-21 14:19:25 UTC (rev 12915)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2006-01-21 14:38:36 UTC (rev 12916)
@@ -615,10 +615,10 @@
gnc_error_dialog
(info->window,
/* Each of the %s is the name of the backend, e.g. "aqhbci". */
- _("The external program \"%s Setup Wizard\" returned a nonzero \n"
- "exit code which means it has not been finished successfully. \n"
- "The further HBCI setup can only be finished if the %s \n"
- "Setup Wizard is run successfully. Please try to start and \n"
+ _("The external program \"%s Setup Wizard\" returned a nonzero "
+ "exit code which means it has not been finished successfully. "
+ "The further HBCI setup can only be finished if the %s "
+ "Setup Wizard is run successfully. Please try to start and "
"successfully finish the %s Setup Wizard program again."),
backend_name, backend_name, backend_name);
druid_disable_next_button(info);
@@ -629,7 +629,7 @@
(info->window,
/* Each of the %s is the name of the backend, e.g. "aqhbci". */
_("The external program \"%s Setup Wizard\" has not been found. \n\n"
- "The package aqbanking is supposed to install the program \n"
+ "The package aqbanking is supposed to install the program "
"\"%s-qt3-wizard\". Please check your installation of aqbanking."),
backend_name, backend_name);
druid_disable_next_button(info);
Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c 2006-01-21 14:19:25 UTC (rev 12915)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c 2006-01-21 14:38:36 UTC (rev 12916)
@@ -283,7 +283,7 @@
((noted_value == 0.0) ?
g_strdup_printf("%s", "") :
bal_print_balance
- (_("For your information: This account also \n"
+ (_("For your information: This account also "
"has a noted balance of %s\n"),
noted_val));
Modified: gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c 2006-01-21 14:19:25 UTC (rev 12915)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c 2006-01-21 14:38:36 UTC (rev 12916)
@@ -218,6 +218,8 @@
}
#if 0
+ /* hbci debugging code; might be adapted to aqbanking at a later
+ point in time */
list = AB_JOB_resultCodes (job);
if (list_int_size (list) > 0) {
@@ -276,6 +278,9 @@
switch (code) {
#if 0
+ /* these error codes existed in openhbci, but no longer in
+ aqbanking. Maybe they might get reintroduced later, but maybe
+ not. */
case AB_ERROR_PIN_WRONG:
GNCInteractor_erasePIN (inter);
return gnc_verify_dialog (parent,
@@ -289,29 +294,6 @@
_("The PIN you entered was wrong.\n"
"ATTENTION: You have zero further wrong retries left!\n"
"Do you want to try again?"));
- case AB_ERROR_PIN_WRONG_1:
- GNCInteractor_erasePIN (inter);
- return gnc_verify_dialog (parent,
- TRUE,
- _("The PIN you entered was wrong.\n"
- "You have one further wrong retry left.\n"
- "Do you want to try again?"));
- case AB_ERROR_PIN_WRONG_2:
- GNCInteractor_erasePIN (inter);
- return gnc_verify_dialog (parent,
- TRUE,
- _("The PIN you entered was wrong.\n"
- "You have two further wrong retries left.\n"
- "Do you want to try again?"));
- case AB_ERROR_PIN_ABORTED:
- /* printf("gnc_hbci_Error_feedback: PIN dialog was aborted.\n"); */
- return FALSE;
- case AB_ERROR_PIN_TOO_SHORT:
- GNCInteractor_erasePIN (inter);
- return gnc_verify_dialog (parent,
- TRUE,
- _("The PIN you entered was too short.\n"
- "Do you want to try again?"));
case AB_ERROR_CARD_DESTROYED:
GNCInteractor_hide (inter);
gnc_error_dialog
@@ -350,6 +332,9 @@
}
#if 0
+/* hbci debugging code; might be adapted to aqbanking at a later
+ point in time */
+
/* Prints all results that can be found in the outbox into the interactor */
static void gnc_hbci_printresult(HBCI_Outbox *outbox, GNCInteractor *inter)
{
@@ -609,267 +594,6 @@
return g_memo;
}
-
-#if 0
-/** Return the only customer that can act on the specified account, or
- NULL if none was found. */
-const HBCI_Customer *
-gnc_hbci_get_first_customer(const AB_ACCOUNT *h_acc)
-{
- /* Get one customer. */
- const list_HBCI_User *userlist;
- const HBCI_Bank *bank;
- const HBCI_User *user;
- g_assert(h_acc);
-
- bank = AB_ACCOUNT_bank (h_acc);
- userlist = HBCI_Bank_users (bank);
- g_assert (userlist);
- user = choose_one_user(gnc_ui_get_toplevel (), userlist);
- g_assert (user);
- return choose_one_customer(gnc_ui_get_toplevel (), HBCI_User_customers (user));
-}
-
-const char *bank_to_str (const HBCI_Bank *bank)
-{
- g_assert (bank);
- return ((strlen(HBCI_Bank_name (bank)) > 0) ?
- HBCI_Bank_name (bank) :
- HBCI_Bank_bankCode(bank));
-}
-
-
-const HBCI_Bank *
-choose_one_bank (gncUIWidget parent, const list_HBCI_Bank *banklist)
-{
- const HBCI_Bank *bank;
- list_HBCI_Bank_iter *iter, *end;
- int list_size;
- g_assert (parent);
- g_assert (banklist);
-
- /*printf("%d banks found.\n", list_HBCI_Bank_size (banklist));*/
- list_size = list_HBCI_Bank_size (banklist);
- if (list_size == 0)
- return NULL;
-
- if (list_size == 1)
- {
- /* Get bank. */
- iter = list_HBCI_Bank_begin (banklist);
- bank = list_HBCI_Bank_iter_get (iter);
- list_HBCI_Bank_iter_delete (iter);
- return bank;
- }
-
- /* More than one bank available. */
- {
- int choice, i;
- GList *node;
- GList *radio_list = NULL;
-
- end = list_HBCI_Bank_end (banklist);
- for (iter = list_HBCI_Bank_begin (banklist);
- !list_HBCI_Bank_iter_equal(iter, end);
- list_HBCI_Bank_iter_next(iter))
- {
- bank = list_HBCI_Bank_iter_get (iter);
- radio_list = g_list_append(radio_list,
- g_strdup_printf ("%s (%s)",
- HBCI_Bank_name (bank),
- HBCI_Bank_bankCode (bank)));
- }
- list_HBCI_Bank_iter_delete (iter);
-
- choice = gnc_choose_radio_option_dialog
- (parent,
- _("Choose HBCI bank"),
- _("More than one HBCI bank is available for \n"
- "the requested operation. Please choose \n"
- "the one that should be used."),
- 0,
- radio_list);
-
- for (node = radio_list; node; node = node->next)
- g_free (node->data);
- g_list_free (radio_list);
-
- i = 0;
- for (iter = list_HBCI_Bank_begin (banklist);
- !list_HBCI_Bank_iter_equal(iter, end);
- list_HBCI_Bank_iter_next(iter))
- if (i == choice)
- {
- bank = list_HBCI_Bank_iter_get (iter);
- list_HBCI_Bank_iter_delete (iter);
- list_HBCI_Bank_iter_delete (end);
- return bank;
- }
- else
- ++i;
- }
-
- g_assert_not_reached();
- return NULL;
-}
-
-const HBCI_Customer *
-choose_one_customer (gncUIWidget parent, const list_HBCI_Customer *custlist)
-{
- const HBCI_Customer *customer;
- list_HBCI_Customer_iter *iter, *end;
- g_assert(parent);
- g_assert(custlist);
-
- if (list_HBCI_Customer_size (custlist) == 0) {
- printf ("choose_one_customer: oops, no customer found.\n");
- return NULL;
- }
- if (list_HBCI_Customer_size (custlist) == 1)
- {
- /* Get one customer */
- iter = list_HBCI_Customer_begin (custlist);
- customer = list_HBCI_Customer_iter_get (iter);
- list_HBCI_Customer_iter_delete (iter);
-
- return customer;
- }
-
- /* More than one customer available. */
- {
- int choice, i;
- GList *node;
- GList *radio_list = NULL;
-
- end = list_HBCI_Customer_end (custlist);
- for (iter = list_HBCI_Customer_begin (custlist);
- !list_HBCI_Customer_iter_equal(iter, end);
- list_HBCI_Customer_iter_next(iter))
- {
- customer = list_HBCI_Customer_iter_get (iter);
- radio_list =
- g_list_append(radio_list,
- /* Translators: %s is the name of the
- * customer. %s is the id of the customer. %s
- * is the name of the bank. %s is the bank
- * code. */
- g_strdup_printf (_("%s (%s) at bank %s (%s)"),
- HBCI_Customer_name (customer),
- HBCI_Customer_custId (customer),
- bank_to_str (HBCI_User_bank(HBCI_Customer_user(customer))),
- HBCI_Bank_bankCode (HBCI_User_bank(HBCI_Customer_user(customer)))));
- }
- list_HBCI_Customer_iter_delete (iter);
-
- choice = gnc_choose_radio_option_dialog
- (parent,
- _("Choose HBCI customer"),
- _("More than one HBCI customer is available for \n"
- "the requested operation. Please choose \n"
- "the one that should be used."),
- 0,
- radio_list);
-
- for (node = radio_list; node; node = node->next)
- g_free (node->data);
- g_list_free (radio_list);
-
- i = 0;
- for (iter = list_HBCI_Customer_begin (custlist);
- !list_HBCI_Customer_iter_equal(iter, end);
- list_HBCI_Customer_iter_next(iter))
- if (i == choice)
- {
- customer = list_HBCI_Customer_iter_get (iter);
- list_HBCI_Customer_iter_delete (iter);
- list_HBCI_Customer_iter_delete (end);
- return customer;
- }
- else
- ++i;
- }
-
- g_assert_not_reached();
- return NULL;
-}
-
-const HBCI_User *
-choose_one_user (gncUIWidget parent, const list_HBCI_User *userlist)
-{
- const HBCI_User *user;
- list_HBCI_User_iter *iter, *end;
- g_assert(parent);
- g_assert(userlist);
-
- if (list_HBCI_User_size (userlist) == 0) {
- printf("choose_one_user: oops, no user found.\n");
- return NULL;
- }
- if (list_HBCI_User_size (userlist) == 1)
- {
- /* Get one User */
- iter = list_HBCI_User_begin (userlist);
- user = list_HBCI_User_iter_get (iter);
- list_HBCI_User_iter_delete (iter);
-
- return user;
- }
-
- /* More than one user available. */
- {
- int choice, i;
- GList *node;
- GList *radio_list = NULL;
-
- end = list_HBCI_User_end (userlist);
- for (iter = list_HBCI_User_begin (userlist);
- !list_HBCI_User_iter_equal(iter, end);
- list_HBCI_User_iter_next(iter))
- {
- user = list_HBCI_User_iter_get (iter);
- radio_list = g_list_append
- (radio_list,
- g_strdup_printf (_("%s (%s) at bank %s (%s)"),
- HBCI_User_name (user),
- HBCI_User_userId (user),
- bank_to_str (HBCI_User_bank(user)),
- HBCI_Bank_bankCode (HBCI_User_bank(user))));
- }
- list_HBCI_User_iter_delete (iter);
-
- choice = gnc_choose_radio_option_dialog
- (parent,
- _("Choose HBCI user"),
- _("More than one HBCI user is available for \n"
- "the requested operation. Please choose \n"
- "the one that should be used."),
- 0,
- radio_list);
-
- for (node = radio_list; node; node = node->next)
- g_free (node->data);
- g_list_free (radio_list);
-
- i = 0;
- for (iter = list_HBCI_User_begin (userlist);
- !list_HBCI_User_iter_equal(iter, end);
- list_HBCI_User_iter_next(iter))
- if (i == choice)
- {
- user = list_HBCI_User_iter_get (iter);
- list_HBCI_User_iter_delete (iter);
- list_HBCI_User_iter_delete (end);
- return user;
- }
- else
- ++i;
- }
-
- g_assert_not_reached();
- return NULL;
-}
-#endif
-
char *gnc_AB_VALUE_toReadableString(const AB_VALUE *v)
{
char tmp[100];
Modified: gnucash/trunk/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interaction.c 2006-01-21 14:19:25 UTC (rev 12915)
+++ gnucash/trunk/src/import-export/hbci/hbci-interaction.c 2006-01-21 14:38:36 UTC (rev 12916)
@@ -344,7 +344,7 @@
if (strlen(passwd) < (unsigned int)minsize) {
gboolean retval;
char *msg =
- g_strdup_printf ( _("The PIN needs to be at least %d characters \n"
+ g_strdup_printf ( _("The PIN needs to be at least %d characters "
"long. Do you want to try again?"),
minsize);
retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
@@ -357,8 +357,8 @@
else if (strlen(passwd) >= (unsigned int)maxLen) {
gboolean retval;
char *msg =
- g_strdup_printf ( _("You entered %ld characters, but the PIN must \n"
- "be no longer than %d characters. \n"
+ g_strdup_printf ( _("You entered %ld characters, but the PIN must "
+ "be no longer than %d characters. "
"Do you want to try again?"),
(long)strlen(passwd), maxLen);
retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
@@ -425,7 +425,7 @@
if (strlen(passwd) < (unsigned int)minsize) {
gboolean retval;
char *msg =
- g_strdup_printf ( _("This TAN needs to be at least %d characters \n"
+ g_strdup_printf ( _("This TAN needs to be at least %d characters "
"long. Do you want to try again?"),
minsize);
retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
@@ -438,8 +438,8 @@
else if (strlen(passwd) >= (unsigned int)maxLen) {
gboolean retval;
char *msg =
- g_strdup_printf ( _("You entered %ld characters, but the TAN must \n"
- "be no longer than %d characters. \n"
+ g_strdup_printf ( _("You entered %ld characters, but the TAN must "
+ "be no longer than %d characters. "
"Do you want to try again?"),
(long)strlen(passwd), maxLen);
retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
More information about the gnucash-changes
mailing list