[Gnucash-changes] 2004-09-04 Christian Stimming <stimming@tuhh.de> *

Christian Stimming cstim at cvs.gnucash.org
Sat Sep 4 08:03:34 EDT 2004


Log Message:
-----------
2004-09-04  Christian Stimming  <stimming at tuhh.de>

	* src/import-export/hbci/*.h, *.c, macros/aqbanking.m4,
	configure.in: Major change for HBCI. It is no longer based on the
	openhbci2 library but instead on the aqbanking library
	http://sf.net/projects/aqbanking which is Martin Preuss' successor
	of openhbci2. This means that now aqbanking-0.9.2 is required
	instead of any of the openhbci[2] package. Still needs more
	testing, though.

Modified Files:
--------------
    gnucash:
        ChangeLog
        configure.in
    gnucash/macros:
        Makefile.am
    gnucash/src/import-export/hbci:
        Makefile.am
        dialog-daterange.c
        dialog-hbcitrans.c
        dialog-hbcitrans.h
        druid-hbci-initial.c
        druid-hbci-utils.c
        druid-hbci-utils.h
        gnc-hbci-getbalance.c
        gnc-hbci-getbalance.h
        gnc-hbci-gettrans.c
        gnc-hbci-gettrans.h
        gnc-hbci-kvp.c
        gnc-hbci-kvp.h
        gnc-hbci-transfer.c
        gnc-hbci-transfer.h
        gnc-hbci-utils.c
        gnc-hbci-utils.h
        gncmod-hbci.c
        hbci-interaction.c
        hbci-interaction.h
        hbci-interactionP.h
    gnucash/src/import-export/hbci/glade:
        hbci.glade

Added Files:
-----------
    gnucash/macros:
        aqbanking.m4

Removed Files:
-------------
    gnucash/macros:
        openhbci2.m4
    gnucash/src/import-export/hbci:
        gnc-hbci-account.c
        gnc-hbci-account.h

Revision Data
-------------
Index: configure.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/configure.in,v
retrieving revision 1.394
retrieving revision 1.395
diff -Lconfigure.in -Lconfigure.in -u -r1.394 -r1.395
--- configure.in
+++ configure.in
@@ -575,8 +575,9 @@
   fi)
 if test x${MT940_DIR} = xmt940 ;
 then
-    AC_MSG_ERROR([Sorry, MT940 support is currently broken since it depends on the hbci module with the old openhbci 0.9.x library. But the hbci module now has been ported to the new openhbci2 library. The MT940 importer needs to be ported to openhbci2 as well before this can be enabled again.])
-    AM_PATH_OPENHBCI(0.9.13.2)
+    AC_MSG_ERROR([Sorry, MT940 support is currently broken since it depended on the hbci module with the old openhbci 0.9.x library. But the hbci module now has been ported yet again, now to the aqbanking library. The MT940 importer needs to be ported to aqbanking as well before this can be enabled again -- but this probably shouldnt be too difficult.])
+    #AM_PATH_OPENHBCI(0.9.13.2)
+    AC_AQBANKING(0,9,2)
     # Note: HBCI_LIBS is changed again below in the --enable-hbci
     # section. So check for mt940 first and *not* the other way round!
     HBCI_LIBS="${OPENHBCI_LIBS}"
@@ -597,12 +598,16 @@
   fi)
 if test x${HBCI_DIR} = xhbci ;
 then
-    AM_PATH_OPENHBCI2(1.9.0.8)
-    #all_libraries="$all_libraries $OPENHBCI_LIBS"
-    #all_includes="$all_includes $OPENHBCI_CXXFLAGS"
-    #AM_PATH_OPENHBCI(0.9.13)
-    HBCI_LIBS="${OPENHBCI_LIBS}"
-    HBCI_CFLAGS="${OPENHBCI_CFLAGS}"
+    #AM_PATH_OPENHBCI2(1.9.0.8)
+    #HBCI_LIBS="${OPENHBCI_LIBS}"
+    #HBCI_CFLAGS="${OPENHBCI_CFLAGS}"
+    AC_AQBANKING(0,9,2)
+    if test x${have_aqbanking} != xyes; 
+    then
+	AC_MSG_ERROR([Could not find aqbanking. If you use --enable-hbci, you *have* to enable aqbanking.])
+    fi
+    HBCI_LIBS="${aqbanking_libs}"
+    HBCI_CFLAGS="${aqbanking_includes}"
 
     # also check for ktoblzcheck
     AC_CHECK_HEADERS(ktoblzcheck.h)
@@ -1170,7 +1175,7 @@
 LIBOBJS_SEDSCRIPT="s,\.[[^.]]* ,$U&,g;s,\.[[^.]]*\$\$,$U&,"
 AC_SUBST(LIBOBJS_SEDSCRIPT)
 
-AC_OUTPUT( intl/Makefile po/Makefile.in
+AC_OUTPUT( intl/Makefile po/Makefile.in 
 	  m4/Makefile
           dnl # Makefiles
           Makefile
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1836
retrieving revision 1.1837
diff -LChangeLog -LChangeLog -u -r1.1836 -r1.1837
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,13 @@
+2004-09-04  Christian Stimming  <stimming at tuhh.de>
+
+	* src/import-export/hbci/*.h, *.c, macros/aqbanking.m4,
+	configure.in: Major change for HBCI. It is no longer based on the
+	openhbci2 library but instead on the aqbanking library
+	http://sf.net/projects/aqbanking which is Martin Preuss' successor
+	of openhbci2. This means that now aqbanking-0.9.2 is required
+	instead of any of the openhbci[2] package. Still needs more
+	testing, though.
+
 2004-08-28  Derek Atkins  <derek at ihtfp.com>
 
 	* src/engine/Account.c: fix xaccAccountGetBalanceAsOfDate() to properly
--- /dev/null
+++ macros/aqbanking.m4
@@ -0,0 +1,126 @@
+# $Id: aqbanking.m4,v 1.1 2004/09/04 12:03:30 cstim Exp $
+# (c) 2004 Martin Preuss<martin at libchipcard.de>
+# This function checks for AqBanking
+
+AC_DEFUN(AC_AQBANKING, [
+dnl searches for aqbanking
+dnl Arguments: 
+dnl   $1: major version minimum
+dnl   $2: minor version minimum
+dnl   $3: patchlevel version minimum
+dnl   $4: build version minimum
+dnl Returns: aqbanking_dir
+dnl          aqbanking_libs
+dnl          aqbanking_libspp
+dnl          aqbanking_data
+dnl          aqbanking_plugins
+dnl          aqbanking_includes
+dnl          have_aqbanking
+
+if test -z "$1"; then vma="0"; else vma="$1"; fi
+if test -z "$2"; then vmi="1"; else vmi="$2"; fi
+if test -z "$3"; then vpl="0"; else vpl="$3"; fi
+if test -z "$4"; then vbld="0"; else vbld="$4"; fi
+
+AC_MSG_CHECKING(if aqbanking support desired)
+AC_ARG_ENABLE(aqbanking,
+  [  --enable-aqbanking      enable aqbanking support (default=yes)],
+  enable_aqbanking="$enableval",
+  enable_aqbanking="yes")
+AC_MSG_RESULT($enable_aqbanking)
+
+have_aqbanking="no"
+aqbanking_dir=""
+aqbanking_data=""
+aqbanking_plugins=""
+aqbanking_libs=""
+aqbanking_libspp=""
+aqbanking_includes=""
+if test "$enable_aqbanking" != "no"; then
+  AC_MSG_CHECKING(for aqbanking)
+  AC_ARG_WITH(aqbanking-dir, [  --with-aqbanking-dir=DIR
+                            uses aqbanking from given dir],
+    [lcc_dir="$withval"],
+    [lcc_dir="${prefix} \
+	     /usr/local \
+             /usr \
+             /"])
+
+  for li in $lcc_dir; do
+      if test -x "$li/bin/aqbanking-config"; then
+          aqbanking_dir="$li";
+          break
+      fi
+  done
+  if test -z "$aqbanking_dir"; then
+      AC_MSG_RESULT([not found ])
+      AC_MSG_ERROR([
+*** The library AqBanking was not found. Obtain it from 
+*** http://www.aquamaniac.de. 
+*** If it is already installed (including the -devel package), 
+*** you might need to specify the location with the 
+*** option --with-aqbanking-dir=DIR.])
+  else
+      AC_MSG_RESULT($aqbanking_dir)
+      AC_MSG_CHECKING(for aqbanking libs)
+      aqbanking_libs="`$aqbanking_dir/bin/aqbanking-config --libraries`"
+      AC_MSG_RESULT($aqbanking_libs)
+      AC_MSG_CHECKING(for aqbanking C++ libs)
+      aqbanking_libspp="`$aqbanking_dir/bin/aqbanking-config --libraries++`"
+      AC_MSG_RESULT($aqbanking_libspp)
+      AC_MSG_CHECKING(for aqbanking includes)
+      aqbanking_includes="`$aqbanking_dir/bin/aqbanking-config --includes`"
+      AC_MSG_RESULT($aqbanking_includes)
+      AC_MSG_CHECKING(for aqbanking plugins)
+      aqbanking_plugins="`$aqbanking_dir/bin/aqbanking-config --plugins`"
+      AC_MSG_RESULT($aqbanking_plugins)
+      AC_MSG_CHECKING(for aqbanking data)
+      aqbanking_data="`$aqbanking_dir/bin/aqbanking-config --data`"
+      AC_MSG_RESULT($aqbanking_data)
+  fi
+  AC_MSG_CHECKING(if aqbanking test desired)
+  AC_ARG_ENABLE(aqbanking,
+    [  --enable-aqbanking-test   enable aqbanking-test (default=yes)],
+     enable_aqbanking_test="$enableval",
+     enable_aqbanking_test="yes")
+  AC_MSG_RESULT($enable_aqbanking_test)
+  AC_MSG_CHECKING(for AqBanking version >=$vma.$vmi.$vpl.$vbld)
+  if test "$enable_aqbanking_test" != "no"; then
+    aqbanking_versionstring="`$aqbanking_dir/bin/aqbanking-config --vstring`.`$aqbanking_dir/bin/aqbanking-config --vbuild`"
+    AC_MSG_RESULT([found $aqbanking_versionstring])
+    if test "$vma" -gt "`$aqbanking_dir/bin/aqbanking-config --vmajor`"; then
+      AC_MSG_ERROR([Your AqBanking version is way too old.
+      Please update from http://www.aquamaniac.de/aqbanking/])
+    elif test "$vma" = "`$aqbanking_dir/bin/aqbanking-config --vmajor`"; then
+      if test "$vmi" -gt "`$aqbanking_dir/bin/aqbanking-config --vminor`"; then
+        AC_MSG_ERROR([Your AqBanking version is too old.
+          Please update from http://www.aquamaniac.de/aqbanking/])
+      elif test "$vmi" = "`$aqbanking_dir/bin/aqbanking-config --vminor`"; then
+          if test "$vpl" -gt "`$aqbanking_dir/bin/aqbanking-config --vpatchlevel`"; then
+            AC_MSG_ERROR([Your AqBanking version is a little bit too old.
+            Please update from http://www.aquamaniac.de/aqbanking/])
+          elif test "$vpl" = "`$aqbanking_dir/bin/aqbanking-config --vpatchlevel`"; then
+            if test "$vbld" -gt "`$aqbanking_dir/bin/aqbanking-config --vbuild`"; then
+              AC_MSG_ERROR([Your AqBanking version is a little bit too old. 
+  Please update to the latest CVS version. Instructions for accessing 
+  CVS can be found on http://www.aquamaniac.de/aqbanking/])
+             fi
+           fi
+      fi
+    fi
+    have_aqbanking="yes"
+    #AC_MSG_RESULT(yes)
+  else
+    have_aqbanking="yes"
+    AC_MSG_RESULT(assuming yes)
+  fi
+dnl end of "if enable-aqbanking"
+fi
+
+AC_SUBST(aqbanking_dir)
+AC_SUBST(aqbanking_plugins)
+AC_SUBST(aqbanking_libs)
+AC_SUBST(aqbanking_libspp)
+AC_SUBST(aqbanking_data)
+AC_SUBST(aqbanking_includes)
+])
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/macros/Makefile.am,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lmacros/Makefile.am -Lmacros/Makefile.am -u -r1.4 -r1.5
--- macros/Makefile.am
+++ macros/Makefile.am
@@ -30,7 +30,8 @@
   gperf-check.m4				\
   linger.m4					\
   need-declaration.m4				\
-  openhbci.m4
+  openhbci.m4					\
+  aqbanking.m4
 
 EXTRA_DIST=$(MACROS) gnome-common.m4 autogen.sh
 MAINTAINERCLEANFILES=macros.dep
--- macros/openhbci2.m4
+++ /dev/null
@@ -1,196 +0,0 @@
-# Configure paths for OpenHBCI
-# by Christian Stimming 2002-07-30, updated 2003-05-09
-# Copied from glib-2.0.m4 by Owen Taylor     1997-2001
-
-dnl AM_PATH_OPENHBCI2([MINIMUM-VERSION, [ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]])
-dnl Test for OPENHBCI, and define OPENHBCI_CFLAGS, OPENHBCI_CXXFLAGS and OPENHBCI_LIBS
-dnl
-AC_DEFUN(AM_PATH_OPENHBCI2, [
-dnl 
-dnl Get the c[xx]flags and libraries from openhbci2-config
-dnl
-AC_MSG_CHECKING(for OpenHBCI)
-AC_ARG_ENABLE(openhbcitest, [  --disable-openhbcitest      do not try to compile and run a test OpenHBCI program],
-		    , enable_openhbcitest=yes)
-
-AC_ARG_WITH( openhbci-prefix,
-  [  --with-openhbci-prefix=PFX   Prefix where OpenHBCI is installed],
-  OPENHBCI_PREFIX="$with_openhbci_prefix",
-  OPENHBCI_PREFIX="${prefix} \
-		/usr/local \
-		/usr/local/openhbci \
-		/usr")
-
-hbci_config=""
-for li in $OPENHBCI_PREFIX; do
-  if test -x "${li}/bin/openhbci2-config"; then
-    hbci_config="${li}/bin/openhbci2-config"
-    hbci_dir="${li}"
-    break
-  fi
-done
-
-if test -x "${hbci_config}" ; then
-  OPENHBCI_LIBS="`${hbci_config} --libraries`"
-  OPENHBCI_CFLAGS="`${hbci_config} --includes`"
-  OPENHBCI_CXXFLAGS="`${hbci_config} --includes`"
-  OPENHBCI_PLUGINS="`${hbci_config} --plugins`"
-else
-  AC_MSG_ERROR([
-  Could not find bin/openhbci2-config in prefix ${OPENHBCI_PREFIX}.
-  Please specify the right path by --with-openhbci-prefix=PREFIX.
-  ])
-fi  
-AC_MSG_RESULT($hbci_dir)
-
-min_openhbci_version=ifelse([$1], ,0.9.0.0,$1)
-AC_MSG_CHECKING(for OpenHBCI - version >= $min_openhbci_version)
-dnl AC_LANG_PUSH(C++) -- DON'T use C++ here!!!
-
-if test "x$enable_openhbcitest" = "xyes" ; then
-  ac_save_CFLAGS="$CFLAGS"
-  ac_save_LIBS="$LIBS"
-  CFLAGS="$CFLAGS $OPENHBCI_CFLAGS"
-  LIBS="$OPENHBCI_LIBS $LIBS"
-dnl
-dnl Now check if the installed OpenHBCI is sufficiently new. (Also sanity
-dnl checks the results of path guessing to some extent)
-dnl
-  rm -f conf.openhbcitest
-  AC_TRY_RUN([
-#include <openhbci2.h>
-#include <stdio.h>
-#include <string.h>
-#include <stdlib.h>
-
-#ifndef OPENHBCI_VERSION_BUILD
-#  define OPENHBCI_VERSION_BUILD 0
-#endif
-int 
-main ()
-{
-  int major, minor, micro, build;
-  int getmajor, getminor, getmicro, getbuild;
-  char *tmp_version;
-
-  system ("touch conf.openhbcitest");
-
-  /* HP/UX 9 writes to sscanf strings */
-  tmp_version = strdup("$min_openhbci_version");
-  build=0;
-  if (sscanf(tmp_version, "%d.%d.%d.%d", &major, &minor, &micro, &build) != 4)
-  {
-    build = 0;
-    if (sscanf(tmp_version, "%d.%d.%d", &major, &minor, &micro) != 3)
-    {
-      micro = 0;
-      if (sscanf(tmp_version, "%d.%d", &major, &minor) != 2)
-      {
-        minor = 0;
-        if (sscanf(tmp_version, "%d", &major) != 1)
-        {
-          printf("\n*** AM PATH OPENHBCI: bad version string: %s\n", "$min_openhbci_version");
-          exit(1);
-        }
-      }
-    }
-  }
-
-  HBCI_Hbci_libraryVersion_build(&getmajor, &getminor, &getmicro, &getbuild);
-
-  if ((getmajor != OPENHBCI_VERSION_MAJOR) ||
-      (getminor != OPENHBCI_VERSION_MINOR) ||
-      (getmicro != OPENHBCI_VERSION_PATCHLEVEL) ||
-      (getbuild != OPENHBCI_VERSION_BUILD))
-    {
-      printf("\n*** OpenHBCI header files openhbci2.h "
-	     "(version %d.%d.%d build %d) do not match\n",
-	     OPENHBCI_VERSION_MAJOR, 
-	     OPENHBCI_VERSION_MINOR, 
-	     OPENHBCI_VERSION_PATCHLEVEL,
-	     OPENHBCI_VERSION_BUILD);
-      printf("*** installed library libopenhbci.so "
-	     "(version %d.%d.%d build %d)\n",
-	     getmajor, getminor, getmicro, getbuild);
-      exit(1);
-    }
-  else
-    {
-      if ((getmajor > major) ||
-	  ((getmajor == major) && (getminor > minor)) ||
-	  ((getmajor == major) && (getminor == minor) && (getmicro > micro)) ||
-	  ((getmajor == major) && (getminor == minor) && 
-	   (getmicro == micro) && (getbuild >= build)))
-	{
-	  return 0;
-	}
-      else
-	{
-	  printf("\n*** An old version of OpenHBCI (%d.%d.%d build %d) was found.\n",
-		 getmajor, getminor, getmicro, getbuild);
-	  printf("*** You need OpenHBCI in version %d.%d.%d build %d or newer. The latest\n",
-		 major, minor, micro, build);
-	  printf("*** version of OpenHBCI is always available from http://www.openhbci.de.\n");
-	  if (build > 0)
-	    printf("*** Note: The non-zero build number '%d' indicates that the latest CVS \n"
-		   "*** version of openhbci is required.\n", build);
-	  printf("***\n"
-	"*** If you have already installed a sufficiently new version, this error\n"
-	"*** probably means that you need to specify the right path by\n"
-	"*** --with-openhbci-prefix=PATH.  (Also, check that your LD_LIBRARY_PATH\n"
-	"*** enviroment variable is correct, or edit /etc/ld.so.conf\n"
-	"*** so that the correct libraries are found at run-time)\n");
-	}
-    }
-  return 1;
-}
-],, no_openhbci=yes,[echo $ac_n "cross compiling; assumed OK... $ac_c"])
-  CFLAGS="$ac_save_CFLAGS"
-  LIBS="$ac_save_LIBS"
-fi
-if test "x$no_openhbci" = x ; then
-  AC_MSG_RESULT(yes)
-  ifelse([$2], , :, [$2])     
-else
-  AC_MSG_RESULT(no)
-  if test -f conf.openhbcitest ; then
-    :
-  else
-    echo "*** Could not run OpenHBCI test program, checking why..."
-    ac_save_CFLAGS="$CFLAGS"
-    ac_save_LIBS="$LIBS"
-    CFLAGS="$CFLAGS $OPENHBCI_CFLAGS"
-    LIBS="$LIBS $OPENHBCI_LIBS"
-    AC_TRY_LINK([
-#include <openhbci2.h>
-#include <stdio.h>
-],      [ return ((OPENHBCI_VERSION_MAJOR) || (OPENHBCI_VERSION_MINOR)); ],
-        [ echo "***"
-	  echo "*** The test program compiled, but did not run. This usually means"
-          echo "*** that the run-time linker is not finding OpenHBCI or finding the wrong"
-          echo "*** version of OpenHBCI. If it is not finding OpenHBCI, you'll need to set your"
-          echo "*** LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf to point"
-          echo "*** to the installed location  Also, make sure you have run ldconfig if that"
-          echo "*** is required on your system."
-	  echo "***"
-          echo "*** If you have an old version installed, it is best to remove it, although"
-          echo "*** you may also be able to get things to work by modifying LD_LIBRARY_PATH." 
-	  echo "***" ],
-        [ echo "***"
-	  echo "*** The test program failed to compile or link. See the file config.log for the"
-          echo "*** exact error that occured. This usually means OpenHBCI is incorrectly installed."])
-    CFLAGS="$ac_save_CFLAGS"
-    LIBS="$ac_save_LIBS"
-  fi
-  OPENHBCI_CFLAGS=""
-  OPENHBCI_LIBS=""
-  ifelse([$3], , :, [$3])
-  exit 1;
-fi
-AC_SUBST(OPENHBCI_CFLAGS)
-AC_SUBST(OPENHBCI_LIBS)
-AC_SUBST(OPENHBCI_CXXFLAGS)
-AC_SUBST(OPENHBCI_PLUGINS)
-dnl AC_LANG_POP(C++)
-rm -f conf.openhbcitest
-])
Index: druid-hbci-utils.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/druid-hbci-utils.c,v
retrieving revision 1.14
retrieving revision 1.15
diff -Lsrc/import-export/hbci/druid-hbci-utils.c -Lsrc/import-export/hbci/druid-hbci-utils.c -u -r1.14 -r1.15
--- src/import-export/hbci/druid-hbci-utils.c
+++ src/import-export/hbci/druid-hbci-utils.c
@@ -45,10 +45,6 @@
 /* #include "gnc-gui-query.h" */
 /* #include "io-example-account.h" */
 /* #include "top-level.h" */
-#include <openhbci2/api.h>
-#include <openhbci2/outboxjob.h>
-#include <openhbci2/mediumrdhbase.h>
-#include <openhbci2/rsakey.h>
 
 #include "gnc-hbci-utils.h"
 
@@ -58,37 +54,21 @@
 static void
 accounts_save_kvp_cb (gpointer key, gpointer value, gpointer user_data)
 {
-  gnc_HBCI_Account *hbci_acc = key;
+  AB_ACCOUNT *hbci_acc = key;
   Account *gnc_acc = value;
   g_assert(hbci_acc);
   g_assert(gnc_acc);
 
-  if ((gnc_hbci_get_account_accountid(gnc_acc) == NULL ) ||
-      (strcmp (gnc_hbci_get_account_accountid(gnc_acc), 
-	       gnc_HBCI_Account_accountId (hbci_acc)) != 0))
-    gnc_hbci_set_account_accountid 
-      (gnc_acc, gnc_HBCI_Account_accountId (hbci_acc));
-
-  if ((gnc_hbci_get_account_bankcode(gnc_acc) == NULL) ||
-      (strcmp (gnc_hbci_get_account_bankcode(gnc_acc), 
-	       HBCI_Bank_bankCode (gnc_HBCI_Account_bank (hbci_acc))) != 0))
-    gnc_hbci_set_account_bankcode
-      (gnc_acc, HBCI_Bank_bankCode (gnc_HBCI_Account_bank (hbci_acc)));
-
-  if (gnc_hbci_get_account_countrycode(gnc_acc) !=
-      HBCI_Bank_country (gnc_HBCI_Account_bank (hbci_acc)))
-    gnc_hbci_set_account_countrycode
-      (gnc_acc, HBCI_Bank_country (gnc_HBCI_Account_bank (hbci_acc)));
+  if (gnc_hbci_get_account_uid(gnc_acc) !=
+      AB_Account_GetUniqueId(hbci_acc))
+    gnc_hbci_set_account_uid
+      (gnc_acc, AB_Account_GetUniqueId(hbci_acc));
 }
 
 static gpointer accounts_clear_kvp (Account *gnc_acc, gpointer user_data)
 {
-  if (gnc_hbci_get_account_accountid(gnc_acc))
-    gnc_hbci_set_account_accountid (gnc_acc, "");
-  if (gnc_hbci_get_account_bankcode(gnc_acc))
-    gnc_hbci_set_account_bankcode (gnc_acc, "");
-  if (gnc_hbci_get_account_countrycode(gnc_acc))
-    gnc_hbci_set_account_countrycode (gnc_acc, 0);
+  if (gnc_hbci_get_account_uid(gnc_acc))
+    gnc_hbci_set_account_uid (gnc_acc, 0);
   return NULL;
 }
 
@@ -112,109 +92,18 @@
 
 
 
-static void 
-update_accounts_forbank (GtkWidget *parent, HBCI_API *api, 
-			 const HBCI_Bank *bank, 
-			 GNCInteractor *inter);
-static void 
-update_accounts_foruser (GtkWidget *parent, HBCI_API *api, 
-			 const HBCI_User *user, 
-			 GNCInteractor *inter);
-static gboolean
-update_accounts_forcustomer (GtkWidget *parent, HBCI_API *api, 
-			     const HBCI_Customer *cust, 
-			     GNCInteractor *inter);
-
-
 void
-update_accounts (GtkWidget *parent, HBCI_API *api, GNCInteractor *inter) 
+update_accounts (GtkWidget *parent, AB_BANKING *api, GNCInteractor *inter) 
 {
-  const list_HBCI_Bank *banklist;
-  list_HBCI_Bank_iter *begin;
   g_assert(api);
 
-  banklist = HBCI_API_bankList (api);
-  /*printf("%d banks found.\n", list_HBCI_Bank_size (banklist)); */
-  if (list_HBCI_Bank_size (banklist) == 0) {
-    /* Zero banks? nothing to do. */
-    return;
-  }
-  else if (list_HBCI_Bank_size (banklist) == 1) {
-    begin = list_HBCI_Bank_begin (banklist);
-    update_accounts_forbank (parent, api, 
-			     list_HBCI_Bank_iter_get (begin), inter);
-    list_HBCI_Bank_iter_delete (begin);
-  }
-  else {
-    printf("Sorry, multiple banks not yet supported.\n");
-  }
-}
-static void 
-update_accounts_forbank (GtkWidget *parent, HBCI_API *api, 
-			 const HBCI_Bank *bank, 
-			 GNCInteractor *inter)
-{
-  const list_HBCI_User *userlist;
-  const HBCI_User *user;
-  g_assert(bank);
-
-  userlist = HBCI_Bank_users (bank);
-  if (list_HBCI_User_size (userlist) == 0) {
-    printf("update_accounts_forbank: Oops, zero users found.\n");
-    /* Zero users? nothing to do. */
-    return;
-  }
-  user = choose_one_user (GNCInteractor_parent(inter), userlist);
-  update_accounts_foruser (parent, api, user, inter);
-}
-static void 
-update_accounts_foruser (GtkWidget *parent, HBCI_API *api, 
-			 const HBCI_User *user, 
-			 GNCInteractor *inter)
-{
-  const list_HBCI_Customer *customerlist;
-  const HBCI_Customer *customer;
-  g_assert(user);
-
-  customerlist = HBCI_User_customers (user);
-  if (list_HBCI_Customer_size (customerlist) == 0) {
-    printf("update_accounts_foruser: Oops, zero customers found.\n");
-    /* Zero customers? nothing to do. */
-    return;
-  }
-  customer = choose_one_customer (GNCInteractor_parent(inter), customerlist);
-  update_accounts_forcustomer (parent, api, customer, inter);
-}
-
-static gboolean
-update_accounts_forcustomer (GtkWidget *parent, HBCI_API *api, 
-			     const HBCI_Customer *cust, GNCInteractor *inter)
-{
-  HBCI_OutboxJob *job;
-  HBCI_Outbox *outbox;
-  gboolean result;
-  g_assert(cust);
-  
-  /* this const-warning is okay and can be ignored. */
-  job = HBCI_OutboxJob_new("JobGetAccounts", (HBCI_Customer *)cust, ""); 
-  outbox = HBCI_Outbox_new();
-  
-  HBCI_Outbox_addJob(outbox, job);
-  
-  /* Execute Outbox. */
-  result = gnc_hbci_api_execute (parent, api, outbox, job, inter);
-
-  HBCI_Outbox_delete (outbox);
-  return result;
 }
 
 
 
-
-
 struct hbci_acc_cb_data 
 {
-  HBCI_API *api;
+  AB_BANKING *api;
   GHashTable *hash;
 };
 
@@ -222,9 +111,9 @@
 gnc_hbci_new_hash_from_kvp_cb (Account *gnc_acc, gpointer user_data)
 {
   struct hbci_acc_cb_data *data = user_data;
-  gnc_HBCI_Account *hbci_acc = NULL;
+  AB_ACCOUNT *hbci_acc = NULL;
 
-  hbci_acc = (gnc_HBCI_Account *) gnc_hbci_get_hbci_acc (data->api, gnc_acc);
+  hbci_acc = (AB_ACCOUNT *) gnc_hbci_get_hbci_acc (data->api, gnc_acc);
   if (hbci_acc) {
     g_hash_table_insert (data->hash, hbci_acc, gnc_acc);
   }
@@ -232,7 +121,7 @@
 }
 
 GHashTable *
-gnc_hbci_new_hash_from_kvp (HBCI_API *api)
+gnc_hbci_new_hash_from_kvp (AB_BANKING *api)
 {
   GHashTable *hash;
 
@@ -286,301 +175,3 @@
 }
 
 
-
-GList *
-gnc_processOutboxResponse(HBCI_API *api, HBCI_Outbox *outbox, 
-			  GList *accountlist)
-{
-  GWEN_DB_NODE *response, *n;
-
-  g_assert(api);
-  g_assert(outbox);
-  /*g_assert(accountlist);*/
-  
-  response = HBCI_Outbox_response(outbox);
-
-  /*printf("gnc_processOutboxResponse: Complete response:\n");
-    GWEN_DB_Dump(response, stdout, 1);*/
-
-  n=GWEN_DB_GetFirstGroup(response);
-  while (n){
-    if (strcasecmp(GWEN_DB_GroupName(n), "AccountData")==0) {
-      /* found account data, create account */
-      const char *accountId;
-      const char *accountSubId;
-      const char *bankCode;
-      int country;
-      const char *custid;
-      const char *currency;
-      const char *acc_name;
-      const char *acc_name1;
-      /*list_HBCI_Customer *customers;*/
-      /*HBCI_User *user;*/
-      HBCI_Bank *bank;
-
-      country=GWEN_DB_GetIntValue(n, "country", 0, 280);
-      custid=GWEN_DB_GetCharValue(n, "customer", 0, "");
-      bankCode=GWEN_DB_GetCharValue(n, "bankcode", 0, "");
-      accountId=GWEN_DB_GetCharValue(n, "accountid", 0, "");
-      accountSubId=GWEN_DB_GetCharValue(n, "accountsubid", 0, "");
-      if (strlen(bankCode)==0 || strlen(accountId)==0 || strlen(custid)==0) {
-	printf("gnc_processOutboxResponse: AccountData without bank code/account id/customer id\n");
-	continue;
-      }
-
-      currency = GWEN_DB_GetCharValue(n, "currency", 0, NULL);
-      acc_name =  GWEN_DB_GetCharValue(n, "name", 0, NULL);
-      acc_name1 = GWEN_DB_GetCharValue(n, "name1", 0, NULL);
-
-      bank = HBCI_API_findBank(api, country, bankCode);
-      if (bank) {
-        /* bank uses a different bank code for the accounts, so find
-         * the matching bank for the given customer */
-        /*customers=getCustomers(country, "*", custid);
-	  if (customers.empty()) {
-          DBG_ERROR(0, "Unknown customer %d/%s/%s",
-	  country, bankCode.c_str(), custid.c_str());
-          GWEN_DB_Group_free(db);
-          return Error("AqMoneyAPI::processOutboxResponse",
-	  ERROR_LEVEL_NORMAL,
-	  HBCI_ERROR_CODE_UNKNOWN,
-	  ERROR_ADVISE_DONTKNOW,
-	  "Unknown customer");
-	  }
-	  if (customers.size()!=1) {
-          DBG_ERROR(0, "Ambiguous customer %d/%s/%s",
-	  country, bankCode.c_str(), custid.c_str());
-          GWEN_DB_Group_free(db);
-          return Error("AqMoneyAPI::processOutboxResponse",
-	  ERROR_LEVEL_NORMAL,
-	  HBCI_ERROR_CODE_UNKNOWN,
-	  ERROR_ADVISE_DONTKNOW,
-	  "Ambiguous customer");
-	  }
-	  user=customers.front().ref().user();
-	  bank=user.ref().bank();*/
-      }
-
-      
-      {
-	/* Check if such an account already exists */
-	gnc_HBCI_Account *acc = 
-	  list_HBCI_Account_find(accountlist, bank, bankCode, accountId);
-	
-	if (acc) {
-	  /* Update account information */
-	  printf("gnc_processOutboxResponse: Account %d/%s/%s already exists, updating.\n",
-		 country, bankCode, accountId);
-	}
-	else {
-	  /* Create new account object */
-	  acc = gnc_HBCI_Account_new(bank, bankCode, accountId);
-
-	  /* Add it to our internal list. */
-	  accountlist = g_list_append(accountlist, acc);
-
-	  printf("gnc_processOutboxResponse: Added account %d/%s/%s\n",
-		 country, bankCode, accountId);
-	}
-	gnc_HBCI_Account_set_currency(acc, currency);
-	gnc_HBCI_Account_set_name(acc, acc_name);
-	gnc_HBCI_Account_set_name1(acc, acc_name1);
-	gnc_HBCI_Account_set_customer(acc, custid);
-      }
-      
-
-    } /* if "AccountData" */
-    else if (strcasecmp(GWEN_DB_GroupName(n), "bankmsg")==0) {
-      /* add to existing bank messages */
-      /*GWEN_DB_AddGroup(_bankMessages, GWEN_DB_Group_dup(n));
-      fprintf(stderr, "------------------------------------\n");
-      fprintf(stderr,
-              "Message from \"%s\":\n",
-              GWEN_DB_GetCharValue(n, "bankCode", 0, "<unknown>"));
-      fprintf(stderr, "Subject: %s\n",
-              GWEN_DB_GetCharValue(n, "subject", 0, "<empty>"));
-      fprintf(stderr, "\n%s\n\n",
-      GWEN_DB_GetCharValue(n, "text", 0, "<empty>"));*/
-    }
-    n=GWEN_DB_GetNextGroup(n);
-  } /* while n */
-
-  GWEN_DB_Group_free(response);
-  //printf("gnc_processOutboxResponse: accountlist.size: %d\n", g_list_length(accountlist));
-  
-  return accountlist;
-}
-
-
-gboolean
-gnc_hbci_evaluate_GetKeys(HBCI_Outbox *outbox, HBCI_OutboxJob *job,
-			  HBCI_Customer *newcustomer)
-{
-  GWEN_DB_NODE *rsp;
-  GWEN_DB_NODE *n;
-  /*HBCI_Error *err;*/
-  HBCI_RSAKey *_cryptKey = NULL;
-  HBCI_RSAKey *_signKey = NULL;
-
-  g_assert(outbox);
-  g_assert(newcustomer);
-  
-  rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
-  if (!rsp) {
-    fprintf(stderr, "JobGetKeys::evaluate: no response data\n");
-    return FALSE;
-  }
-
-  /*printf("JobGetKeys: Complete response:\n");
-    GWEN_DB_Dump(rsp, stderr, 1);*/
-
-  n=GWEN_DB_GetFirstGroup(rsp);
-  while(n) {
-    if (strcasecmp(GWEN_DB_GroupName(n), "GetKeyResponse")==0) {
-      unsigned int bs;
-      const void *p;
-      GWEN_DB_NODE *keydb;
-      const char defaultExpo[3]={0x01, 0x00, 0x01};
-      gboolean iscrypt;
-
-      //DBG_NOTICE(0, "Found Key response");
-      iscrypt=FALSE;
-
-      keydb=GWEN_DB_Group_new("key");
-      GWEN_DB_SetCharValue(keydb,
-                           GWEN_DB_FLAGS_OVERWRITE_VARS,
-                           "type",
-                           "RSA");
-      // TODO: check for the correct exponent (for now assume 65537)
-      GWEN_DB_SetBinValue(keydb,
-                          GWEN_DB_FLAGS_OVERWRITE_VARS,
-                          "data/e",
-                          defaultExpo,
-                          sizeof(defaultExpo));
-
-      GWEN_DB_SetIntValue(keydb,
-                          GWEN_DB_FLAGS_OVERWRITE_VARS,
-                          "data/public",
-                          1);
-
-      iscrypt=(strcasecmp(GWEN_DB_GetCharValue(n,
-                                               "keyname/keytype", 0,
-                                               "V"), "V")==0);
-      GWEN_DB_SetCharValue(keydb,
-                           GWEN_DB_FLAGS_OVERWRITE_VARS,
-                           "name",
-                           GWEN_DB_GetCharValue(n,
-                                                "keyname/keytype", 0,
-                                                "V"));
-      GWEN_DB_SetCharValue(keydb,
-                           GWEN_DB_FLAGS_OVERWRITE_VARS,
-                           "owner",
-                           GWEN_DB_GetCharValue(n, "keyname/userId", 0, ""));
-      GWEN_DB_SetIntValue(keydb,
-                          GWEN_DB_FLAGS_OVERWRITE_VARS,
-                          "number",
-                          GWEN_DB_GetIntValue(n, "keyname/keynum", 0, 0));
-      GWEN_DB_SetIntValue(keydb,
-                          GWEN_DB_FLAGS_OVERWRITE_VARS,
-                          "version",
-                          GWEN_DB_GetIntValue(n, "keyname/keyversion", 0, 0));
-
-
-      p=GWEN_DB_GetBinValue(n, "key/modulus", 0, 0, 0 , &bs);
-      if (!p || !bs) {
-	fprintf(stderr, "JobGetKeys::evaluate: no modulus\n");
-	return FALSE;
-      }
-      GWEN_DB_SetBinValue(keydb,
-			  GWEN_DB_FLAGS_OVERWRITE_VARS,
-                          "data/n",
-			  p, bs);
-
-      if (iscrypt)
-	_cryptKey = HBCI_RSAKey_new(iscrypt, keydb);
-      else
-	_signKey = HBCI_RSAKey_new(iscrypt, keydb);
-      fprintf(stderr, "gnc_hbci_evaluate_GetKeys: Created %s key\n", iscrypt?"crypt":"sign");
-    } // if we have a key response
-    n=GWEN_DB_GetNextGroup(n);
-  } // while
-
-  // Key creation finished. Now add them to the medium @§%$!!!
-
-  if (!_cryptKey) {
-    printf("gnc_hbci_evaluate_GetKeys: Oops, no cryptKey received.\n");
-    return FALSE;
-  }
-  
-  
-  {
-    HBCI_MediumRDHBase *mrdh;
-    HBCI_Medium *medium;
-    const HBCI_Bank *bank;
-    const HBCI_User *user;
-    HBCI_Error *err;
-
-    // get some vars
-    user = HBCI_Customer_user(newcustomer);
-    bank = HBCI_User_bank(user);
-    medium = (HBCI_Medium *) HBCI_User_medium(user);
-    mrdh = HBCI_Medium_MediumRDHBase (medium);
-
-    // mount medium
-    err = HBCI_Medium_mountMedium(medium, "");
-    if (err && !HBCI_Error_isOk(err)) {
-      fprintf(stderr, "JobGetKeys::commit: 1\n");
-      return FALSE;
-    }
-
-    // select context
-    err = HBCI_Medium_selectContext(medium, HBCI_Bank_country(bank),
-				    HBCI_Bank_bankCode(bank),
-				    HBCI_User_userId(user));
-    if (err && !HBCI_Error_isOk(err)) {
-      HBCI_Medium_unmountMedium(medium, "");
-      fprintf(stderr, "JobGetKeys::commit: 2\n");
-      return FALSE;
-    }
-
-    // set crypt key
-    if (_cryptKey) {
-      fprintf(stderr, "Setting Institute Crypt Key\n");
-      if (!HBCI_RSAKey_isCryptoKey(_cryptKey)) {
-	fprintf(stderr, "Crypt key expected\n");
-	return FALSE;
-      }
-      err = HBCI_MediumRDHBase_setInstituteCryptKey(mrdh, _cryptKey);
-      if (err && !HBCI_Error_isOk(err)) {
-	HBCI_Medium_unmountMedium(medium, "");
-	fprintf(stderr, "JobGetKeys::commit: 3\n");
-	return FALSE;
-      }
-    }
-
-    // set sign key
-    if (_signKey) {
-      fprintf(stderr, "Setting Institute Sign Key\n");
-      err=HBCI_MediumRDHBase_setInstituteSignKey(mrdh, _signKey);
-      if (err && !HBCI_Error_isOk(err)) {
-	HBCI_Medium_unmountMedium(medium, "");
-	fprintf(stderr, "JobGetKeys::commit: 4\n");
-	return FALSE;
-      }
-      if (!HBCI_MediumRDHBase_hasInstSignKey(mrdh)) {
-	fprintf(stderr, "What ??? I just set the signkey but there is none ?!\n");
-      }
-    }
-
-    err = HBCI_Medium_unmountMedium(medium, "");
-    if (err && !HBCI_Error_isOk(err)) {
-      fprintf(stderr, "JobGetKeys::commit: 5\n");
-      return FALSE;
-    }
-    fprintf(stderr, "New institute keys activated\n");
-  }
-  
-  // use result returned from lower class
-  return TRUE;
-}
-
Index: dialog-daterange.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-daterange.c,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lsrc/import-export/hbci/dialog-daterange.c -Lsrc/import-export/hbci/dialog-daterange.c -u -r1.1 -r1.2
--- src/import-export/hbci/dialog-daterange.c
+++ src/import-export/hbci/dialog-daterange.c
@@ -59,10 +59,10 @@
   GtkWidget *first_button;
   GtkWidget *now_button;
   
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_daterange_dialog");
+  xml = gnc_glade_xml_new ("hbci.glade", "GWEN_TIMErange_dialog");
 
   g_assert
-    (dialog = glade_xml_get_widget (xml, "HBCI_daterange_dialog"));
+    (dialog = glade_xml_get_widget (xml, "GWEN_TIMErange_dialog"));
 
   if (parent)
     gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (parent));
Index: dialog-hbcitrans.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-hbcitrans.c,v
retrieving revision 1.30
retrieving revision 1.31
diff -Lsrc/import-export/hbci/dialog-hbcitrans.c -Lsrc/import-export/hbci/dialog-hbcitrans.c -u -r1.30 -r1.31
--- src/import-export/hbci/dialog-hbcitrans.c
+++ src/import-export/hbci/dialog-hbcitrans.c
@@ -27,8 +27,8 @@
 #endif
 
 #include <gnome.h>
-#include <openhbci2/bank.h>
-#include <openhbci2.h>
+#include <aqbanking/account.h>
+#include <aqbanking/jobsingletransfer.h>
 
 #include "dialog-utils.h"
 #include "gnc-ui.h"
@@ -82,7 +82,7 @@
   gboolean templ_changed;
   
   /* The HBCI transaction that got created here */
-  HBCI_Transaction *hbci_trans;
+  AB_TRANSACTION *hbci_trans;
   
   /* The gnucash transaction dialog where the user specifies the gnucash transaction. */
   XferDialog *gnc_trans_dialog;
@@ -104,7 +104,7 @@
   if (td->gnc_trans_dialog)
     gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
   if (td->hbci_trans)
-    HBCI_Transaction_delete (td->hbci_trans);
+    AB_Transaction_free (td->hbci_trans);
 
   td->selected_template = NULL;
     
@@ -124,7 +124,7 @@
   g_assert(td);
   return td->parent;
 }
-const HBCI_Transaction *gnc_hbci_dialog_get_htrans(const HBCITransDialog *td)
+const AB_TRANSACTION *gnc_hbci_dialog_get_htrans(const HBCITransDialog *td)
 {
   g_assert(td);
   return td->hbci_trans;
@@ -155,11 +155,11 @@
 /* Prototypes; callbacks for dialog function */
 /* -------------------------------------- */
 
-HBCI_Transaction *
-hbci_trans_fill_values(const gnc_HBCI_Account *h_acc, HBCITransDialog *td);
+AB_TRANSACTION *
+hbci_trans_fill_values(const AB_ACCOUNT *h_acc, HBCITransDialog *td);
 gboolean
 check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td, 
-		  const HBCI_Transaction *trans);
+		  const AB_TRANSACTION *trans);
 
 void on_template_list_select_child(GtkList  *list, GtkWidget  *widget, gpointer  user_data);
 void on_template_list_selection_changed(GtkList *list, gpointer  user_data);
@@ -204,14 +204,13 @@
 
 HBCITransDialog *
 gnc_hbci_dialog_new (GtkWidget *parent,
-		const gnc_HBCI_Account *h_acc,
-		const HBCI_Customer *customer,
+		const AB_ACCOUNT *h_acc,
 		Account *gnc_acc,
 		GNC_HBCI_Transtype trans_type,
 		GList *templates)
 {
   GladeXML *xml;
-  const HBCI_Bank *bank;
+  const char *hbci_bankid, *hbci_bankname;
   HBCITransDialog *td;
 
   td = g_new0(HBCITransDialog, 1);
@@ -220,9 +219,8 @@
   td->templ = templates;
   td->trans_type = trans_type;
   g_assert (h_acc);
-  g_assert (customer);
-  bank = gnc_HBCI_Account_bank (h_acc);
-  g_assert (bank);
+  hbci_bankid = AB_Account_GetBankCode(h_acc);
+  hbci_bankname = AB_Account_GetBankName(h_acc);
 #if HAVE_KTOBLZCHECK_H
   td->blzcheck = AccountNumberCheck_new();
 #endif
@@ -354,17 +352,15 @@
     
     /* Fill in the values from the objects */
     gtk_label_set_text (GTK_LABEL (orig_name_label), 
-			(strlen(HBCI_Customer_name (customer)) > 0 ?
-			 HBCI_Customer_name (customer) :
-			 HBCI_Customer_custId (customer)));
+			AB_Account_GetOwnerName (h_acc));
     gtk_label_set_text (GTK_LABEL (orig_account_label), 
-			gnc_HBCI_Account_accountId (h_acc));
+			AB_Account_GetAccountNumber (h_acc));
     gtk_label_set_text (GTK_LABEL (orig_bankname_label), 
-			(strlen(HBCI_Bank_name (bank))>0 ?
-			 HBCI_Bank_name (bank) :
+			(strlen(hbci_bankname)>0 ?
+			 hbci_bankname :
 			 _("(unknown)")));
     gtk_label_set_text (GTK_LABEL (orig_bankcode_label), 
-			HBCI_Bank_bankCode (bank));
+			hbci_bankid);
 
     /* fill list for choosing a transaction template */
     g_list_foreach(td->templ, fill_template_list_func, 
@@ -424,7 +420,7 @@
  */
 
 int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td, 
-				 const gnc_HBCI_Account *h_acc)
+				 const AB_ACCOUNT *h_acc)
 {
   int result;
   gboolean values_ok;
@@ -449,13 +445,13 @@
     }
 
     /* Now fill in the values from the entry fields into a new
-       HBCI_Transaction. */
+       AB_TRANSACTION. */
     td->hbci_trans = hbci_trans_fill_values(h_acc, td);
     values_ok = TRUE;
 
     /*printf("dialog-hbcitrans: Got value as %s .\n", 
-      HBCI_Value_toReadableString (HBCI_Transaction_value (trans)));*/
-    if (HBCI_Value_getValue (HBCI_Transaction_value (td->hbci_trans)) == 0.0) {
+      AB_VALUE_toReadableString (AB_TRANSACTION_value (trans)));*/
+    if (AB_Value_GetValue (AB_Transaction_GetValue (td->hbci_trans)) == 0.0) {
       gtk_widget_show_all (td->dialog); 
       values_ok = !gnc_verify_dialog
 	(GTK_WIDGET (td->dialog),
@@ -468,7 +464,7 @@
 	   "This does not result in a valid online transfer job.\n"
 	   "Do you want to enter the job again?"));
       if (values_ok) {
-	HBCI_Transaction_delete (td->hbci_trans);
+	AB_Transaction_free (td->hbci_trans);
 	return -1;
       }
       continue;
@@ -477,7 +473,7 @@
     /* FIXME: If this is a direct debit, set the textkey/ "Textschluessel"/
        transactionCode according to some GUI selection here!! */
     /*if (td->trans_type == SINGLE_DEBITNOTE)
-      HBCI_Transaction_setTransactionCode (td->hbci_trans, 05);*/
+      AB_TRANSACTION_setTransactionCode (td->hbci_trans, 05);*/
 
     /* And finally check the account code, if ktoblzcheck is available. */
     values_ok = check_ktoblzcheck(GTK_WIDGET (td->dialog), td, td->hbci_trans);
@@ -488,62 +484,63 @@
 }
 
 
-/** Create a new HBCI_Transaction, fill the values from the entry
+/** Create a new AB_TRANSACTION, fill the values from the entry
     fields into it and return it. The caller must
-    HBCI_Transaction_delete() it when finished. */
-HBCI_Transaction *
-hbci_trans_fill_values(const gnc_HBCI_Account *h_acc, HBCITransDialog *td)
+    AB_TRANSACTION_free() it when finished. */
+AB_TRANSACTION *
+hbci_trans_fill_values(const AB_ACCOUNT *h_acc, HBCITransDialog *td)
 {
-  GWEN_DB_NODE *xnode = GWEN_DB_Group_new("transaction");
   /* Fill in the user-entered values */
-  HBCI_Transaction *trans = HBCI_Transaction_new(xnode);
+  AB_TRANSACTION *trans = AB_Transaction_new();
 	
   /* OpenHBCI newer than 0.9.8: use account's bankCode values
    * instead of the bank's ones since this is what some banks
    * require. */
-  HBCI_Transaction_setOurBankCode (trans, 
-				   gnc_HBCI_Account_bankCode (h_acc));
-  HBCI_Transaction_setOurAccountId (trans, gnc_HBCI_Account_accountId (h_acc));
+  AB_Transaction_SetLocalBankCode (trans, 
+				   AB_Account_GetBankCode (h_acc));
+  AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (h_acc));
 	
-  HBCI_Transaction_setOtherBankCode 
+  AB_Transaction_SetRemoteBankCode
     (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)));
   /* printf("Got otherBankCode %s.\n",
-     HBCI_Transaction_otherBankCode (trans)); */
-  HBCI_Transaction_setOtherAccountId
+     AB_Transaction_otherBankCode (trans)); */
+  AB_Transaction_SetRemoteAccountNumber
     (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_account_entry)));
   /* printf("Got otherAccountId %s.\n",
-     HBCI_Transaction_otherAccountId (trans)); */
-  HBCI_Transaction_addOtherName
-    (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)));
+     AB_Transaction_otherAccountId (trans)); */
+  AB_Transaction_AddRemoteName
+    (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)), FALSE);
 	
-  HBCI_Transaction_addDescription
-    (trans, gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)));
-  HBCI_Transaction_addDescription
-    (trans, gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
+  /* The last argument means: If TRUE, then the string will be only be
+     appended if it doesn't exist yet. */
+  AB_Transaction_AddPurpose
+    (trans, gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)), FALSE);
+  AB_Transaction_AddPurpose
+    (trans, gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)), FALSE);
 	
   /* FIXME: Replace "EUR" by account-dependent string here. */
-  HBCI_Transaction_setValue 
-    (trans, HBCI_Value_new_double 
+  AB_Transaction_SetValue 
+    (trans, AB_Value_new
      (gnc_amount_edit_get_damount (GNC_AMOUNT_EDIT (td->amount_edit)), "EUR"));
 
   /* If this is a direct debit, a textkey/ "Textschluessel"/
      transactionCode different from the default has to be set. */
   switch(td->trans_type) {
   case SINGLE_DEBITNOTE:
-    HBCI_Transaction_setTransactionCode (trans, 05);
+    AB_Transaction_SetTransactionCode (trans, 05);
   default:
-    HBCI_Transaction_setTransactionCode (trans, 51);
+    AB_Transaction_SetTransactionCode (trans, 51);
   }
 
   return trans;
 }
 
-/** Checks the account code in the HBCI_Transaction, if the
+/** Checks the account code in the AB_TRANSACTION, if the
     ktoblzcheck package is available. Returns TRUE if everything is
     fine, or FALSE if this transaction should be entered again. */
 gboolean
 check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td, 
-		  const HBCI_Transaction *trans)	
+		  const AB_TRANSACTION *trans)	
 {
 #if HAVE_KTOBLZCHECK_H
   int blzresult;
@@ -552,8 +549,8 @@
   
   blzresult = AccountNumberCheck_check
     (td->blzcheck, 
-     HBCI_Transaction_otherBankCode (trans),
-     HBCI_Transaction_otherAccountId (trans));
+     AB_Transaction_GetRemoteBankCode (trans),
+     AB_Transaction_GetRemoteAccountNumber (trans));
   switch (blzresult) {
   case 2:
     gtk_widget_show_all (parent); 
@@ -564,8 +561,8 @@
 	 "at the specified bank with bank code '%s' failed. This means \n"
 	 "the account number might contain an error. Should the online \n"
 	 "transfer job be sent with this account number anyway?"),
-       HBCI_Transaction_otherAccountId (trans),
-       HBCI_Transaction_otherBankCode (trans));
+       AB_Transaction_GetRemoteAccountNumber (trans),
+       AB_Transaction_GetRemoteBankCode (trans));
     blztext = "Kontonummer wahrscheinlich falsch";
     break;
   case 0:
@@ -588,14 +585,12 @@
 #endif    
 }
 
-HBCI_OutboxJob *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, HBCI_API *api,
-			      HBCI_Outbox *outbox,
-			      const HBCI_Customer *customer, 
-			      gnc_HBCI_Account *h_acc, 
+AB_JOB *
+gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, AB_BANKING *api,
+			      AB_ACCOUNT *h_acc, 
 			      GNC_HBCI_Transtype trans_type) 
 {
-  HBCI_OutboxJob *job;
+  AB_JOB *job;
   const char *jobname;
 
   /* Create a Do-Transaction (Transfer) job. */
@@ -617,39 +612,36 @@
       jobname = "JobSingleTransfer";
     }
   }
-  job = HBCI_OutboxJob_new(jobname, (HBCI_Customer *)customer, 
-			   gnc_HBCI_Account_accountId(h_acc));
-  HBCI_Job_addRequestData(HBCI_OutboxJob_Job(job), 
-			  "", HBCI_Transaction_node(td->hbci_trans));
+  job = AB_JobSingleTransfer_new(h_acc);
+  AB_JobSingleTransfer_SetTransaction(job, td->hbci_trans);
 
   /* Make really sure there is no other job in the queue */
-  HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE);
+/*   HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE); */
 
   /* Add job to queue */
-  HBCI_Outbox_addJob(outbox, job);
+  AB_Banking_EnqueueJob(api, job);
 
   return job;
 }
 
 gboolean 
-gnc_hbci_trans_dialog_execute(HBCITransDialog *td, HBCI_API *api, 
-			      HBCI_Outbox *outbox,
-			      HBCI_OutboxJob *job, GNCInteractor *interactor)
+gnc_hbci_trans_dialog_execute(HBCITransDialog *td, AB_BANKING *api, 
+			      AB_JOB *job, GNCInteractor *interactor)
 {
   gboolean successful;
   g_assert(td);
   g_assert(api);
   g_assert(job);
 
-  successful = gnc_hbci_api_execute (td->parent, api, outbox, job, interactor);
+  successful = gnc_AB_BANKING_execute (td->parent, api, job, interactor);
 
   /*printf("dialog-hbcitrans: Ok, result of api_execute was %d.\n", 
     successful);*/
 	  
   if (!successful) {
-    /* HBCI_API_executeOutbox failed. */
-    if ((HBCI_OutboxJob_status (job) == HBCI_JOB_STATUS_DONE) &&
-	(HBCI_OutboxJob_result (job) == HBCI_JOB_RESULT_FAILED)) 
+    /* AB_BANKING_executeOutbox failed. */
+    if ((AB_Job_GetStatus (job) == AB_Job_StatusPending) ||
+	(AB_Job_GetStatus (job) == AB_Job_StatusError)) 
       successful = !gnc_verify_dialog
 	(td->parent, 
 	 FALSE,
@@ -662,12 +654,12 @@
 	   "\n"
 	   "Do you want to enter the job again?"));
 
-    HBCI_Transaction_delete (td->hbci_trans);
+    AB_Transaction_free (td->hbci_trans);
     td->hbci_trans = NULL;
   }
   /* Watch out! The job *has* to be removed from the queue
      here because otherwise it might be executed again. */
-  HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE);
+  AB_Banking_DequeueJob(api, job);
   return successful;
 }
 
Index: gncmod-hbci.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gncmod-hbci.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -Lsrc/import-export/hbci/gncmod-hbci.c -Lsrc/import-export/hbci/gncmod-hbci.c -u -r1.20 -r1.21
--- src/import-export/hbci/gncmod-hbci.c
+++ src/import-export/hbci/gncmod-hbci.c
@@ -16,6 +16,7 @@
 
 #include "gnc-hbci-cb.h"
 #include "druid-hbci-initial.h"
+#include "gnc-hbci-utils.h"
 
 /* version of the gnc module system interface we require */
 int libgncmod_hbci_LTX_gnc_module_system_interface = 0;
@@ -78,6 +79,7 @@
 
 int
 libgncmod_hbci_LTX_gnc_module_end(int refcount) {
+  gnc_AB_BANKING_delete(0);
   return TRUE;
 }
 
Index: gnc-hbci-getbalance.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-getbalance.h,v
retrieving revision 1.3
retrieving revision 1.4
diff -Lsrc/import-export/hbci/gnc-hbci-getbalance.h -Lsrc/import-export/hbci/gnc-hbci-getbalance.h -u -r1.3 -r1.4
--- src/import-export/hbci/gnc-hbci-getbalance.h
+++ src/import-export/hbci/gnc-hbci-getbalance.h
@@ -25,9 +25,9 @@
 
 #include <gnome.h>
 #include "Account.h"
-#include <openhbci2/outboxjob.h>
+#include <aqbanking/jobgetbalance.h>
 
-/** Starts a GetBalance job, adds the job to the HBCI_API, and
+/** Starts a GetBalance job, adds the job to the AB_BANKING, and
  * (currently) calls executeOutbox. */
 void
 gnc_hbci_getbalance (GtkWidget *parent, Account *gnc_acc);
@@ -37,7 +37,7 @@
 gboolean
 gnc_hbci_getbalance_finish (GtkWidget *parent, 
 			    Account *gnc_acc,
-			    const HBCI_OutboxJob *job);
+			    const AB_JOB *job);
 
 
 #endif /* GNC_HBCI_GETBALANCE_H */
Index: gnc-hbci-kvp.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-kvp.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -Lsrc/import-export/hbci/gnc-hbci-kvp.h -Lsrc/import-export/hbci/gnc-hbci-kvp.h -u -r1.8 -r1.9
--- src/import-export/hbci/gnc-hbci-kvp.h
+++ src/import-export/hbci/gnc-hbci-kvp.h
@@ -30,27 +30,37 @@
 
 /* Account */
 
-/** Returns a non-copied pointer to the accountid string in the
+#if 0
+/** DEPRECATED. Returns a non-copied pointer to the accountid string in the
  * Account a. The char* is still owned by the kvp_frame, so don't free
  * it until you want to delete the whole kvp_frame. */
 char *gnc_hbci_get_account_accountid (Account *a);
-/** Set the accountid string in the Account a. A copy of the string
+/** DEPRECATED. Set the accountid string in the Account a. A copy of the string
  * will be stored. The Account will be marked as "dirty". */
 void gnc_hbci_set_account_accountid (Account *a, const char *id);
 
-/** Returns a non-copied pointer to the bankcode string in the
+/** DEPRECATED. Returns a non-copied pointer to the bankcode string in the
  * Account a. The char* is still owned by the kvp_frame, so don't free
  * it until you want to delete the whole kvp_frame. */
 char *gnc_hbci_get_account_bankcode (Account *a);
-/** Set the bankcode string in the Account a. A copy of the string
+/** DEPRECATED. Set the bankcode string in the Account a. A copy of the string
  * will be stored. The Account will be marked as "dirty". */
 void gnc_hbci_set_account_bankcode (Account *a, const char *code);
 
-/** Returns the countrycode integer value from the Account a.  */
+/** DEPRECATED. Returns the countrycode integer value from the Account a.  */
 gint gnc_hbci_get_account_countrycode (Account *a);
-/** Set the countrycode integer value in the Account a.  The Account
+/** DEPRECATED. Set the countrycode integer value in the Account a.  The Account
  * will be marked as "dirty". */
 void gnc_hbci_set_account_countrycode (Account *a, gint code);
+#endif
+
+/** Returns the unique id for the AB_BANKING account in the Account
+ * a. */
+gint gnc_hbci_get_account_uid (Account *a);
+/** Set the unique id for the AB_BANKING account in the Account a. The
+    Account will be marked as "dirty". */
+void gnc_hbci_set_account_uid (Account *a, gint uid);
+
 
 /** Returns the time of last online transaction retrieval */
 Timespec gnc_hbci_get_account_trans_retrieval (Account *a);
@@ -75,11 +85,13 @@
 GList *gnc_hbci_get_book_template_list (GNCBook *b);
 void gnc_hbci_set_book_template_list (GNCBook *b, GList *template_list);
 
+#if 0
 /** Returns a non-copied pointer to the GList of kvp_frames which
  * eventually are the available HBCI accounts, stored in the given
  * book. */
 GList *gnc_hbci_get_book_account_list (GNCBook *b);
 void gnc_hbci_set_book_account_list (GNCBook *b, GList *account_list);
+#endif
 
 /* lowlevel */
 
Index: hbci-interaction.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interaction.h,v
retrieving revision 1.10
retrieving revision 1.11
diff -Lsrc/import-export/hbci/hbci-interaction.h -Lsrc/import-export/hbci/hbci-interaction.h -u -r1.10 -r1.11
--- src/import-export/hbci/hbci-interaction.h
+++ src/import-export/hbci/hbci-interaction.h
@@ -23,13 +23,13 @@
 #ifndef HBCI_INTERACTION_H
 #define HBCI_INTERACTION_H
 
-#include <openhbci2/api.h>
+#include <aqbanking/banking.h>
 #include <gnome.h>
 
 typedef struct _inter_data GNCInteractor;
 
 /** Adds the interactor and progressmonitor classes to the api. */
-GNCInteractor *gnc_hbci_api_interactors (HBCI_API *api, GtkWidget *parent);
+GNCInteractor *gnc_AB_BANKING_interactors (AB_BANKING *api, GtkWidget *parent);
 
 gboolean GNCInteractor_aborted(const GNCInteractor *i);
 void GNCInteractor_show(GNCInteractor *i);
Index: hbci-interactionP.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interactionP.h,v
retrieving revision 1.8
retrieving revision 1.9
diff -Lsrc/import-export/hbci/hbci-interactionP.h -Lsrc/import-export/hbci/hbci-interactionP.h -u -r1.8 -r1.9
--- src/import-export/hbci/hbci-interactionP.h
+++ src/import-export/hbci/hbci-interactionP.h
@@ -24,7 +24,7 @@
 #ifndef HBCI_INTERACTIONP_H
 #define HBCI_INTERACTIONP_H
 
-#include <openhbci2/interactor.h>
+#include <aqbanking/banking.h>
 #include <gnome.h>
 
 
@@ -45,6 +45,7 @@
   GtkWidget *job_entry;
   GtkWidget *action_entry;
   GtkWidget *action_progress;
+  double action_max;
 
   /* Log window */
   GtkWidget *log_text;
@@ -75,14 +76,20 @@
   gboolean cache_pin;
   /* The cached PIN and the HBCI_User it's cached for. */
   char *pw;
-  const HBCI_User *user;
+  char *cache_text;
   /* Whether this PIN is really valid or not. */
   gboolean cache_valid;
+
+  /* Dialogs */
+  int showbox_id;
+  GHashTable *showbox_hash; 
+  GtkWidget *showbox_last;
+
 };
 
 void delete_GNCInteractor (GNCInteractor *data);
 
-HBCI_Interactor *
-gnc_hbci_new_interactor(GNCInteractor *data);
+void
+gnc_hbci_add_callbacks(AB_BANKING *ba, GNCInteractor *data);
 
 #endif
--- src/import-export/hbci/gnc-hbci-account.c
+++ /dev/null
@@ -1,344 +0,0 @@
-/********************************************************************\
- * gnc-hbci-account.c -- hbci account functions                     *
- * Copyright (C) 2004 Christian Stimming                            *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-#include "config.h"
-#include "gnc-hbci-account.h"
-
-#include <gnome.h>
-#include <errno.h>
-#include <openhbci2.h>
-#include <openhbci2/error.h>
-#include "Account.h"
-
-#include "hbci-interaction.h"
-
-/* static short module = MOD_IMPORT; */
-
-struct _gnc_HBCI_Account 
-{
-  const HBCI_Bank *bank;
-  char *bankCode;
-  char *accountid;
-  char *name;
-  char *customer;
-  char *currency;
-  char *name1;
-};
-
-gnc_HBCI_Account *gnc_HBCI_Account_new(const HBCI_Bank *bank, 
-				       const char *bankCode,
-				       const char *accountid)
-{
-  gnc_HBCI_Account *r = g_new0(gnc_HBCI_Account, 1);
-  r->bank = bank;
-  r->bankCode = g_strdup (bankCode);
-  r->accountid = g_strdup (accountid);
-  return r;
-}
-void gnc_HBCI_Account_delete (gnc_HBCI_Account *h)
-{
-  if (!h) return;
-  g_free(h->bankCode);
-  g_free(h->accountid);
-  if (h->name) g_free(h->name);
-  if (h->customer) g_free(h->customer);
-  if (h->currency) g_free(h->currency);
-  if (h->name1) g_free(h->name1);
-  g_free(h);
-}
-
-const char *gnc_HBCI_Account_accountId (const gnc_HBCI_Account *hbci_acc)
-{
-  g_assert(hbci_acc);
-  return hbci_acc->accountid;
-}
-const char *gnc_HBCI_Account_bankCode (const gnc_HBCI_Account *hbci_acc)
-{
-  g_assert(hbci_acc);
-  return hbci_acc->bankCode;
-}
-const HBCI_Bank *
-gnc_HBCI_Account_bank (const gnc_HBCI_Account *hbci_acc)
-{
-  g_assert(hbci_acc);
-  return hbci_acc->bank;
-}
-
-
-void gnc_HBCI_Account_set_name (gnc_HBCI_Account *hbci_acc, const char *n)
-{
-  g_assert(hbci_acc);
-  if (hbci_acc->name) g_free(hbci_acc->name);
-  hbci_acc->name = g_strdup(n);
-}
-void gnc_HBCI_Account_set_customer (gnc_HBCI_Account *hbci_acc, const char *n)
-{
-  g_assert(hbci_acc);
-  if (hbci_acc->customer) g_free(hbci_acc->customer);
-  hbci_acc->customer = g_strdup(n);
-}
-void gnc_HBCI_Account_set_currency (gnc_HBCI_Account *hbci_acc, const char *n)
-{
-  g_assert(hbci_acc);
-  if (hbci_acc->currency) g_free(hbci_acc->currency);
-  hbci_acc->currency = g_strdup(n);
-}
-void gnc_HBCI_Account_set_name1 (gnc_HBCI_Account *hbci_acc, const char *n)
-{
-  g_assert(hbci_acc);
-  if (hbci_acc->name1) g_free(hbci_acc->name1);
-  hbci_acc->name1 = g_strdup(n);
-}
-const char *gnc_HBCI_Account_name (const gnc_HBCI_Account *hbci_acc)
-{
-  g_assert(hbci_acc);
-  return hbci_acc->name;
-}
-const char *gnc_HBCI_Account_customer (const gnc_HBCI_Account *hbci_acc)
-{
-  g_assert(hbci_acc);
-  return hbci_acc->customer;
-}
-const char *gnc_HBCI_Account_currency (const gnc_HBCI_Account *hbci_acc)
-{
-  g_assert(hbci_acc);
-  return hbci_acc->currency;
-}
-const char *gnc_HBCI_Account_name1 (const gnc_HBCI_Account *hbci_acc)
-{
-  g_assert(hbci_acc);
-  return hbci_acc->name1;
-}
-
-gchar *gnc_HBCI_Account_longname(const gnc_HBCI_Account *hacc)
-{
-  g_assert(hacc);
-  /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
-  return g_strdup_printf(_("%s at %s (code %s)"),
-			 gnc_HBCI_Account_accountId (hacc),
-			 gnc_HBCI_Account_bank (hacc) ? 
-			 HBCI_Bank_name (gnc_HBCI_Account_bank (hacc)) : 
-			 gnc_HBCI_Account_bankCode (hacc),
-			 gnc_HBCI_Account_bankCode (hacc));
-}
-
-void *list_HBCI_Account_foreach(GList *h_list, 
-				void*(*func_cb)(gnc_HBCI_Account *acc,
-						void *user_data), 
-				void *user_data)
-{
-  GList *iter;
-  g_assert(func_cb);
-  void *res = NULL;
-
-  if (!h_list) return NULL;
-
-  for (iter = h_list; iter; iter = iter->next)
-    {
-      if (iter->data)
-	res = func_cb(iter->data, user_data);
-      if (res)
-	break;
-    }
-  return res;
-}
-
-
-static void* del_func(gnc_HBCI_Account *acc, void *user_data)
-{
-    gnc_HBCI_Account_delete(acc);
-    return NULL;
-}
-
-
-void list_HBCI_Account_delete(GList *list_HBCI_Account)
-{
-    list_HBCI_Account_foreach(list_HBCI_Account, del_func, NULL);
-    g_list_free (list_HBCI_Account);
-}
-
-
-static void *hbci_find_acc_cb(gnc_HBCI_Account *acc, void *user_data)
-{
-  gnc_HBCI_Account *new_acc = user_data;
-  if (gnc_HBCI_Account_bank(acc) == gnc_HBCI_Account_bank(new_acc)) {
-    if (strcmp(gnc_HBCI_Account_accountId(acc),
-	       gnc_HBCI_Account_accountId(new_acc))==0) {
-      return acc;
-    }
-  }
-  return NULL;
-}
-
-  
-gnc_HBCI_Account *list_HBCI_Account_find(GList *list,
-					 const HBCI_Bank *bank, 
-					 const char *bankCode,
-					 const char *accountid)
-{
-  gnc_HBCI_Account *acc;
-  gnc_HBCI_Account *res;
-
-  if (list == NULL) return NULL;
-  g_assert(bank);
-  g_assert(bankCode);
-  g_assert(accountid);
-  
-  /* Create the wrapper object */
-  acc = gnc_HBCI_Account_new(bank, bankCode, accountid);
-
-  /* Check if such an account already exists */
-  res = list_HBCI_Account_foreach(list, hbci_find_acc_cb, acc);
-
-  gnc_HBCI_Account_delete(acc);
-  return res;
-}
-
-
-
-
-/* ------------------------------------------------------------ */
-
-#define HBCI_ACCOUNT_ID "account-id"
-#define HBCI_BANK_CODE "bank-code"
-#define HBCI_COUNTRY_CODE "country-code"
-#define HBCI_ACCOUNT_CURRENCY "acc-currency"
-#define HBCI_ACCOUNT_NAME "acc-name"
-#define HBCI_ACCOUNT_NAME1 "acc-name1"
-#define HBCI_ACCOUNT_CUSTOMER "acc-customer"
-
-/** Constructor from a kvp_frame */
-gnc_HBCI_Account *gnc_HBCI_Account_from_kvp(kvp_frame *k, HBCI_API *api)
-{
-  gnc_HBCI_Account *res = NULL;
-  HBCI_Bank *bank;
-  char *bankcode;
-  int countrycode;
-  g_assert(k);
-
-  bankcode = kvp_value_get_string (kvp_frame_get_slot(k, HBCI_BANK_CODE));
-  countrycode = kvp_value_get_gint64 (kvp_frame_get_slot(k, HBCI_COUNTRY_CODE));
-
-  if (bankcode && (strlen(bankcode)>0) && (countrycode > 0)) {
-    bank = HBCI_API_findBank (api, countrycode, bankcode);
-    /*printf("gnc_HBCI_Account_from_kvp: kvpframe has blz %s and ccode %d and accountid %s, bank %p\n",
-      bankcode, countrycode, kvp_value_get_string
-      (kvp_frame_get_slot(k, HBCI_ACCOUNT_ID)), bank);*/
-    if (!bank) {
-      printf("gnc_HBCI_Account_from_kvp: oops, the file has a HBCI_Account but its bank could not be found in the HBCI_API. Ignoring this account.\n");
-      return NULL;
-    }
-    res = gnc_HBCI_Account_new(bank, 
-			       bankcode,
-			       kvp_value_get_string
-			       (kvp_frame_get_slot(k, HBCI_ACCOUNT_ID)));
-    gnc_HBCI_Account_set_currency(res, kvp_value_get_string
-				  (kvp_frame_get_slot(k, HBCI_ACCOUNT_CURRENCY)));
-    gnc_HBCI_Account_set_name(res, kvp_value_get_string
-			      (kvp_frame_get_slot(k, HBCI_ACCOUNT_NAME)));
-    gnc_HBCI_Account_set_name1(res, kvp_value_get_string
-			       (kvp_frame_get_slot(k, HBCI_ACCOUNT_NAME1)));
-    gnc_HBCI_Account_set_customer(res, kvp_value_get_string
-				  (kvp_frame_get_slot(k, HBCI_ACCOUNT_CUSTOMER)));
-  }
-  return res;
-}
-
-/** Creates a kvp_frame from this TransTempl */
-kvp_frame *gnc_HBCI_Account_to_kvp(const gnc_HBCI_Account *t)
-{
-  kvp_frame *k = kvp_frame_new();
-  g_assert(t);
-
-  kvp_frame_set_slot(k, HBCI_ACCOUNT_ID, 
-		     kvp_value_new_string(gnc_HBCI_Account_accountId(t)));
-  kvp_frame_set_slot(k, HBCI_BANK_CODE, 
-		     kvp_value_new_string(gnc_HBCI_Account_bankCode (t)));
-  kvp_frame_set_slot(k, HBCI_ACCOUNT_CURRENCY, 
-		     kvp_value_new_string(gnc_HBCI_Account_currency (t)));
-  kvp_frame_set_slot(k, HBCI_ACCOUNT_NAME, 
-		     kvp_value_new_string(gnc_HBCI_Account_name (t)));
-  kvp_frame_set_slot(k, HBCI_ACCOUNT_NAME1, 
-		     kvp_value_new_string(gnc_HBCI_Account_name1 (t)));
-  kvp_frame_set_slot(k, HBCI_ACCOUNT_CUSTOMER, 
-		     kvp_value_new_string(gnc_HBCI_Account_customer (t)));
-  if (gnc_HBCI_Account_bank(t))
-    kvp_frame_set_slot(k, HBCI_COUNTRY_CODE, 
-		       kvp_value_new_gint64(HBCI_Bank_country 
-					    (gnc_HBCI_Account_bank(t))));
-  return k;
-}
-
-struct _glistapi
-{
-  GList *res;
-  HBCI_API *api;
-};
-/** Creates a GList of gnc_HBCI_Account from a GList of kvp_values which
-    in turn contain a kvp_frame. */
-static void glist_from_kvp_func(gpointer data, gpointer user_data)
-{
-  struct _glistapi *mydata = user_data;
-  kvp_value *k = data;
-  gnc_HBCI_Account *new_acc = gnc_HBCI_Account_from_kvp(kvp_value_get_frame(k),
-							mydata->api);
-  if (new_acc)
-    mydata->res = g_list_append(mydata->res, new_acc);
-}
-
-/** Creates a GList of gnc_HBCI_Account from a GList of kvp_values which
-    in turn contain a kvp_frame. */
-GList *gnc_HBCI_Account_glist_from_kvp_glist(GList *v, HBCI_API *api)
-{
-  struct _glistapi mydata;
-  if (!v) return NULL;
-
-  mydata.res = NULL;
-  mydata.api = api;
-  
-  g_list_foreach (v, glist_from_kvp_func, &mydata);
-  return mydata.res;
-}
-
-
-/** Creates a GList of kvp_value (which in turn contain a kvp_frame)
-    from a GList of gnc_HBCI_Account. */
-static void glist_to_kvp_func(gpointer data, gpointer user_data)
-{
-  GList **tmp = user_data;
-  GList *res = *tmp;
-  gnc_HBCI_Account *g = data;
-  *tmp = g_list_append(res, 
-		       kvp_value_new_frame_nc(gnc_HBCI_Account_to_kvp(g)));
-}
-/** Creates a GList of kvp_value (which in turn contain a kvp_frame)
-    from a GList of gnc_HBCI_Account. */
-GList *gnc_HBCI_Account_kvp_glist_from_glist(GList *k)
-{
-  GList *res = NULL;
-  if (!k) return NULL;
-
-  g_list_foreach (k, glist_to_kvp_func, &res);
-  return res;
-}
-
-
Index: gnc-hbci-gettrans.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-gettrans.c,v
retrieving revision 1.27
retrieving revision 1.28
diff -Lsrc/import-export/hbci/gnc-hbci-gettrans.c -Lsrc/import-export/hbci/gnc-hbci-gettrans.c -u -r1.27 -r1.28
--- src/import-export/hbci/gnc-hbci-gettrans.c
+++ src/import-export/hbci/gnc-hbci-gettrans.c
@@ -23,8 +23,6 @@
 #include "config.h"
 #include "gnc-hbci-gettrans.h"
 
-#include <openhbci2/api.h>
-
 #include "gnc-ui.h"
 #include "gnc-numeric.h"
 #include "gnc-date.h"
@@ -46,10 +44,9 @@
 
 gboolean
 gettrans_dates(GtkWidget *parent, Account *gnc_acc, 
-	       HBCI_Date **from_date, HBCI_Date **to_date);
+	       GWEN_TIME **from_date, GWEN_TIME **to_date);
 
-static void *trans_list_cb (GWEN_DB_NODE *trans_node, void *user_data);
-static void *reports_cb(GWEN_DB_NODE *reportn, void *user_data);
+static AB_TRANSACTION *trans_list_cb(AB_TRANSACTION *reportn, void *user_data);
 
 struct trans_list_data 
 {
@@ -61,80 +58,53 @@
 void
 gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc)
 {
-  HBCI_API *api = NULL;
-  HBCI_Outbox *outbox = NULL;
-  const gnc_HBCI_Account *h_acc = NULL;
+  AB_BANKING *api = NULL;
+  const AB_ACCOUNT *h_acc = NULL;
   GNCInteractor *interactor = NULL;
-  const HBCI_Customer *customer = NULL;
-  GList *hbci_accountlist = NULL;
   
   g_assert(parent);
   g_assert(gnc_acc);
 
   /* Get the api */
-  api = gnc_hbci_api_new_currentbook (parent, &interactor, &hbci_accountlist);
+  api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
   if (api == NULL) {
     printf("gnc_hbci_gettrans: Couldn't get HBCI API.\n");
     return;
   }
   g_assert (interactor);
-  outbox = HBCI_Outbox_new();
 
-  /* Get the HBCI account */
+  /* Get HBCI account */
   h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
   if (h_acc == NULL) {
-    printf("gnc_hbci_gettrans: No HBCI account found.\n");
+    printf("gnc_hbci_getbalance: No HBCI account found.\n");
+    /* FIXME: free unneeded data */
     return;
   }
-  /* printf("gnc_hbci_gettrans: HBCI account no. %s found.\n",
-     gnc_HBCI_Account_accountId (h_acc)); */
-
-  /* Get the customer that should be doing this job. */
-  customer = gnc_hbci_get_first_customer(h_acc);
-  if (!customer) 
-    return;
-
-  /* g_assert (customer); */
-  /* printf("gnc_hbci_gettrans: Customer id %s found.\n",
-     HBCI_Customer_custId ((HBCI_Customer *)customer)); */
 
   {
     /* Execute a GetTransactions job. */
-    HBCI_OutboxJob *job;
+    AB_JOB *job;
     Timespec until_timespec;
-    HBCI_Date *from_date, *to_date;
+    GWEN_TIME *from_date, *to_date;
 
     /* Get the start and end dates for the Gettrans job.  */
     if (!gettrans_dates(parent, gnc_acc, &from_date, &to_date))
       return;
     /* Use this as a local storage for the until_time below. */
-    timespecFromTime_t(&until_timespec, HBCI_Date_to_time_t(to_date));
+    timespecFromTime_t(&until_timespec, GWEN_Time_toTime_t(to_date));
     
     /* Create OutboxJob */
-    job = HBCI_OutboxJob_new("JobGetTransactions", (HBCI_Customer *)customer, 
-			     gnc_HBCI_Account_accountId(h_acc));
-    
-    {
-      HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
-      char *tmp;
-      
-      tmp = HBCI_Date_toString(from_date);
-      HBCI_Job_setProperty(jjob, "fromDate", tmp);
-      free(tmp);
-      tmp = HBCI_Date_toString(to_date);
-      HBCI_Job_setProperty(jjob, "toDate", tmp);
-      free(tmp);
-    }
-    HBCI_Date_delete (from_date);
-    HBCI_Date_delete (to_date);
+    job = AB_JobGetTransactions_new((AB_ACCOUNT*)h_acc);
+    AB_JobGetTransactions_SetFromTime(job, from_date);
+    AB_JobGetTransactions_SetToTime(job, to_date);
 
-    /* Add job to HBCI_API queue. */
-    HBCI_Outbox_addJob (outbox, job);
+    /* Add job to AB_BANKING queue. */
+    AB_Banking_EnqueueJob(api, job);
 
     /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (parent, api, outbox, job, interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE);
+    if (!gnc_AB_BANKING_execute (parent, api, job, interactor)) {
+      /* AB_BANKING_executeOutbox failed. */
+      AB_Banking_DequeueJob(api, job);
       return;
     }
 
@@ -145,9 +115,8 @@
     gnc_hbci_gettrans_final(parent, gnc_acc, job, FALSE);
 
     /* Clean up behind ourself. */
-    HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE);
-    HBCI_Outbox_delete(outbox);
-    gnc_hbci_api_save (api);
+    AB_Banking_DequeueJob(api, job);
+    gnc_AB_BANKING_save (api);
     GNCInteractor_hide (interactor);
   }
 }
@@ -159,11 +128,10 @@
     deleted. */
 gboolean
 gettrans_dates(GtkWidget *parent, Account *gnc_acc, 
-	       HBCI_Date **from_date, HBCI_Date **to_date)
+	       GWEN_TIME **from_date, GWEN_TIME **to_date)
 {
   Timespec last_timespec, until_timespec;
-  time_t now = time(NULL), time_convert;
-  struct tm tm;
+  time_t now = time(NULL);
   gboolean use_last_date = TRUE, 
     use_earliest_date = TRUE, use_until_now = TRUE;
 
@@ -189,19 +157,17 @@
     
     /* Now calculate from date */
     if (use_earliest_date)
-      *from_date = HBCI_Date_new_blank();
+      *from_date = GWEN_Time_fromSeconds(0);
     else {
       if (use_last_date)
 	last_timespec = gnc_hbci_get_account_trans_retrieval (gnc_acc);
-      time_convert = timespecToTime_t(last_timespec);
-      *from_date = HBCI_Date_new (localtime_r (&time_convert, &tm));
+      *from_date = GWEN_Time_fromSeconds(timespecToTime_t(last_timespec));
     }
 
     /* Now calculate to date */
     if (use_until_now)
       timespecFromTime_t (&until_timespec, now);
-    time_convert = timespecToTime_t (until_timespec);
-    *to_date = HBCI_Date_new (localtime_r (&time_convert, &tm));
+    *to_date = GWEN_Time_fromSeconds(timespecToTime_t (until_timespec));
 
     return TRUE;
 }
@@ -212,24 +178,15 @@
 gboolean
 gnc_hbci_gettrans_final(GtkWidget *parent, 
 			Account *gnc_acc, 
-			const HBCI_OutboxJob *trans_job,
+			const AB_JOB *trans_job,
 			gboolean run_until_done)
 {
   /* Now add the retrieved transactions to the gnucash account. */
-  GWEN_DB_NODE *trans_list, *response;
-
+  AB_TRANSACTION_LIST2 *trans_list;
 
-  response = HBCI_Job_responseData((HBCI_Job*)HBCI_OutboxJob_Job_const(trans_job));
-  if (!response) {
-    printf("gnc_hbci_gettrans_final: Got no responseData.\n");
-    return FALSE;
-  }
-
-  trans_list = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, 
-				"transactions");
+  trans_list = AB_JobGetTransactions_GetTransactions(trans_job);
   if (!trans_list) {
     printf("gnc_hbci_gettrans_final: No transactions section. Response was:\n");
-    GWEN_DB_Dump(response, stdout, 1);
 
     gnome_ok_dialog_parented 
       (_("The HBCI import returned no transactions for the selected time period."),
@@ -237,15 +194,7 @@
     return TRUE;
   }
   
-  trans_list = GWEN_DB_GetGroup(trans_list,
-				GWEN_PATH_FLAGS_NAMEMUSTEXIST,
-				"booked");
-
-  if (!trans_list) {
-    printf("gnc_hbci_gettrans_final: No booked section. Response was:\n");
-    GWEN_DB_Dump(response, stdout, 1);
-  }
-  if (trans_list && (GWEN_DB_Groups_Count(trans_list) > 0)) {
+  if (trans_list && (AB_Transaction_List2_GetSize(trans_list) > 0)) {
     struct trans_list_data data;
     GNCImportMainMatcher *importer_generic_gui = 
       gnc_gen_trans_list_new(NULL, NULL, TRUE);
@@ -253,7 +202,7 @@
     data.importer_generic = importer_generic_gui;
     data.gnc_acc = gnc_acc;
 	
-    GWEN_DB_Groups_Foreach (trans_list, reports_cb, &data);
+    AB_Transaction_List2_ForEach (trans_list, trans_list_cb, &data);
 
     if (run_until_done)
       return gnc_gen_trans_list_run (importer_generic_gui);
@@ -269,28 +218,10 @@
 }
 
 
-static void *reports_cb(GWEN_DB_NODE *reportn, void *user_data)
-{
-  if (!reportn) {
-    /*DBG_INFO(0, "Oops: reportn is NULL");*/
-    return NULL;
-  }
-  if (strcasecmp(GWEN_DB_GroupName(reportn), "report")==0) {
-    return GWEN_DB_Groups_Foreach(reportn, trans_list_cb, user_data);
-  } // if report
-  else {
-    /*DBG_WARN(0, "Unknown section \"%s\"", GWEN_DB_GroupName(reportn));*/
-  }
-  return NULL;
-}
-
-
-/* list_HBCI_Transaction_foreach callback. The Conversion from HBCI to
-   GNC transaction is done here, once for each HBCI_Transaction.  */
-static void *trans_list_cb (GWEN_DB_NODE *trans_node, 
-			    void *user_data)
+/* list_AB_TRANSACTION_foreach callback. The Conversion from HBCI to
+   GNC transaction is done here, once for each AB_TRANSACTION.  */
+static AB_TRANSACTION *trans_list_cb(AB_TRANSACTION *h_trans, void *user_data)
 {
-  HBCI_Transaction *h_trans;
   time_t current_time, tt1, tt2; 
   /*struct tm tm1, tm2;*/
   Account *gnc_acc;
@@ -300,113 +231,82 @@
   struct trans_list_data *data = user_data;
   g_assert(data);
 
-  if (!trans_node) return NULL;
+  if (!h_trans) return NULL;
 
   gnc_acc = data->gnc_acc;
   g_assert(gnc_acc);
   book = xaccAccountGetBook(gnc_acc);
 
-  if (strcasecmp(GWEN_DB_GroupName(trans_node), "transaction")==0) {
-    /* Create wrapper HBCI_Transaction */
-    h_trans = HBCI_Transaction_new(trans_node);
-
-    gnc_trans = xaccMallocTransaction(book);
-    xaccTransBeginEdit(gnc_trans);
-
-    /*if(data.fi_id_valid==true){
-      gnc_import_set_trans_online_id(gnc_trans, data.fi_id);
-      }*/
-
-    tt1 = HBCI_Date_to_time_t (HBCI_Transaction_date(h_trans));
-    tt2 = HBCI_Date_to_time_t (HBCI_Transaction_valutaDate(h_trans));
-    /*printf("Date? %s ValutaDate? %s", ctime(&tt1), ctime(&tt2));*/
-    /*tm1 = HBCI_Date_to_tm (HBCI_Transaction_date(h_trans));
-      tm2 = HBCI_Date_to_tm (HBCI_Transaction_valutaDate(h_trans));
-      printf("Date asc %s ValutaDate asc %s", asctime(&tm1), asctime(&tm2));*/
+  /* Create new gnucash transaction for the given hbci one */
+  gnc_trans = xaccMallocTransaction(book);
+  xaccTransBeginEdit(gnc_trans);
+
+  /*if(data.fi_id_valid==true){
+    gnc_import_set_trans_online_id(gnc_trans, data.fi_id);
+    }*/
+
+  tt1 = GWEN_Time_toTime_t (AB_Transaction_GetDate(h_trans));
+  tt2 = GWEN_Time_toTime_t (AB_Transaction_GetValutaDate(h_trans));
+  /*printf("Date? %s ValutaDate? %s", ctime(&tt1), ctime(&tt2));*/
+  /*tm1 = GWEN_TIME_to_tm (AB_Transaction_date(h_trans));
+    tm2 = GWEN_TIME_to_tm (AB_Transaction_valutaDate(h_trans));
+    printf("Date asc %s ValutaDate asc %s", asctime(&tm1), asctime(&tm2));*/
   
   
-    /* Date / Time */
-    xaccTransSetDateSecs
-      (gnc_trans, HBCI_Date_to_time_t (HBCI_Transaction_valutaDate (h_trans)));
+  /* Date / Time */
+  xaccTransSetDateSecs
+    (gnc_trans, GWEN_Time_toTime_t (AB_Transaction_GetValutaDate (h_trans)));
     
-    current_time = time(NULL);
-    xaccTransSetDateEnteredSecs(gnc_trans, mktime(localtime(&current_time)));
+  current_time = time(NULL);
+  xaccTransSetDateEnteredSecs(gnc_trans, mktime(localtime(&current_time)));
     
-    /* Currency; we take simply the default currency of the gnucash account */
-    xaccTransSetCurrency(gnc_trans, xaccAccountGetCommodity(gnc_acc));
+  /* Currency; we take simply the default currency of the gnucash account */
+  xaccTransSetCurrency(gnc_trans, xaccAccountGetCommodity(gnc_acc));
     
-    {
-      /* Number. We use the "customer reference", if there is one. */
-      const char *custref = HBCI_Transaction_customerReference (h_trans);
-      if (custref && (strlen (custref) > 0) && 
-	  (g_strncasecmp (custref, "NONREF", 6) != 0))
-	xaccTransSetNum (gnc_trans, custref);
-    }
+  {
+    /* Number. We use the "customer reference", if there is one. */
+    const char *custref = AB_Transaction_GetCustomerReference (h_trans);
+    if (custref && (strlen (custref) > 0) && 
+	(g_strncasecmp (custref, "NONREF", 6) != 0))
+      xaccTransSetNum (gnc_trans, custref);
+  }
     
-    /* Description */
-    {
-      char *g_descr = gnc_hbci_descr_tognc (h_trans);
-      xaccTransSetDescription (gnc_trans, g_descr);
-      g_free (g_descr);
-    }
+  /* Description */
+  {
+    char *g_descr = gnc_hbci_descr_tognc (h_trans);
+    xaccTransSetDescription (gnc_trans, g_descr);
+    g_free (g_descr);
+  }
   
-    /* Notes. */
-    /*xaccTransSetNotes (gnc_trans, g_notes);*/
-    /* But Nobody ever uses the Notes field? */
-    
-    /* Add one split */
-    split=xaccMallocSplit(book);
-    xaccTransAppendSplit(gnc_trans, split);
-    xaccAccountInsertSplit(gnc_acc, split);
+  /* Notes. */
+  /*xaccTransSetNotes (gnc_trans, g_notes);*/
+  /* But Nobody ever uses the Notes field? */
+  
+  /* Add one split */
+  split=xaccMallocSplit(book);
+  xaccTransAppendSplit(gnc_trans, split);
+  xaccAccountInsertSplit(gnc_acc, split);
     
-    {
-      /* Amount into the split */
-      gnc_numeric gnc_amount = double_to_gnc_numeric
-	(HBCI_Value_getValue (HBCI_Transaction_value (h_trans)),
-	 xaccAccountGetCommoditySCU(gnc_acc),
-	 GNC_RND_ROUND);
+  {
+    /* Amount into the split */
+    gnc_numeric gnc_amount = double_to_gnc_numeric
+      (AB_Value_GetValue (AB_Transaction_GetValue (h_trans)),
+       xaccAccountGetCommoditySCU(gnc_acc),
+       GNC_RND_ROUND);
     xaccSplitSetBaseValue(split, gnc_amount, xaccAccountGetCommodity(gnc_acc));
-    }
+  }
     
-    /* Memo in the Split. */
-    {
-      char *g_memo = gnc_hbci_memo_tognc (h_trans);
-      xaccSplitSetMemo(split, g_memo);
-      g_free (g_memo);
-    }
+  /* Memo in the Split. */
+  {
+    char *g_memo = gnc_hbci_memo_tognc (h_trans);
+    xaccSplitSetMemo(split, g_memo);
+    g_free (g_memo);
+  }
     
-    /* Instead of xaccTransCommitEdit(gnc_trans)  */
-    g_assert (data->importer_generic);
-    gnc_gen_trans_list_add_trans (data->importer_generic, gnc_trans);
+  /* Instead of xaccTransCommitEdit(gnc_trans)  */
+  g_assert (data->importer_generic);
+  gnc_gen_trans_list_add_trans (data->importer_generic, gnc_trans);
 
-    HBCI_Transaction_delete(h_trans);
-  }
-  else if (strcasecmp(GWEN_DB_GroupName(trans_node), "startsaldo")==0) {
-    /*DBG_INFO(0, "Found opening balance");*/
-  }
-  else if (strcasecmp(GWEN_DB_GroupName(trans_node), "endsaldo")==0) {
-    /* Found closing balance */
-    trans_node = GWEN_DB_GetGroup(trans_node,
-				  GWEN_PATH_FLAGS_NAMEMUSTEXIST,
-				  "value");
-    /*if (trans_node) {
-      HBCI_Value *bal;
-      char *val;
-      DBG_INFO(0, "Found closing balance");
-      
-      bal = HBCI_Value_new(GWEN_DB_GetCharValue(trans_node, "value", 0, "0"),
-			   GWEN_DB_GetCharValue(trans_node, "currency", 0, "EUR"));
-      
-      val = HBCI_Value_toReadableString(bal);
-      printf("Got closing balance %s\n", val);
-      
-      free(val);
-      HBCI_Value_delete(bal);
-      }*/
-  }
-  else {
-    /*DBG_WARN(0, "Unknown section \"%s\"", GWEN_DB_GroupName(trans_node));*/
-  }
   return NULL;
   
 }
Index: gnc-hbci-transfer.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-transfer.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/import-export/hbci/gnc-hbci-transfer.h -Lsrc/import-export/hbci/gnc-hbci-transfer.h -u -r1.4 -r1.5
--- src/import-export/hbci/gnc-hbci-transfer.h
+++ src/import-export/hbci/gnc-hbci-transfer.h
@@ -24,7 +24,7 @@
 #define GNC_HBCI_TRANSFER_H
 
 #include <gnome.h>
-#include <openhbci2/transaction.h>
+#include <aqbanking/jobsingletransfer.h>
 #include "Account.h"
 #include "dialog-hbcitrans.h"
 
@@ -33,7 +33,7 @@
 		    GNC_HBCI_Transtype trans_type);
 
 /** Open a gnucash transfer dialog for gnucash Account gnc_acc and
- * fill in all the values from the HBCI_Transaction inside the
+ * fill in all the values from the AB_TRANSACTION inside the
  * HBCITransDialog. Returns TRUE if the gnucash transaction has been
  * successfully created, FALSE if e.g. the user pressed cancel. */
 gboolean
Index: druid-hbci-initial.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/druid-hbci-initial.c,v
retrieving revision 1.47
retrieving revision 1.48
diff -Lsrc/import-export/hbci/druid-hbci-initial.c -Lsrc/import-export/hbci/druid-hbci-initial.c -u -r1.47 -r1.48
--- src/import-export/hbci/druid-hbci-initial.c
+++ src/import-export/hbci/druid-hbci-initial.c
@@ -40,21 +40,13 @@
 #include "gnc-html.h"
 #include "gnc-component-manager.h"
 
-#include <openhbci2/api.h>
-#include <openhbci2/outboxjob.h>
-#include <openhbci2/mediumrdhbase.h>
+#include <aqbanking/banking.h>
 
-#include <openhbci2.h>
-
-#define DEFAULT_HBCI_VERSION 201
+/* #define DEFAULT_HBCI_VERSION 201 */
 
 typedef enum _infostate {
-  INI_ADD_BANK,
-  INI_ADD_USER,
   INI_UPDATE_ACCOUNTS,
   INI_MATCH_ACCOUNTS,
-  ADD_BANK,
-  ADD_USER,
   UPDATE_ACCOUNTS,
   MATCH_ACCOUNTS
 } Infostate;
@@ -66,56 +58,13 @@
 
   /* configfile page */
   GtkWidget *filepage;
-  GtkWidget *configfileentry;
-  char *configfile;
-  
-  /* bank info page */
-  GtkWidget *bankpage;
-  GtkWidget *bankcode;
-  GtkWidget *countrycode;
-  GtkWidget *ipaddr;
-  /*GtkWidget *port;*/
-
-  /* user info page */
-  GtkWidget *userpage;
-  GtkWidget *user_bankcode;
-  GtkWidget *user_bankname;
-  GtkWidget *userid;
-  GtkWidget *username;
-  GtkWidget *customerid;
-  GtkWidget *customername;
-  GtkWidget *mediumrdh;
-  GtkWidget *mediumpath;
-  GtkWidget *mediumddv;
-
-  /* account update info page */
-  GtkWidget *accountinfopage;
   
   /* account match page */
   GtkWidget *accountpage;
   GtkWidget *accountlist;
     
-  /* server iniletter info page */
-  GtkWidget *serverinfopage;
-
-  /* iniletter server */
-  GtkWidget *serverpage;
-  GtkWidget *server_vbox;
-  GtkWidget *server_frame;
-  gnc_html *server_html;
-
-  /* user iniletter info page */
-  GtkWidget *userinfopage;
-  
-  /* iniletter user */
-  GtkWidget *user_vbox;
-  GtkWidget *user_frame;
-  gnc_html *user_html;
-
   /* OpenHBCI stuff */
-  HBCI_API *api;
-  HBCI_Outbox *outbox;
-  GList *hbci_accountlist;
+  AB_BANKING *api;
   GNCInteractor *interactor;
 
   /* account match: row_number (int) -> hbci_account */
@@ -126,14 +75,6 @@
   /* Status of user's movement through the wizard */
   Infostate state;
 
-  /* Newly created customer */
-  const HBCI_Customer *newcustomer;
-  /* Bank for which a new user is about to be created */
-  const HBCI_Bank *newbank;
-
-  /* Customer for which we already got the keys */
-  const HBCI_Customer *gotkeysforCustomer;
-  
 };
 
 static gboolean
@@ -156,29 +97,16 @@
 {
   if (info == NULL) return;
 
-  if (info->api != NULL) 
-    gnc_hbci_api_delete (info->api);
+  if (info->api != NULL) {
+    gnc_AB_BANKING_delete (info->api);
+  }
   info->api = NULL;
 
-  if (info->outbox != NULL)
-    HBCI_Outbox_delete(info->outbox);
-  info->outbox = NULL;
-
-  info->newcustomer = NULL;
-  info->newbank = NULL;
-  
-  if (info->configfile != NULL) 
-    g_free (info->configfile);
-  info->configfile = NULL;
-    
   delete_hash (info->hbci_hash);
   info->hbci_hash = NULL;
   if (info->gnc_hash != NULL)
     g_hash_table_destroy (info->gnc_hash);
   info->gnc_hash = NULL;
-
-  list_HBCI_Account_delete(info->hbci_accountlist);
-  info->hbci_accountlist = NULL;
 }
 
 static void
@@ -201,8 +129,8 @@
 /*******************************************************************
  * update_accountlist widget
  */
-static gpointer
-update_accountlist_acc_cb (gnc_HBCI_Account *hacc, gpointer user_data)
+static AB_ACCOUNT *
+update_accountlist_acc_cb (AB_ACCOUNT *hacc, gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
   gchar *row_text[3];
@@ -214,7 +142,7 @@
   g_assert(info);
   row_text[2] = "";
   
-  row_text[0] = gnc_HBCI_Account_longname(hacc);
+  row_text[0] = g_strdup(AB_Account_GetOwnerName(hacc));
 		
   /* Get corresponding gnucash account */
   gacc = g_hash_table_lookup (info->gnc_hash, hacc);
@@ -236,7 +164,7 @@
   /* Store the row_number -> hbci_account hash reference. */
   row_key = g_new(gint, 1);
   *row_key = row;
-  g_hash_table_insert (info->hbci_hash, row_key, (gnc_HBCI_Account*)hacc);
+  g_hash_table_insert (info->hbci_hash, row_key, (AB_ACCOUNT*)hacc);
 
   return NULL;
 }
@@ -245,18 +173,12 @@
 static void
 update_accountlist (HBCIInitialInfo *info)
 {
-  const list_HBCI_Bank *banklist;
   int sel_row = 0;
 
   g_assert(info);
   g_assert(info->api);
   g_assert(info->gnc_hash);
 
-  banklist = HBCI_API_bankList (info->api);
-  /*printf("%d banks found.\n", list_HBCI_Bank_size (banklist));*/
-  if (list_HBCI_Bank_size (banklist) == 0) 
-    return;
-
   /* Store old selected row here. */
   sel_row = (GTK_CLIST(info->accountlist))->focus_row;
 
@@ -270,9 +192,9 @@
   g_hash_table_freeze (info->hbci_hash);
   
   /* Go through all HBCI accounts */
-  list_HBCI_Account_foreach (info->hbci_accountlist,
-			     update_accountlist_acc_cb,
-			     info);
+  AB_Account_List2_ForEach (AB_Banking_GetAccounts(info->api),
+			    update_accountlist_acc_cb,
+			    info);
 
   //printf("update_accountlist: HBCI hash has %d entries.\n", g_hash_table_size(info->hbci_hash));
   //printf("update_accountlist: GNC hash has %d entries.\n", g_hash_table_size(info->gnc_hash));
@@ -309,291 +231,6 @@
  * end button enabling
  *******************************************************************/
 
-/******************************************************************
- * string conversion 
- */
-static char *
-to_hexstring (const char *str)
-{
-  int i, bytes = strlen(str)/2;
-  char *res = g_strnfill (3*bytes, ' ');
-  for (i=0; i < bytes; i++) {
-    res[3*i+0] = str[2*i+0];
-    res[3*i+1] = str[2*i+1];
-    if (i % 16 == 15)
-      res[3*i+2] = '\n';
-  }
-  res [3*i+2] = '\0';
-  /*printf ("Converted -%s- to -%s-.\n", str, res);*/
-  return res;
-}
-static char *
-to_hexstring_hash (const char *str)
-{
-  int i, bytes = strlen(str)/2;
-  char *res = g_strnfill (3*bytes, ' ');
-  for (i=0; i < bytes; i++) {
-    res[3*i+0] = str[2*i+0];
-    res[3*i+1] = str[2*i+1];
-    if (i % 10 == 9)
-      res[3*i+2] = '\n';
-  }
-  res [3*i+2] = '\0';
-  /*printf ("Converted -%s- to -%s-.\n", str, res);*/
-  return res;
-}
-/*
- * end string conversion 
- ***************************************************************/
-
-
-
-
-
-
-static const HBCI_Customer *
-choose_customer (HBCIInitialInfo *info)
-{
-  const HBCI_Bank *bank;
-  const HBCI_User *user;
-  g_assert (info);
-
-  /* Get HBCI bank from the banklist */
-  bank = choose_one_bank (info->window, HBCI_API_bankList (info->api) );
-
-  if (bank == 0) 
-    return NULL;
-  
-  /* Get User from user list. */
-  user = choose_one_user (info->window, HBCI_Bank_users (bank) );
-
-  if (user == NULL)
-    return NULL;
-
-  /* Get customer from customer list. */
-  return choose_one_customer(info->window, HBCI_User_customers (user) );
-}
-
-/*********************************************************************
- * HBCI Version Picking dialog
- */
-static void *hbciversion_cb (int value, void *user_data) 
-{
-  GtkWidget *clist = user_data;
-  gchar *text;
-  int row;
-  g_assert (clist);
-
-  switch (value) 
-    {
-    case 2:
-      text = g_strdup ("HBCI 2.0");
-      break;
-    case 201:
-      text = g_strdup ("HBCI 2.0.1");
-      break;
-    case 210:
-      text = g_strdup ("HBCI 2.1");
-      break;
-    case 220:
-      text = g_strdup ("HBCI 2.2");
-      break;
-    case 300:
-      text = g_strdup ("FinTS (HBCI 3.0)");
-      break;
-    default:
-      text = g_strdup_printf ("HBCI %d", value);
-    }
-  
-  row = gtk_clist_append (GTK_CLIST (clist), &text);
-  gtk_clist_set_row_data (GTK_CLIST (clist), row, GINT_TO_POINTER (value));
-  
-  return NULL;
-}
-static void hbciversion_select_row (GtkCList *clist,
-				    gint row, gint column,
-				    GdkEventButton *event, gpointer user_data)
-{
-  int *pointer = user_data;
-  *pointer = row;
-}
-static void hbciversion_unselect_row (GtkCList *clist,
-				      gint row, gint column,
-				      GdkEventButton *event, 
-				      gpointer user_data)
-{
-  int *pointer = user_data;
-  *pointer = 0;
-}
-
-static gboolean 
-choose_hbciversion_dialog (GtkWindow *parent, HBCI_Bank *bank,
-			   HBCIInitialInfo *info)
-{
-  int retval = -1;
-  int selected_row = 0;
-  int initial_selection;
-  GladeXML *xml;
-  GtkWidget *version_clist;
-  GtkWidget *dialog;
-  g_assert (bank);
-  
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_version_dialog");
-
-  g_assert
-    (dialog = glade_xml_get_widget (xml, "HBCI_version_dialog"));
-  g_assert
-    (version_clist = glade_xml_get_widget (xml, "version_clist"));
-  gtk_signal_connect (GTK_OBJECT (version_clist), "select_row",
-		      GTK_SIGNAL_FUNC (hbciversion_select_row), &selected_row);
-  gtk_signal_connect (GTK_OBJECT (version_clist), "unselect_row",
-		      GTK_SIGNAL_FUNC (hbciversion_unselect_row),
-		      &selected_row);
-
-  gnome_dialog_set_parent (GNOME_DIALOG (dialog), parent);
-  gtk_clist_freeze (GTK_CLIST (version_clist));
-  {
-    list_int *supported_v = HBCI_Bank_supportedVersions (bank);
-    g_assert (supported_v);
-    if (list_int_size (supported_v) == 0) {
-      list_int_delete (supported_v);
-      return FALSE;
-    }
-    list_int_foreach (supported_v, hbciversion_cb, version_clist);
-    list_int_delete (supported_v);
-  }
-
-  /* Initial selection */
-  initial_selection = HBCI_Bank_hbciVersion (bank);
-  gtk_clist_select_row 
-    (GTK_CLIST (version_clist), 
-     gtk_clist_find_row_from_data
-     (GTK_CLIST (version_clist), GINT_TO_POINTER (initial_selection)), 
-     0);
-
-  gtk_clist_thaw (GTK_CLIST (version_clist));
-  gnome_dialog_close_hides (GNOME_DIALOG (dialog), TRUE);
-
-  retval = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));  
-
-  /*fprintf (stderr, "retval = %d, selected_row = %d\n", retval, selected_row);*/
-  if ((retval == 0) && (selected_row > 0))
-    {
-      int newversion = 
-	GPOINTER_TO_INT (gtk_clist_get_row_data
-			 (GTK_CLIST (version_clist), selected_row));
-      if (newversion != initial_selection) 
-	{
-	  HBCI_OutboxJob *job;
-
-	  gtk_widget_destroy (dialog);
-	  /*fprintf (stderr, "Setting new HBCI version %d\n", newversion); */
-	  HBCI_Bank_setHbciVersion (bank, newversion);
-	  /*HBCI_Bank_setBPDVersion (bank, 0);*/
-	  job = HBCI_OutboxJob_new("JobUpdateBankInfo", 
-				   (HBCI_Customer*)info->newcustomer, "");
-	  HBCI_Outbox_addJob(info->outbox, job);
-	  
-	  {
-	    HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
-	    /* copied from aqmoney-tng/src/libaqmoney/adminjobs.cpp
-	       JobUpdateBankInfo */
-	    HBCI_Job_setIntProperty(jjob, "open/ident/country", 
-				    HBCI_Bank_country(bank));
-	    HBCI_Job_setProperty(jjob, "open/ident/bankcode", 
-				 HBCI_Bank_bankCode(bank));
-	    HBCI_Job_setIntProperty(jjob, "open/prepare/bpdversion",0);
-	    HBCI_Job_setIntProperty(jjob, "open/prepare/updversion",0);
-	  }
-	  
-	  gnome_ok_dialog_parented 
-	    /* 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. */
-	    (_("You have changed the HBCI version. GnuCash will now need to \n"
-	       "update various system parameters, including the account list.\n"
-	       "Press 'Ok' now to proceed to updating the system and the account list."), parent);
-	  return TRUE;
-	}
-    }
-  
-  gtk_widget_destroy (dialog);
-  return FALSE;
-}
-
-
-/* -------------------------------------- */
-/* Copied from window-help.c */
-static void
-goto_string_cb(char * string, gpointer data)
-{
-  if(!data) return;
-  if(!string) {
-    *(char **)data = NULL;
-  }
-  else {
-    *(char **)data = g_strdup(string);
-  }
-}
-static void gnc_hbci_addaccount(HBCIInitialInfo *info, 
-				const HBCI_Customer *cust)
-{
-  HBCI_Bank *bank;
-  const HBCI_User *user;
-  gnc_HBCI_Account *acc;
-
-  GtkWidget *dlg;
-  char *prompt;
-  char *accnr = NULL;
-  int retval = -1;
-
-  g_assert(info);
-  user = HBCI_Customer_user (cust);
-  bank = (HBCI_Bank *) HBCI_User_bank (user);
-
-  /* Ask for new account id by opening a request_dialog -- a druid
-     page would be better from GUI design, but I'm too lazy. */
-  prompt = g_strdup_printf(_("Enter account id for new account \n"
-			     "at bank %s (bank code %s):"), 
-			   HBCI_Bank_name (bank), HBCI_Bank_bankCode (bank));
-  
-  dlg = gnome_request_dialog(FALSE, prompt, "", 20,
-			     &goto_string_cb, &accnr, GTK_WINDOW(info->window));
-  retval = gnome_dialog_run_and_close(GNOME_DIALOG(dlg));
-  
-  if ((retval == 0) && accnr && (strlen(accnr) > 0)) {
-    
-    /* Search for existing duplicate */
-    acc = list_HBCI_Account_find(info->hbci_accountlist, 
-				 bank, HBCI_Bank_bankCode (bank), accnr);
-
-    /* Check if such an account already exists */
-    if (acc)
-      {
-	/* Yes, then don't create it again */
-	gnc_error_dialog
-	  (info->window,
-	   _("An account with this account id at this bank already exists."));
-      }
-    else
-      {
-	/* No, then create it and add it to our internal list. */
-	acc = gnc_HBCI_Account_new (bank, HBCI_Bank_bankCode (bank), accnr);
-	info->hbci_accountlist = g_list_append(info->hbci_accountlist, acc);
-
-	/* Don't forget to update the account list, otherwise the new
-	   accounts won't show up. */
-	update_accountlist(info);
-      }
-  }
-    
-  g_free(prompt);
-  if (accnr) 
-    g_free (accnr);
-}
-/* -------------------------------------- */
-
 
 
 /*************************************************************
@@ -619,636 +256,23 @@
   gboolean successful = TRUE;
   g_assert (info);
 
-  if (info->configfile) {
-    //printf("on_finish: Got configfile %s, but the book has %s.\n", info->configfile, gnc_hbci_get_book_configfile (gnc_get_current_book ()));
-    if (!gnc_hbci_get_book_configfile (gnc_get_current_book ()) ||
-	(strcmp(info->configfile, 
-		gnc_hbci_get_book_configfile (gnc_get_current_book ())) != 0)) {
-      /* Name of configfile has changed */
-      gnc_hbci_set_book_configfile (gnc_get_current_book (), info->configfile);
-      if ((gnc_hbci_get_book_configfile (gnc_get_current_book ()) == 0) ||
-	  strcmp(info->configfile, 
-		 gnc_hbci_get_book_configfile (gnc_get_current_book ())) != 0) 
-	printf("on_finish: OOOPS: I just setted the book_configfile to %s, but the book now still has %s.\n", info->configfile, gnc_hbci_get_book_configfile (gnc_get_current_book ()));
-    }
-  }
-  
-  {
-    HBCI_Error *err;
-    //printf("on_finish: trying to save openhbci data to file %s.\n", gnc_hbci_get_book_configfile (gnc_get_current_book ()));
-    
-    err = gnc_hbci_api_save (info->api);
-    //printf("on_finish: finished saving openhbci data to file.\n");
-
-    if (err != NULL) {
-      if (!HBCI_Error_isOk (err)) {
-	successful = FALSE;
-	printf("on_finish: Error at saving OpenHBCI data: %s.\n",
-	       HBCI_Error_message (err));
-      }
-      HBCI_Error_delete (err);
-    }
-  }
-  
   if (successful && info->gnc_hash)
     accounts_save_kvp (info->gnc_hash);
-  if (successful && info->hbci_accountlist)
-    {
-      GList *kvplist = 
-	gnc_HBCI_Account_kvp_glist_from_glist(info->hbci_accountlist);
-      gnc_hbci_set_book_account_list (gnc_get_current_book (), kvplist);
-    }
   
+  gnc_AB_BANKING_save (info->api);
   delete_initial_druid(info);
 }
 
 
-static gboolean 
-on_configfile_next (GnomeDruidPage *gnomedruidpage,
-		    gpointer arg1,
-		    gpointer user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  char *filename;
-  HBCI_API *api;
-
-  filename = g_strstrip(gnome_file_entry_get_full_path 
-			(GNOME_FILE_ENTRY (info->configfileentry), FALSE));
-
-  if (!gnc_verify_exist_or_new_file (GTK_WIDGET (info->window), filename)) {
-    g_free (filename);
-    return TRUE;
-  }
-  /* file doesn't need to be created here since OpenHBCI will create
-     it automatically.*/
-
-  if (!gnc_test_dir_exist_error (GTK_WINDOW (info->window), filename)) {
-    g_free (filename);
-    return TRUE;
-  }
-  
-  {
-    if ((info->configfile == NULL) ||
-	(strcmp(filename, info->configfile) != 0)) {
-      /* Name of configfile has changed, so reset everything */
-      reset_initial_info (info);
-      info->configfile = g_strdup (filename);
-      /* Create new HBCI_API object, loading its data from filename */
-      info->api = gnc_hbci_api_new (filename, TRUE, 
-				    GTK_WIDGET (info->window), 
-				    &(info->interactor),
-				    &(info->hbci_accountlist));
-    }
-    else if (info->api == NULL)
-      /* Create new HBCI_API object, loading its data from filename */
-      info->api = gnc_hbci_api_new (filename, TRUE, 
-				    GTK_WIDGET (info->window), 
-				    &(info->interactor),
-				    &(info->hbci_accountlist));
-
-    api = info->api;
-    g_free (filename);
-    if (api == NULL)
-      return TRUE;
-  }
-  /* no libchipcard? Make that button greyed out*/
-  if (HBCI_API_mediumType(info->api, "DDVCard") != MediumTypeCard)
-    {
-      gtk_widget_set_sensitive (GTK_WIDGET (info->mediumddv),
-				FALSE);
-    } else {
-      gtk_widget_set_sensitive (GTK_WIDGET (info->mediumddv),
-				TRUE);
-    }
-
-  /* Together with the api, create a new outbox queue */
-  info->outbox = HBCI_Outbox_new();
-  
-  /* Get HBCI bank and account list */
-  {
-    const list_HBCI_Bank *banklist;
-
-    banklist = HBCI_API_bankList (api);
-    /*printf("%d banks found.\n", list_HBCI_Bank_size (banklist));*/
-    if (list_HBCI_Bank_size (banklist) == 0) {
-      /* Zero banks? go to next page (create_bank)*/
-      info->state = INI_ADD_BANK;
-      gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			    GNOME_DRUID_PAGE (info->bankpage));
-      return TRUE;
-    }
-
-    if (HBCI_API_totalUsers(api) == 0) {
-      /* zero users? go to user-creation page*/
-      info->state = INI_ADD_USER;
-      info->newbank = choose_one_bank (info->window, 
-				       HBCI_API_bankList (info->api) );
-      gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			    GNOME_DRUID_PAGE (info->userpage));
-      return TRUE;
-    }
-    
-    if (g_list_length(gnc_hbci_get_book_account_list
-		      (gnc_get_current_book ())) == 0) {
-      /* still no accounts? go to account update page*/
-      info->state = INI_UPDATE_ACCOUNTS;
-      info->newcustomer = choose_customer (info);
-      gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			    GNOME_DRUID_PAGE (info->accountinfopage));
-      return TRUE;
-    }
-  }
-
-  info->state = INI_MATCH_ACCOUNTS;
-  /* accounts already exist? Then go to account matching page*/
-  gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			GNOME_DRUID_PAGE (info->accountpage));
-  return TRUE;
-}
-static void
-on_configfile_activate (GtkEditable *editable,
-			gpointer user_data)
-{
-  on_configfile_next (NULL, NULL, user_data);
-}
-
-
-static gboolean 
-on_bankpage_back (GnomeDruidPage  *gnomedruidpage,
-		  gpointer         arg1,
-		  gpointer         user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  g_assert(info);
-  
-  switch (info->state) {
-  case INI_ADD_BANK:
-    return FALSE;
-  case ADD_BANK:
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->accountpage));
-    return TRUE;
-  default:
-    return FALSE;
-  }
-}
-static gboolean 
-on_bankpage_next (GnomeDruidPage  *gnomedruidpage,
-		  gpointer         arg1,
-		  gpointer         user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  const char *bankcode = NULL;
-  int countrycode = 0;
-  const char *ipaddr = NULL;/*, *port;*/
-  HBCI_Bank *bank = NULL;
-  g_assert (info);
-  g_assert (info->api);
-  
-  bankcode = gtk_entry_get_text (GTK_ENTRY (info->bankcode));
-  countrycode = atoi (gtk_entry_get_text (GTK_ENTRY (info->countrycode)));
-  ipaddr = gtk_entry_get_text (GTK_ENTRY (info->ipaddr));
-  
-  bank = HBCI_API_findBank(info->api, countrycode, bankcode);
-  if (bank == NULL) {
-    /*printf("on_bankpage_next: Creating bank with code %s.\n", bankcode);*/
-    bank = HBCI_API_bankFactory (info->api, countrycode, bankcode, ipaddr,
-				 "");
-    {
-      HBCI_Error *err;
-      HBCI_Transporter *tr;
-      HBCI_MessageEngine *me;
-
-      me = HBCI_API_engineFactory(info->api, 
-				  countrycode,
-				  bankcode,
-				  DEFAULT_HBCI_VERSION,
-				  "msgxml");
-      tr = HBCI_API_transporterFactory(info->api,
-				       ipaddr,
-				       "3000" /* DEFAULT_PORT */,
-				       500 /*AQMONEY_DEFAULT_CONN_TIMEOUT*/,
-				       "xptcp");
-      HBCI_Bank_setMessageEngine(bank, me, TRUE);
-      HBCI_Bank_setTransporter(bank, tr, TRUE);
-
-      err = HBCI_API_addBank (info->api, bank, TRUE);
-      if (err != NULL) {
-	printf("on_bankpage_next-CRITICAL: Error at addBank: %s.\n",
-	       HBCI_Error_message (err));
-	HBCI_Error_delete (err);
-	return TRUE;
-      }
-
-    }
-  } 
-  /*else {
-    printf("on_bankpage_next: Found bank, name %s.\n", HBCI_Bank_name(bank));
-    };*/
-  info->newbank = bank;
-
-  gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			GNOME_DRUID_PAGE (info->userpage));
-  return TRUE;
-}
-/*static void
-on_ipaddr_activate (GtkEditable *editable,
-		    gpointer user_data)
-{
-  HBCIInitialInfo *info;
-  g_assert (info);
-  
-  if ((strlen(gtk_entry_get_text (GTK_ENTRY (info->bankcode))) > 0) &&
-      (strlen(gtk_entry_get_text (GTK_ENTRY (info->countrycode))) > 0) &&
-      (strlen(gtk_entry_get_text (GTK_ENTRY (info->ipaddr))) > 0))
-    on_bankpage_next (NULL, NULL, info);
-    }*/
 
 static void
-on_userid_prepare (GnomeDruidPage *gnomedruidpage,
-		   gpointer arg1,
-		   gpointer user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  const char *bankcode, *bankname;
-  g_assert (info);
-  g_assert (info->newbank);
-    
-  bankcode = HBCI_Bank_bankCode (info->newbank);
-  bankname = HBCI_Bank_name (info->newbank);
-  
-  gtk_label_set_text (GTK_LABEL (info->user_bankcode),
-		      bankcode);
-  if (bankname && (strlen (bankname) > 0))
-    gtk_label_set_text (GTK_LABEL (info->user_bankname), bankname);
-  else {
-    gtk_label_set_text (GTK_LABEL (info->user_bankname), _("Unknown"));
-    gtk_widget_set_sensitive (GTK_WIDGET (info->user_bankname), FALSE);
-  }
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-}
-
-static gboolean 
-on_userid_back (GnomeDruidPage  *gnomedruidpage,
-		gpointer         arg1,
-		gpointer         user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  g_assert(info);
-  
-  switch (info->state) {
-  case INI_ADD_BANK:
-  case ADD_BANK:
-    return FALSE;
-  case INI_ADD_USER:
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->filepage));
-    return TRUE;
-  case ADD_USER:
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->accountpage));
-    return TRUE;
-  default:
-    return FALSE;
-  }
-}
-static gboolean
-on_userid_focus_out (GtkWidget *widget,
-		     GdkEventFocus *event,
+on_aqbutton_prepare (GnomeDruidPage *gnomedruidpage,
+		     gpointer arg1,
 		     gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
-  const char *userid = NULL;
-  const char *customerid = NULL;
-  g_assert(info);
-  
-  userid = gtk_entry_get_text (GTK_ENTRY (info->userid));
-  customerid = gtk_entry_get_text (GTK_ENTRY (info->customerid));
-
-  if (strlen(customerid)==0)
-    gtk_entry_set_text (GTK_ENTRY (info->customerid), userid);
-
-  return FALSE;
+  druid_disable_next_button(info);
 }
-static gboolean
-on_userid_next (GnomeDruidPage  *gnomedruidpage,
-		gpointer         arg1,
-		gpointer         user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  const char *userid = NULL, *username = NULL;
-  const char *customerid = NULL, *customername = NULL;
-  HBCI_API *api = NULL;
-  HBCI_Bank *bank = NULL;
-  const HBCI_User *user = NULL;
-
-  g_assert (info);
-  api = info->api;
-  g_assert (api);
-  bank = (HBCI_Bank *)info->newbank;
-  g_assert (bank);
-  on_userid_focus_out (NULL, NULL, info);
-      
-  userid = gtk_entry_get_text (GTK_ENTRY (info->userid));
-  username = gtk_entry_get_text (GTK_ENTRY (info->username));
-  customerid = gtk_entry_get_text (GTK_ENTRY (info->customerid));
-  customername = gtk_entry_get_text (GTK_ENTRY (info->customername));
-
-  /*user = HBCI_Bank_findUser(bank, userid);
-    if (user == NULL)*/ 
-  user = NULL;
-  {
-    gboolean is_rdh;
-    HBCI_Medium *medium;
-    HBCI_User *newuser;
-    HBCI_Error *err;
-    char *mediumname;
-    const char *mediumtype;
-    int secmode;
-
-    /*printf("on_userid_next: Didn't find user with userid %s.\n", userid);*/
-    is_rdh = gtk_toggle_button_get_active 
-      (GTK_TOGGLE_BUTTON (info->mediumrdh));
-
-    if (is_rdh) {
-      /* Create RDH Medium */ 
-      mediumname = gnome_file_entry_get_full_path 
-	(GNOME_FILE_ENTRY (info->mediumpath), FALSE);
-
-      /* Some sanity checks on the filename*/
-      if (!gnc_verify_exist_or_new_file 
-	  (GTK_WIDGET (info->window), mediumname)) {
-	g_free (mediumname);
-	return TRUE;
-      }
-      if (!gnc_test_dir_exist_error (GTK_WINDOW (info->window), 
-				     mediumname)) {
-	g_free (mediumname);
-	return TRUE;
-      }
-      secmode = HBCI_SECURITY_RDH;
-      mediumtype = "RDHFile";
-    }
-    else {
-      /* Create DDV Medium */
-      mediumname = g_strdup("");
-      secmode = HBCI_SECURITY_DDV;
-      mediumtype = "DDVCard";
-    }
-
-    medium = HBCI_API_createNewMedium (api, 
-				       mediumtype,
-				       FALSE,
-				       280,
-				       HBCI_Bank_bankCode (bank),
-				       userid, 
-				       mediumname, &err);
-    g_free(mediumname);
-
-    if (medium == NULL) {
-      printf("on_userid_next: Couldn't create medium: %s\n", 
-	     HBCI_Error_message (err));
-      HBCI_Error_delete (err);
-      return TRUE;
-    }
-    
-    newuser = HBCI_API_userFactory (bank, medium, TRUE, userid, username);
-    /*HBCI_User_setUserName (newuser, username);*/
-    /*printf("on_userid_next: Created user with userid %s.\n", userid);*/
-    g_assert(newuser);
-    err = HBCI_Bank_addUser (bank, newuser, TRUE);
-    if (err != NULL) {
-      printf("on_userid_next-CRITICAL: Error at addUser: %s.\n",
-	     HBCI_Error_message (err));
-      HBCI_Error_delete (err);
-      return TRUE;
-    }
-      
-    /* Test mounting only for DDV cards. RDH files should work... */
-    if (secmode == HBCI_SECURITY_DDV) {
-      err = HBCI_Medium_mountMedium (medium, NULL);
-      if (err != NULL) {
-	printf("on_userid_next: Mounting medium failed: %s.\n",
-	       HBCI_Error_message (err));
-	HBCI_Error_delete (err);
-	return TRUE;
-      } 
-      printf("on_userid_next: Mounting medium was successful.\n");
-      HBCI_Medium_unmountMedium (medium, NULL);
-    }
-      
-
-    {
-      HBCI_Customer *cust;
-      cust = HBCI_API_customerFactory (newuser, customerid, customername);
-      g_assert (cust);
-      HBCI_User_addCustomer (newuser, cust, TRUE);
-      info->newcustomer = cust;
-    }
-
-    if (is_rdh) {
-      gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			    GNOME_DRUID_PAGE (info->serverinfopage));
-      return TRUE;
-    } 
-    else
-      return FALSE;
-
-  }/*
-  else {
-    printf("on_userid_next: Found user, name %s.\n", HBCI_User_userName(user));
-    }*/
-
-  return FALSE;
-}
-
-static gboolean 
-on_accountinfo_back (GnomeDruidPage  *gnomedruidpage,
-		     gpointer         arg1,
-		     gpointer         user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  g_assert(info);
-  
-  switch (info->state) {
-  case UPDATE_ACCOUNTS:
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->accountpage));
-    return TRUE;
-  case INI_UPDATE_ACCOUNTS:
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->filepage));
-    return TRUE;
-  default:
-    return FALSE;
-  }
-}
-static gboolean 
-on_accountinfo_next (GnomeDruidPage  *gnomedruidpage,
-		     gpointer         arg1,
-		     gpointer         user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  const HBCI_Customer *customer = NULL;
-  const HBCI_User *user = NULL;
-  const HBCI_Medium *medium = NULL;
-  const HBCI_Bank *bank = NULL;
-  g_assert(info);
-  
-  /* of course we need to know for which customer we do this */
-  if (info->newcustomer == NULL) 
-    info->newcustomer = choose_customer (info);
-  
-  if (info->newcustomer == NULL) 
-    return FALSE;
-
-  customer = info->newcustomer;
-  user = HBCI_Customer_user(customer);
-  bank = HBCI_User_bank(user);
-  medium = HBCI_User_medium(user);
-  
-  {
-    HBCI_OutboxJob *job;
-      
-    /* Execute a Synchronize job, then a GetAccounts job. */
-    if (HBCI_Medium_securityMode(medium) == 
-	HBCI_SECURITY_RDH) {
-      /* Only do this sync job if this is a rdh medium. */
-      if ((strlen(HBCI_User_systemId(user)) == 0) ||
-	  (strcmp(HBCI_User_systemId(user), "0") == 0)) {
-	/* Only do this sync job if we don't have a systemId yet (not
-	   sure whether this is a good idea though */
-	job = HBCI_OutboxJob_new("JobSync", 
-				 (HBCI_Customer *)customer, "");
-	HBCI_Outbox_addJob (info->outbox, job);
-      
-	{
-	  HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
-	  HBCI_Job_setIntProperty
-	    (jjob, "open/ident/country", HBCI_Bank_country(bank));
-	  HBCI_Job_setProperty
-	    (jjob, "open/ident/bankcode", HBCI_Bank_bankCode(bank));
-	  HBCI_Job_setProperty
-	    (jjob, "open/ident/customerid", HBCI_Customer_custId(customer));
-
-	  /* for getting a system id */
-	  HBCI_Job_setIntProperty(jjob, "open/sync/mode",0);
-	  HBCI_Job_setProperty(jjob, "open/ident/systemid", "0");
-	}
-
-	/* Execute Outbox. */
-	if (!gnc_hbci_api_execute (info->window, info->api, info->outbox, 
-				   job, info->interactor)) {
-	  /* HBCI_API_executeOutbox failed. */
-	  GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
-	  printf("on_accountinfo_next: oops, executeOutbox of JobSync failed.\n");
-
-	  printf("on_accountinfo_next: Complete HBCI_Outbox response:\n");
-	  GWEN_DB_Dump(rsp, stdout, 1);
-	  GWEN_DB_Group_free(rsp);
-
-	  rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
-	  printf("on_accountinfo_next: Complete HBCI_Job response:\n");
-	  if (rsp) 
-	    GWEN_DB_Dump(rsp, stderr, 1);
-	  /*return FALSE;*/
-	  /* -- it seems to be no problem if this fails ?! */
-	}
-
-	/* Now process the response of the JobSync */
-	{
-	  const char *sysid = 
-	    HBCI_Job_getProperty(HBCI_OutboxJob_Job(job), 
-				 "response/syncresponse/systemid", "");
-	  g_assert(sysid);
-
-	  if (strlen(sysid) > 0) {
-	    HBCI_User_setSystemId((HBCI_User*) user, sysid);
-	    printf("on_accountinfo_next: Ok. Got sysid '%s'.\n", sysid);
-	  }
-	  else {
-	    /* Got no sysid. */
-	    GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
-	    printf("on_accountinfo_next: oops, got no sysid.\n");
-	
-	    printf("on_accountinfo_next: Complete HBCI_Outbox response:\n");
-	    GWEN_DB_Dump(rsp, stdout, 1);
-	    GWEN_DB_Group_free(rsp);
-
-	    rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
-	    printf("on_accountinfo_next: Complete HBCI_Job response:\n");
-	    if (rsp) 
-	      GWEN_DB_Dump(rsp, stderr, 1);
-	    return FALSE;
-	  }
-	}
-      } /* if strlen(systemid)==0 */
-    } /* if securityMode == RDH */
-    
-  
-    /* Now the GetAccounts job. */
-    job = HBCI_OutboxJob_new("JobGetAccounts", 
-			     (HBCI_Customer *)customer, "");
-    HBCI_Outbox_addJob (info->outbox, job);
-    
-    {
-      HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
-      HBCI_Job_setIntProperty
-	(jjob, "open/ident/country", HBCI_Bank_country(bank));
-      HBCI_Job_setProperty
-	(jjob, "open/ident/bankcode", HBCI_Bank_bankCode(bank));
-      HBCI_Job_setProperty
-	(jjob, "open/ident/customerid", HBCI_Customer_custId(customer));
-      HBCI_Job_setIntProperty(jjob, "open/prepare/updversion",0);
-
-      if (HBCI_Medium_securityMode(medium) == 
-	  HBCI_SECURITY_RDH) {
-	/* Only set this for RDH medium */
-	char *mediumid = HBCI_Medium_mediumId((HBCI_Medium *)medium);
-	g_assert(mediumid);
-	if (strlen(mediumid)==0)
-	  HBCI_Job_setProperty(jjob, "open/ident/systemId", "0");
-	else
-	  HBCI_Job_setProperty(jjob, "open/ident/systemId", mediumid);
-	free(mediumid);
-      }
-    }
-    
-
-    /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (info->window, info->api, info->outbox, 
-			       job, info->interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
-      printf("on_accountinfo_next: oops, executeOutbox of JobGetAccounts failed.\n");
-
-      printf("on_accountinfo_next: Complete HBCI_Outbox response:\n");
-      GWEN_DB_Dump(rsp, stdout, 1);
-      GWEN_DB_Group_free(rsp);
-
-      rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
-      printf("on_accountinfo_next: Complete HBCI_Job response:\n");
-      if (rsp) 
-	GWEN_DB_Dump(rsp, stderr, 1);
-
-      /* And clean everything up */
-      HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
-      return FALSE;
-    }
-
-    /* Now evaluate the GetAccounts job. */
-    info->hbci_accountlist =
-      gnc_processOutboxResponse(info->api, info->outbox, info->hbci_accountlist);
-    
-    /* And clean everything up */
-    HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
-  }
-  
-  return FALSE;
-}
-
-
 
 
 static gboolean 
@@ -1286,13 +310,24 @@
   update_accountlist(info);
 }
 
+
+static gchar *gnc_hbci_account_longname(const AB_ACCOUNT *hacc)
+{
+  g_assert(hacc);
+  /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
+  return g_strdup_printf(_("%s at %s (code %s)"),
+			 AB_Account_GetAccountNumber (hacc),
+			 AB_Account_GetBankName (hacc),
+			 AB_Account_GetBankCode (hacc));
+}
+
 static void
 on_accountlist_select_row (GtkCList *clist, gint row,
 			   gint column, GdkEvent *event,
 			   gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
-  gnc_HBCI_Account *hbci_acc;
+  AB_ACCOUNT *hbci_acc;
   Account *gnc_acc, *old_value;
   gchar *longname;
   gnc_commodity *currency = NULL;
@@ -1301,16 +336,16 @@
   if (hbci_acc) {
     old_value = g_hash_table_lookup (info->gnc_hash, hbci_acc);
 
-    /*printf("on_accountlist_select_row: Selected hbci_acc id %s; old_value %p \n",
-	   gnc_HBCI_Account_accountId(hbci_acc),
-	   old_value);*/
-
-    longname = gnc_HBCI_Account_longname(hbci_acc);
-    if (gnc_HBCI_Account_currency(hbci_acc) && 
-	(strlen(gnc_HBCI_Account_currency(hbci_acc)) > 0)) {
+    printf("on_accountlist_select_row: Selected hbci_acc id %s; old_value %p \n",
+	   AB_Account_GetAccountNumber(hbci_acc),
+	   old_value);
+
+    longname = gnc_hbci_account_longname(hbci_acc);
+    if (AB_Account_GetCurrency (hbci_acc) && 
+	(strlen(AB_Account_GetCurrency (hbci_acc)) > 0)) {
       currency = gnc_commodity_table_lookup 
 	(gnc_book_get_commodity_table (gnc_get_current_book ()), 
-	 GNC_COMMODITY_NS_ISO, gnc_HBCI_Account_currency(hbci_acc));
+	 GNC_COMMODITY_NS_ISO, AB_Account_GetCurrency (hbci_acc));
     }
 
     gnc_acc = gnc_import_select_account(NULL, TRUE, longname, currency, BANK,
@@ -1333,403 +368,6 @@
 
 
 
-static gboolean
-on_iniletter_info_back (GnomeDruidPage  *gnomedruidpage,
-			  gpointer arg1,
-			  gpointer user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  g_assert(info);
-
-  if (info->interactor)
-    GNCInteractor_hide (info->interactor);
-  
-  gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			GNOME_DRUID_PAGE (info->userpage));
-  return TRUE;
-}
-
-
-
-
-static gboolean
-on_iniletter_info_next (GnomeDruidPage  *gnomedruidpage,
-			  gpointer arg1,
-			  gpointer user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  const HBCI_Customer *customer = NULL;
-  const HBCI_User *user = NULL;
-  const HBCI_Bank *bank = NULL;
-  g_assert(info);
-
-  if (info->newcustomer == NULL) 
-    return FALSE;
-
-  customer = info->newcustomer;
-  user = HBCI_Customer_user(customer);
-  bank = HBCI_User_bank(user);
-  
-  if (info->gotkeysforCustomer == NULL) {
-    /* Execute a GetKey job. */
-    HBCI_OutboxJob *job;
-    
-    job = HBCI_OutboxJob_new("JobGetKeys", (HBCI_Customer*)customer, "");
-    
-    {
-      HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
-      /* Copied from libaqmoney's JobGetKeys::JobGetKeys(Pointer<Customer> c) */
-      HBCI_Job_setIntProperty(jjob, "open/ident/country", HBCI_Bank_country(bank));
-      HBCI_Job_setProperty(jjob, "open/ident/bankcode", HBCI_Bank_bankCode(bank));
-      HBCI_Job_setProperty(jjob, "open/ident/customerId", "9999999999");
-      HBCI_Job_setProperty(jjob, "open/ident/systemId", "0");
-
-      HBCI_Job_setIntProperty(jjob, "open/signkey/key/country", 
-			      HBCI_Bank_country(bank));
-      HBCI_Job_setProperty(jjob, "open/signkey/key/bankcode", 
-			   HBCI_Bank_bankCode(bank));
-      /*HBCI_Job_setProperty(jjob, "open/signkey/key/userid", "9999999999");*/
-
-      HBCI_Job_setIntProperty(jjob, "open/cryptkey/key/country", 
-			      HBCI_Bank_country(bank));
-      HBCI_Job_setProperty(jjob, "open/cryptkey/key/bankcode", 
-			   HBCI_Bank_bankCode(bank));
-      /*HBCI_Job_setProperty(jjob, "open/cryptkey/key/userid", "9999999999");*/
-    }
-    HBCI_Outbox_addJob (info->outbox, job);
-
-    /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (info->window, info->api, info->outbox, 
-			       job, info->interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
-      printf("on_iniletter_info_next: oops, executeOutbox failed.\n");
-
-      printf("Complete HBCI_Outbox response:\n");
-      GWEN_DB_Dump(rsp, stdout, 1);
-      GWEN_DB_Group_free(rsp);
-
-      rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
-      printf("Complete HBCI_Job response:\n");
-      if (rsp) 
-	GWEN_DB_Dump(rsp, stderr, 1);
-
-      /* And clean everything up */
-      HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
-      return FALSE;
-    }
-
-    /* Get keys from Job; store them in the customer's medium @§%&! */
-    if (!gnc_hbci_evaluate_GetKeys(info->outbox, job,
-				   (HBCI_Customer *)customer)) {
-      return FALSE;
-    }
-    
-    HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
-    info->gotkeysforCustomer = customer;
-
-  }
-  else if (info->gotkeysforCustomer != customer) {
-    printf("on_iniletter_info_next: Oops, already got keys for another customer. Not yet implemented.\n");
-
-    /* And clean everything up */
-    HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
-    return TRUE;
-  }
-
-  /* Create Ini-Letter */
-  {
-    char *res;
-    const HBCI_Medium *med;
-    const HBCI_MediumRDHBase *medr;
-    gboolean use_cryptkey;
-    char *tmp, *hash, *exponent, *modulus;
-    const char *bankcode, *bankname, *bankip;
-    int keynumber, keyversion;
-    time_t now = time(NULL);
-    char *time_now = ctime(&now);
-
-    bankcode = HBCI_Bank_bankCode (bank);
-    bankname = HBCI_Bank_name (bank);
-    bankname = (strlen (bankname) > 0 ? bankname : _("Unknown"));
-    bankip = HBCI_Bank_addr (bank);    
-
-    med = HBCI_User_medium (user);
-    medr = HBCI_Medium_MediumRDHBase ((HBCI_Medium *)med);
-    g_assert (medr);
-
-    use_cryptkey = !HBCI_MediumRDHBase_hasInstSignKey (medr);
-    tmp = HBCI_MediumRDHBase_getInstIniLetterHash(medr, use_cryptkey);
-    hash = to_hexstring_hash (tmp);
-    free (tmp);
-    tmp = HBCI_MediumRDHBase_getInstIniLetterExponent(medr, use_cryptkey);
-    exponent = to_hexstring (tmp);
-    free (tmp);
-    tmp = HBCI_MediumRDHBase_getInstIniLetterModulus(medr, use_cryptkey);
-    modulus = to_hexstring (tmp);
-    free (tmp);
-    keynumber = HBCI_MediumRDHBase_getInstKeyNumber(medr, use_cryptkey);
-    keyversion = HBCI_MediumRDHBase_getInstKeyVersion(medr, use_cryptkey);
-
-    res = g_strdup_printf("<html><body><h1>Ini-Brief der Bank %s</h1>\n"
-"<h2>Bankdaten</h2><table>\n"
-"<tr><td>Bankleitzahl</td><td>%s</td></tr>\n"
-"<tr><td>IP-Adresse</td><td>%s</td></tr>\n"
-"<tr><td>Datum, Uhrzeit</td><td>%s</td></tr>\n"
-"<tr><td>Schl&uuml;sselnummer</td><td>%d</td></tr>\n"
-"<tr><td>Schl&uuml;sselversion</td><td>%d</td></tr>\n"
-"</table>\n"
-"<h2>Oeffentlicher Schl&uuml;ssel f&uuml;r die elektronische\n"
-"Signatur</h2>\n"
-"<h3>Exponent (768 Bit)</h3>\n"
-"<pre>%s</pre>\n"
-"<h3>Modulus (768 Bit)</h3>\n"
-"<pre>%s</pre>\n"
-"<h3>Hashwert</h3>\n"
-"<pre>%s</pre>\n"
-"</body></html>",
-			  bankname, 
-			  bankcode,
-			  bankip,
-			  time_now,
-			  keynumber, keyversion,
-			  exponent, modulus, hash);
-
-    g_free (exponent);
-    g_free (modulus);
-    g_free (hash);
-    
-    gnc_html_show_data (info->server_html, res, strlen(res));
-    gnc_html_reload (info->server_html);
-    
-    g_free (res);
-  }
-  
-  return FALSE;
-}
-
-
-static void
-on_iniletter_server_prepare (GnomeDruidPage *gnomedruidpage,
-			     gpointer arg1,
-			     gpointer user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  g_assert(info);
-
-  /* Workaround to get let the GtkHTML scrollbars appear. */
-  gtk_box_set_spacing (GTK_BOX (info->server_vbox), 1);
-  gtk_widget_queue_resize (GTK_WIDGET (info->server_vbox));
-  while (g_main_iteration (FALSE));
-  gtk_box_set_spacing (GTK_BOX (info->server_vbox), 0);
-  gtk_widget_queue_resize (GTK_WIDGET (info->server_vbox));
-  
-  druid_disable_next_button (info);
-
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-}
-
-static gboolean
-on_iniletter_userinfo_next (GnomeDruidPage  *gnomedruidpage,
-			  gpointer arg1,
-			  gpointer user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  char *res;
-  g_assert (info);
-
-  if (info->newcustomer == NULL)
-    return FALSE;
-
-  if (info->gotkeysforCustomer == info->newcustomer) {
-    /* Execute a SendKey job. */
-    HBCI_OutboxJob *job;
-    
-    job = HBCI_OutboxJob_new("JobSendKeys", 
-			     (HBCI_Customer*)info->newcustomer, "");
-
-    {
-      HBCI_Job *jjob = HBCI_OutboxJob_Job(job);
-      const HBCI_Customer *customer = info->newcustomer;
-      const HBCI_User *user = HBCI_Customer_user(customer);
-      const HBCI_Bank *bank = HBCI_User_bank(user);
-      const HBCI_Medium *med = HBCI_User_medium (user);
-      const HBCI_MediumRDHBase *medr = HBCI_Medium_MediumRDHBase ((HBCI_Medium*)med);
-      const HBCI_RSAKey *signkey = HBCI_MediumRDHBase_userPubSignKey(medr);
-      const HBCI_RSAKey *cryptkey = HBCI_MediumRDHBase_userPubCryptKey(medr);
-#define MY_MAXBUF_SIZE 1024
-      unsigned tmp_bufsize = MY_MAXBUF_SIZE;
-      unsigned tmp_actual;
-      char tmp[MY_MAXBUF_SIZE];
-      g_assert (medr);
-      /* Copied from libaqmoney's JobSendKeys::JobSendKeys(Pointer<Customer> c) */
-
-      // prepare identification
-      HBCI_Job_setProperty(jjob, "open/ident/systemid", "0");
-      HBCI_Job_setIntProperty(jjob, "open/ident/country", HBCI_Bank_country(bank));
-      HBCI_Job_setProperty(jjob, "open/ident/bankcode", HBCI_Bank_bankCode(bank));
-      HBCI_Job_setProperty(jjob, "open/ident/customerid", HBCI_Customer_custId(customer));
-
-      // prepare sign key
-      HBCI_Job_setProperty(jjob, "open/signkey/keyname/bankCode", HBCI_Bank_bankCode(bank));
-      HBCI_Job_setProperty(jjob, "open/signkey/keyname/userid", HBCI_User_userId(user));
-      HBCI_Job_setIntProperty(jjob, "open/signkey/keyname/keynum", HBCI_RSAKey_number(signkey));
-      HBCI_Job_setIntProperty(jjob, "open/signkey/keyname/keyversion", HBCI_RSAKey_version(signkey));
-      tmp_actual = HBCI_RSAKey_getModulusData(signkey, tmp, tmp_bufsize);
-      HBCI_Job_setBinProperty(jjob, "open/signkey/key/modulus", tmp, tmp_actual);
-      tmp_actual = HBCI_RSAKey_getExpData(signkey, tmp, tmp_bufsize);
-      HBCI_Job_setBinProperty(jjob, "open/signkey/key/exponent", tmp, tmp_actual);
-
-      // prepare crypt key
-      HBCI_Job_setProperty(jjob, "open/cryptkey/keyname/bankCode", HBCI_Bank_bankCode(bank));
-      HBCI_Job_setProperty(jjob, "open/cryptkey/keyname/userid", HBCI_User_userId(user));
-      HBCI_Job_setIntProperty(jjob, "open/cryptkey/keyname/keynum", HBCI_RSAKey_number(cryptkey));
-      HBCI_Job_setIntProperty(jjob, "open/cryptkey/keyname/keyversion", HBCI_RSAKey_version(cryptkey));
-      tmp_actual = HBCI_RSAKey_getModulusData(cryptkey, tmp, tmp_bufsize);
-      HBCI_Job_setBinProperty(jjob, "open/cryptkey/key/modulus", tmp, tmp_actual);
-      tmp_actual = HBCI_RSAKey_getExpData(cryptkey, tmp, tmp_bufsize);
-      HBCI_Job_setBinProperty(jjob, "open/cryptkey/key/exponent", tmp, tmp_actual);
-    }
-
-    HBCI_Outbox_addJob (info->outbox, job);
-
-    /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (info->window, info->api, info->outbox, 
-			       job, info->interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
-      printf("on_iniletter_userinfo_next: Oops, api_execute failed.\n");
-      printf("on_iniletter_userinfo_next: Complete HBCI_Outbox response:\n");
-      GWEN_DB_Dump(rsp, stdout, 1);
-      GWEN_DB_Group_free(rsp);
-
-      rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
-      printf("on_iniletter_userinfo_next: Complete HBCI_Job response:\n");
-      if (rsp) 
-	GWEN_DB_Dump(rsp, stderr, 1);
-
-      /* And clean everything up */
-      HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
-      return FALSE;
-    }
-    
-    {
-      GWEN_DB_NODE *rsp = HBCI_Outbox_response(info->outbox);
-      printf("on_iniletter_userinfo_next: Complete HBCI_Outbox response:\n");
-      GWEN_DB_Dump(rsp, stdout, 1);
-      GWEN_DB_Group_free(rsp);
-
-      rsp = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
-      printf("on_iniletter_userinfo_next: Complete HBCI_Job response:\n");
-      if (rsp) 
-	GWEN_DB_Dump(rsp, stderr, 1);
-    }
-    
-
-    HBCI_Outbox_removeByStatus (info->outbox, HBCI_JOB_STATUS_NONE);
-  }
-  else {
-    printf("on_iniletter_userinfo_next: Oops, already got keys for another customer. Not yet implemented.\n");
-    return TRUE;
-  }
-
-  {
-    const HBCI_Medium *med;
-    const HBCI_MediumRDHBase *medr;
-    int keynumber, keyversion;
-    char *tmp, *hash, *exponent, *modulus;
-    const HBCI_User *user;
-    HBCI_Customer *cust;
-    time_t now = time(NULL);
-    char *time_now = ctime(&now);
-
-    cust = (HBCI_Customer *)info->newcustomer;
-    user = HBCI_Customer_user (cust);
-    med = HBCI_User_medium (user);
-    medr = HBCI_Medium_MediumRDHBase ((HBCI_Medium *)med);
-    g_assert (medr);
-
-    tmp = HBCI_MediumRDHBase_getUserIniLetterHash(medr);
-    hash = to_hexstring_hash (tmp);
-    g_free (tmp);
-    tmp = HBCI_MediumRDHBase_getUserIniLetterExponent(medr);
-    exponent = to_hexstring (tmp);
-    g_free (tmp);
-    tmp = HBCI_MediumRDHBase_getUserIniLetterModulus(medr);
-    modulus = to_hexstring (tmp);
-    g_free (tmp);
-    keynumber = HBCI_MediumRDHBase_getUserKeyNumber(medr);
-    keyversion = HBCI_MediumRDHBase_getUserKeyVersion(medr);
-
-    res = g_strdup_printf("<html><body><h1>Ini-Brief</h1>\n"
-"<h2>Benutzerdaten</h2><table>\n"
-"<tr><td>Benutzername</td><td>%s</td></tr>\n"
-"<tr><td>Datum, Uhrzeit</td><td>%s</td></tr>\n"
-"<tr><td>Benutzerkennung</td><td>%s</td></tr>\n"
-"<tr><td>Schl&uuml;sselnummer</td><td>%d</td></tr>\n"
-"<tr><td>Schl&uuml;sselversion</td><td>%d</td></tr>\n"
-"<tr><td>Kundensystemkennung</td><td>%s</td></tr>\n"
-"</table>\n"
-"<h2>Oeffentlicher Schl&uuml;ssel f&uuml;r die elektronische\n"
-"Signatur</h2>\n"
-"<h3>Exponent</h3>\n"
-"<pre>%s</pre>\n"
-"<h3>Modulus</h3>\n"
-"<pre>%s</pre>\n"
-"<h3>Hash</h3>\n"
-"<pre>%s</pre>\n"
-"<p>&nbsp;</p>\n"
-"<hr>\n"
-"Ort, Datum, Unterschrift</body></html>",
-			  HBCI_User_name (user),
-			  time_now,
-			  HBCI_User_userId (user),
-			  keynumber, keyversion,
-			  HBCI_Hbci_systemName (HBCI_API_Hbci (info->api)),
-			  exponent, modulus, hash);
-    
-    g_free (exponent);
-    g_free (modulus);
-    g_free (hash);
-  }
-  gnc_html_show_data (info->user_html, res, strlen(res));
-  gnc_html_reload (info->user_html);
-
-  g_free (res);
-
-  return FALSE;
-}
-
-static void
-on_iniletter_user_prepare (GnomeDruidPage  *gnomedruidpage,
-			gpointer arg1,
-			gpointer user_data)
-{
-  HBCIInitialInfo *info = user_data;
-  g_assert (info);
-  
-  /* Workaround to get let the GtkHTML scrollbars appear. */
-  gtk_box_set_spacing (GTK_BOX (info->user_vbox), 1);
-  gtk_widget_queue_resize (GTK_WIDGET (info->user_vbox));
-  while (g_main_iteration (FALSE));
-  gtk_box_set_spacing (GTK_BOX (info->user_vbox), 0);
-  gtk_widget_queue_resize (GTK_WIDGET (info->user_vbox));
-
-  druid_disable_next_button (info);
-
-  while (g_main_iteration (FALSE));
-}
-static gboolean
-on_iniletter_user_next (GnomeDruidPage  *gnomedruidpage,
-			gpointer arg1,
-			gpointer user_data)
-{
-  /*HBCIInitialInfo *info = user_data;*/
-  return FALSE;
-}
-
-
 
 
 static void
@@ -1739,60 +377,15 @@
   HBCIInitialInfo *info = user_data;
   char *name;
   g_assert(info->druid);
-  g_assert(info->userpage);
   
   name = gtk_widget_get_name (GTK_WIDGET (button));
-  if (strcmp (name, "addbank_button") == 0) {
-    info->state = ADD_BANK;
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->bankpage));
-  } else if (strcmp (name, "adduser_button") == 0) {
-    info->state = ADD_USER;
-    info->newbank = choose_one_bank (info->window, 
-				     HBCI_API_bankList (info->api) );
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->userpage));
-  } else if (strcmp (name, "hbciversion_button") == 0) {
-    /* Choose hbci version */
-    info->state = UPDATE_ACCOUNTS;
-    info->newcustomer = choose_customer (info);
-    if (info->newcustomer == NULL)
-      return;
-    if (choose_hbciversion_dialog 
-	(GTK_WINDOW (info->window),
-	 (HBCI_Bank *) 
-	 HBCI_User_bank (HBCI_Customer_user (info->newcustomer)),
-	 info))
-      gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			    GNOME_DRUID_PAGE (info->accountinfopage));
+  if (strcmp (name, "aqhbci_button") == 0) {
+/*     info->state = ADD_BANK; */
+    /* gnome_druid_set_page (GNOME_DRUID (info->druid), 
+       GNOME_DRUID_PAGE (info->bankpage)); */
   } else if (strcmp (name, "updatelist_button") == 0) {
     info->state = UPDATE_ACCOUNTS;
-    info->newcustomer = choose_customer (info);
     /* Nothing else to do. */
-    gnome_druid_set_page (GNOME_DRUID (info->druid), 
-			  GNOME_DRUID_PAGE (info->accountinfopage));
-  } else if (strcmp (name, "addaccount_button") == 0) {
-    /* manually adding HBCI account is not yet implemented (should be
-       rather easy, though) */
-    info->newcustomer = choose_customer (info);
-    gnc_hbci_addaccount(info, info->newcustomer);
-    /* Nothing else to do. Stay at this druid page. */
-  } else if (strcmp (name, "serveryes_button") == 0) {
-    druid_enable_next_button (info);
-  } else if (strcmp (name, "serverno_button") == 0) {
-    druid_disable_next_button (info);
-    gnc_error_dialog(info->window,
-		     _("Since the cryptographic keys of the bank cannot be verified,\n"
-		       "you should stop contacting this Server Internet Address\n"
-		       "and contact your bank. To help your bank figure out the\n"
-		       "problem, you should print out this erroneous Ini-Letter\n"
-		       "and show it to your bank. Please abort the HBCI setup\n"
-		       "druid now."));
-  } else if (strcmp (name, "serverprint_button") == 0) {
-    gnc_html_print (info->server_html);
-  } else if (strcmp (name, "userprint_button") == 0) {
-    druid_enable_next_button (info);
-    gnc_html_print (info->user_html);
   } else {
     printf("on_button_clicked: Oops, unknown button: %s\n",
 	   name);
@@ -1800,6 +393,33 @@
 }
 
 
+static void
+on_aqhbci_button (GtkButton *button,
+		  gpointer user_data)
+{
+  HBCIInitialInfo *info = user_data;
+  GWEN_BUFFER *buf;
+  int res;
+  g_assert(info->druid);
+
+  buf = GWEN_Buffer_new(NULL, 200, 0, 0);
+  AB_Banking_GetWizardPath(info->api, "aqhbci", buf);
+  GWEN_Buffer_AppendString(buf, "/kde_wizard");
+
+  if (strlen(GWEN_Buffer_GetStart(buf)) > 0) {
+    res = system(GWEN_Buffer_GetStart(buf));
+    if (res == 0)
+      druid_enable_next_button(info);
+    else {
+      printf("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, GWEN_Buffer_GetStart(buf));
+      druid_disable_next_button(info);
+    }
+  } else {
+    printf("on_aqhbci_button: Oops, no aqhbci wizard found. Cannot start aqhbci wizard.\n");
+    druid_disable_next_button(info);
+  }
+  GWEN_Buffer_free(buf);
+}
 
 
 
@@ -1812,8 +432,7 @@
   GtkWidget *page;
   
   info = g_new0 (HBCIInitialInfo, 1);
-  info->hbci_accountlist = NULL;
-  
+
   xml = gnc_glade_xml_new ("hbci.glade", "HBCI Init Druid");
 
   info->window = glade_xml_get_widget (xml, "HBCI Init Druid");
@@ -1826,93 +445,18 @@
   glade_xml_signal_connect_data (xml, "on_cancel", 
 				 GTK_SIGNAL_FUNC (on_cancel), info);
   
+  info->api = gnc_AB_BANKING_new_currentbook(info->window, &(info->interactor));
 
   {
     /* Page with config file entry widget */
     page = glade_xml_get_widget(xml, "configfile_page");
     info->filepage = page;
-    info->configfileentry = 
-      glade_xml_get_widget(xml, "configfile_fileentry");
-    gtk_signal_connect 
-      (GTK_OBJECT (gnome_file_entry_gtk_entry
-		  (GNOME_FILE_ENTRY (info->configfileentry))), 
-       "activate", 
-       GTK_SIGNAL_FUNC (on_configfile_activate), info);
-    /* Set the saved filename, if that is a valid file */
-    if (gnc_hbci_get_book_configfile (gnc_get_current_book ()))
-      info->configfile =
-	g_strdup (gnc_hbci_get_book_configfile (gnc_get_current_book () ));
-    if (info->configfile && 
-	g_file_test (info->configfile, 
-		     G_FILE_TEST_ISFILE | G_FILE_TEST_ISLINK)) 
-      gtk_entry_set_text 
-	(GTK_ENTRY (gnome_file_entry_gtk_entry
-		    (GNOME_FILE_ENTRY (info->configfileentry))), 
-	 info->configfile);
-    else {
-      const char *homedir = g_get_home_dir();
-      char *file = NULL;
-      g_assert(homedir);
-      file = g_strdup_printf("%s/.openhbci", homedir);
-      gtk_entry_set_text 
-	(GTK_ENTRY (gnome_file_entry_gtk_entry
-		    (GNOME_FILE_ENTRY (info->configfileentry))), 
-	 file);
-      g_free (file);
-    }
-      
-    gtk_signal_connect (GTK_OBJECT (page), "next", 
-			GTK_SIGNAL_FUNC (on_configfile_next), info);
-  }
-  {
-    page = glade_xml_get_widget(xml, "bank_page");
-    info->bankpage = page;
-    info->bankcode = glade_xml_get_widget(xml, "bank_code_entry");
-    info->countrycode = glade_xml_get_widget(xml, "country_code_entry");
-    info->ipaddr = glade_xml_get_widget(xml, "ip_address_entry");
-    /*gtk_signal_connect (GTK_OBJECT (info->ipaddr), "activate", 
-			GTK_SIGNAL_FUNC (on_ipaddr_activate), info);*/
-    gtk_signal_connect (GTK_OBJECT (page), "back", 
-			GTK_SIGNAL_FUNC (on_bankpage_back), info);
-    gtk_signal_connect (GTK_OBJECT (page), "next", 
-			GTK_SIGNAL_FUNC (on_bankpage_next), info);
-  }
-  {
-    page = glade_xml_get_widget(xml, "user_page");
-    info->userpage = page;
-    info->user_bankcode = glade_xml_get_widget(xml, "user_bankcode_label");
-    info->user_bankname = glade_xml_get_widget(xml, "user_bankname_label");
-    info->userid = glade_xml_get_widget(xml, "user_id_entry");
-    info->username = glade_xml_get_widget(xml, "user_name_entry");
-    gtk_signal_connect (GTK_OBJECT (info->userid), "focus-out-event", 
-			GTK_SIGNAL_FUNC (on_userid_focus_out), info);
-    info->customerid = glade_xml_get_widget(xml, "customer_id_entry");
-    info->customername = glade_xml_get_widget(xml, "customer_name_entry");
-    info->mediumrdh = glade_xml_get_widget(xml, "rdh_radiobutton");
-    info->mediumpath = glade_xml_get_widget(xml, "keyfile_fileentry");
-    info->mediumddv = glade_xml_get_widget(xml, "ddv_radiobutton");
-    {
-      char *curdir = g_get_current_dir();
-      gtk_entry_set_text 
-	(GTK_ENTRY (gnome_file_entry_gtk_entry
-		    (GNOME_FILE_ENTRY (info->mediumpath))), 
-	 curdir);
-      g_free (curdir);
-    }
-    gtk_signal_connect (GTK_OBJECT (page), "back", 
-			GTK_SIGNAL_FUNC (on_userid_back), info);
-    gtk_signal_connect (GTK_OBJECT (page), "prepare", 
-			GTK_SIGNAL_FUNC (on_userid_prepare), info);
-    gtk_signal_connect (GTK_OBJECT (page), "next", 
-			GTK_SIGNAL_FUNC (on_userid_next), info);
-  }
-  {
-    page = glade_xml_get_widget(xml, "account_info_page");
-    info->accountinfopage = page;
-    gtk_signal_connect (GTK_OBJECT (page), "back", 
-			GTK_SIGNAL_FUNC (on_accountinfo_back), info);
-    gtk_signal_connect (GTK_OBJECT (page), "next", 
-			GTK_SIGNAL_FUNC (on_accountinfo_next), info);
+    gtk_signal_connect (GTK_OBJECT (page), "prepare",
+			GTK_SIGNAL_FUNC (on_aqbutton_prepare), info);
+    gtk_signal_connect (GTK_OBJECT 
+			(glade_xml_get_widget (xml, "aqhbci_button")), 
+			"clicked",
+			GTK_SIGNAL_FUNC (on_aqhbci_button), info);
   }
   {
     page = glade_xml_get_widget(xml, "account_match_page");
@@ -1921,88 +465,18 @@
     gtk_signal_connect (GTK_OBJECT (info->accountlist), "select_row",
 			GTK_SIGNAL_FUNC (on_accountlist_select_row), info);
     gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "addbank_button")), 
+			(glade_xml_get_widget (xml, "aqhbci_again_button")), 
 			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
-    gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "adduser_button")), 
-			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
-    gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "hbciversion_button")), 
-			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
+			GTK_SIGNAL_FUNC (on_aqhbci_button), info);
     gtk_signal_connect (GTK_OBJECT 
 			(glade_xml_get_widget (xml, "updatelist_button")), 
 			"clicked",
 			GTK_SIGNAL_FUNC (on_button_clicked), info);
-    gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "addaccount_button")), 
-			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
     gtk_signal_connect (GTK_OBJECT (page), "prepare", 
 			GTK_SIGNAL_FUNC (on_accountlist_prepare), info);
     gtk_signal_connect (GTK_OBJECT (page), "back", 
 			GTK_SIGNAL_FUNC (on_accountlist_back), info);
   }
-  {
-    page = glade_xml_get_widget (xml, "iniletter_info_page");
-    info->serverinfopage = page;
-    gtk_signal_connect (GTK_OBJECT (page), "back", 
-			GTK_SIGNAL_FUNC (on_iniletter_info_back), info);
-    gtk_signal_connect (GTK_OBJECT (page), "next", 
-			GTK_SIGNAL_FUNC (on_iniletter_info_next), info);
-  }
-  {
-    page = glade_xml_get_widget(xml, "iniletter_server_page");
-    info->serverpage = page;
-    info->server_vbox = glade_xml_get_widget(xml, "iniletter_server_vbox");
-    info->server_frame = glade_xml_get_widget(xml, "iniletter_server_frame");
-    info->server_html = gnc_html_new();
-    gtk_container_add (GTK_CONTAINER (info->server_frame), 
-		       gnc_html_get_widget (info->server_html));
-
-    gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "serveryes_button")), 
-			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
-    gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "serverno_button")), 
-			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
-    gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "serverprint_button")), 
-			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
-    gtk_signal_connect (GTK_OBJECT (page), "prepare", 
-			GTK_SIGNAL_FUNC (on_iniletter_server_prepare), info);
-    /*gtk_signal_connect (GTK_OBJECT (page), "next", 
-      GTK_SIGNAL_FUNC (on_iniletter_server_next), info);*/
-  }
-  {
-    page = glade_xml_get_widget (xml, "iniletter_userinfo_page");
-    info->userinfopage = page;
-    gtk_signal_connect (GTK_OBJECT (page), "next", 
-			GTK_SIGNAL_FUNC (on_iniletter_userinfo_next), info);
-  }
-  {
-    page = glade_xml_get_widget(xml, "iniletter_user_page");
-    info->user_vbox = glade_xml_get_widget(xml, "iniletter_user_vbox");
-    info->user_frame = glade_xml_get_widget(xml, "iniletter_user_frame");
-    info->user_html = gnc_html_new();
-    gtk_container_add (GTK_CONTAINER (info->user_frame), 
-		       gnc_html_get_widget (info->user_html));
-
-    gtk_signal_connect (GTK_OBJECT 
-			(glade_xml_get_widget (xml, "userprint_button")), 
-			"clicked",
-			GTK_SIGNAL_FUNC (on_button_clicked), info);
-    gtk_signal_connect (GTK_OBJECT (page), "next", 
-			GTK_SIGNAL_FUNC (on_iniletter_user_next), info);
-    gtk_signal_connect (GTK_OBJECT (page), "prepare", 
-			GTK_SIGNAL_FUNC (on_iniletter_user_prepare), info);
-  }
-  
 
 
   /*gtk_signal_connect (GTK_OBJECT(dialog), "destroy",*/
Index: gnc-hbci-utils.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-utils.h,v
retrieving revision 1.16
retrieving revision 1.17
diff -Lsrc/import-export/hbci/gnc-hbci-utils.h -Lsrc/import-export/hbci/gnc-hbci-utils.h -u -r1.16 -r1.17
--- src/import-export/hbci/gnc-hbci-utils.h
+++ src/import-export/hbci/gnc-hbci-utils.h
@@ -25,19 +25,20 @@
 
 #include <glib.h>
 #include <gnome.h>
-/*#include <openhbci2/account.h>*/
-#include <openhbci2/api.h>
-#include <openhbci2/transaction.h>
+
+#include <aqbanking/banking.h>
+#include <aqbanking/transaction.h>
+#include <aqbanking/account.h>
+
 #include "gnc-ui.h"
 #include "Account.h"
 #include "Transaction.h"
 #include "gnc-book.h"
 
 #include "hbci-interaction.h"
-#include "gnc-hbci-account.h"
 
 
-/** Create a new HBCI_API and let it load its environment from the
+/** Create a new AB_BANKING and let it load its environment from the
  * configuration file filename. If the file doesn't exist and
  * allowNewFile is set to FALSE, this function returns NULL. If the
  * file exists, but OpenHBCI encountered an error upon opening, then
@@ -49,11 +50,10 @@
  * @param inter Reference to a GNCInteractor-pointer in order to use this later. 
  * May be NULL.
  */
-HBCI_API * gnc_hbci_api_new (const char *filename, 
+AB_BANKING * gnc_AB_BANKING_new (const char *filename, 
 			     gboolean allowNewFile, 
 			     GtkWidget *parent,
-			     GNCInteractor **inter,
-			     GList **list_accounts);
+			     GNCInteractor **inter);
 
 /** Same as above, but takes the filename already from the current
  * book's kvp frame AND caches a pointer to the api. Returns NULL if
@@ -64,75 +64,73 @@
  * @param inter Reference to a GNCInteractor-pointer in order to use this later. 
  * May be NULL.
  */ 
-HBCI_API * gnc_hbci_api_new_currentbook (GtkWidget *parent,
-					 GNCInteractor **inter,
-					 GList **list_accounts);
+AB_BANKING * gnc_AB_BANKING_new_currentbook (GtkWidget *parent,
+					     GNCInteractor **inter);
 
-/** Delete the given HBCI_API. If this is also the one that was cached
-    by gnc_hbci_api_new_currentbook, then that reference is deleted, too. */
-void gnc_hbci_api_delete (HBCI_API *api);
+/** Delete the given AB_BANKING. If this is also the one that was cached
+    by gnc_AB_BANKING_new_currentbook, then that reference is deleted, too. */
+void gnc_AB_BANKING_delete (AB_BANKING *api);
 
 
-/** Save this API to the config file given in the current book. Return
- * an error if one occurred, or if no filename was found in the
+/* Save this API to the config file given in the current book. Return
+ * nonzero if an error occurred, or if no filename was found in the
  * current book. */
-HBCI_Error * gnc_hbci_api_save (const HBCI_API *api);
+int gnc_AB_BANKING_save (const AB_BANKING *api);
 
 
 /* Get the corresponding HBCI account to a gnucash account. Of course
  * this only works after the gnucash account has been set up for HBCI
  * use, i.e. the kvp_frame "hbci/..." have been filled with
- * information. Returns NULL if no gnc_HBCI_Account was found.
+ * information. Returns NULL if no AB_ACCOUNT was found.
  *
- * @param api The HBCI_API to get the gnc_HBCI_Account from.
- * @param gnc_acc The gnucash account to query for gnc_HBCI_Account reference data. */
-const gnc_HBCI_Account *
-gnc_hbci_get_hbci_acc (const HBCI_API *api, Account *gnc_acc);
+ * @param api The AB_BANKING to get the AB_ACCOUNT from.
+ * @param gnc_acc The gnucash account to query for AB_ACCOUNT reference data. */
+AB_ACCOUNT *
+gnc_hbci_get_hbci_acc (const AB_BANKING *api, Account *gnc_acc);
 
 /* Return the HBCI return code of the given 'job', or zero if none was
  * found. If 'verbose' is TRUE, make a lot of debugging messages about
  * this outboxjob. */
 int
-gnc_hbci_debug_outboxjob (HBCI_OutboxJob *job, gboolean verbose);
+gnc_hbci_debug_outboxjob (AB_JOB *job, gboolean verbose);
 
-/* Check HBCI_Error on whether some feedback should be given to the
+/* Check int on whether some feedback should be given to the
  * user. Returns true if the HBCI action should be tried again; on the
  * other hand, returns false if the user can't do anything about this
  * error right now. */
 gboolean
-gnc_hbci_error_retry (GtkWidget *parent, HBCI_Error *error, 
+gnc_hbci_Error_retry (GtkWidget *parent, int error, 
 		      GNCInteractor *inter);
 
-/* Calls HBCI_API_executeQueue with some supplementary stuff around
+/* Calls AB_BANKING_executeQueue with some supplementary stuff around
  * it: set the debugLevel, show the GNCInteractor, and do some error
  * checking. Returns TRUE upon success or FALSE if the calling dialog
  * should abort. */
 gboolean
-gnc_hbci_api_execute (GtkWidget *parent, HBCI_API *api,
-		      HBCI_Outbox *queue,
-		      HBCI_OutboxJob *job, GNCInteractor *inter);
+gnc_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
+			AB_JOB *job, GNCInteractor *inter);
 
 
 /* Create the appropriate description field for a Gnucash Transaction
- * by the information given in the HBCI_Transaction h_trans. The
+ * by the information given in the AB_TRANSACTION h_trans. The
  * returned string must be g_free'd by the caller. */
-char *gnc_hbci_descr_tognc (const HBCI_Transaction *h_trans);
+char *gnc_hbci_descr_tognc (const AB_TRANSACTION *h_trans);
 
 /* Create the appropriate memo field for a Gnucash Split by the
- * information given in the HBCI_Transaction h_trans. The returned
+ * information given in the AB_TRANSACTION h_trans. The returned
  * string must be g_free'd by the caller. */
-char *gnc_hbci_memo_tognc (const HBCI_Transaction *h_trans);
+char *gnc_hbci_memo_tognc (const AB_TRANSACTION *h_trans);
 
 /** Return the first customer that can act on the specified account,
     or NULL if none was found (and an error message is printed on
     stdout). */
-const HBCI_Customer *
-gnc_hbci_get_first_customer(const gnc_HBCI_Account *h_acc);
+/* const HBCI_Customer * */
+/* gnc_hbci_get_first_customer(const AB_ACCOUNT *h_acc); */
 
 /** Returns the name of this bank. This function is helpful because it
  * always makes sure to return a valid const char pointer, even if no
  * bankName is available. */
-const char *bank_to_str (const HBCI_Bank *bank);
+/* const char *bank_to_str (const HBCI_Bank *bank); */
 
 /** Chooses one bank out of the given list. 
  *
@@ -140,8 +138,8 @@
  * dialog so that the user can choose one bank. If the list has only
  * one bank, it returns it. If the list has zero banks, it returns
  * NULL. */ 
-const HBCI_Bank *
-choose_one_bank (gncUIWidget parent, const list_HBCI_Bank *banklist);
+/* const HBCI_Bank * */
+/* choose_one_bank (gncUIWidget parent, const list_HBCI_Bank *banklist); */
 
 /** Chooses one customer out of the given list. 
  *
@@ -149,8 +147,8 @@
  * dialog so that the user can choose one customer. If the list has only
  * one customer, it returns it. If the list has zero customers, it returns
  * NULL. */ 
-const HBCI_Customer *
-choose_one_customer (gncUIWidget parent, const list_HBCI_Customer *custlist);
+/* const HBCI_Customer * */
+/* choose_one_customer (gncUIWidget parent, const list_HBCI_Customer *custlist); */
 
 /** Chooses one user out of the given list. 
  *
@@ -158,9 +156,10 @@
  * dialog so that the user can choose one user. If the list has only
  * one user, it returns it. If the list has zero users, it returns
  * NULL. */ 
-const HBCI_User *
-choose_one_user (gncUIWidget parent, const list_HBCI_User *userlist);
-
+/* const HBCI_User * */
+/* choose_one_user (gncUIWidget parent, const list_HBCI_User *userlist); */
 
+/** Return a newly allocated string. */
+char *gnc_AB_VALUE_toReadableString(const AB_VALUE *v);
 
 #endif
Index: gnc-hbci-utils.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-utils.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -Lsrc/import-export/hbci/gnc-hbci-utils.c -Lsrc/import-export/hbci/gnc-hbci-utils.c -u -r1.39 -r1.40
--- src/import-export/hbci/gnc-hbci-utils.c
+++ src/import-export/hbci/gnc-hbci-utils.c
@@ -25,8 +25,6 @@
 
 #include <gnome.h>
 #include <errno.h>
-#include <openhbci2.h>
-#include <openhbci2/error.h>
 #include <gwenhywfar/directory.h>
 
 #include "gnc-ui.h"
@@ -39,22 +37,21 @@
 
 /* static short module = MOD_IMPORT; */
 
-/* Globale variables for HBCI_API caching. */
-static HBCI_API *gnc_hbci_api = NULL;
+/* Globale variables for AB_BANKING caching. */
+static AB_BANKING *gnc_AB_BANKING = NULL;
 static char *gnc_hbci_configfile = NULL;
 static GNCInteractor *gnc_hbci_inter = NULL;
-static GList *gnc_hbci_accountlist = NULL;
+/* static GList *AB_ACCOUNTlist = NULL; */
 
 
 /* ------------------------------------------------------------ */
-HBCI_API *
-gnc_hbci_api_new (const char *filename, gboolean allowNewFile,
-		  GtkWidget *parent, GNCInteractor **inter,
-		  GList **list_accounts)
-{
-  HBCI_API *api = NULL;
-  HBCI_Error *err = NULL;
-  char *errstring;
+AB_BANKING *
+gnc_AB_BANKING_new (const char *filename, gboolean allowNewFile,
+		  GtkWidget *parent, GNCInteractor **inter)
+{
+  AB_BANKING *api = NULL;
+/*   int *err = NULL; */
+/*   char *errstring; */
   
   g_assert(inter);
   
@@ -77,60 +74,12 @@
     }
   
 
-  api = HBCI_API_new (FALSE, TRUE);
+  api = AB_Banking_new ("gnucash", 0);
+  /* FIXME: The configfile is ignored here */
   
-  {
-    unsigned hbci_major, hbci_minor;
-    HBCI_Error *er;
-    er = HBCI_API_configHbciVersion(filename, &hbci_major, &hbci_minor);
-    if (er) {
-      HBCI_Error_delete(er);
-      /* do nothing else; new file */
-    }
-    else {
-      if ((hbci_major == 0) && (hbci_minor == 9)) {
-	gnc_warning_dialog
-	  (parent,
-	   _(
-"The file %s seems to be from a previous version of OpenHBCI.\n"
-"With the new version of OpenHBCI, you need to run the HBCI Setup \n"
-"Druid again and create a new configuration file before you can work \n"
-"with HBCI. You need to create \n"
-"your User and Customer in the HBCI Setup Druid, but you can \n"
-"directly re-use your existing keyfile or chip card."), filename);
-	HBCI_API_delete (api);
-	return NULL;
-      }
-    }
-  }
-  
-  
-  err = HBCI_API_loadEnvironment (api, filename);
-  if (!HBCI_Error_isOk (err) && !allowNewFile) {
-    errstring = HBCI_Error_errorString (err);
-    HBCI_Error_delete (err);
-    gnc_warning_dialog
-	(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\n"), errstring);
-    free (errstring);
-    HBCI_API_delete (api);
-    return NULL;
-  }
-  HBCI_Error_delete (err);
-
-  *inter = gnc_hbci_api_interactors (api, parent);
-
-  gnc_hbci_accountlist =
-      gnc_HBCI_Account_glist_from_kvp_glist
-      (gnc_hbci_get_book_account_list(gnc_get_current_book ()),
-       api);
-  if (list_accounts)
-    *list_accounts = gnc_hbci_accountlist;
+  *inter = gnc_AB_BANKING_interactors (api, parent);
 
+#if 0
   {
     /* Well, currently gnucash doesn't offer a way to uniformly ask
        for the ~/.gnucash directory, so we have to generate that path
@@ -145,110 +94,95 @@
     databuffer = g_strjoin("", homebuffer, "/.gnucash/hbci");
 
     /*fprintf(stderr, "Setting log dir to %s\n", databuffer);*/
-    HBCI_Hbci_setApplicationDataDir(HBCI_API_Hbci(api), databuffer);
+/*     HBCI_Hbci_setApplicationDataDir(AB_Banking_Hbci(api), databuffer); */
+    /* FIXME: do we need to set this here? */
 
     g_free(databuffer);
     g_free(homebuffer);
   }
+#endif
 
   return api;
 }
 
-HBCI_API * gnc_hbci_api_new_currentbook (GtkWidget *parent, 
-					 GNCInteractor **inter,
-					 GList **list_accounts)
+AB_BANKING * gnc_AB_BANKING_new_currentbook (GtkWidget *parent, 
+					 GNCInteractor **inter)
 {
-  if (gnc_hbci_api == NULL) {
+  if (gnc_AB_BANKING == NULL) {
     /* No API cached -- create new one. */
     gnc_hbci_configfile = 
       g_strdup (gnc_hbci_get_book_configfile (gnc_get_current_book ()));
-    gnc_hbci_api = gnc_hbci_api_new (gnc_hbci_configfile, 
-				     FALSE, parent, &gnc_hbci_inter, 
-				     list_accounts);
+    gnc_AB_BANKING = gnc_AB_BANKING_new (gnc_hbci_configfile, 
+					 FALSE, parent, &gnc_hbci_inter);
     if (inter)
       *inter = gnc_hbci_inter;
 
-    return gnc_hbci_api;
+    return gnc_AB_BANKING;
 
   } else if ((gnc_hbci_configfile != NULL) && 
 	     (strcmp(gnc_hbci_configfile, 
 		     gnc_hbci_get_book_configfile (gnc_get_current_book ()))
 	      != 0)) {
     /* Wrong API cached -- delete old and create new. */
-    gnc_hbci_api_delete (gnc_hbci_api);
+    gnc_AB_BANKING_delete (gnc_AB_BANKING);
     fprintf(stderr,
-	    "gnc_hbci_api_new_currentbook: Wrong HBCI_API cached; creating new one.\n");
-    return gnc_hbci_api_new_currentbook (parent, inter, list_accounts);
+	    "gnc_AB_BANKING_new_currentbook: Wrong AB_BANKING cached; creating new one.\n");
+    return gnc_AB_BANKING_new_currentbook (parent, inter);
   } else {
     /* Correct API cached. */
     if (inter) {
       *inter = gnc_hbci_inter;
       GNCInteractor_reparent (*inter, parent);
     }
-    if (list_accounts)
-      *list_accounts = gnc_hbci_accountlist;
     
-    return gnc_hbci_api;
+    return gnc_AB_BANKING;
   }
 }
 
-void gnc_hbci_api_delete (HBCI_API *api)
+void gnc_AB_BANKING_delete (AB_BANKING *api)
 {
-  if (api == gnc_hbci_api) {
-    gnc_hbci_api = NULL;
+  if (api == gnc_AB_BANKING) {
+    gnc_AB_BANKING = NULL;
     gnc_hbci_inter = NULL;
     g_free (gnc_hbci_configfile);
     gnc_hbci_configfile = NULL;
-    list_HBCI_Account_delete (gnc_hbci_accountlist);
-    gnc_hbci_accountlist = NULL;
   }
-  HBCI_API_delete (api);
+  if (api == 0)
+    api = gnc_AB_BANKING;
+  if (api) {
+    AB_Banking_Fini(api);
+    AB_Banking_free(api);
+  }
 }
 
 
-HBCI_Error * gnc_hbci_api_save (const HBCI_API *api)
+int gnc_AB_BANKING_save (const AB_BANKING *api) 
 {
-  const char *file = gnc_hbci_get_book_configfile (gnc_get_current_book ());
-  if ((file == NULL) || (strlen (file) == 0)) 
-    return HBCI_Error_new ("gnc_hbci_api_save", ERROR_LEVEL_NORMAL, 0, 
-			   ERROR_ADVISE_ABORT, 
-			   "No filename for config file in gnc_book.", "");
-  
-  return HBCI_API_saveEnvironment (api, file);
+  /* FIXME: do something to save the current state */
+  return 0;
 }
 
 
 
-const gnc_HBCI_Account *
-gnc_hbci_get_hbci_acc (const HBCI_API *api, Account *gnc_acc) 
+
+AB_ACCOUNT *
+gnc_hbci_get_hbci_acc (const AB_BANKING *api, Account *gnc_acc) 
 {
-  const char *bankcode = NULL, *accountid = NULL;
-  int countrycode = 0;
-  const HBCI_Bank *bank;
-  gnc_HBCI_Account *hbci_acc = NULL;
+  int account_uid = 0;
+  AB_ACCOUNT *hbci_acc = NULL;
 
-  bankcode = gnc_hbci_get_account_bankcode (gnc_acc);
-  countrycode = gnc_hbci_get_account_countrycode (gnc_acc);
-  if (bankcode && (strlen(bankcode)>0) && (countrycode > 0)) {
+  account_uid = gnc_hbci_get_account_uid (gnc_acc);
+  if (account_uid > 0) {
     /*printf("gnc_hbci_get_hbci_acc: gnc_acc %s has blz %s and ccode %d\n",
       xaccAccountGetName (gnc_acc), bankcode, countrycode);*/
-    bank = HBCI_API_findBank (api, countrycode, bankcode);
-    if (bank) {
-      accountid = gnc_hbci_get_account_accountid (gnc_acc);
-      /*printf("gnc_hbci_get_hbci_acc: gnc_acc %s found blz %s and ccode %d and accountid %s, bank %p\n",
-	xaccAccountGetName (gnc_acc), bankcode, countrycode, accountid, bank);*/
-      if (accountid && (strlen(accountid)>0)) {
-	hbci_acc = list_HBCI_Account_find(gnc_hbci_accountlist, 
-					  bank, bankcode, accountid);
-	/*printf("gnc_hbci_get_hbci_acc: return HBCI_Account %p\n", hbci_acc);*/
-	return hbci_acc;
-      }
-    }
+    hbci_acc = AB_Banking_GetAccount(api, account_uid);
+    /*printf("gnc_hbci_get_hbci_acc: return HBCI_Account %p\n", hbci_acc);*/
+    return hbci_acc;
   }
   return NULL;
 }
 
-
+#if 0
 static void *
 print_list_int_cb (int value, void *user_data)
 {
@@ -281,52 +215,29 @@
   cause = (int) list_int_foreach (list, &get_resultcode_error_cb, &tmp_result);
   return MAX(tmp_result, cause);
 }
-
+#endif
 int
-gnc_hbci_debug_outboxjob (HBCI_OutboxJob *job, gboolean verbose)
+gnc_hbci_debug_outboxjob (AB_JOB *job, gboolean verbose)
 {
-  list_int *list;
-  const char *msg;
+/*   list_int *list; */
+/*   const char *msg; */
   int cause = 0;
   
   g_assert (job);
-/*   if (HBCI_OutboxJob_status (job) != HBCI_JOB_STATUS_DONE) */
+/*   if (AB_JOB_status (job) != HBCI_JOB_STATUS_DONE) */
 /*     return; */
-/*   if (HBCI_OutboxJob_result (job) != HBCI_JOB_RESULT_FAILED) */
+/*   if (AB_JOB_result (job) != HBCI_JOB_RESULT_FAILED) */
 /*     return; */
 
   if (verbose) {
-    printf("OutboxJob status: ");
-    switch(HBCI_OutboxJob_status (job)) {
-    case HBCI_JOB_STATUS_TODO:
-      printf("todo");
-      break;
-    case HBCI_JOB_STATUS_DONE:
-      printf("done");
-      break;
-    default:
-    case HBCI_JOB_STATUS_NONE:
-      printf("none");
-      break;
-    }
+    printf("OutboxJob status: %s", AB_Job_Status2Char(AB_Job_GetStatus(job)));
 
-    printf(", result: ");
-    switch(HBCI_OutboxJob_result (job)) {
-    case HBCI_JOB_RESULT_SUCCESS:
-      printf("success");
-      break;
-    case HBCI_JOB_RESULT_FAILED:
-      printf("failed");
-      break;
-    default:
-    case HBCI_JOB_STATUS_NONE:
-      printf("none");
-      break;
-    }
+    printf(", result: %s", AB_Job_GetResultText(job));
     printf("\n");
   }
-  
-  list = HBCI_OutboxJob_resultCodes (job);
+
+#if 0  
+  list = AB_JOB_resultCodes (job);
   if (list_int_size (list) > 0) {
 
     cause = get_resultcode_error (list);
@@ -358,84 +269,88 @@
       printf("OutboxJob's resultCodes list has zero length.\n");
   }
   list_int_delete (list);
+#endif
 
   return cause;
 }
 
 
 gboolean
-gnc_hbci_error_retry (GtkWidget *parent, HBCI_Error *error,
+gnc_hbci_Error_retry (GtkWidget *parent, int error, 
 		      GNCInteractor *inter)
 {
-  int code = HBCI_Error_code (error);
+  int code = error;
 
   switch (code) {
-  case HBCI_ERROR_CODE_PIN_WRONG:
+#if 0
+  case AB_ERROR_PIN_WRONG:
     GNCInteractor_erasePIN (inter);
     return gnc_verify_dialog (parent,
 				       TRUE,
 				       _("The PIN you entered was wrong.\n"
 					 "Do you want to try again?"));
-  case HBCI_ERROR_CODE_PIN_WRONG_0:
+  case AB_ERROR_PIN_WRONG_0:
     GNCInteractor_erasePIN (inter);
     return gnc_verify_dialog (parent,
 				       TRUE,
 				       _("The PIN you entered was wrong.\n"
 					 "ATTENTION: You have zero further wrong retries left!\n"
 					 "Do you want to try again?"));
-  case HBCI_ERROR_CODE_PIN_WRONG_1:
+  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 HBCI_ERROR_CODE_PIN_WRONG_2:
+  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 HBCI_ERROR_CODE_PIN_ABORTED:
-    /*     printf("gnc_hbci_error_feedback: PIN dialog was aborted.\n"); */
+  case AB_ERROR_PIN_ABORTED:
+    /*     printf("gnc_hbci_Error_feedback: PIN dialog was aborted.\n"); */
     return FALSE;
-  case HBCI_ERROR_CODE_PIN_TOO_SHORT:
+  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 HBCI_ERROR_CODE_CARD_DESTROYED:
+  case AB_ERROR_CARD_DESTROYED:
     GNCInteractor_hide (inter);
     gnc_error_dialog
       (parent,
        _("Unfortunately you entered a wrong PIN for too many times.\n"
 	 "Your chip card is therefore destroyed. Aborting."));
     return FALSE;
-  case HBCI_ERROR_CODE_FILE_NOT_FOUND:
-    /*     printf("gnc_hbci_error_feedback: File not found error.\n"); */
+  case AB_ERROR_FILE_NOT_FOUND:
+    /*     printf("gnc_hbci_Error_feedback: File not found error.\n"); */
     return FALSE;
-  case HBCI_ERROR_CODE_NO_CARD:
+  case AB_ERROR_NO_CARD:
     return gnc_verify_dialog (parent,
 				       TRUE,
 				       _("No chip card has been found in the chip card reader.\n"
 					 "Do you want to try again?"));
-  case HBCI_ERROR_CODE_JOB_NOT_SUPPORTED:
+  case AB_ERROR_JOB_NOT_SUPPORTED:
     GNCInteractor_hide (inter);
     gnc_error_dialog 
       (parent,
        _("Unfortunately this HBCI job is not supported \n"
 	 "by your bank or for your account. Aborting."));
     return FALSE;
-  case HBCI_ERROR_CODE_SOCKET_NO_CONNECT:
+#endif
+  case AB_ERROR_NETWORK:
     GNCInteractor_hide (inter);
     gnc_error_dialog 
       (parent,
        _("The server of your bank refused the HBCI connection.\n"
 	 "Please try again later. Aborting."));
     return FALSE;
-  case HBCI_ERROR_CODE_MEDIUM:
+#if 0
+  case AB_ERROR_MEDIUM:
     gnc_error_dialog 
       (parent,
        _("There was an error when loading the plugin for your security medium \n"
@@ -444,13 +359,14 @@
 	 "to recompile and reinstall the plugin again. Aborting now."));
     GNCInteractor_hide (inter);
     return FALSE;
-  case HBCI_ERROR_CODE_BAD_MEDIUM:
+  case AB_ERROR_BAD_MEDIUM:
     gnc_error_dialog 
       (parent,
        _("Your security medium is not supported. No appropriate plugin \n"
 	 "has been found for that medium. Aborting."));
     GNCInteractor_hide (inter);
     return FALSE;
+#endif
       
   default:
     return FALSE;
@@ -458,6 +374,7 @@
   
 }
 
+#if 0
 /* Prints all results that can be found in the outbox into the interactor */
 static void gnc_hbci_printresult(HBCI_Outbox *outbox, GNCInteractor *inter)
 {
@@ -507,14 +424,22 @@
 
   GWEN_DB_Group_free(rsp);
 }
+#endif
 
+static gboolean hbci_Error_isOk(int err) {
+  switch (err) {
+  case 0:
+    return TRUE;
+  default:
+    return FALSE;
+  };
+}
 
 gboolean
-gnc_hbci_api_execute (GtkWidget *parent, HBCI_API *api,
-		      HBCI_Outbox *queue,
-		      HBCI_OutboxJob *job, GNCInteractor *inter)
+gnc_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
+			AB_JOB *job, GNCInteractor *inter)
 {
-  HBCI_Error *err;
+  int err;
   int resultcode;
 	  
   if (inter)
@@ -522,33 +447,31 @@
 
   if (gnc_lookup_boolean_option("_+Advanced", 
 				"HBCI Verbose Debug Messages", FALSE)) {
-    GWEN_Logger_SetLevel(0, GWEN_LoggerLevelDebug);
-    HBCI_Hbci_setDebugLevel (4);
+/*     GWEN_Logger_SetLevel(0, GWEN_LoggerLevelDebug); */
+/*     HBCI_Hbci_setDebugLevel (4); */
   }
-  else
-    HBCI_Hbci_setDebugLevel (0);
+/*   else */
+/*     HBCI_Hbci_setDebugLevel (0); */
 
   do {
     if (inter)
       GNCInteractor_show_nodelete (inter);
-    err = HBCI_API_executeQueue (api, queue);
-    g_assert (err);
+    err = AB_Banking_ExecuteQueue (api);
 
     /* Print result codes to interactor */
-    gnc_hbci_printresult(queue, inter);
+/*     gnc_hbci_printresult(queue, inter); */
     
-  } while (gnc_hbci_error_retry (parent, err, inter));
+  } while (gnc_hbci_Error_retry (parent, err, inter));
   
   resultcode = gnc_hbci_debug_outboxjob (job, FALSE);
-  if (!HBCI_Error_isOk(err)) {
-    char *errstr = 
-      g_strdup_printf("gnc_hbci_api_execute: Error at executeQueue: %s",
-		      HBCI_Error_message (err));
-    printf("%s\n", errstr);
-    HBCI_Interactor_msgStateResponse (HBCI_Hbci_interactor 
-				      (HBCI_API_Hbci (api)), errstr);
-    g_free (errstr);
-    HBCI_Error_delete (err);
+  if (!hbci_Error_isOk(err)) {
+/*     char *errstr =  */
+/*       g_strdup_printf("gnc_AB_BANKING_execute: Error at executeQueue: %s", */
+/* 		      hbci_Error_message (err)); */
+/*     printf("%s\n", errstr); */
+/*     HBCI_Interactor_msgStateResponse (HBCI_Hbci_interactor  */
+/* 				      (AB_BANKING_Hbci (api)), errstr); */
+/*     g_free (errstr); */
     gnc_hbci_debug_outboxjob (job, TRUE);
     GNCInteractor_show_nodelete (inter);
     return FALSE;
@@ -556,13 +479,11 @@
 
   GNCInteractor_set_cache_valid (inter, TRUE);
   if (resultcode <= 20) {
-    HBCI_Error_delete (err);
     return TRUE;
   }
   else {
-    printf("gnc_hbci_api_execute: Some message at executeQueue: %s",
-	   HBCI_Error_message (err));
-    HBCI_Error_delete (err);
+/*     printf("gnc_AB_BANKING_execute: Some message at executeQueue: %s", */
+/* 	   hbci_Error_message (err)); */
     GNCInteractor_show_nodelete (inter);
     return TRUE; /* <- This used to be a FALSE but this was probably
 		  * as wrong as it could get. @§%$! */
@@ -596,7 +517,7 @@
 }
 
 
-char *gnc_hbci_descr_tognc (const HBCI_Transaction *h_trans)
+char *gnc_hbci_descr_tognc (const AB_TRANSACTION *h_trans)
 {
   /* Description */
   char *h_descr = NULL;
@@ -607,12 +528,12 @@
      g_strstrip every single element of the string list, which is
      only done in our callback gnc_list_string_cb. The separator is
      also set there. */
-  list_string_foreach (HBCI_Transaction_description (h_trans), 
-		       &gnc_list_string_cb,
-		       &h_descr);
-  list_string_foreach (HBCI_Transaction_otherName (h_trans), 
-		       &gnc_list_string_cb,
-		       &othername);
+  GWEN_StringList_ForEach (AB_Transaction_GetPurpose (h_trans), 
+			   &gnc_list_string_cb,
+			   &h_descr);
+  GWEN_StringList_ForEach (AB_Transaction_GetRemoteName (h_trans), 
+			   &gnc_list_string_cb,
+			   &othername);
   /*DEBUG("HBCI Description '%s'", h_descr);*/
 
   if (othername && (strlen (othername) > 0))
@@ -633,16 +554,16 @@
   return g_descr;
 }
 
-char *gnc_hbci_memo_tognc (const HBCI_Transaction *h_trans)
+char *gnc_hbci_memo_tognc (const AB_TRANSACTION *h_trans)
 {
   /* Memo in the Split. HBCI's transactionText contains strings like
    * "STANDING ORDER", "UEBERWEISUNGSGUTSCHRIFT", etc.  */
   /*   char *h_transactionText =  */
-  /*     g_strdup (HBCI_Transaction_transactionText (h_trans)); */
+  /*     g_strdup (AB_TRANSACTION_transactionText (h_trans)); */
   char *h_otherAccountId =
-    g_strdup (HBCI_Transaction_otherAccountId (h_trans));
+    g_strdup (AB_Transaction_GetRemoteAccountNumber (h_trans));
   char *h_otherBankCode =
-    g_strdup (HBCI_Transaction_otherBankCode (h_trans));
+    g_strdup (AB_Transaction_GetRemoteBankCode (h_trans));
   char *g_memo;
 
   /*   g_strstrip (h_transactionText); */
@@ -662,10 +583,11 @@
 }
 
 
+#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 gnc_HBCI_Account *h_acc)
+gnc_hbci_get_first_customer(const AB_ACCOUNT *h_acc)
 {
   /* Get one customer. */
   const list_HBCI_User *userlist;
@@ -673,7 +595,7 @@
   const HBCI_User *user;
   g_assert(h_acc);
   
-  bank = gnc_HBCI_Account_bank (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);
@@ -919,3 +841,11 @@
   g_assert_not_reached();
   return NULL;
 }
+#endif
+
+char *gnc_AB_VALUE_toReadableString(const AB_VALUE *v)
+{
+  char tmp[100];
+  sprintf(tmp, "%.2f %s", AB_Value_GetValue(v), AB_Value_GetCurrency(v));
+  return g_strdup(tmp);
+}
Index: gnc-hbci-getbalance.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-getbalance.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -Lsrc/import-export/hbci/gnc-hbci-getbalance.c -Lsrc/import-export/hbci/gnc-hbci-getbalance.c -u -r1.23 -r1.24
--- src/import-export/hbci/gnc-hbci-getbalance.c
+++ src/import-export/hbci/gnc-hbci-getbalance.c
@@ -23,7 +23,7 @@
 #include "config.h"
 #include "gnc-hbci-getbalance.h"
 
-#include <openhbci2/api.h>
+#include <aqbanking/banking.h>
 
 #include "gnc-ui.h"
 #include "gnc-numeric.h"
@@ -32,45 +32,44 @@
 
 #include "hbci-interaction.h"
 #include "gnc-hbci-utils.h"
-#include "dialog-hbcitrans.h"
+/* #include "dialog-hbcitrans.h" */
 
 
-void gnc_hbci_getbalance_debugprint(HBCI_OutboxJob *balance_job,
-				    const gnc_HBCI_Account *h_acc);
+void gnc_hbci_getbalance_debugprint(AB_JOB *balance_job,
+				    const AB_ACCOUNT *h_acc);
 
+#if 0
 static void 
 bal_print_debug(const char *name,
-		const HBCI_Value *val,
+		const AB_VALUE *val,
 		gboolean negative,
 		const char *date_str,
 		const char *time_str)
 {
-  char *str = HBCI_Value_toReadableString (val);
+  char *str = gnc_AB_VALUE_toReadableString (val);
   printf("GetBalance: %s%s %s at date %s %s",
 	 (negative ? "-" : ""), str, 
 	 name, date_str, time_str);
   free (str);
 }
+#endif 
 
 
 void
 gnc_hbci_getbalance (GtkWidget *parent, Account *gnc_acc)
 {
-  HBCI_API *api = NULL;
-  HBCI_Outbox *outbox = NULL;
-  const gnc_HBCI_Account *h_acc = NULL;
+  AB_BANKING *api = NULL;
+  const AB_ACCOUNT *h_acc = NULL;
   GNCInteractor *interactor = NULL;
-  const HBCI_Customer *customer = NULL;
-  GList *hbci_accountlist = NULL;
   
   g_assert(parent);
   if (gnc_acc == NULL)
     return;
 
   /* Get API */
-  api = gnc_hbci_api_new_currentbook (parent, &interactor, &hbci_accountlist);
+  api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
   if (api == NULL) {
-    printf("gnc_hbci_getbalance: Couldn't get HBCI API.\n");
+    printf("gnc_hbci_getbalance: Couldn't get AB_BANKING API.\n");
     return;
   }
   g_assert (interactor);
@@ -79,35 +78,32 @@
   h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
   if (h_acc == NULL) {
     printf("gnc_hbci_getbalance: No HBCI account found.\n");
+    /* FIXME: free unneeded data */
     return;
   }
   /* printf("gnc_hbci_getbalance: HBCI account no. %s found.\n",
-     gnc_HBCI_Account_accountId (h_acc)); */
+     AB_ACCOUNT_accountId (h_acc)); */
   
-  /* Get the customer that should be doing this job. */
-  customer = gnc_hbci_get_first_customer(h_acc);
-  if (!customer) 
-    return;
-  /* printf("gnc_hbci_getbalance: Customer id %s found.\n",
-     HBCI_Customer_custId ((HBCI_Customer *)customer)); */
-
   {
     /* Execute a GetBalance job. */
-    HBCI_OutboxJob *job;
+    AB_JOB *job;
 
-    job = HBCI_OutboxJob_new("JobGetBalance", (HBCI_Customer *)customer, 
-			     gnc_HBCI_Account_accountId(h_acc));
-    HBCI_Job_setProperty(HBCI_OutboxJob_Job(job), "allAccounts", "N");
+    job = AB_JobGetBalance_new((AB_ACCOUNT*)h_acc);
+    if (!AB_Job_CheckAvailability(job)) {
+      printf("gnc_hbci_getbalance: JobGetBalance not avaiable for this account.\n");
+      /* FIXME: free unneeded data */
+      return;
+    }
     
     /* Add job to API queue */
-    outbox = HBCI_Outbox_new();
-    HBCI_Outbox_addJob (outbox, job);
+    AB_Banking_EnqueueJob(api, job);
 
     /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (parent, api, outbox, job, interactor)) {
+    if (!gnc_AB_BANKING_execute (parent, api, job, interactor)) {
 
-      /* HBCI_API_executeOutbox failed. */
-      HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE);
+      /* AB_BANKING_executeOutbox failed. */
+      AB_Banking_DequeueJob(api, job);
+      /* FIXME: free unneeded data */
       return;
     }
 
@@ -119,24 +115,23 @@
 				job);
 
     /* Clean up after ourselves. */
-    HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE);
-    HBCI_Outbox_delete(outbox);
-    gnc_hbci_api_save (api);
+    AB_Banking_DequeueJob(api, job);
+    gnc_AB_BANKING_save (api);
     GNCInteractor_hide (interactor);
   }
 }
 
 
-
-void gnc_hbci_getbalance_debugprint(HBCI_OutboxJob *job,
-				    const gnc_HBCI_Account *h_acc)
+#if 0
+void gnc_hbci_getbalance_debugprint(AB_JOB *job,
+				    const AB_ACCOUNT *h_acc)
 {
   GWEN_DB_NODE *response, *acc_bal;
   GWEN_DB_NODE *noted_grp, *booked_grp;
-  HBCI_Value *booked_val, *noted_val;
+  AB_VALUE *booked_val, *noted_val;
   /* time_t balance_tt, noted_tt, booked_tt; */
 	
-  response = HBCI_Job_responseData(HBCI_OutboxJob_Job(job));
+  response = HBCI_Job_responseData(AB_JOB_Job(job));
   if (!response)
     return;
   acc_bal =GWEN_DB_GetGroup(response, 
@@ -147,13 +142,13 @@
   noted_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "noted");
   booked_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "booked");
 
-  booked_val = HBCI_Value_new(GWEN_DB_GetCharValue(booked_grp, "value", 0, "0"),
+  booked_val = AB_VALUE_new(GWEN_DB_GetCharValue(booked_grp, "value", 0, "0"),
 			      GWEN_DB_GetCharValue(booked_grp, "currency", 0, "EUR"));
-  noted_val = HBCI_Value_new(GWEN_DB_GetCharValue(noted_grp, "value", 0, "0"),
+  noted_val = AB_VALUE_new(GWEN_DB_GetCharValue(noted_grp, "value", 0, "0"),
 			     GWEN_DB_GetCharValue(noted_grp, "currency", 0, "EUR"));
     
   printf("GetBalance: Balances for account %s :\n",
-	 gnc_HBCI_Account_accountId (h_acc));
+	 AB_ACCOUNT_accountId (h_acc));
   bal_print_debug("Booked balance",
 		  booked_val,
 		  (strcasecmp(GWEN_DB_GetCharValue(booked_grp, "debitmark", 0, "C"),"D")==0),
@@ -165,24 +160,25 @@
 		  GWEN_DB_GetCharValue(noted_grp, "date", 0, ""),
 		  GWEN_DB_GetCharValue(noted_grp, "time", 0, ""));
 /*   bal_print_debug("Bank Line",  */
-/* 		  gnc_HBCI_AccountBalance_bankLine (acc_bal), FALSE, */
+/* 		  AB_ACCOUNTBalance_bankLine (acc_bal), FALSE, */
 /* 		  balance_tt); */
 /*   bal_print_debug("Disposable amount", */
-/* 		  gnc_HBCI_AccountBalance_disposable (acc_bal), FALSE, */
+/* 		  AB_ACCOUNTBalance_disposable (acc_bal), FALSE, */
 /* 		  balance_tt); */
 /*   bal_print_debug("Already disposed", */
-/* 		  gnc_HBCI_AccountBalance_disposed (acc_bal), FALSE, */
+/* 		  AB_ACCOUNTBalance_disposed (acc_bal), FALSE, */
 /* 		  balance_tt); */
-  HBCI_Value_delete(booked_val);
-  HBCI_Value_delete(noted_val);
+  AB_VALUE_delete(booked_val);
+  AB_VALUE_delete(noted_val);
 }
+#endif
 
 static gchar*
 bal_print_balance(const char *format,
-		  const HBCI_Value *val,
+		  const AB_VALUE *val,
 		  gboolean negative)
 {
-  char *str = HBCI_Value_toReadableString (val);
+  char *str = gnc_AB_VALUE_toReadableString (val);
   char *res = g_strdup_printf(format, 
 			      (negative ? "-" : ""), 
 			      str);
@@ -195,55 +191,40 @@
 gboolean
 gnc_hbci_getbalance_finish (GtkWidget *parent, 
 			    Account *gnc_acc,
-			    const HBCI_OutboxJob *job)
+			    const AB_JOB *job)
 {
-  GWEN_DB_NODE *response, *acc_bal;
-  GWEN_DB_NODE *noted_grp, *booked_grp;
-  HBCI_Value *booked_val, *noted_val;
+  const AB_ACCOUNT_STATUS *response;
+  const AB_BALANCE *noted_grp, *booked_grp;
+  const AB_VALUE *booked_val, *noted_val;
 
   time_t booked_tt;
 
   gboolean booked_debit, noted_debit;
   gboolean dialogres;
-	    
-  response = HBCI_Job_responseData((HBCI_Job*)HBCI_OutboxJob_Job_const(job));
+
+  response = AB_JobGetBalance_GetAccountStatus((AB_JOB*)job);
   if (!response) {
     printf("gnc_hbci_getbalance_finish: Oops, response == NULL.\n");
     return TRUE;
   }
-  acc_bal = GWEN_DB_GetGroup(response, 
-			    GWEN_PATH_FLAGS_NAMEMUSTEXIST, "balance");
-  if (!acc_bal) {
-    printf("gnc_hbci_getbalance_finish: Oops, acc_bal == NULL. Response was:\n");
-    GWEN_DB_Dump(response, stdout, 1);
-    return TRUE;
-  }
 
-  noted_grp = GWEN_DB_GetGroup(acc_bal, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "noted");
-  booked_grp = GWEN_DB_GetGroup(acc_bal, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "booked");
+  noted_grp = AB_AccountStatus_GetNotedBalance(response);
+  booked_grp = AB_AccountStatus_GetBookedBalance(response);
 
   if (!booked_grp || !noted_grp) {
-    printf("gnc_hbci_getbalance_finish: Oops, booked_grp or noted_grp == NULL. Response was:\n");
-    GWEN_DB_Dump(response, stdout, 1);
+    printf("gnc_hbci_getbalance_finish: Oops, booked_grp or noted_grp == NULL.\n");
     return TRUE;
   }
-  booked_val = HBCI_Value_new(GWEN_DB_GetCharValue(booked_grp, "value", 0, "0"),
-			      GWEN_DB_GetCharValue(booked_grp, "currency", 0, "EUR"));
-  booked_debit = (strcasecmp(GWEN_DB_GetCharValue(booked_grp, "debitmark", 0, "C"),"D")==0);
+  booked_val = AB_Balance_GetValue(booked_grp);
+  booked_debit = AB_Value_GetValue(booked_val) < 0;
   
-  noted_val = HBCI_Value_new(GWEN_DB_GetCharValue(noted_grp, "value", 0, "0"),
-			     GWEN_DB_GetCharValue(noted_grp, "currency", 0, "EUR"));
-  noted_debit = (strcasecmp(GWEN_DB_GetCharValue(noted_grp, "debitmark", 0, "C"),"D")==0);
+  noted_val = AB_Balance_GetValue(noted_grp);
+  noted_debit = AB_Value_GetValue(noted_val) < 0;
   
-  {
-    HBCI_Date *a = HBCI_Date_new_string(GWEN_DB_GetCharValue(booked_grp, "date", 0, ""), 4);
-    
-    booked_tt = HBCI_Date_to_time_t (a);
-    HBCI_Date_delete(a);
-  }
+  booked_tt = GWEN_Time_toTime_t (AB_Balance_GetTime(booked_grp));
     
-  if ((HBCI_Value_getValue (noted_val) == 0) &&
-      (HBCI_Value_getValue (booked_val) == 0))
+  if ((AB_Value_GetValue (noted_val) == 0) &&
+      (AB_Value_GetValue (booked_val) == 0))
     {
       gnome_ok_dialog_parented 
 	/* Translators: Strings from this file are really only
@@ -261,7 +242,7 @@
     }
   else
     {
-      char *booked_str = HBCI_Value_toReadableString (booked_val);
+      char *booked_str = gnc_AB_VALUE_toReadableString (booked_val);
       char *message1 = g_strdup_printf
 	(
 	 /* Translators: The first %s is "-" if this amount is
@@ -272,7 +253,7 @@
 	 (booked_debit ? "-" : ""),
 	 booked_str);
       char *message2 = 
-	((HBCI_Value_getValue (noted_val) == 0) ?
+	((AB_Value_GetValue (noted_val) == 0) ?
 	 g_strdup_printf("%s", "") :
 	 bal_print_balance
 	 /* Translators: The first %s is "-" if this amount is
@@ -299,7 +280,7 @@
   if (dialogres) 
     {
       gnc_numeric abs_value =
-	double_to_gnc_numeric (HBCI_Value_getValue (booked_val),
+	double_to_gnc_numeric (AB_Value_GetValue (booked_val),
 			       xaccAccountGetCommoditySCU(gnc_acc),
 			       GNC_RND_ROUND);
       recnWindowWithBalance (parent, 
Index: dialog-hbcitrans.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-hbcitrans.h,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lsrc/import-export/hbci/dialog-hbcitrans.h -Lsrc/import-export/hbci/dialog-hbcitrans.h -u -r1.9 -r1.10
--- src/import-export/hbci/dialog-hbcitrans.h
+++ src/import-export/hbci/dialog-hbcitrans.h
@@ -27,10 +27,9 @@
 
 #include <gnome.h>
 
-#include <openhbci2/api.h>
-#include <openhbci2/customer.h>
-#include <openhbci2/transaction.h>
-#include <openhbci2/outboxjob.h>
+#include <aqbanking/banking.h>
+#include <aqbanking/transaction.h>
+#include <aqbanking/job.h>
 
 #include "Account.h"
 #include "gnc-hbci-utils.h"
@@ -44,11 +43,11 @@
 } GNC_HBCI_Transtype;
 
 
-/*HBCI_Transaction *
+/*AB_TRANSACTION *
 gnc_hbci_trans (GtkWidget *parent,
-		HBCI_API *api,
+		AB_BANKING *api,
 		GNCInteractor *interactor,
-		const gnc_HBCI_Account *h_acc,
+		const AB_ACCOUNT *h_acc,
 		const HBCI_Customer *customer,
 		Account *gnc_acc,
 		GNC_HBCI_Transtype type,
@@ -58,8 +57,7 @@
  * specified by the arguments, and return a pointer to it. */
 HBCITransDialog *
 gnc_hbci_dialog_new (GtkWidget *parent,
-		     const gnc_HBCI_Account *h_acc,
-		     const HBCI_Customer *customer,
+		     const AB_ACCOUNT *h_acc,
 		     Account *gnc_acc,
 		     GNC_HBCI_Transtype trans_type,
 		     GList *templ);
@@ -72,8 +70,8 @@
 GList *gnc_hbci_dialog_get_templ(const HBCITransDialog *td);
 /** Return the change status of the template list */
 gboolean gnc_hbci_dialog_get_templ_changed(const HBCITransDialog *td) ;
-/** Return the HBCI_Transaction. */
-const HBCI_Transaction *gnc_hbci_dialog_get_htrans(const HBCITransDialog *td);
+/** Return the AB_TRANSACTION. */
+const AB_TRANSACTION *gnc_hbci_dialog_get_htrans(const HBCITransDialog *td);
 /** Return the gnucash Transaction. */
 Transaction *gnc_hbci_dialog_get_gtrans(const HBCITransDialog *td);
 /** Hide the dialog */
@@ -84,12 +82,10 @@
 
 
 int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td, 
-				 const gnc_HBCI_Account *h_acc);
-HBCI_OutboxJob *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, HBCI_API *api,
-			      HBCI_Outbox *outbox,
-			      const HBCI_Customer *customer, 
-			      gnc_HBCI_Account *h_acc, 
+				 const AB_ACCOUNT *h_acc);
+AB_JOB *
+gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, AB_BANKING *api,
+			      AB_ACCOUNT *h_acc, 
 			      GNC_HBCI_Transtype trans_type);
 /** Callback function for gnc_xfer_dialog_set_txn_cb(). The user_data
  * has to be a pointer to a HBCITransDialog structure.  */
@@ -99,9 +95,8 @@
  * the application should continue, and FALSE if the user wants to
  * enter this job again.  */
 gboolean 
-gnc_hbci_trans_dialog_execute(HBCITransDialog *td, HBCI_API *api, 
-			      HBCI_Outbox *outbox,
-			      HBCI_OutboxJob *job, GNCInteractor *interactor);
+gnc_hbci_trans_dialog_execute(HBCITransDialog *td, AB_BANKING *api, 
+			      AB_JOB *job, GNCInteractor *interactor);
 
 
 #endif
Index: gnc-hbci-gettrans.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-gettrans.h,v
retrieving revision 1.4
retrieving revision 1.5
diff -Lsrc/import-export/hbci/gnc-hbci-gettrans.h -Lsrc/import-export/hbci/gnc-hbci-gettrans.h -u -r1.4 -r1.5
--- src/import-export/hbci/gnc-hbci-gettrans.h
+++ src/import-export/hbci/gnc-hbci-gettrans.h
@@ -24,7 +24,7 @@
 #define GNC_HBCI_GETTRANS_H
 
 #include <gnome.h>
-#include <openhbci2/outboxjob.h>
+#include <aqbanking/jobgettransactions.h>
 #include "Account.h"
 
 /** Start a GetTrans job. */
@@ -36,7 +36,7 @@
 gboolean
 gnc_hbci_gettrans_final(GtkWidget *parent, 
 			Account *gnc_acc, 
-			const HBCI_OutboxJob *trans_job,
+			const AB_JOB *trans_job,
 			gboolean run_until_done);
 
 
Index: hbci-interaction.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interaction.c,v
retrieving revision 1.35
retrieving revision 1.36
diff -Lsrc/import-export/hbci/hbci-interaction.c -Lsrc/import-export/hbci/hbci-interaction.c -u -r1.35 -r1.36
--- src/import-export/hbci/hbci-interaction.c
+++ src/import-export/hbci/hbci-interaction.c
@@ -28,7 +28,7 @@
 #include "hbci-interaction.h"
 #include "hbci-interactionP.h"
 
-#include <openhbci2/interactorcb.h>
+#include <aqbanking/banking.h>
 #include "dialog-utils.h"
 #include "druid-utils.h"
 #include "gnc-ui-util.h"
@@ -38,14 +38,12 @@
 #include "dialog-pass.h"
 #include "gnc-hbci-utils.h"
 
-#include <openhbci2.h>
-
 #define PREF_TAB_ONLINE_BANKING N_("Online Banking & Importing")
 
 
 
 /** Adds the interactor and progressmonitor classes to the api. */
-GNCInteractor *gnc_hbci_api_interactors (HBCI_API *api, GtkWidget *parent)
+GNCInteractor *gnc_AB_BANKING_interactors (AB_BANKING *api, GtkWidget *parent)
 {
   GNCInteractor *data;
   
@@ -57,10 +55,11 @@
     gnc_lookup_boolean_option(PREF_TAB_ONLINE_BANKING,
 			      "HBCI Remember PIN in memory",
                               FALSE);
+  data->showbox_id = 1;
+  data->showbox_hash = g_hash_table_new(NULL, NULL); 
 
   /* set HBCI_Interactor */
-  HBCI_Hbci_setInteractor(HBCI_API_Hbci(api), 
-			  gnc_hbci_new_interactor(data), TRUE);
+  gnc_hbci_add_callbacks(api, data);
   return data;
 }
 
@@ -159,6 +158,8 @@
   }
   
   data->dialog = NULL;
+
+  g_hash_table_destroy(data->showbox_hash);
 }
 
 void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value)
@@ -174,7 +175,7 @@
     g_free (memset (i->pw, 0, strlen (i->pw)));
   i->pw = NULL;
   i->cache_valid = FALSE;
-  i->user = NULL;
+  /* i->user = NULL; */
 }
 void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent)
 {
@@ -194,93 +195,48 @@
 /********************************************************
  * Now all the callback functions 
  */
-static const char *username_from_user(const HBCI_User *user)
-{
-  return (user ? 
-	  (HBCI_User_name (user) ? HBCI_User_name (user) :
-	   (HBCI_User_userId (user) ? HBCI_User_userId (user) :
-	    _("Unknown"))) :
-	  _("Newly created user"));
-}
 
-static int msgInputPin(const HBCI_User *user,
-		       char **pinbuf,
-		       int minsize,
-		       int newPin,
-		       void *user_data)
+static int inputBoxCB(AB_BANKING *ab,
+		      GWEN_TYPE_UINT32 flags,
+		      const char *title,
+		      const char *text,
+		      char *resultbuffer,
+		      int minsize,
+		      int maxLen)
 {
-  GNCInteractor *data = user_data;
-  const HBCI_Bank *bank = NULL;
+  GNCInteractor *data;
   char *msgstr = NULL, *passwd = NULL;
   int retval = 0;
-  g_assert(data);
+  int newPin;
+  int hideInput;
+  g_assert(ab);
+  data = /* (GNCInteractor *) */ AB_Banking_GetUserData(ab);
+  g_assert(data);
+  g_assert(maxLen > minsize);
+
+  newPin = (flags | AB_BANKING_INPUT_FLAGS_CONFIRM) ? TRUE : FALSE;
+  hideInput = (flags | AB_BANKING_INPUT_FLAGS_SHOW) ? FALSE : TRUE;
+  if (!hideInput)
+    printf("inputBoxCB: Oops, hideInput is false -- not implemented.\n");
 
   while (TRUE) {
-    const char *username = username_from_user(user);
-    g_assert (username);
-    
-    if (newPin) {
-      if (user != NULL) {
-	bank = HBCI_User_bank (user);
-	if (bank != NULL) {
-	  /* 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.
-	   *
-	   * xgettext:c-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, 
-				    bank_to_str (bank),
-				    minsize);
-	}
-	else 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf ( _("Please enter and confirm a new PIN for \n"
-				       "user '%s',\n"
-				       "with at least %d characters."), 
-				     username, minsize);
-      }
-      else 
-	/* xgettext:c-format */	    
-	msgstr = g_strdup_printf ( _("Please enter and confirm a new PIN\n"
-				     "with at least %d characters."), 
-				   minsize);
 
+    if (newPin) {
+      msgstr = g_strdup_printf("%s\n\n%s", title, text);
       retval = gnc_hbci_get_initial_password (data->parent,
 					      msgstr,
 					      &passwd);
       g_free (msgstr);
     }
     else {
-      if (data->cache_valid && user && (user == data->user)) {
+      if (data->cache_valid && text && (strcmp(text, data->cache_text)==0)) {
 	/* Cached user matches, so use cached PIN. */
 	/*printf("Got the cached PIN for user %s.\n", HBCI_User_userId (user));*/
-	*pinbuf = g_strdup (data->pw);
+	strcpy(resultbuffer, data->pw);
 	return 1;
       }
       else {
-	if (user != NULL) {
-	  bank = HBCI_User_bank (user);
-	  if (bank != NULL) {
-	    /* xgettext:c-format */	    
-	    msgstr = g_strdup_printf (_("Please enter PIN for \n"
-					"user '%s' at bank '%s'."),
-				      username, 
-				      bank_to_str (bank));
-	  }
-	  else {
-	    /* xgettext:c-format */	    
-	    msgstr = g_strdup_printf ( _("Please enter PIN for \n"
-					 "user '%s' at unknown bank."),
-				       username);
-	  }
-	}
-	else 
-	  msgstr = g_strdup ( _("Please enter the PIN for \n"
-				"the newly created user."));
+	msgstr = g_strdup_printf("%s\n\n%s", title, text);
 	
 	retval = gnc_hbci_get_password (data->parent,
 					msgstr,
@@ -307,10 +263,11 @@
 	break;
     }
     else {
-      *pinbuf = g_strdup (passwd);
-      if (user && data->cache_pin) {
+      g_assert (maxLen > strlen(resultbuffer));
+      strcpy(resultbuffer, passwd);
+      if (text && data->cache_pin) {
 	/*printf("Cached the PIN for user %s.\n", HBCI_User_userId (user));*/
-	data->user = user;
+	data->cache_text = g_strdup(text);
 	if (data->pw)
 	  g_free (memset (data->pw, 0, strlen (data->pw)));
 	data->pw = passwd;
@@ -325,155 +282,6 @@
   return 0;
 }
 
-
-static int msgInsertMediumOrAbort(const HBCI_User *user, 
-				MediumType mtype, 
-				void *user_data)
-{
-  GNCInteractor *data = user_data;
-  const HBCI_Bank * b = NULL;
-  char *msgstr = NULL;
-  GNCVerifyResult retval;
-  g_assert(data);
-
-  if (user != NULL) {
-    const char *username = username_from_user(user);
-    b = HBCI_User_bank (user);
-    switch (mtype) 
-      {
-      case MediumTypeFile:
-	if (b != NULL) 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf 
-	    ( _("Please make sure the key file for user '%s' at bank '%s' can be \n"
-		"accessed. If the key file is on your harddisk, simply press 'Ok'. If \n"
-		"the key file is on a floppy disk or other removable media, please make \n"
-		"sure the floppy disk or medium is correctly mounted."), 
-	      username, bank_to_str (b));
-	else 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf 
-	    ( _("Please make sure the key file for user '%s' can be \n"
-		"accessed. If the key file is on your harddisk, simply press 'Ok'. If \n"
-		"the key file is on a floppy disk or other removable media, please make \n"
-		"sure the floppy disk or medium is correctly mounted."), 
-				     username);
-	break;
-      case MediumTypeCard:
-      default:
-	if (b != NULL) 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf ( _("Please insert chip card for \n"
-				       "user '%s' at bank '%s'."), 
-				     username, bank_to_str (b));
-	else 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf ( _("Please insert chip card for \n"
-				       "user '%s'."), 
-				     username);
-    }
-  }
-  else 
-    switch (mtype) 
-      {
-      case MediumTypeFile:
-	msgstr = g_strdup 
-	  (_("Please make sure the key file for the newly created user can be \n"
-	     "accessed. If you want to create the key file on your harddisk, simply \n"
-	     "press 'Ok'. If you want to create the key on a floppy disk or other \n"
-	     "removable media, please make sure the floppy disk or medium is \n"
-	     "correctly mounted."));
-	break;
-      case MediumTypeCard:
-      default:
-	msgstr = g_strdup ( _("Please insert chip card for \n"
-			      "the newly created user."));
-      }
-    
-  retval = gnc_ok_cancel_dialog (data->parent,
-					  GTK_RESPONSE_OK, 
-					  "%s", msgstr);
-  g_free (msgstr);
-  
-  return (retval == GTK_RESPONSE_OK);
-}
-
-
-static int msgInsertCorrectMediumOrAbort(const HBCI_User *user, 
-				       MediumType mtype, 
-				       void *user_data)
-{
-  GNCInteractor *data = user_data;
-  const HBCI_Bank * b = NULL;
-  char *msgstr = NULL;
-  GNCVerifyResult retval;
-  g_assert(data);
-
-  if (user != NULL) {
-    const char *username = username_from_user(user);
-    b = HBCI_User_bank (user);
-    switch (mtype) 
-      {
-      case MediumTypeFile: 
-	if (b != NULL) 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf ( _("The key file does not seem to be the correct \n"
-				       "file for user '%s' at bank '%s'. Please make \n"
-				       "sure the correct key file can be accessed."), 
-				     username, bank_to_str (b));
-	else 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf ( _("The key file does not seem to be the correct \n"
-				       "file for user '%s'. Please make sure the \n"
-				       "correct key file can be accessed."), 
-				     username);
-	break;
-      case MediumTypeCard: 
-      default:
-	if (b != NULL) 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf ( _("Please insert the correct chip card for \n"
-				       "user '%s' at bank '%s'."), 
-				     username, bank_to_str (b));
-	else 
-	  /* xgettext:c-format */	    
-	  msgstr = g_strdup_printf ( _("Please insert the correct chip card for \n"
-				       "user '%s'."), 
-				     username);
-      }
-  }
-  else 
-    switch (mtype) 
-      {
-      case MediumTypeFile: 
-	msgstr = g_strdup ( _("The key file does not seem to be the correct \n"
-			      "file for the newly created user. Please make \n"
-			      "sure the correct key file can be accessed."));
-	break;
-      case MediumTypeCard: 
-      default:
-	msgstr = g_strdup ( _("Please insert the correct chip card for \n"
-			      "the newly created user."));
-      }
-  
-  retval = gnc_ok_cancel_dialog (data->parent,
-					  GTK_RESPONSE_OK,
-					  "%s", msgstr);
-  g_free (msgstr);
-  
-  return (retval == GTK_RESPONSE_OK);
-}
-
-
-/*static void msgStateResponse(const char *msg, void *user_data)
-{
-  GNCInteractor *data = user_data;
-  g_assert(data);
-
-  GNCInteractor_add_log_text (data, msg);
-  while (g_main_iteration (FALSE));
-  }*/
-
 static int keepAlive(void *user_data)
 {
   GNCInteractor *data = user_data;
@@ -486,7 +294,8 @@
   return data->keepAlive;
 }
 
-static void destr(void *user_data) 
+
+static void destr(void *bp, void *user_data)
 {
   GNCInteractor *data = user_data;
   if (data == NULL)
@@ -498,203 +307,184 @@
   }
 }
 
+/* ************************************************************ 
+ */
+
 static void 
-msgEndInputPinViaKeypadCB(const HBCI_User *user, void *user_data)
+hideBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
 {
-  GNCInteractor *data = user_data;
+  GNCInteractor *data;
+  GtkWidget *dialog;
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
   g_assert(data);
-  if (data->pin_keypad_dialog) {
-    gnome_dialog_close (GNOME_DIALOG (data->pin_keypad_dialog));
-    gtk_widget_destroy (data->pin_keypad_dialog);
-    data->pin_keypad_dialog = NULL;
+
+  if (id > 0) {
+    dialog = g_hash_table_lookup(data->showbox_hash, (gpointer)id);
+  } else {
+    dialog = data->showbox_last;
+  }
+  if (dialog) {
+    gnome_dialog_close (GNOME_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+    g_hash_table_remove(data->showbox_hash, (gpointer)id);
   }
 }
 
-static void 
-msgStartInputPinViaKeypadCB(const HBCI_User *user, void *user_data)
+static GWEN_TYPE_UINT32
+showBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags,
+	  const char *title, const char *text)
 {
-  const HBCI_Bank *bank;
   char *msgstr;
   GtkWidget *dialog;
-  GNCInteractor *data = user_data;
-  
+  GNCInteractor *data;
+  GWEN_TYPE_UINT32 result;
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
   g_assert(data);
-
-  /* Already an existing dialog? Shouldn't happen. Better delete
-     existing dialog first. */
-  if (data->pin_keypad_dialog != NULL)
-    msgEndInputPinViaKeypadCB(user, user_data);
-
+  
   /* Create message string */
-  if (user != NULL) {
-    const char *username = username_from_user(user);
-    bank = HBCI_User_bank (user);
-    if (bank != NULL) {
-      /* xgettext:c-format */	    
-      msgstr = g_strdup_printf (_("Please enter PIN for \n"
-				  "user '%s' at bank '%s'\n"
-				  "at the keypad of your chip card reader."),
-				username, 
-				bank_to_str (bank));
-    }
-    else {
-      /* xgettext:c-format */	    
-      msgstr = g_strdup_printf ( _("Please enter PIN for \n"
-				   "user '%s'\n"
-				   "at the keypad of your chip card reader."),
-				 username);
-    }
-  }
-  else 
-    msgstr = g_strdup ( _("Please enter PIN for \n"
-			  "the newly created user \n"
-			  "at the keypad of your chip card reader."));
+  msgstr = g_strdup_printf ("%s\n%s", title, text);
 
   /* Create new dialog */
   dialog = gnome_ok_dialog_parented (msgstr, GTK_WINDOW (data->parent));
   gnome_dialog_close_hides (GNOME_DIALOG(dialog), TRUE);
   gtk_widget_show_all (dialog);
-  data->pin_keypad_dialog = dialog;
+
+  result = data->showbox_id;
+  g_hash_table_insert(data->showbox_hash, (gpointer)result, dialog);
+  data->showbox_id++;
+  data->showbox_last = dialog;
 
   g_free (msgstr);
+  return result;
 }
 
 /* ************************************************************ 
  */
 
-int debug_pmonitor = FALSE;
+static int messageBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags, 
+			const char *title, const char *text, 
+			const char *b1, const char *b2, const char *b3)
+{
+  GNCInteractor *data;
+  GtkWidget *dialog, *label;
+  int result;
 
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
+  g_assert(data);
+
+  dialog = gnome_dialog_new (title, b1, b2, b3, NULL);
+  gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (data->parent));
+  gnome_dialog_set_close (GNOME_DIALOG (dialog), TRUE);
+  label = gtk_label_new (text);
+  gtk_box_pack_start (GTK_BOX (GNOME_DIALOG (dialog)->vbox), label, TRUE, TRUE, 0);
+
+  result = gnome_dialog_run_and_close (GNOME_DIALOG (dialog));
+  if (result<0 || result>2) {
+    printf("messageBoxCB: Bad result %d", result);
+    return 0;
+  }
+  return result+1;
+}
 
-/* old ProgressMonitor callbacks
+/* ************************************************************ 
  */
 
-static void actStarted (ActionProgressType type, void *user_data)
+#define progress_id 4711
+
+static GWEN_TYPE_UINT32 progressStartCB(AB_BANKING *ab, const char *title, 
+					const char *text, GWEN_TYPE_UINT32 total)
 {
-  GNCInteractor *data = user_data;
-  const char *msg = NULL;
+  GNCInteractor *data;
+  //GtkWidget *dialog;
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
   g_assert(data);
-  switch (type) {
-    /** Creating HBCI job. Number of Job will follow in string argument. */
-  case ACT_FILLINGQUEUE:
-    msg = _("Creating HBCI Job");
-    break;
-    /** Contacting server. Server IP address will follow in string argument. */
-  case ACT_CONTACTINGSERVER:
-    msg = _("Contacting Server");
-    break;
-    /** Checking Job result. */
-  case ACT_CHKRESULT:
-    msg = _("Checking Job result");
-    break;
-    /** Updating local system. */
-  case ACT_UPDATESYSTEM:
-    msg = _("Updating local system");
-    break;
-    /** Closing connection. */
-  case ACT_CLOSECONNECTION:
-    msg = _("Closing connection");
-    break;
-  case ACT_OPENSESSION:
-    msg = _("Open session");
-    break;
-  case ACT_CLOSESESSION:
-    msg = _("Close session");
-    break;
-  case ACT_OPENDIALOG:
-    msg = _("Open dialog");
-    break;
-  case ACT_CLOSEDIALOG:
-    msg = _("Close dialog");
-    break;
-  case ACT_PROCESSMSG:
-    msg = _("Process message");
-    break;
-  case ACT_CREATEJOB:
-    msg = _("Create job");
-    break;
-  case ACT_HANDLEJOBS:
-    msg = _("Handle jobs");
-    break;
-  case ACT_SIGNMSG:
-    msg = _("Sign message");
-    break;
-  case ACT_ENCRYPTMSG:
-    msg = _("Encrypt message");
-    break;
-  case ACT_VERIFYMSG:
-    msg = _("Verify message");
-    break;
-  case ACT_DECRYPTMSG:
-    msg = _("Decrypt message");
-    break;
-  case ACT_ENCODEMSG:
-    msg = _("Encode message");
-    break;
-  case ACT_DECODEMSG:
-    msg = _("Decode message");
-    break;
-    /** Sending message. */
-  case ACT_SENDINGMESSAGE:
-    /* Note: the ACT_SENDINGMESSAGE doesn't seem to be used. */
-  case ACT_LOW_SENDMSG:
-    msg = _("Sending message");
-    break;
-  case ACT_LOW_RECEIVEMSG:
-    msg = _("Receiving message");
-    break;
-    /*default:
-      msg = _("Unknown");
-      break;*/
+
+  gtk_entry_set_text (GTK_ENTRY (data->job_entry), title);
+  gtk_entry_set_text (GTK_ENTRY (data->action_entry), text);
+
+/*   printf("progressLogCB: Logging msg: %s\n", text); */
+/*   GNCInteractor_add_log_text (data, text); */
+
+  gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 
+			       0.0);
+  data->action_max = total;
+  GNCInteractor_setRunning(data);
+
+  GNCInteractor_show(data);
+  return progress_id;
+}
+
+static int progressAdvanceCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id, 
+			     GWEN_TYPE_UINT32 progress)
+{
+  GNCInteractor *data;
+  //GtkWidget *dialog;
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
+  g_assert(data);
+
+  if ((id != 0) || (id != progress_id)) {
+    printf("progressLogCB: Oops, wrong progress id -- ignored.\n");
   }
-  
-  g_assert(msg);
-  gtk_entry_set_text (GTK_ENTRY (data->action_entry), msg);
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-  if (debug_pmonitor)
-    printf("actStarted-cb: current_job %d, jobs %d, current_act %d, actions %d, msg %s.\n", 
-	   data->current_job, data->jobs, data->current_act, data->actions, msg);
 
-  GNCInteractor_setRunning (data);
- 
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
+  if (progress != AB_BANKING_PROGRESS_NONE) {
+    gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 
+				 progress/data->action_max);
+  }
+
+  keepAlive(data);
+  return 0;
 }
 
-static void closeConnection(TransportType t, void *user_data)
+
+static int progressLogCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id, 
+			 AB_BANKING_LOGLEVEL level, const char *text)
 {
-  GNCInteractor *data = user_data;
+  GNCInteractor *data;
+  //GtkWidget *dialog;
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
   g_assert(data);
-  data->current_act++;
-  gtk_entry_set_text (GTK_ENTRY (data->action_entry), _("Done"));
-  /*gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 
-    1.0);*/
-
-  if (debug_pmonitor)
-    printf("actFinished-cb: current_job %d, jobs %d, current_act %d, actions %d.\n", 
-	   data->current_job, data->jobs, data->current_act, data->actions);
-  /*if (data->current_act > data->actions) {
-    printf("actFinished-cb: oops, current_act==%d is > than actions==%d.\n",
-    data->current_act, data->actions);
-    }*/
-  
-  GNCInteractor_setFinished (data);
- 
-  while (g_main_iteration (FALSE));
+
+  if ((id != 0) || (id != progress_id)) {
+    printf("progressLogCB: Oops, wrong progress id -- ignored.\n");
+  }
+
+  printf("progressLogCB: Logging msg: %s\n", text);
+  GNCInteractor_add_log_text (data, text);
+
+  keepAlive(data);
+  return 0;
 }
-static void logMsg (const char *msg, void *user_data)
+
+static int progressEndCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
 {
-  /* Note: this isn't used anyway. */
-  GNCInteractor *data = user_data;
+  GNCInteractor *data;
+  //GtkWidget *dialog;
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
   g_assert(data);
-  
-  printf("logMsg: Logging msg: %s\n", msg);
-  GNCInteractor_add_log_text (data, msg);
-			    
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
+
+  if ((id != 0) || (id != progress_id)) {
+    printf("progressLogCB: Oops, wrong progress id -- ignored.\n");
+  }
+
+  GNCInteractor_setFinished(data);
+
+  keepAlive(data);
+  return 0;
 }
 
+
+
+/* ************************************************************ 
+ */
+
+int debug_pmonitor = FALSE;
 void GNCInteractor_add_log_text (GNCInteractor *data, const char *msg)
 {
   int pos;
@@ -734,14 +524,14 @@
   while (g_main_iteration (FALSE));
 }
 
+GWEN_INHERIT(AB_BANKING, GNCInteractor)
 
 /********************************************************
  * Constructor 
  */
-HBCI_Interactor *
-gnc_hbci_new_interactor(GNCInteractor *data)
+void
+gnc_hbci_add_callbacks(AB_BANKING *ab, GNCInteractor *data)
 {
-  HBCI_InteractorCB *inter;
   GtkWidget *dialog;
   GladeXML *xml;
 
@@ -779,8 +569,22 @@
   gtk_object_ref (GTK_OBJECT (dialog));
   gtk_widget_hide_all (dialog);
 
+  GWEN_INHERIT_SETDATA(AB_BANKING, GNCInteractor,
+                       ab, data,
+                       &destr);
+
+  AB_Banking_SetMessageBoxFn(ab, messageBoxCB);
+  AB_Banking_SetInputBoxFn(ab, inputBoxCB);
+  AB_Banking_SetShowBoxFn(ab, showBoxCB);
+  AB_Banking_SetHideBoxFn(ab, hideBoxCB);
+  AB_Banking_SetProgressStartFn(ab, progressStartCB);
+  AB_Banking_SetProgressAdvanceFn(ab, progressAdvanceCB);
+  AB_Banking_SetProgressLogFn(ab, progressLogCB);
+  AB_Banking_SetProgressEndFn(ab, progressEndCB);
+
+  AB_Banking_SetUserData(ab, data);
 
-  inter = HBCI_InteractorCB_new4(&destr,
+  /*inter = HBCI_InteractorCB_new4(&destr,
 				 &msgInputPin,
 				 &msgInsertMediumOrAbort,
 				 &msgInsertCorrectMediumOrAbort,
@@ -791,7 +595,6 @@
 				 &closeConnection,
 				 &actStarted,
 				 &logMsg,
-				 data);
+				 data);*/
 
-  return HBCI_InteractorCB_Interactor(inter);
 }
Index: gnc-hbci-transfer.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-transfer.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -Lsrc/import-export/hbci/gnc-hbci-transfer.c -Lsrc/import-export/hbci/gnc-hbci-transfer.c -u -r1.17 -r1.18
--- src/import-export/hbci/gnc-hbci-transfer.c
+++ src/import-export/hbci/gnc-hbci-transfer.c
@@ -25,8 +25,7 @@
 #include "config.h"
 #include "gnc-hbci-transfer.h"
 
-#include <openhbci2/api.h>
-#include <openhbci2/outboxjob.h>
+#include <aqbanking/banking.h>
 
 #include "gnc-ui.h"
 #include "gnc-numeric.h"
@@ -48,24 +47,20 @@
 gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc,
 		    GNC_HBCI_Transtype trans_type)
 {
-  HBCI_API *api = NULL;
-  HBCI_Outbox *outbox = NULL;
-  const gnc_HBCI_Account *h_acc = NULL;
+  AB_BANKING *api = NULL;
+  const AB_ACCOUNT *h_acc = NULL;
   GNCInteractor *interactor = NULL;
-  const HBCI_Customer *customer = NULL;
-  GList *hbci_accountlist = NULL;
   
   g_assert(parent);
   g_assert(gnc_acc);
 
   /* Get API */
-  api = gnc_hbci_api_new_currentbook (parent, &interactor, &hbci_accountlist);
+  api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
   if (api == NULL) {
     printf("gnc_hbci_maketrans: Couldn't get HBCI API. Nothing will happen.\n");
     return;
   }
   g_assert (interactor);
-  outbox = HBCI_Outbox_new();
 
   /* Get HBCI account */
   h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
@@ -74,13 +69,8 @@
     return;
   }
   /*printf("gnc_hbci_maketrans: HBCI account no. %s found.\n",
-    gnc_HBCI_Account_accountId (h_acc));*/
+    AB_ACCOUNT_accountId (h_acc));*/
   
-  /* Get the customer that should be doing this job. */
-  customer = gnc_hbci_get_first_customer(h_acc);
-  if (!customer) 
-    return;
-
   {
     GList *template_list = 
       gnc_trans_templ_glist_from_kvp_glist
@@ -91,10 +81,10 @@
     HBCITransDialog *td;
 
     /* Now open the HBCI_trans_dialog, which also calls
-       HBCI_API_executeQueue. */
+       AB_BANKING_executeQueue. */
       
     /* Create new HBCIDialogTrans */
-    td = gnc_hbci_dialog_new(parent, h_acc, customer, gnc_acc, 
+    td = gnc_hbci_dialog_new(parent, h_acc, gnc_acc, 
 			     trans_type, template_list);
 	
     /* Repeat until HBCI action was successful or user pressed cancel */
@@ -117,9 +107,9 @@
       gnc_hbci_dialog_hide(td);
 
       {
-	HBCI_OutboxJob *job = 
-	  gnc_hbci_trans_dialog_enqueue(td, api, outbox, customer, 
-					(gnc_HBCI_Account *)h_acc, trans_type);
+	AB_JOB *job = 
+	  gnc_hbci_trans_dialog_enqueue(td, api,
+					(AB_ACCOUNT *)h_acc, trans_type);
       
 	/* HBCI Transaction has been created and enqueued, so now open
 	 * the gnucash transaction dialog and fill in all values. */
@@ -133,7 +123,7 @@
 
 	  /* If the user pressed "execute now", then execute this job
 	     now. This function already delete()s the job. */
-	  successful = gnc_hbci_trans_dialog_execute(td, api, outbox, 
+	  successful = gnc_hbci_trans_dialog_execute(td, api, 
 						     job, interactor);
 
 	  if (!successful) {
@@ -163,9 +153,7 @@
       }*/
 
     /* Just to be on the safe side, clear queue once again. */
-    HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE);
-    HBCI_Outbox_delete(outbox);
-    gnc_hbci_api_save (api);
+    gnc_AB_BANKING_save (api);
     gnc_hbci_dialog_delete(td);
     gnc_trans_templ_delete_glist (template_list);
     
@@ -201,7 +189,7 @@
 {
   gnc_numeric amount;
   XferDialog *transdialog;
-  const HBCI_Transaction *h_trans;
+  const AB_TRANSACTION *h_trans;
   gboolean run_until_done = TRUE;
   g_assert(td);
 
@@ -222,7 +210,7 @@
       
   /* Amount */
   amount = double_to_gnc_numeric 
-    (HBCI_Value_getValue (HBCI_Transaction_value (h_trans)),
+    (AB_Value_GetValue (AB_Transaction_GetValue (h_trans)),
      xaccAccountGetCommoditySCU(gnc_acc),
      GNC_RND_ROUND); 
   /*switch (trans_type) {
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/Makefile.am,v
retrieving revision 1.25
retrieving revision 1.26
diff -Lsrc/import-export/hbci/Makefile.am -Lsrc/import-export/hbci/Makefile.am -u -r1.25 -r1.26
--- src/import-export/hbci/Makefile.am
+++ src/import-export/hbci/Makefile.am
@@ -3,21 +3,22 @@
 pkglib_LTLIBRARIES = libgncmod-hbci.la
 
 libgncmod_hbci_la_SOURCES = \
-  gncmod-hbci.c \
-  druid-hbci-utils.c \
-  dialog-pass.c \
-  dialog-hbcitrans.c \
   dialog-daterange.c \
-  gnc-hbci-account.c \
-  gnc-hbci-kvp.c \
-  gnc-hbci-utils.c \
+  dialog-hbcitrans.c \
+  dialog-pass.c \
   gnc-hbci-cb.c \
-  gnc-hbci-transfer.c \
-  gnc-hbci-trans-templ.c \
   gnc-hbci-getbalance.c \
   gnc-hbci-gettrans.c \
+  gnc-hbci-kvp.c \
+  gnc-hbci-trans-templ.c \
+  gnc-hbci-transfer.c \
+  gnc-hbci-utils.c \
   hbci-interaction.c \
-  druid-hbci-initial.c 
+  druid-hbci-utils.c \
+  druid-hbci-initial.c \
+  gncmod-hbci.c
+
+
 
 # Must be included in tarball because they are listed in POTFILES.in
 libgncmod_hbci_la_empty = \
@@ -29,8 +30,6 @@
   dialog-pass.h \
   druid-hbci-initial.h \
   druid-hbci-utils.h \
-  gnc-hbci-actions.h \
-  gnc-hbci-account.h \
   gnc-hbci-cb.h \
   gnc-hbci-getbalance.h \
   gnc-hbci-gettrans.h \
--- src/import-export/hbci/gnc-hbci-account.h
+++ /dev/null
@@ -1,106 +0,0 @@
-/********************************************************************\
- * gnc-hbci-account.h -- hbci account definition                    *
- * Copyright (C) 2004 Christian Stimming                            *
- *                                                                  *
- * This program is free software; you can redistribute it and/or    *
- * modify it under the terms of the GNU General Public License as   *
- * published by the Free Software Foundation; either version 2 of   *
- * the License, or (at your option) any later version.              *
- *                                                                  *
- * This program is distributed in the hope that it will be useful,  *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
- * GNU General Public License for more details.                     *
- *                                                                  *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact:                        *
- *                                                                  *
- * Free Software Foundation           Voice:  +1-617-542-5942       *
- * 59 Temple Place - Suite 330        Fax:    +1-617-542-2652       *
- * Boston, MA  02111-1307,  USA       gnu at gnu.org                   *
-\********************************************************************/
-
-/** @file 
-    Hbci account definition
-*/
-
-#ifndef GNC_HBCI_ACCOUNT_H
-#define GNC_HBCI_ACCOUNT_H
-
-#include <glib.h>
-#include <gnome.h>
-#include <openhbci2/api.h>
-
-#include "gnc-book.h"
-
-typedef struct _gnc_HBCI_Account gnc_HBCI_Account;
-/** @name HBCI_Account wrapper class */
-/*@{*/
-/** Constructor */
-gnc_HBCI_Account *gnc_HBCI_Account_new(const HBCI_Bank *bank, 
-				       const char *bankCode,
-				       const char *accountid);
-/** Returns the account id */
-const char *gnc_HBCI_Account_accountId (const gnc_HBCI_Account *hbci_acc);
-/** Returns the bank code -- this might be different than the actual
- * bank's bank code */
-const char *gnc_HBCI_Account_bankCode (const gnc_HBCI_Account *hbci_acc);
-
-void gnc_HBCI_Account_set_name (gnc_HBCI_Account *hbci_acc, const char *n);
-void gnc_HBCI_Account_set_customer (gnc_HBCI_Account *hbci_acc, const char *n);
-void gnc_HBCI_Account_set_currency (gnc_HBCI_Account *hbci_acc, const char *n);
-void gnc_HBCI_Account_set_name1 (gnc_HBCI_Account *hbci_acc, const char *n);
-const char *gnc_HBCI_Account_name (const gnc_HBCI_Account *hbci_acc);
-const char *gnc_HBCI_Account_customer (const gnc_HBCI_Account *hbci_acc);
-const char *gnc_HBCI_Account_currency (const gnc_HBCI_Account *hbci_acc);
-const char *gnc_HBCI_Account_name1 (const gnc_HBCI_Account *hbci_acc);
-
-/** Returns the bank this account belongs to */
-const HBCI_Bank *
-gnc_HBCI_Account_bank (const gnc_HBCI_Account *hbci_acc);
-/** Destructor for this account object */
-void gnc_HBCI_Account_delete (gnc_HBCI_Account *hbci_acc);
-
-/** Returns a newly allocated string that is a human-readable
- * description of this account. The returned string will be owned by
- * the caller. */
-gchar *gnc_HBCI_Account_longname(const gnc_HBCI_Account *hbci_acc);
-/*@}*/
-
-/** @name List of hbci accounts */
-/*@{*/
-/** Foreach function */
-void *list_HBCI_Account_foreach(GList *list_HBCI_Account, 
-				void*(*func_cb)(gnc_HBCI_Account *acc,
-						void *user_data), 
-				void *user_data);
-/** Delete each element of a GList of HBCI_Accounts and finally the
- * list itself.  */
-void list_HBCI_Account_delete(GList *list_HBCI_Account);
-
-/** Searches for an account with the given data fields. Returns this
- * account, or NULL if none was found. */
-gnc_HBCI_Account *list_HBCI_Account_find(GList *list_HBCI_Account,
-					 const HBCI_Bank *bank, 
-					 const char *bankCode,
-					 const char *accountid);
-/*@}*/
-
-/** @name Serialization -- List of gnc_HBCI_Accounts to kvp_frame and
- * back */
-/*@{*/
-/** Constructor from a kvp_frame (the kvp_frame is left unchanged) */
-gnc_HBCI_Account *gnc_HBCI_Account_from_kvp(kvp_frame *k, HBCI_API *api);
-/** Creates a kvp_frame from this TransTempl */
-kvp_frame *gnc_HBCI_Account_to_kvp(const gnc_HBCI_Account *t);
-
-/** Creates a GList of gnc_HBCI_Account from a GList of kvp_values which
-    in turn contain a kvp_frame. */
-GList *gnc_HBCI_Account_glist_from_kvp_glist(GList *v, HBCI_API *api);
-/** Creates a GList of kvp_value (which in turn contain a kvp_frame)
-    from a GList of gnc_HBCI_Account. */
-GList *gnc_HBCI_Account_kvp_glist_from_glist(GList *k);
-/*@}*/
-
-
-#endif /* GNC_HBCI_ACCOUNT_H */
Index: druid-hbci-utils.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/druid-hbci-utils.h,v
retrieving revision 1.7
retrieving revision 1.8
diff -Lsrc/import-export/hbci/druid-hbci-utils.h -Lsrc/import-export/hbci/druid-hbci-utils.h -u -r1.7 -r1.8
--- src/import-export/hbci/druid-hbci-utils.h
+++ src/import-export/hbci/druid-hbci-utils.h
@@ -24,7 +24,7 @@
 #define DRUID_HBCI_UTILS_H
 
 #include <gnome.h>
-#include <openhbci2/api.h>
+#include <aqbanking/banking.h>
 #include "hbci-interaction.h"
 #include "gnc-hbci-utils.h"
 
@@ -36,17 +36,17 @@
 
 
 /** Update the account list in all the banks stored in this
- * HBCI_API. Straightforward, if we have only one bank and one user
+ * AB_BANKING. Straightforward, if we have only one bank and one user
  * with one customer. All other cases are not currently
  * implemented. */
-void update_accounts (GtkWidget *parent, HBCI_API *api, 
+void update_accounts (GtkWidget *parent, AB_BANKING *api, 
 		      GNCInteractor *inter);
 
 /** Builds a new hash table mapping all HBCI accounts to Gnucash
  * accounts, where the Gnucash accounts already have the reference
  * strings stored in their kvp's. */
 GHashTable *
-gnc_hbci_new_hash_from_kvp (HBCI_API *api);
+gnc_hbci_new_hash_from_kvp (AB_BANKING *api);
 
 gboolean 
 gnc_verify_exist_or_new_file (GtkWidget *parent, const char *filename);
@@ -54,13 +54,5 @@
 gboolean
 gnc_test_dir_exist_error (GtkWindow *parent, const char *filename);
 
-GList *
-gnc_processOutboxResponse(HBCI_API *api, HBCI_Outbox *outbox, 
-			  GList *accountlist);
-
-/* Get keys from Job; store them in the customer's medium @§%&! */
-gboolean
-gnc_hbci_evaluate_GetKeys(HBCI_Outbox *outbox, HBCI_OutboxJob *job,
-			  HBCI_Customer *newcustomer);
 
 #endif
Index: gnc-hbci-kvp.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-kvp.c,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lsrc/import-export/hbci/gnc-hbci-kvp.c -Lsrc/import-export/hbci/gnc-hbci-kvp.c -u -r1.9 -r1.10
--- src/import-export/hbci/gnc-hbci-kvp.c
+++ src/import-export/hbci/gnc-hbci-kvp.c
@@ -25,12 +25,14 @@
 
 #define HBCI_KEY "hbci"
 #define HBCI_ACCOUNT_ID "account-id"
+#define HBCI_ACCOUNT_UID "account-uid"
 #define HBCI_BANK_CODE "bank-code"
 #define HBCI_COUNTRY_CODE "country-code"
 #define HBCI_TRANS_RETRIEVAL "trans-retrieval"
 #define HBCI_ACCOUNTS "hbci-accounts"
 
 /* Account */
+#if 0
 char *gnc_hbci_get_account_accountid (Account *a)
 {
   kvp_frame *frame = gnc_hbci_get_account_kvp (a);
@@ -49,12 +51,6 @@
   kvp_value *value = kvp_frame_get_slot (frame, HBCI_COUNTRY_CODE);
   return kvp_value_get_gint64 (value);
 }
-Timespec gnc_hbci_get_account_trans_retrieval (Account *a)
-{
-  kvp_frame *frame = gnc_hbci_get_account_kvp (a);
-  kvp_value *value = kvp_frame_get_slot (frame, HBCI_TRANS_RETRIEVAL);
-  return kvp_value_get_timespec (value);
-}
 void gnc_hbci_set_account_accountid (Account *a, const char *id)
 {
   kvp_frame *frame = gnc_hbci_get_account_kvp (a);
@@ -79,6 +75,27 @@
   kvp_frame_set_slot_nc (frame, HBCI_COUNTRY_CODE, value);
   xaccAccountCommitEdit (a);
 }
+#endif
+gint gnc_hbci_get_account_uid (Account *a)
+{
+  kvp_frame *frame = gnc_hbci_get_account_kvp (a);
+  kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNT_UID);
+  return kvp_value_get_gint64 (value);
+}
+void gnc_hbci_set_account_uid (Account *a, gint uid)
+{
+  kvp_frame *frame = gnc_hbci_get_account_kvp (a);
+  kvp_value *value = kvp_value_new_gint64 (uid);
+  xaccAccountBeginEdit (a);
+  kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_UID, value);
+  xaccAccountCommitEdit (a);
+}
+Timespec gnc_hbci_get_account_trans_retrieval (Account *a)
+{
+  kvp_frame *frame = gnc_hbci_get_account_kvp (a);
+  kvp_value *value = kvp_frame_get_slot (frame, HBCI_TRANS_RETRIEVAL);
+  return kvp_value_get_timespec (value);
+}
 void gnc_hbci_set_account_trans_retrieval (Account *a, Timespec time)
 {
   kvp_frame *frame = gnc_hbci_get_account_kvp (a);
@@ -121,6 +138,7 @@
   qof_book_kvp_changed (b);
 }
 
+#if 0
 GList *gnc_hbci_get_book_account_list (GNCBook *b)
 {
   kvp_frame *frame = gnc_hbci_get_book_kvp (b);
@@ -134,6 +152,7 @@
   kvp_frame_set_slot_nc (frame, HBCI_ACCOUNTS, value);
   qof_book_kvp_changed (b);
 }
+#endif
 
 
 /* lowlevel */
Index: hbci.glade
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/glade/hbci.glade,v
retrieving revision 1.32
retrieving revision 1.33
diff -Lsrc/import-export/hbci/glade/hbci.glade -Lsrc/import-export/hbci/glade/hbci.glade -u -r1.32 -r1.33
--- src/import-export/hbci/glade/hbci.glade
+++ src/import-export/hbci/glade/hbci.glade
@@ -74,7 +74,7 @@
     <widget>
       <class>GnomeDruidPageStandard</class>
       <name>configfile_page</name>
-      <title>Enter OpenHBCI Configuration File</title>
+      <title>Start AqHBCI Wizard</title>
       <title_color>255,255,255</title_color>
       <background_color>153,191,153</background_color>
       <logo_background_color>255,255,255</logo_background_color>
@@ -95,7 +95,7 @@
 	<widget>
 	  <class>GtkFrame</class>
 	  <name>frame56</name>
-	  <label>OpenHBCI Configuration File</label>
+	  <label>Start AqHBCI Setup Wizard</label>
 	  <label_xalign>4.84288e-08</label_xalign>
 	  <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
 	  <child>
@@ -111,28 +111,40 @@
 	    <spacing>0</spacing>
 
 	    <widget>
+	      <class>GtkLabel</class>
+	      <name>label8877441</name>
+	      <label>The Setup of your HBCI connection is handled by the external program &quot;AqHBCI Setup Wizard&quot;. Please press the button below to start this program.	</label>
+	      <justify>GTK_JUSTIFY_LEFT</justify>
+	      <wrap>True</wrap>
+	      <xalign>0</xalign>
+	      <yalign>0.5</yalign>
+	      <xpad>10</xpad>
+	      <ypad>0</ypad>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
+	    </widget>
+
+	    <widget>
 	      <class>GtkHBox</class>
-	      <name>hbox108</name>
-	      <border_width>5</border_width>
+	      <name>hbox118</name>
+	      <border_width>9</border_width>
 	      <homogeneous>False</homogeneous>
-	      <spacing>5</spacing>
+	      <spacing>0</spacing>
 	      <child>
 		<padding>0</padding>
-		<expand>True</expand>
-		<fill>True</fill>
+		<expand>False</expand>
+		<fill>False</fill>
 	      </child>
 
 	      <widget>
-		<class>GtkLabel</class>
-		<name>label8477402</name>
-		<label>Configuration File</label>
-		<justify>GTK_JUSTIFY_CENTER</justify>
-		<wrap>False</wrap>
-		<xalign>0.5</xalign>
-		<yalign>0.5</yalign>
-		<xpad>5</xpad>
-		<ypad>0</ypad>
-		<focus_target>configfile-entry</focus_target>
+		<class>GtkButton</class>
+		<name>aqhbci_button</name>
+		<can_focus>True</can_focus>
+		<label>Start AqHBCI Wizard</label>
+		<relief>GTK_RELIEF_NORMAL</relief>
 		<child>
 		  <padding>0</padding>
 		  <expand>False</expand>
@@ -141,53 +153,9 @@
 	      </widget>
 
 	      <widget>
-		<class>GnomeFileEntry</class>
-		<name>configfile_fileentry</name>
-		<history_id>openhbci_configfile</history_id>
-		<max_saved>10</max_saved>
-		<title>Choose OpenHBCI Configuration File</title>
-		<directory>False</directory>
-		<modal>False</modal>
-		<child>
-		  <padding>0</padding>
-		  <expand>True</expand>
-		  <fill>True</fill>
-		</child>
-
-		<widget>
-		  <class>GtkEntry</class>
-		  <child_name>GnomeEntry:entry</child_name>
-		  <name>configfile-entry</name>
-		  <can_focus>True</can_focus>
-		  <editable>True</editable>
-		  <text_visible>True</text_visible>
-		  <text_max_length>0</text_max_length>
-		  <text></text>
-		</widget>
+		<class>Placeholder</class>
 	      </widget>
 	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8877441</name>
-	      <label>If you already have an OpenHBCI configuration file (e.g. from 'aqmoney'), 
-please select it here. GnuCash will continue to use your existing configuration.
-
-If you do not yet have an OpenHBCI configuration file, please specify a file name here. 
-A new OpenHBCI configuration file with that name will be created when this HBCI 
-Setup finishes.</label>
-	      <justify>GTK_JUSTIFY_LEFT</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>10</xpad>
-	      <ypad>0</ypad>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
 	  </widget>
 	</widget>
       </widget>
@@ -195,8 +163,8 @@
 
     <widget>
       <class>GnomeDruidPageStandard</class>
-      <name>bank_page</name>
-      <title>Enter Bank Information</title>
+      <name>account_match_page</name>
+      <title>Match HBCI accounts with GnuCash accounts</title>
       <title_color>255,255,255</title_color>
       <background_color>153,191,153</background_color>
       <logo_background_color>255,255,255</logo_background_color>
@@ -204,10 +172,10 @@
       <widget>
 	<class>GtkVBox</class>
 	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>vbox130</name>
+	<name>druid-vbox3</name>
 	<border_width>10</border_width>
 	<homogeneous>False</homogeneous>
-	<spacing>5</spacing>
+	<spacing>0</spacing>
 	<child>
 	  <padding>0</padding>
 	  <expand>True</expand>
@@ -215,202 +183,156 @@
 	</child>
 
 	<widget>
-	  <class>GtkFrame</class>
-	  <name>frame54</name>
-	  <label>Bank Identification</label>
-	  <label_xalign>0</label_xalign>
-	  <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+	  <class>GtkHBox</class>
+	  <name>hbox112</name>
+	  <homogeneous>False</homogeneous>
+	  <spacing>0</spacing>
 	  <child>
 	    <padding>0</padding>
-	    <expand>False</expand>
-	    <fill>False</fill>
+	    <expand>True</expand>
+	    <fill>True</fill>
 	  </child>
 
 	  <widget>
-	    <class>GtkTable</class>
-	    <name>table1</name>
-	    <border_width>20</border_width>
-	    <rows>2</rows>
-	    <columns>3</columns>
+	    <class>GtkVBox</class>
+	    <name>vbox157</name>
 	    <homogeneous>False</homogeneous>
-	    <row_spacing>5</row_spacing>
-	    <column_spacing>0</column_spacing>
+	    <spacing>0</spacing>
+	    <child>
+	      <padding>0</padding>
+	      <expand>True</expand>
+	      <fill>True</fill>
+	    </child>
 
 	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477399</name>
-	      <label>Country Code (Germany: 280)</label>
-	      <justify>GTK_JUSTIFY_CENTER</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <focus_target>country_code_entry</focus_target>
+	      <class>GtkScrolledWindow</class>
+	      <name>scrolledwindow25</name>
+	      <hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
+	      <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
+	      <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
+	      <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
 	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>1</right_attach>
-		<top_attach>1</top_attach>
-		<bottom_attach>2</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
+		<padding>0</padding>
+		<expand>True</expand>
+		<fill>True</fill>
 	      </child>
-	    </widget>
 
-	    <widget>
-	      <class>GtkEntry</class>
-	      <name>country_code_entry</name>
-	      <can_focus>True</can_focus>
-	      <editable>True</editable>
-	      <text_visible>True</text_visible>
-	      <text_max_length>3</text_max_length>
-	      <text>280</text>
-	      <child>
-		<left_attach>1</left_attach>
-		<right_attach>2</right_attach>
-		<top_attach>1</top_attach>
-		<bottom_attach>2</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>True</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>False</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
+	      <widget>
+		<class>GtkCList</class>
+		<name>account_page_list</name>
+		<can_focus>True</can_focus>
+		<columns>3</columns>
+		<column_widths>281,242,53</column_widths>
+		<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
+		<show_titles>True</show_titles>
+		<shadow_type>GTK_SHADOW_IN</shadow_type>
 
-	    <widget>
-	      <class>GtkEntry</class>
-	      <name>bank_code_entry</name>
-	      <can_focus>True</can_focus>
-	      <editable>True</editable>
-	      <text_visible>True</text_visible>
-	      <text_max_length>8</text_max_length>
-	      <text></text>
-	      <child>
-		<left_attach>1</left_attach>
-		<right_attach>2</right_attach>
-		<top_attach>0</top_attach>
-		<bottom_attach>1</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>True</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>False</xfill>
-		<yfill>False</yfill>
-	      </child>
+		<widget>
+		  <class>GtkLabel</class>
+		  <child_name>CList:title</child_name>
+		  <name>label834</name>
+		  <label>HBCI account name</label>
+		  <justify>GTK_JUSTIFY_CENTER</justify>
+		  <wrap>False</wrap>
+		  <xalign>0.5</xalign>
+		  <yalign>0.5</yalign>
+		  <xpad>0</xpad>
+		  <ypad>0</ypad>
+		</widget>
+
+		<widget>
+		  <class>GtkLabel</class>
+		  <child_name>CList:title</child_name>
+		  <name>label835</name>
+		  <label>GnuCash account name</label>
+		  <justify>GTK_JUSTIFY_CENTER</justify>
+		  <wrap>False</wrap>
+		  <xalign>0.5</xalign>
+		  <yalign>0.5</yalign>
+		  <xpad>0</xpad>
+		  <ypad>0</ypad>
+		</widget>
+
+		<widget>
+		  <class>GtkLabel</class>
+		  <child_name>CList:title</child_name>
+		  <name>label836</name>
+		  <label>New?</label>
+		  <justify>GTK_JUSTIFY_CENTER</justify>
+		  <wrap>False</wrap>
+		  <xalign>0.5</xalign>
+		  <yalign>0.5</yalign>
+		  <xpad>0</xpad>
+		  <ypad>0</ypad>
+		</widget>
+	      </widget>
 	    </widget>
 
 	    <widget>
 	      <class>GtkLabel</class>
-	      <name>label8477398</name>
-	      <label>Bank Code</label>
-	      <justify>GTK_JUSTIFY_RIGHT</justify>
+	      <name>label828</name>
+	      <label>Click on the line of a HBCI account name if you want to match it to a GnuCash account.
+Click &quot;Next&quot; when all desired accounts are matching.</label>
+	      <justify>GTK_JUSTIFY_LEFT</justify>
 	      <wrap>False</wrap>
-	      <xalign>0</xalign>
+	      <xalign>0.5</xalign>
 	      <yalign>0.5</yalign>
 	      <xpad>0</xpad>
 	      <ypad>0</ypad>
-	      <focus_target>bank_code_entry</focus_target>
 	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>1</right_attach>
-		<top_attach>0</top_attach>
-		<bottom_attach>1</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
 	      </child>
 	    </widget>
 	  </widget>
-	</widget>
-
-	<widget>
-	  <class>GtkFrame</class>
-	  <name>frame55</name>
-	  <label>Server Address</label>
-	  <label_xalign>0</label_xalign>
-	  <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	  <child>
-	    <padding>0</padding>
-	    <expand>False</expand>
-	    <fill>False</fill>
-	  </child>
 
 	  <widget>
-	    <class>GtkTable</class>
-	    <name>table2</name>
-	    <border_width>10</border_width>
-	    <rows>1</rows>
-	    <columns>3</columns>
-	    <homogeneous>False</homogeneous>
-	    <row_spacing>0</row_spacing>
-	    <column_spacing>0</column_spacing>
+	    <class>GtkFrame</class>
+	    <name>frame72</name>
+	    <label>HBCI Setup</label>
+	    <label_xalign>0</label_xalign>
+	    <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
+	    <child>
+	      <padding>0</padding>
+	      <expand>False</expand>
+	      <fill>True</fill>
+	    </child>
 
 	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477400</name>
-	      <label>Internet Address</label>
-	      <justify>GTK_JUSTIFY_CENTER</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <focus_target>ip_address_entry</focus_target>
-	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>1</right_attach>
-		<top_attach>0</top_attach>
-		<bottom_attach>1</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
+	      <class>GtkVBox</class>
+	      <name>vbox144</name>
+	      <border_width>5</border_width>
+	      <homogeneous>False</homogeneous>
+	      <spacing>5</spacing>
 
-	    <widget>
-	      <class>GtkEntry</class>
-	      <name>ip_address_entry</name>
-	      <can_focus>True</can_focus>
-	      <editable>True</editable>
-	      <text_visible>True</text_visible>
-	      <text_max_length>50</text_max_length>
-	      <text>www.hbci-kernel.de</text>
-	      <child>
-		<left_attach>1</left_attach>
-		<right_attach>2</right_attach>
-		<top_attach>0</top_attach>
-		<bottom_attach>1</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>True</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>False</xfill>
-		<yfill>False</yfill>
-	      </child>
+	      <widget>
+		<class>GtkButton</class>
+		<name>updatelist_button</name>
+		<can_focus>True</can_focus>
+		<label>Update 
+account list</label>
+		<relief>GTK_RELIEF_NORMAL</relief>
+		<child>
+		  <padding>0</padding>
+		  <expand>False</expand>
+		  <fill>False</fill>
+		</child>
+	      </widget>
+
+	      <widget>
+		<class>GtkButton</class>
+		<name>aqhbci_again_button</name>
+		<can_focus>True</can_focus>
+		<label>AqHBCI 
+Setup</label>
+		<relief>GTK_RELIEF_NORMAL</relief>
+		<child>
+		  <padding>0</padding>
+		  <expand>False</expand>
+		  <fill>False</fill>
+		</child>
+	      </widget>
 	    </widget>
 	  </widget>
 	</widget>
@@ -418,1213 +340,20 @@
     </widget>
 
     <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>user_page</name>
-      <title>Enter User Information</title>
-      <title_color>255,255,255</title_color>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-
-      <widget>
-	<class>GtkVBox</class>
-	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>vbox141</name>
-	<border_width>10</border_width>
-	<homogeneous>False</homogeneous>
-	<spacing>10</spacing>
-	<child>
-	  <padding>0</padding>
-	  <expand>True</expand>
-	  <fill>True</fill>
-	</child>
-
-	<widget>
-	  <class>GtkFrame</class>
-	  <name>frame61</name>
-	  <label>Bank</label>
-	  <label_xalign>0</label_xalign>
-	  <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	  <child>
-	    <padding>0</padding>
-	    <expand>False</expand>
-	    <fill>False</fill>
-	  </child>
-
-	  <widget>
-	    <class>GtkHBox</class>
-	    <name>hbox114</name>
-	    <border_width>5</border_width>
-	    <homogeneous>False</homogeneous>
-	    <spacing>5</spacing>
+      <class>GnomeDruidPageFinish</class>
+      <name>initial_finish_page</name>
+      <signal>
+	<name>finish</name>
+	<handler>on_finish</handler>
+	<last_modification_time>Sat, 16 Jun 2001 23:41:40 GMT</last_modification_time>
+      </signal>
+      <title>HBCI Setup Finished</title>
+      <text>Now the setup for all HBCI accounts that are matching
+to a Gnucash account is finished. You can now invoke HBCI actions
+on those accounts.
 
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477419</name>
-	      <label>Bank Code:</label>
-	      <justify>GTK_JUSTIFY_CENTER</justify>
-	      <wrap>False</wrap>
-	      <xalign>0.5</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkFrame</class>
-	      <name>frame62</name>
-	      <label_xalign>0</label_xalign>
-	      <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-
-	      <widget>
-		<class>GtkLabel</class>
-		<name>user_bankcode_label</name>
-		<label>10010010</label>
-		<justify>GTK_JUSTIFY_CENTER</justify>
-		<wrap>False</wrap>
-		<xalign>0.5</xalign>
-		<yalign>0.5</yalign>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-	      </widget>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477421</name>
-	      <label>Name:</label>
-	      <justify>GTK_JUSTIFY_CENTER</justify>
-	      <wrap>False</wrap>
-	      <xalign>0.5</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkFrame</class>
-	      <name>frame63</name>
-	      <label_xalign>0</label_xalign>
-	      <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-
-	      <widget>
-		<class>GtkLabel</class>
-		<name>user_bankname_label</name>
-		<label>my-bank</label>
-		<justify>GTK_JUSTIFY_CENTER</justify>
-		<wrap>False</wrap>
-		<xalign>0.5</xalign>
-		<yalign>0.5</yalign>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-	      </widget>
-	    </widget>
-	  </widget>
-	</widget>
-
-	<widget>
-	  <class>GtkFrame</class>
-	  <name>frame59</name>
-	  <label>User Identification</label>
-	  <label_xalign>0</label_xalign>
-	  <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	  <child>
-	    <padding>0</padding>
-	    <expand>False</expand>
-	    <fill>False</fill>
-	  </child>
-
-	  <widget>
-	    <class>GtkTable</class>
-	    <name>table3</name>
-	    <border_width>10</border_width>
-	    <rows>5</rows>
-	    <columns>4</columns>
-	    <homogeneous>False</homogeneous>
-	    <row_spacing>5</row_spacing>
-	    <column_spacing>0</column_spacing>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477402</name>
-	      <label>User ID (&quot;Benutzerkennung&quot;)</label>
-	      <justify>GTK_JUSTIFY_RIGHT</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <focus_target>user_id_entry</focus_target>
-	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>1</right_attach>
-		<top_attach>1</top_attach>
-		<bottom_attach>2</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkEntry</class>
-	      <name>user_id_entry</name>
-	      <can_focus>True</can_focus>
-	      <editable>True</editable>
-	      <text_visible>True</text_visible>
-	      <text_max_length>50</text_max_length>
-	      <text></text>
-	      <child>
-		<left_attach>1</left_attach>
-		<right_attach>2</right_attach>
-		<top_attach>1</top_attach>
-		<bottom_attach>2</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>True</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>False</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477417</name>
-	      <label>Name (optional)</label>
-	      <justify>GTK_JUSTIFY_RIGHT</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <focus_target>user_name_entry</focus_target>
-	      <child>
-		<left_attach>2</left_attach>
-		<right_attach>3</right_attach>
-		<top_attach>1</top_attach>
-		<bottom_attach>2</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkEntry</class>
-	      <name>user_name_entry</name>
-	      <can_focus>True</can_focus>
-	      <editable>True</editable>
-	      <text_visible>True</text_visible>
-	      <text_max_length>50</text_max_length>
-	      <text></text>
-	      <child>
-		<left_attach>3</left_attach>
-		<right_attach>4</right_attach>
-		<top_attach>1</top_attach>
-		<bottom_attach>2</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>True</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>False</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477410</name>
-	      <label>Customer ID (&quot;Kundennummer&quot;)</label>
-	      <justify>GTK_JUSTIFY_RIGHT</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <focus_target>customer_id_entry</focus_target>
-	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>1</right_attach>
-		<top_attach>3</top_attach>
-		<bottom_attach>4</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477418</name>
-	      <label>Name (optional)</label>
-	      <justify>GTK_JUSTIFY_CENTER</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <focus_target>customer_name_entry</focus_target>
-	      <child>
-		<left_attach>2</left_attach>
-		<right_attach>3</right_attach>
-		<top_attach>3</top_attach>
-		<bottom_attach>4</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkHSeparator</class>
-	      <name>hseparator3</name>
-	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>4</right_attach>
-		<top_attach>2</top_attach>
-		<bottom_attach>3</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>True</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkEntry</class>
-	      <name>customer_id_entry</name>
-	      <can_focus>True</can_focus>
-	      <editable>True</editable>
-	      <text_visible>True</text_visible>
-	      <text_max_length>50</text_max_length>
-	      <text></text>
-	      <child>
-		<left_attach>1</left_attach>
-		<right_attach>2</right_attach>
-		<top_attach>3</top_attach>
-		<bottom_attach>4</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>True</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>False</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkEntry</class>
-	      <name>customer_name_entry</name>
-	      <can_focus>True</can_focus>
-	      <editable>True</editable>
-	      <text_visible>True</text_visible>
-	      <text_max_length>50</text_max_length>
-	      <text></text>
-	      <child>
-		<left_attach>3</left_attach>
-		<right_attach>4</right_attach>
-		<top_attach>3</top_attach>
-		<bottom_attach>4</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>True</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>False</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8877438</name>
-	      <label>If your bank did not specify a Customer ID, enter the User ID here.</label>
-	      <justify>GTK_JUSTIFY_LEFT</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <focus_target>customer_id_entry</focus_target>
-	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>4</right_attach>
-		<top_attach>4</top_attach>
-		<bottom_attach>5</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8877440</name>
-	      <label>Enter the IDs given from your bank here. Please make sure the spelling is correct. </label>
-	      <justify>GTK_JUSTIFY_CENTER</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <child>
-		<left_attach>0</left_attach>
-		<right_attach>4</right_attach>
-		<top_attach>0</top_attach>
-		<bottom_attach>1</bottom_attach>
-		<xpad>0</xpad>
-		<ypad>0</ypad>
-		<xexpand>False</xexpand>
-		<yexpand>False</yexpand>
-		<xshrink>False</xshrink>
-		<yshrink>False</yshrink>
-		<xfill>True</xfill>
-		<yfill>False</yfill>
-	      </child>
-	    </widget>
-	  </widget>
-	</widget>
-
-	<widget>
-	  <class>GtkFrame</class>
-	  <name>frame58</name>
-	  <label>Security Medium</label>
-	  <label_xalign>0</label_xalign>
-	  <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	  <child>
-	    <padding>0</padding>
-	    <expand>True</expand>
-	    <fill>True</fill>
-	  </child>
-
-	  <widget>
-	    <class>GtkVBox</class>
-	    <name>vbox142</name>
-	    <border_width>5</border_width>
-	    <homogeneous>False</homogeneous>
-	    <spacing>0</spacing>
-
-	    <widget>
-	      <class>GtkRadioButton</class>
-	      <name>rdh_radiobutton</name>
-	      <can_focus>True</can_focus>
-	      <label>RDH Medium (Key File)</label>
-	      <active>True</active>
-	      <draw_indicator>True</draw_indicator>
-	      <group>choose_medium</group>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkVBox</class>
-	      <name>vbox143</name>
-	      <border_width>5</border_width>
-	      <homogeneous>False</homogeneous>
-	      <spacing>0</spacing>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>True</fill>
-	      </child>
-
-	      <widget>
-		<class>GtkHBox</class>
-		<name>hbox110</name>
-		<homogeneous>False</homogeneous>
-		<spacing>0</spacing>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-
-		<widget>
-		  <class>GtkLabel</class>
-		  <name>label8477408</name>
-		  <label>Path to Key File</label>
-		  <justify>GTK_JUSTIFY_CENTER</justify>
-		  <wrap>False</wrap>
-		  <xalign>0.5</xalign>
-		  <yalign>0.5</yalign>
-		  <xpad>12</xpad>
-		  <ypad>0</ypad>
-		  <focus_target>entry1</focus_target>
-		  <child>
-		    <padding>0</padding>
-		    <expand>False</expand>
-		    <fill>False</fill>
-		  </child>
-		</widget>
-
-		<widget>
-		  <class>GnomeFileEntry</class>
-		  <name>keyfile_fileentry</name>
-		  <history_id>keyfile</history_id>
-		  <max_saved>10</max_saved>
-		  <title>Choose file for secret key</title>
-		  <directory>False</directory>
-		  <modal>False</modal>
-		  <child>
-		    <padding>0</padding>
-		    <expand>True</expand>
-		    <fill>True</fill>
-		  </child>
-
-		  <widget>
-		    <class>GtkEntry</class>
-		    <child_name>GnomeEntry:entry</child_name>
-		    <name>entry1</name>
-		    <can_focus>True</can_focus>
-		    <editable>True</editable>
-		    <text_visible>True</text_visible>
-		    <text_max_length>0</text_max_length>
-		    <text></text>
-		  </widget>
-		</widget>
-	      </widget>
-
-	      <widget>
-		<class>GtkLabel</class>
-		<name>label8477409</name>
-		<label>If you already have a key file, please choose it here and make sure the User ID and
-Customer ID match the ones when you created that key file earlier. 
-If you do not have one yet, choose a filename, and a key file will be created there. Make
-sure to remember the exact User ID and Customer ID specified now.</label>
-		<justify>GTK_JUSTIFY_LEFT</justify>
-		<wrap>False</wrap>
-		<xalign>4.47035e-08</xalign>
-		<yalign>1</yalign>
-		<xpad>12</xpad>
-		<ypad>0</ypad>
-		<focus_target>entry1</focus_target>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-	      </widget>
-	    </widget>
-
-	    <widget>
-	      <class>GtkRadioButton</class>
-	      <name>ddv_radiobutton</name>
-	      <can_focus>True</can_focus>
-	      <label>DDV Medium (Chip Card)</label>
-	      <active>False</active>
-	      <draw_indicator>True</draw_indicator>
-	      <group>choose_medium</group>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8877439</name>
-	      <label>If you have a Chip Card but are not sure about the exact User ID and Customer ID, you can 
-use the tool 'hbcicard' from the libchipcard package to read these numbers from the Chip Card.</label>
-	      <justify>GTK_JUSTIFY_FILL</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</xalign>
-	      <yalign>0</yalign>
-	      <xpad>17</xpad>
-	      <ypad>0</ypad>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
-	  </widget>
-	</widget>
-      </widget>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>account_info_page</name>
-      <title>Account list will be updated</title>
-      <title_color>255,255,255</title_color>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-
-      <widget>
-	<class>GtkVBox</class>
-	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>druid-vbox10</name>
-	<homogeneous>False</homogeneous>
-	<spacing>0</spacing>
-	<child>
-	  <padding>0</padding>
-	  <expand>True</expand>
-	  <fill>True</fill>
-	</child>
-
-	<widget>
-	  <class>GtkLabel</class>
-	  <name>label8437423</name>
-	  <label>In order to update your list of HBCI-enabled accounts, your bank
-server will be contacted and will be queried for the 
-HBCI-accessible accounts.
-
-Press 'Next' now to contact the bank server. You can then see the 
-progress of the HBCI connection in the HBCI connection window.</label>
-	  <justify>GTK_JUSTIFY_LEFT</justify>
-	  <wrap>False</wrap>
-	  <xalign>0.5</xalign>
-	  <yalign>0.5</yalign>
-	  <xpad>0</xpad>
-	  <ypad>0</ypad>
-	  <child>
-	    <padding>0</padding>
-	    <expand>True</expand>
-	    <fill>True</fill>
-	  </child>
-	</widget>
-      </widget>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>account_match_page</name>
-      <title>Match HBCI accounts with GnuCash accounts</title>
-      <title_color>255,255,255</title_color>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-
-      <widget>
-	<class>GtkVBox</class>
-	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>druid-vbox3</name>
-	<border_width>10</border_width>
-	<homogeneous>False</homogeneous>
-	<spacing>0</spacing>
-	<child>
-	  <padding>0</padding>
-	  <expand>True</expand>
-	  <fill>True</fill>
-	</child>
-
-	<widget>
-	  <class>GtkHBox</class>
-	  <name>hbox112</name>
-	  <homogeneous>False</homogeneous>
-	  <spacing>0</spacing>
-	  <child>
-	    <padding>0</padding>
-	    <expand>True</expand>
-	    <fill>True</fill>
-	  </child>
-
-	  <widget>
-	    <class>GtkVBox</class>
-	    <name>vbox157</name>
-	    <homogeneous>False</homogeneous>
-	    <spacing>0</spacing>
-	    <child>
-	      <padding>0</padding>
-	      <expand>True</expand>
-	      <fill>True</fill>
-	    </child>
-
-	    <widget>
-	      <class>GtkScrolledWindow</class>
-	      <name>scrolledwindow25</name>
-	      <hscrollbar_policy>GTK_POLICY_ALWAYS</hscrollbar_policy>
-	      <vscrollbar_policy>GTK_POLICY_ALWAYS</vscrollbar_policy>
-	      <hupdate_policy>GTK_UPDATE_CONTINUOUS</hupdate_policy>
-	      <vupdate_policy>GTK_UPDATE_CONTINUOUS</vupdate_policy>
-	      <child>
-		<padding>0</padding>
-		<expand>True</expand>
-		<fill>True</fill>
-	      </child>
-
-	      <widget>
-		<class>GtkCList</class>
-		<name>account_page_list</name>
-		<can_focus>True</can_focus>
-		<columns>3</columns>
-		<column_widths>281,242,53</column_widths>
-		<selection_mode>GTK_SELECTION_SINGLE</selection_mode>
-		<show_titles>True</show_titles>
-		<shadow_type>GTK_SHADOW_IN</shadow_type>
-
-		<widget>
-		  <class>GtkLabel</class>
-		  <child_name>CList:title</child_name>
-		  <name>label834</name>
-		  <label>HBCI account name</label>
-		  <justify>GTK_JUSTIFY_CENTER</justify>
-		  <wrap>False</wrap>
-		  <xalign>0.5</xalign>
-		  <yalign>0.5</yalign>
-		  <xpad>0</xpad>
-		  <ypad>0</ypad>
-		</widget>
-
-		<widget>
-		  <class>GtkLabel</class>
-		  <child_name>CList:title</child_name>
-		  <name>label835</name>
-		  <label>GnuCash account name</label>
-		  <justify>GTK_JUSTIFY_CENTER</justify>
-		  <wrap>False</wrap>
-		  <xalign>0.5</xalign>
-		  <yalign>0.5</yalign>
-		  <xpad>0</xpad>
-		  <ypad>0</ypad>
-		</widget>
-
-		<widget>
-		  <class>GtkLabel</class>
-		  <child_name>CList:title</child_name>
-		  <name>label836</name>
-		  <label>New?</label>
-		  <justify>GTK_JUSTIFY_CENTER</justify>
-		  <wrap>False</wrap>
-		  <xalign>0.5</xalign>
-		  <yalign>0.5</yalign>
-		  <xpad>0</xpad>
-		  <ypad>0</ypad>
-		</widget>
-	      </widget>
-	    </widget>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label828</name>
-	      <label>Click on the line of a HBCI account name if you want to match it to a GnuCash account.
-Click &quot;Next&quot; when all desired accounts are matching.</label>
-	      <justify>GTK_JUSTIFY_LEFT</justify>
-	      <wrap>False</wrap>
-	      <xalign>0.5</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
-	  </widget>
-
-	  <widget>
-	    <class>GtkFrame</class>
-	    <name>frame72</name>
-	    <label>HBCI Setup</label>
-	    <label_xalign>0</label_xalign>
-	    <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	    <child>
-	      <padding>0</padding>
-	      <expand>False</expand>
-	      <fill>True</fill>
-	    </child>
-
-	    <widget>
-	      <class>GtkVBox</class>
-	      <name>vbox144</name>
-	      <border_width>5</border_width>
-	      <homogeneous>False</homogeneous>
-	      <spacing>5</spacing>
-
-	      <widget>
-		<class>GtkButton</class>
-		<name>hbciversion_button</name>
-		<can_focus>True</can_focus>
-		<label>HBCI
-Version</label>
-		<relief>GTK_RELIEF_NORMAL</relief>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-	      </widget>
-
-	      <widget>
-		<class>GtkButton</class>
-		<name>updatelist_button</name>
-		<can_focus>True</can_focus>
-		<label>Update 
-account list</label>
-		<relief>GTK_RELIEF_NORMAL</relief>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-	      </widget>
-
-	      <widget>
-		<class>GtkButton</class>
-		<name>addaccount_button</name>
-		<can_focus>True</can_focus>
-		<label>Manually add
-Account</label>
-		<relief>GTK_RELIEF_NORMAL</relief>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-	      </widget>
-
-	      <widget>
-		<class>GtkButton</class>
-		<name>addbank_button</name>
-		<can_focus>True</can_focus>
-		<label>Add 
-Bank</label>
-		<relief>GTK_RELIEF_NORMAL</relief>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-	      </widget>
-
-	      <widget>
-		<class>GtkButton</class>
-		<name>adduser_button</name>
-		<can_focus>True</can_focus>
-		<label>Add 
-User</label>
-		<relief>GTK_RELIEF_NORMAL</relief>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-	      </widget>
-	    </widget>
-	  </widget>
-	</widget>
-      </widget>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageFinish</class>
-      <name>initial_finish_page</name>
-      <signal>
-	<name>finish</name>
-	<handler>on_finish</handler>
-	<last_modification_time>Sat, 16 Jun 2001 23:41:40 GMT</last_modification_time>
-      </signal>
-      <title>HBCI Setup Finished</title>
-      <text>Now the setup for all HBCI accounts that are matching
-to a Gnucash account is finished. You can now invoke HBCI actions
-on those accounts.
-
-If you want to add another HBCI bank, user, or account, you can 
-start this druid again anytime.
-
-Press 'Finish' now.</text>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-      <textbox_color>255,255,255</textbox_color>
-      <text_color>0,0,0</text_color>
-      <title_color>255,255,255</title_color>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>iniletter_info_page</name>
-      <title>Public Keys will be retrieved</title>
-      <title_color>255,255,255</title_color>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-
-      <widget>
-	<class>GtkVBox</class>
-	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>druid-vbox10</name>
-	<homogeneous>False</homogeneous>
-	<spacing>0</spacing>
-	<child>
-	  <padding>0</padding>
-	  <expand>True</expand>
-	  <fill>True</fill>
-	</child>
-
-	<widget>
-	  <class>GtkLabel</class>
-	  <name>label8877423</name>
-	  <label>In order to setup HBCI access to your bank, OpenHBCI first has to 
-retrieve the cryptographic public keys of your bank. You will need 
-to enter your PIN for this to happen. After the successful key 
-retrieval, you need to verify those against the Ini-Letter that 
-your bank gave to you on paper.
-
-Press 'Next' now to retrieve the keys from the bank. If you have just
-created a new key file, you have to enter its PIN again. 
-
-You can then see the progress of the HBCI connection in the HBCI
-connection window. Please do not close the HBCI connection window
-before this whole druid has finished.</label>
-	  <justify>GTK_JUSTIFY_LEFT</justify>
-	  <wrap>False</wrap>
-	  <xalign>0.5</xalign>
-	  <yalign>0.5</yalign>
-	  <xpad>0</xpad>
-	  <ypad>0</ypad>
-	  <child>
-	    <padding>0</padding>
-	    <expand>True</expand>
-	    <fill>True</fill>
-	  </child>
-	</widget>
-      </widget>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>iniletter_server_page</name>
-      <title>Verify Ini-Letter from Server</title>
-      <title_color>255,255,255</title_color>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-
-      <widget>
-	<class>GtkVBox</class>
-	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>druid-vbox8</name>
-	<homogeneous>False</homogeneous>
-	<spacing>0</spacing>
-	<child>
-	  <padding>0</padding>
-	  <expand>True</expand>
-	  <fill>True</fill>
-	</child>
-
-	<widget>
-	  <class>GtkVBox</class>
-	  <name>iniletter_server_vbox</name>
-	  <homogeneous>False</homogeneous>
-	  <spacing>0</spacing>
-	  <child>
-	    <padding>0</padding>
-	    <expand>True</expand>
-	    <fill>True</fill>
-	  </child>
-
-	  <widget>
-	    <class>GtkFrame</class>
-	    <name>iniletter_server_frame</name>
-	    <border_width>10</border_width>
-	    <label>Ini-Letter Server</label>
-	    <label_xalign>0</label_xalign>
-	    <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	    <child>
-	      <padding>0</padding>
-	      <expand>True</expand>
-	      <fill>True</fill>
-	    </child>
-
-	    <widget>
-	      <class>Placeholder</class>
-	    </widget>
-	  </widget>
-
-	  <widget>
-	    <class>GtkHBox</class>
-	    <name>hbox113</name>
-	    <border_width>10</border_width>
-	    <homogeneous>False</homogeneous>
-	    <spacing>10</spacing>
-	    <child>
-	      <padding>0</padding>
-	      <expand>False</expand>
-	      <fill>True</fill>
-	    </child>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477411</name>
-	      <label>Do these values match the values on your paper Ini-Letter? 
-(If you cannot see anything, press the 'Print' button.)</label>
-	      <justify>GTK_JUSTIFY_CENTER</justify>
-	      <wrap>False</wrap>
-	      <xalign>0.5</xalign>
-	      <yalign>0.5</yalign>
-	      <xpad>0</xpad>
-	      <ypad>0</ypad>
-	      <child>
-		<padding>0</padding>
-		<expand>False</expand>
-		<fill>False</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkButton</class>
-	      <name>serveryes_button</name>
-	      <can_focus>True</can_focus>
-	      <stock_button>GNOME_STOCK_BUTTON_YES</stock_button>
-	      <relief>GTK_RELIEF_NORMAL</relief>
-	      <child>
-		<padding>0</padding>
-		<expand>True</expand>
-		<fill>True</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkButton</class>
-	      <name>serverno_button</name>
-	      <can_focus>True</can_focus>
-	      <stock_button>GNOME_STOCK_BUTTON_NO</stock_button>
-	      <relief>GTK_RELIEF_NORMAL</relief>
-	      <child>
-		<padding>0</padding>
-		<expand>True</expand>
-		<fill>True</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkVSeparator</class>
-	      <name>vseparator1</name>
-	      <child>
-		<padding>0</padding>
-		<expand>True</expand>
-		<fill>True</fill>
-	      </child>
-	    </widget>
-
-	    <widget>
-	      <class>GtkButton</class>
-	      <name>serverprint_button</name>
-	      <can_focus>True</can_focus>
-	      <label>Print</label>
-	      <relief>GTK_RELIEF_NORMAL</relief>
-	      <child>
-		<padding>0</padding>
-		<expand>True</expand>
-		<fill>True</fill>
-	      </child>
-	    </widget>
-	  </widget>
-	</widget>
-      </widget>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>iniletter_userinfo_page</name>
-      <title>User Keys will be sent</title>
-      <title_color>255,255,255</title_color>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-
-      <widget>
-	<class>GtkVBox</class>
-	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>druid-vbox10</name>
-	<homogeneous>False</homogeneous>
-	<spacing>0</spacing>
-	<child>
-	  <padding>0</padding>
-	  <expand>True</expand>
-	  <fill>True</fill>
-	</child>
-
-	<widget>
-	  <class>GtkLabel</class>
-	  <name>label8877423</name>
-	  <label>Now you need to send your cryptographic public keys to the bank
-server. Once you press 'Next', you public keys are sent to the 
-bank. ATTENTION: This step cannot be undone. Once you have sent 
-your keys to the bank, you cannot generate new ones but instead 
-have to use these for months to come (unless you personally ask 
-your bank to reset them).
-
-AGAIN ATTENTION: If you happen to encounter a bug in this unstable
-Gnucash version and/or OpenHBCI, these keys might get broken and you
-might actually have ask your bank to reset them and generate new ones.
-
-If you are really sure to proceed, then press 'Next' now to send 
-the keys to the bank. You can then see the progress of the HBCI 
-connection in the HBCI connection window.</label>
-	  <justify>GTK_JUSTIFY_LEFT</justify>
-	  <wrap>False</wrap>
-	  <xalign>0.5</xalign>
-	  <yalign>0.5</yalign>
-	  <xpad>0</xpad>
-	  <ypad>0</ypad>
-	  <child>
-	    <padding>0</padding>
-	    <expand>True</expand>
-	    <fill>True</fill>
-	  </child>
-	</widget>
-      </widget>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>iniletter_user_page</name>
-      <title>Print Ini-Letter of User</title>
-      <title_color>255,255,255</title_color>
-      <background_color>153,191,153</background_color>
-      <logo_background_color>255,255,255</logo_background_color>
-
-      <widget>
-	<class>GtkVBox</class>
-	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>iniletter_user_vbox</name>
-	<border_width>10</border_width>
-	<homogeneous>False</homogeneous>
-	<spacing>5</spacing>
-	<child>
-	  <padding>0</padding>
-	  <expand>True</expand>
-	  <fill>True</fill>
-	</child>
-
-	<widget>
-	  <class>GtkFrame</class>
-	  <name>iniletter_user_frame</name>
-	  <label>Ini-Letter User</label>
-	  <label_xalign>0</label_xalign>
-	  <shadow_type>GTK_SHADOW_ETCHED_IN</shadow_type>
-	  <child>
-	    <padding>0</padding>
-	    <expand>True</expand>
-	    <fill>True</fill>
-	  </child>
-
-	  <widget>
-	    <class>Placeholder</class>
-	  </widget>
-	</widget>
-
-	<widget>
-	  <class>GtkHBox</class>
-	  <name>hbox114</name>
-	  <border_width>10</border_width>
-	  <homogeneous>False</homogeneous>
-	  <spacing>20</spacing>
-	  <child>
-	    <padding>0</padding>
-	    <expand>False</expand>
-	    <fill>False</fill>
-	  </child>
-
-	  <widget>
-	    <class>GtkLabel</class>
-	    <name>label8477345</name>
-	    <label>This is the Ini-Letter of you, the user. (If you cannot see anything, please 
-press the 'Print' button.) Please print out a paper copy 
-by pressing 'Print'. Then press 'Next'.</label>
-	    <justify>GTK_JUSTIFY_LEFT</justify>
-	    <wrap>False</wrap>
-	    <xalign>0</xalign>
-	    <yalign>0</yalign>
-	    <xpad>0</xpad>
-	    <ypad>0</ypad>
-	    <child>
-	      <padding>0</padding>
-	      <expand>False</expand>
-	      <fill>False</fill>
-	    </child>
-	  </widget>
-
-	  <widget>
-	    <class>GtkButton</class>
-	    <name>userprint_button</name>
-	    <can_focus>True</can_focus>
-	    <label>Print</label>
-	    <relief>GTK_RELIEF_NORMAL</relief>
-	    <child>
-	      <padding>0</padding>
-	      <expand>True</expand>
-	      <fill>True</fill>
-	    </child>
-	  </widget>
-	</widget>
-      </widget>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageFinish</class>
-      <name>initial_finish_page</name>
-      <signal>
-	<name>finish</name>
-	<handler>on_finish</handler>
-	<last_modification_time>Sat, 16 Jun 2001 23:41:40 GMT</last_modification_time>
-      </signal>
-      <title>Initial HBCI Setup Finished</title>
-      <text>Now you need to sign your (the User's) Ini-Letter and send it to your bank. 
-
-The initial HBCI setup is now finished.
-
-Once your bank has received and processed your Ini-Letter, you
-have to execute this &quot;HBCI Setup&quot; druid again in order 
-to use the HBCI functionality in your accounts.
+If you want to add another HBCI bank, user, or account, you can 
+start this druid again anytime.
 
 Press 'Finish' now.</text>
       <background_color>153,191,153</background_color>


More information about the gnucash-changes mailing list