Store the log level of all printed messages and use this as

yet another check whether aqbanking had any errors.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@13687 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming
2006-03-23 12:12:48 +00:00
parent e274670ddc
commit d209e7a3a1
4 changed files with 20 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
2006-03-23 Christian Stimming <stimming@tuhh.de>
* src/import-export/hbci/hbci-interaction.c: Store the log level
of all printed messages and use this as yet another check whether
aqbanking had any errors.
2006-03-22 David Hampton <hampton@employees.org>
* accounts/*/acctchrt_common.gnucash-xea: Mark all common account

View File

@@ -453,7 +453,7 @@ gnc_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
}
GNCInteractor_set_cache_valid (inter, TRUE);
if (resultcode <= 20) {
if (resultcode <= 20 && (! GNCInteractor_hadErrors(inter)) ) {
return TRUE;
}
else {

View File

@@ -67,6 +67,7 @@ GNCInteractor *gnc_AB_BANKING_interactors (AB_BANKING *api, GtkWidget *parent)
gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
data->showbox_id = 1;
data->showbox_hash = g_hash_table_new(NULL, NULL);
data->min_loglevel = AB_Banking_LogLevelVerbous;
/* set HBCI_Interactor */
gnc_hbci_add_callbacks(api, data);
@@ -215,7 +216,8 @@ void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent)
gboolean GNCInteractor_hadErrors (const GNCInteractor *i)
{
g_assert (i);
return i->msgBoxError != 0;
return (i->msgBoxError != 0) ||
(i->min_loglevel < AB_Banking_LogLevelNotice);
}
/* ************************************************************
@@ -652,6 +654,9 @@ static GWEN_TYPE_UINT32 progressStartCB(AB_BANKING *ab, const char *utf8title,
/* Show the dialog */
GNCInteractor_show(data);
/* Initialize loglevel caching */
data->min_loglevel = AB_Banking_LogLevelVerbous;
g_free(title);
g_free(text);
return progress_id;
@@ -701,6 +706,10 @@ static int progressLogCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id,
/* printf("progressLogCB: Logging msg: %s\n", text); */
GNCInteractor_add_log_text (data, text);
/* Cache loglevel */
if (level < data->min_loglevel)
data->min_loglevel = level;
g_free(text);
return !keepAlive(data);
}

View File

@@ -77,6 +77,9 @@ struct _inter_data
/* Flag whether the last dialog showed any error */
gboolean msgBoxError;
/* Cache the lowest loglevel, corresponding to the most serious
warning. */
AB_BANKING_LOGLEVEL min_loglevel;
};
void delete_GNCInteractor (GNCInteractor *data);