[Gnucash-changes] 2005-03-12 Christian Stimming <stimming@tuhh.de> *

Christian Stimming cstim at cvs.gnucash.org
Sat Mar 12 06:48:52 EST 2005


Log Message:
-----------
2005-03-12  Christian Stimming  <stimming at tuhh.de>

	* src/import-export/hbci/gnc-hbci-gettrans.c, hbci-interaction.h:
	Improve error handling in HBCI operations.

Tags:
----
gnucash-1-8-branch

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/import-export/hbci:
        gnc-hbci-gettrans.c
        hbci-interaction.c
        hbci-interaction.h
        hbci-interactionP.h

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1461.2.402
retrieving revision 1.1461.2.403
diff -LChangeLog -LChangeLog -u -r1.1461.2.402 -r1.1461.2.403
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,8 @@
+2005-03-12  Christian Stimming  <stimming at tuhh.de>
+
+	* src/import-export/hbci/gnc-hbci-gettrans.c, hbci-interaction.h:
+	Improve error handling in HBCI operations.
+
 2005-02-26  Christian Stimming  <stimming at tuhh.de>
 
 	* src/import-export/hbci/gnc-hbci-kvp.c (force_account_dirty):
Index: hbci-interaction.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interaction.h,v
retrieving revision 1.6.2.4
retrieving revision 1.6.2.5
diff -Lsrc/import-export/hbci/hbci-interaction.h -Lsrc/import-export/hbci/hbci-interaction.h -u -r1.6.2.4 -r1.6.2.5
--- src/import-export/hbci/hbci-interaction.h
+++ src/import-export/hbci/hbci-interaction.h
@@ -42,6 +42,7 @@
 void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value);
 GtkWidget *GNCInteractor_parent(GNCInteractor *i);
 void GNCInteractor_add_log_text (GNCInteractor *i, const char *msg);
+gboolean GNCInteractor_hadErrors (const GNCInteractor *i);
 
 
 #endif
Index: hbci-interactionP.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interactionP.h,v
retrieving revision 1.4.2.4
retrieving revision 1.4.2.5
diff -Lsrc/import-export/hbci/hbci-interactionP.h -Lsrc/import-export/hbci/hbci-interactionP.h -u -r1.4.2.4 -r1.4.2.5
--- src/import-export/hbci/hbci-interactionP.h
+++ src/import-export/hbci/hbci-interactionP.h
@@ -76,6 +76,8 @@
   GHashTable *showbox_hash; 
   GtkWidget *showbox_last;
 
+  /* Flag whether the last dialog showed any error */
+  gboolean msgBoxError;
 };
 
 void delete_GNCInteractor (GNCInteractor *data);
Index: hbci-interaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interaction.c,v
retrieving revision 1.16.2.18
retrieving revision 1.16.2.19
diff -Lsrc/import-export/hbci/hbci-interaction.c -Lsrc/import-export/hbci/hbci-interaction.c -u -r1.16.2.18 -r1.16.2.19
--- src/import-export/hbci/hbci-interaction.c
+++ src/import-export/hbci/hbci-interaction.c
@@ -203,6 +203,12 @@
     }
 }
 
+gboolean GNCInteractor_hadErrors (const GNCInteractor *i)
+{
+  g_assert (i);
+  return i->msgBoxError != 0;
+}
+
 /* ************************************************************ 
  */
 
@@ -530,6 +536,7 @@
   g_assert(ab);
   data = AB_Banking_GetUserData(ab);
   g_assert(data);
+  data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
 
   text = gnc_hbci_utf8ToLatin1(data, utf8text);
   title = gnc_hbci_utf8ToLatin1(data, utf8title);
Index: gnc-hbci-gettrans.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-gettrans.c,v
retrieving revision 1.20.2.8
retrieving revision 1.20.2.9
diff -Lsrc/import-export/hbci/gnc-hbci-gettrans.c -Lsrc/import-export/hbci/gnc-hbci-gettrans.c -u -r1.20.2.8 -r1.20.2.9
--- src/import-export/hbci/gnc-hbci-gettrans.c
+++ src/import-export/hbci/gnc-hbci-gettrans.c
@@ -107,7 +107,9 @@
     AB_Banking_EnqueueJob(api, job);
 
     /* Execute Outbox. */
-    if (!gnc_AB_BANKING_execute (parent, api, job, interactor)) {
+    if (!gnc_AB_BANKING_execute (parent, api, job, interactor) ||
+	(AB_Job_GetStatus(job) == AB_Job_StatusError) ||
+	GNCInteractor_hadErrors (interactor)) {
       /* AB_BANKING_executeOutbox failed. */
       gnc_hbci_cleanup_job(api, job);
       return;


More information about the gnucash-changes mailing list