[Gnucash-changes] Change HBCI support to aqbanking, back-ported from HEAD.

Christian Stimming cstim at cvs.gnucash.org
Sat Sep 25 06:16:55 EDT 2004


Log Message:
-----------
Change HBCI support to aqbanking, back-ported from HEAD.

2004-09-25  Christian Stimming  <stimming at tuhh.de>

	* configure.in, src/import-export/hbci/hbci-interaction.c: Major
	change for HBCI, back-ported from HEAD. The HBCI online banking is
	no longer based on the openhbci library but instead on the
	aqbanking library http://sf.net/projects/aqbanking which is Martin
	Preuss' successor of openhbci. This means that now aqbanking-0.9.5
	is required instead of any openhbci package. This is almost ready
	for production work but still should need extensive testing.

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

Modified Files:
--------------
    gnucash:
        ChangeLog
        configure.in
    gnucash/macros:
        Makefile.am
    gnucash/src/import-export/hbci:
        Makefile.am
        dialog-hbcitrans.c
        dialog-hbcitrans.h
        dialog-pass.c
        dialog-pass.h
        druid-hbci-initial.c
        druid-hbci-utils.c
        druid-hbci-utils.h
        gnc-hbci-actions.c
        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
        hbci-progressmon.c
    gnucash/src/import-export/hbci/glade:
        hbci.glade

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

Removed Files:
-------------
    gnucash/macros:
        openhbci.m4

Revision Data
-------------
Index: configure.in
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/configure.in,v
retrieving revision 1.358.2.38
retrieving revision 1.358.2.39
diff -Lconfigure.in -Lconfigure.in -u -r1.358.2.38 -r1.358.2.39
--- configure.in
+++ configure.in
@@ -530,9 +530,16 @@
   fi)
 if test x${HBCI_DIR} = xhbci ;
 then
-    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)
@@ -545,6 +552,7 @@
     AC_SUBST(HBCI_CFLAGS)
 fi
 AC_SUBST(HBCI_DIR)
+
 ### --------------------------------------------------------------------------
 ### i18n
 
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1461.2.352
retrieving revision 1.1461.2.353
diff -LChangeLog -LChangeLog -u -r1.1461.2.352 -r1.1461.2.353
--- ChangeLog
+++ ChangeLog
@@ -1,3 +1,13 @@
+2004-09-25  Christian Stimming  <stimming at tuhh.de>
+
+	* configure.in, src/import-export/hbci/hbci-interaction.c: Major
+	change for HBCI, back-ported from HEAD. The HBCI online banking is
+	no longer based on the openhbci library but instead on the
+	aqbanking library http://sf.net/projects/aqbanking which is Martin
+	Preuss' successor of openhbci. This means that now aqbanking-0.9.5
+	is required instead of any openhbci package. This is almost ready
+	for production work but still should need extensive testing.
+
 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,128 @@
+# $Id: aqbanking.m4,v 1.2.2.1 2004/09/25 10:16:51 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)
+dnl Disabled this switch because it is confusing (as if there were an option)
+#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)
+])
--- macros/openhbci.m4
+++ /dev/null
@@ -1,205 +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_OPENHBCI([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_OPENHBCI, [
-dnl 
-dnl Get the c[xx]flags and libraries from openhbci-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/openhbci-config"; then
-    hbci_config="${li}/bin/openhbci-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`"
-else
-  AC_MSG_ERROR([
-  Could not find bin/openhbci-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 <openhbci.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);
-        }
-      }
-    }
-  }
-
-#if ((OPENHBCI_VERSION_MAJOR>0) || (OPENHBCI_VERSION_MINOR>9) || \
-      (OPENHBCI_VERSION_PATCHLEVEL>9) || (OPENHBCI_VERSION_BUILD>17))
-  /* Four-argument libraryVersion_build() was introduced with 0.9.9.18. */
-  HBCI_Hbci_libraryVersion_build(&getmajor, &getminor, &getmicro, &getbuild);
-#elif ((OPENHBCI_VERSION_MAJOR>0) || (OPENHBCI_VERSION_MINOR>9) || \
-      (OPENHBCI_VERSION_PATCHLEVEL>9) || (OPENHBCI_VERSION_BUILD>8))
-  /* Four-argument libraryVersion() was introduced with 0.9.9.9. */
-  HBCI_Hbci_libraryVersion(&getmajor, &getminor, &getmicro, &getbuild);
-#else
-  HBCI_Hbci_libraryVersion(&getmajor, &getminor, &getmicro);
-  getbuild = OPENHBCI_VERSION_BUILD;
-#endif
-
-  if ((getmajor != OPENHBCI_VERSION_MAJOR) ||
-      (getminor != OPENHBCI_VERSION_MINOR) ||
-      (getmicro != OPENHBCI_VERSION_PATCHLEVEL) ||
-      (getbuild != OPENHBCI_VERSION_BUILD))
-    {
-      printf("\n*** OpenHBCI header files openhbci.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 <openhbci.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)
-dnl AC_LANG_POP(C++)
-rm -f conf.openhbcitest
-])
Index: Makefile.am
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/macros/Makefile.am,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -Lmacros/Makefile.am -Lmacros/Makefile.am -u -r1.3 -r1.3.2.1
--- macros/Makefile.am
+++ macros/Makefile.am
@@ -29,7 +29,7 @@
   gperf-check.m4				\
   linger.m4					\
   need-declaration.m4				\
-  openhbci.m4
+  aqbanking.m4
 
 EXTRA_DIST=$(MACROS) gnome-common.m4 autogen.sh
 MAINTAINERCLEANFILES=macros.dep
Index: druid-hbci-utils.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/druid-hbci-utils.c,v
retrieving revision 1.5.2.1
retrieving revision 1.5.2.2
diff -Lsrc/import-export/hbci/druid-hbci-utils.c -Lsrc/import-export/hbci/druid-hbci-utils.c -u -r1.5.2.1 -r1.5.2.2
--- src/import-export/hbci/druid-hbci-utils.c
+++ src/import-export/hbci/druid-hbci-utils.c
@@ -45,10 +45,8 @@
 /* #include "gnc-gui-query.h" */
 /* #include "io-example-account.h" */
 /* #include "top-level.h" */
-#include <openhbci/api.h>
-#include <openhbci/outboxjobs.h>
-
 
+#include "gnc-hbci-utils.h"
 
 /**
  * Save the reference strings to the HBCI accounts in the kvp's of the
@@ -56,27 +54,40 @@
 static void
 accounts_save_kvp_cb (gpointer key, gpointer value, gpointer user_data)
 {
-  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), 
-	       HBCI_Account_accountId (hbci_acc)) != 0))
-    gnc_hbci_set_account_accountid 
-      (gnc_acc, 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 (HBCI_Account_bank (hbci_acc))) != 0))
+  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));
+
+  if (AB_Account_GetAccountNumber(hbci_acc) && 
+      ((gnc_hbci_get_account_accountid(gnc_acc) == NULL) ||
+       (strcmp(gnc_hbci_get_account_accountid(gnc_acc), 
+	       AB_Account_GetAccountNumber(hbci_acc)) != 0)))
+    gnc_hbci_set_account_accountid
+      (gnc_acc, AB_Account_GetAccountNumber(hbci_acc));
+
+  if (AB_Account_GetBankCode(hbci_acc) && 
+      ((gnc_hbci_get_account_bankcode(gnc_acc) == NULL) ||
+       (strcmp(gnc_hbci_get_account_bankcode(gnc_acc), 
+	       AB_Account_GetBankCode(hbci_acc)) != 0)))
     gnc_hbci_set_account_bankcode
-      (gnc_acc, HBCI_Bank_bankCode (HBCI_Account_bank (hbci_acc)));
+      (gnc_acc, AB_Account_GetBankCode(hbci_acc));
+}
 
-  if (gnc_hbci_get_account_countrycode(gnc_acc) !=
-      HBCI_Bank_countryCode (HBCI_Account_bank (hbci_acc)))
-    gnc_hbci_set_account_countrycode
-      (gnc_acc, HBCI_Bank_countryCode (HBCI_Account_bank (hbci_acc)));
+static gpointer accounts_clear_kvp (Account *gnc_acc, gpointer user_data)
+{
+  if (gnc_hbci_get_account_uid(gnc_acc))
+    gnc_hbci_set_account_uid (gnc_acc, 0);
+  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, "");
+  return NULL;
 }
 
 /* hash is a DIRECT hash from each HBCI account to each gnucash
@@ -84,7 +95,14 @@
 void
 accounts_save_kvp (GHashTable *hash)
 {
+  AccountGroup *grp;
   g_assert(hash);
+
+  grp = gnc_book_get_group (gnc_get_current_book ());
+  xaccGroupForEachAccount (grp, 
+			   &accounts_clear_kvp,
+			   NULL, TRUE);
+
   g_hash_table_foreach (hash, &accounts_save_kvp_cb, NULL);
 }
 /*
@@ -92,120 +110,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;
-  list_HBCI_User_iter *begin;
-  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;
-  }
-  else if (list_HBCI_User_size (userlist) == 1) {
-    begin = list_HBCI_User_begin (userlist);
-    update_accounts_foruser (parent, api, 
-			     list_HBCI_User_iter_get (begin), inter);
-    list_HBCI_User_iter_delete (begin);
-  }
-  else {
-    printf("update_accounts_forbank: Sorry, multiple users not yet supported.\n");
-  }
-}
-static void 
-update_accounts_foruser (GtkWidget *parent, HBCI_API *api, 
-			 const HBCI_User *user, 
-			 GNCInteractor *inter)
-{
-  const list_HBCI_Customer *customerlist;
-  list_HBCI_Customer_iter *begin;
-  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;
-  }
-  else if (list_HBCI_Customer_size (customerlist) == 1) {
-    begin = list_HBCI_Customer_begin (customerlist);
-    if (!update_accounts_forcustomer (parent, api, 
-				      list_HBCI_Customer_iter_get (begin),
-				      inter))
-      return;
-    list_HBCI_Customer_iter_delete (begin);
-  }
-  else {
-    printf("update_accounts_foruser: Sorry, multiple customers not yet supported.\n");
-  }
-}
-
-static gboolean
-update_accounts_forcustomer (GtkWidget *parent, HBCI_API *api, 
-			     const HBCI_Customer *cust, GNCInteractor *inter)
-{
-  HBCI_OutboxJobGetAccounts* get_job; 
-  HBCI_OutboxJob *job;
-  g_assert(cust);
-  
-  /* this const-warning is okay and can be ignored. */
-  get_job = HBCI_OutboxJobGetAccounts_new((HBCI_Customer *)cust); 
-  job = HBCI_OutboxJobGetAccounts_OutboxJob(get_job);
-  HBCI_API_addJob(api, job);
-  
-  /* Execute Outbox. */
-  return gnc_hbci_api_execute (parent, api, job, inter);
 }
 
 
 
-
-
 struct hbci_acc_cb_data 
 {
-  HBCI_API *api;
+  AB_BANKING *api;
   GHashTable *hash;
 };
 
@@ -213,9 +129,9 @@
 gnc_hbci_new_hash_from_kvp_cb (Account *gnc_acc, gpointer user_data)
 {
   struct hbci_acc_cb_data *data = user_data;
-  HBCI_Account *hbci_acc = NULL;
+  AB_ACCOUNT *hbci_acc = NULL;
 
-  hbci_acc = (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);
   }
@@ -223,7 +139,7 @@
 }
 
 GHashTable *
-gnc_hbci_new_hash_from_kvp (HBCI_API *api)
+gnc_hbci_new_hash_from_kvp (AB_BANKING *api)
 {
   GHashTable *hash;
 
@@ -258,14 +174,14 @@
 }
 
 gboolean
-gnc_test_dir_exist_error (GtkWindow *parent, const char *filename) 
+gnc_test_dir_exist_error (GtkWidget *parent, const char *filename) 
 {
   char *dirname = g_dirname (filename);
   gboolean dirtest = g_file_test (dirname, G_FILE_TEST_ISDIR);
   g_free (dirname);
   if (!dirtest) {
     gnc_error_dialog_parented
-      (parent, 
+      (GTK_WINDOW (parent), 
        _("The directory for file\n"
 "%s\n"
 "does not exist. \n"
@@ -276,3 +192,4 @@
   return TRUE;
 }
 
+
Index: dialog-hbcitrans.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-hbcitrans.c,v
retrieving revision 1.9.2.17
retrieving revision 1.9.2.18
diff -Lsrc/import-export/hbci/dialog-hbcitrans.c -Lsrc/import-export/hbci/dialog-hbcitrans.c -u -r1.9.2.17 -r1.9.2.18
--- src/import-export/hbci/dialog-hbcitrans.c
+++ src/import-export/hbci/dialog-hbcitrans.c
@@ -27,9 +27,8 @@
 #endif
 
 #include <gnome.h>
-#include <openhbci/bank.h>
-#include <openhbci/outboxaccjobs.h>
-#include <openhbci.h>
+#include <aqbanking/account.h>
+#include <aqbanking/jobsingletransfer.h>
 
 #include "dialog-utils.h"
 #include "gnc-ui.h"
@@ -66,6 +65,8 @@
   /* Purpose, description */
   GtkWidget *purpose_entry;
   GtkWidget *purpose_cont_entry;
+  GtkWidget *purpose_cont2_entry;
+  GtkWidget *purpose_cont3_entry;
 
   /* Recipient's bank name (may be filled in automatically sometime later) */
   GtkWidget *recp_bankname_label;
@@ -83,7 +84,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;
@@ -105,7 +106,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;
     
@@ -125,7 +126,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;
@@ -156,11 +157,11 @@
 /* Prototypes; callbacks for dialog function */
 /* -------------------------------------- */
 
-HBCI_Transaction *
-hbci_trans_fill_values(const 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);
@@ -205,14 +206,13 @@
 
 HBCITransDialog *
 gnc_hbci_dialog_new (GtkWidget *parent,
-		const 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);
@@ -221,9 +221,8 @@
   td->templ = templates;
   td->trans_type = trans_type;
   g_assert (h_acc);
-  g_assert (customer);
-  bank = 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
@@ -257,57 +256,61 @@
     GtkWidget *del_templ_button;
         
     g_assert 
-      (heading_label = glade_xml_get_widget (xml, "heading_label"));
+      ((heading_label = glade_xml_get_widget (xml, "heading_label")) != NULL);
     g_assert 
-      (td->recp_name_entry = glade_xml_get_widget (xml, "recp_name_entry"));
+      ((td->recp_name_entry = glade_xml_get_widget (xml, "recp_name_entry")) != NULL);
     g_assert 
-      (recp_name_heading = glade_xml_get_widget (xml, "recp_name_heading"));
+      ((recp_name_heading = glade_xml_get_widget (xml, "recp_name_heading")) != NULL);
     g_assert
-      (td->recp_account_entry = glade_xml_get_widget (xml, "recp_account_entry"));
+      ((td->recp_account_entry = glade_xml_get_widget (xml, "recp_account_entry")) != NULL);
     g_assert
-      (recp_account_heading = glade_xml_get_widget (xml, "recp_account_heading"));
+      ((recp_account_heading = glade_xml_get_widget (xml, "recp_account_heading")) != NULL);
     g_assert
-      (td->recp_bankcode_entry = glade_xml_get_widget (xml, "recp_bankcode_entry"));
+      ((td->recp_bankcode_entry = glade_xml_get_widget (xml, "recp_bankcode_entry")) != NULL);
     g_assert
-      (recp_bankcode_heading = glade_xml_get_widget (xml, "recp_bankcode_heading"));
+      ((recp_bankcode_heading = glade_xml_get_widget (xml, "recp_bankcode_heading")) != NULL);
     g_assert
-      (td->recp_bankname_label = glade_xml_get_widget (xml, "recp_bankname_label"));
+      ((td->recp_bankname_label = glade_xml_get_widget (xml, "recp_bankname_label")) != NULL);
     g_assert
-      (amount_hbox = glade_xml_get_widget (xml, "amount_hbox"));
+      ((amount_hbox = glade_xml_get_widget (xml, "amount_hbox")) != NULL);
     g_assert
-      (td->purpose_entry = glade_xml_get_widget (xml, "purpose_entry"));
+      ((td->purpose_entry = glade_xml_get_widget (xml, "purpose_entry")) != NULL);
     g_assert
-      (td->purpose_cont_entry = glade_xml_get_widget (xml, "purpose_cont_entry"));
+      ((td->purpose_cont_entry = glade_xml_get_widget (xml, "purpose_cont_entry")) != NULL);
     g_assert
-      (orig_name_label = glade_xml_get_widget (xml, "orig_name_label"));
+      ((td->purpose_cont2_entry = glade_xml_get_widget (xml, "purpose_cont2_entry")) != NULL);
     g_assert
-      (orig_account_label = glade_xml_get_widget (xml, "orig_account_label"));
+      ((td->purpose_cont3_entry = glade_xml_get_widget (xml, "purpose_cont3_entry")) != NULL);
     g_assert
-      (orig_bankname_label = glade_xml_get_widget (xml, "orig_bankname_label"));
+      ((orig_name_label = glade_xml_get_widget (xml, "orig_name_label")) != NULL);
     g_assert
-      (orig_bankcode_label = glade_xml_get_widget (xml, "orig_bankcode_label"));
+      ((orig_account_label = glade_xml_get_widget (xml, "orig_account_label")) != NULL);
     g_assert
-      (orig_name_heading = glade_xml_get_widget (xml, "orig_name_heading"));
+      ((orig_bankname_label = glade_xml_get_widget (xml, "orig_bankname_label")) != NULL);
     g_assert
-      (orig_account_heading = glade_xml_get_widget (xml, "orig_account_heading"));
+      ((orig_bankcode_label = glade_xml_get_widget (xml, "orig_bankcode_label")) != NULL);
     g_assert
-      (orig_bankname_heading = glade_xml_get_widget (xml, "orig_bankname_heading"));
+      ((orig_name_heading = glade_xml_get_widget (xml, "orig_name_heading")) != NULL);
     g_assert
-      (orig_bankcode_heading = glade_xml_get_widget (xml, "orig_bankcode_heading"));
+      ((orig_account_heading = glade_xml_get_widget (xml, "orig_account_heading")) != NULL);
     g_assert
-      (exec_later_button = glade_xml_get_widget (xml, "exec_later_button"));
+      ((orig_bankname_heading = glade_xml_get_widget (xml, "orig_bankname_heading")) != NULL);
     g_assert
-      (td->template_gtk_list = glade_xml_get_widget (xml, "template_list"));
+      ((orig_bankcode_heading = glade_xml_get_widget (xml, "orig_bankcode_heading")) != NULL);
     g_assert
-      (add_templ_button = glade_xml_get_widget (xml, "add_templ_button"));
+      ((exec_later_button = glade_xml_get_widget (xml, "exec_later_button")) != NULL);
     g_assert
-      (moveup_templ_button = glade_xml_get_widget (xml, "moveup_templ_button"));
+      ((td->template_gtk_list = glade_xml_get_widget (xml, "template_list")) != NULL);
     g_assert
-      (movedown_templ_button = glade_xml_get_widget (xml, "movedown_templ_button"));
+      ((add_templ_button = glade_xml_get_widget (xml, "add_templ_button")) != NULL);
     g_assert
-      (sort_templ_button = glade_xml_get_widget (xml, "sort_templ_button"));
+      ((moveup_templ_button = glade_xml_get_widget (xml, "moveup_templ_button")) != NULL);
     g_assert
-      (del_templ_button = glade_xml_get_widget (xml, "del_templ_button"));
+      ((movedown_templ_button = glade_xml_get_widget (xml, "movedown_templ_button")) != NULL);
+    g_assert
+      ((sort_templ_button = glade_xml_get_widget (xml, "sort_templ_button")) != NULL);
+    g_assert
+      ((del_templ_button = glade_xml_get_widget (xml, "del_templ_button")) != NULL);
 
     td->amount_edit = gnc_amount_edit_new();
     gtk_box_pack_start_defaults(GTK_BOX(amount_hbox), td->amount_edit);
@@ -355,17 +358,15 @@
     
     /* Fill in the values from the objects */
     gtk_label_set_text (GTK_LABEL (orig_name_label), 
-			(strlen(HBCI_Customer_custName (customer))>0 ? 
-			 HBCI_Customer_custName (customer) :
-			 HBCI_Customer_custId (customer)));
+			AB_Account_GetOwnerName (h_acc));
     gtk_label_set_text (GTK_LABEL (orig_account_label), 
-			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) :
+			(hbci_bankname && (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, 
@@ -425,11 +426,27 @@
  */
 
 int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td, 
-				 const HBCI_Account *h_acc)
+				 const AB_ACCOUNT *h_acc)
 {
   int result;
+  int max_purpose_lines;
   gboolean values_ok;
 
+  {
+    AB_JOB *job = AB_JobSingleTransfer_new((AB_ACCOUNT *)h_acc);
+    if (AB_Job_CheckAvailability(job)) {
+      printf("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
+      return -1;
+    }
+    max_purpose_lines = AB_JobSingleTransfer_GetMaxPurposeLines(job);
+    /* these are the number of fields, 27 characters each. */
+    AB_Job_free(job);
+  }
+  /* gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_entry), max_purpose_lines > 0); */
+  gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont_entry), max_purpose_lines > 1);
+  gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont2_entry), max_purpose_lines > 2);
+  gtk_widget_set_sensitive (GTK_WIDGET (td->purpose_cont3_entry), max_purpose_lines > 3);
+
   /* Repeat until entered values make sense */
   do {
 
@@ -450,13 +467,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_parented
 	(GTK_WIDGET (td->dialog),
@@ -469,7 +486,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;
@@ -478,7 +495,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_setTextKey (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);
@@ -489,61 +506,72 @@
 }
 
 
-/** 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 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)
 {
   /* Fill in the user-entered values */
-  HBCI_Transaction *trans = HBCI_Transaction_new();
+  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_setOurCountryCode (trans, 
-				      HBCI_Account_countryCode (h_acc));
-  HBCI_Transaction_setOurBankCode (trans, 
-				   HBCI_Account_instituteCode (h_acc));
-  HBCI_Transaction_setOurAccountId (trans, HBCI_Account_accountId (h_acc));
-  HBCI_Transaction_setOurSuffix (trans, HBCI_Account_accountSuffix (h_acc));
+  AB_Transaction_SetLocalBankCode (trans, 
+				   AB_Account_GetBankCode (h_acc));
+  AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (h_acc));
+  AB_Transaction_SetLocalCountry (trans, "DE");
 	
-  HBCI_Transaction_setOtherCountryCode (trans, 280);
-  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_SetRemoteCountry (trans, "DE");
+  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);
+  AB_Transaction_AddPurpose
+    (trans, gtk_entry_get_text (GTK_ENTRY (td->purpose_cont2_entry)), FALSE);
+  AB_Transaction_AddPurpose
+    (trans, gtk_entry_get_text (GTK_ENTRY (td->purpose_cont3_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. */
-  if (td->trans_type == SINGLE_DEBITNOTE)
-    HBCI_Transaction_setTransactionCode (trans, 05);
+  switch(td->trans_type) {
+  case SINGLE_DEBITNOTE:
+    /* AB_Transaction_SetTransactionCode (trans, 05); */
+    AB_Transaction_SetTextKey (trans, 05);
+    break;
+  default:
+    /* AB_Transaction_SetTransactionCode (trans, 51); */
+    AB_Transaction_SetTextKey (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 +580,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 +592,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,73 +616,53 @@
 #endif    
 }
 
-HBCI_OutboxJob *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, HBCI_API *api,
-			      const HBCI_Customer *customer, 
-			      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;
+
   /* Create a Do-Transaction (Transfer) job. */
-  switch (trans_type) {
-  case SINGLE_DEBITNOTE:
-    {
-      HBCI_OutboxJobDebitNote *debit_job =
-	HBCI_OutboxJobDebitNote_new (customer, h_acc, td->hbci_trans);
-      job = HBCI_OutboxJobDebitNote_OutboxJob (debit_job);
-    }
-    break;
-  case SINGLE_TRANSFER:
-    {
-      HBCI_OutboxJobTransfer *transfer_job = 
-	HBCI_OutboxJobTransfer_new (customer, h_acc, td->hbci_trans);
-      job = HBCI_OutboxJobTransfer_OutboxJob (transfer_job);
-    }
-    break;
-  default:
-    {
-      /*printf("dialog-hbcitrans: Oops, unknown GNC_HBCI_Transtype %d.\n",
-	trans_type);*/
-      HBCI_OutboxJobTransfer *transfer_job = 
-	HBCI_OutboxJobTransfer_new (customer, h_acc, td->hbci_trans);
-      job = HBCI_OutboxJobTransfer_OutboxJob (transfer_job);
-    }
+  job = AB_JobSingleTransfer_new(h_acc);
+  if (AB_Job_CheckAvailability(job)) {
+    printf("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
+    return NULL;
   }
-  g_assert (job);
+  AB_JobSingleTransfer_SetTransaction(job, td->hbci_trans);
 
   /* Make really sure there is no other job in the queue */
-  HBCI_API_clearQueueByStatus (api, HBCI_JOB_STATUS_NONE);
+/*   HBCI_Outbox_removeByStatus (outbox, HBCI_JOB_STATUS_NONE); */
 
   /* Add job to queue */
-  HBCI_API_addJob (api, job);
+  AB_Banking_EnqueueJob(api, job);
 
   return job;
 }
 
 gboolean 
-gnc_hbci_trans_dialog_execute(HBCITransDialog *td, HBCI_API *api, 
-			      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, 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_parented
 	(td->parent, 
 	 FALSE,
 	 "%s",
-	 _("The job was successfully sent to the bank, but the \n"
+	 _("The job was sent to the bank successfully, but the \n"
 	   "bank is refusing to execute the job. Please check \n"
 	   "the log window for the exact error message of the \n"
 	   "bank. The line with the error message contains a \n"
@@ -662,12 +670,15 @@
 	   "\n"
 	   "Do you want to enter the job again?"));
 
-    HBCI_Transaction_delete (td->hbci_trans);
+    if (AB_Job_GetStatus (job) == AB_Job_StatusPending)
+      AB_Banking_DelPendingJob(api, job);
+
+    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_API_clearQueueByStatus (api, HBCI_JOB_STATUS_NONE);
+  /* FIXME: need to do 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.16.2.1
retrieving revision 1.16.2.2
diff -Lsrc/import-export/hbci/gncmod-hbci.c -Lsrc/import-export/hbci/gncmod-hbci.c -u -r1.16.2.1 -r1.16.2.2
--- src/import-export/hbci/gncmod-hbci.c
+++ src/import-export/hbci/gncmod-hbci.c
@@ -7,8 +7,8 @@
 
 #include "config.h"
 #include <stdio.h>
-#include <guile/gh.h>
 #include <glib.h>
+#include <guile/gh.h>
 
 #include "gnc-module.h"
 #include "gnc-module-api.h"
@@ -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;
@@ -65,10 +66,10 @@
   }
 
   /* load the HBCI Scheme code */
-  gh_eval_str("(load-from-path \"hbci/hbci.scm\")");
+  scm_c_eval_string("(load-from-path \"hbci/hbci.scm\")");
 
-  gh_new_procedure("gnc:hbci-initial-setup", 
-		   scm_hbci_initial_druid, 0, 0, 0);
+  scm_c_define_gsubr("gnc:hbci-initial-setup", 
+		     0, 0, 0, scm_hbci_initial_druid);
 
   /* Add menu items with C callbacks */
   gnc_hbci_addmenus();
@@ -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.1.2.1
retrieving revision 1.1.2.2
diff -Lsrc/import-export/hbci/gnc-hbci-getbalance.h -Lsrc/import-export/hbci/gnc-hbci-getbalance.h -u -r1.1.2.1 -r1.1.2.2
--- 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 <openhbci/outboxaccjobs.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_OutboxJobGetBalance *balance_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.5.2.1
retrieving revision 1.5.2.2
diff -Lsrc/import-export/hbci/gnc-hbci-kvp.h -Lsrc/import-export/hbci/gnc-hbci-kvp.h -u -r1.5.2.1 -r1.5.2.2
--- src/import-export/hbci/gnc-hbci-kvp.h
+++ src/import-export/hbci/gnc-hbci-kvp.h
@@ -52,6 +52,14 @@
  * will be marked as "dirty". */
 void gnc_hbci_set_account_countrycode (Account *a, gint code);
 
+/** 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);
 /** Set the time of last online transaction retrieval. The account
@@ -75,6 +83,14 @@
 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 */
 
 /* internal getter for kvp frame in book */
Index: hbci-interaction.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interaction.h,v
retrieving revision 1.6.2.2
retrieving revision 1.6.2.3
diff -Lsrc/import-export/hbci/hbci-interaction.h -Lsrc/import-export/hbci/hbci-interaction.h -u -r1.6.2.2 -r1.6.2.3
--- 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 <openhbci/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);
@@ -39,6 +39,8 @@
 void GNCInteractor_erasePIN(GNCInteractor *i);
 void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent);
 void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value);
+GtkWidget *GNCInteractor_parent(GNCInteractor *i);
+void GNCInteractor_add_log_text (GNCInteractor *i, const char *msg);
 
 
 #endif
Index: dialog-pass.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-pass.h,v
retrieving revision 1.2
retrieving revision 1.2.2.1
diff -Lsrc/import-export/hbci/dialog-pass.h -Lsrc/import-export/hbci/dialog-pass.h -u -r1.2 -r1.2.2.1
--- src/import-export/hbci/dialog-pass.h
+++ src/import-export/hbci/dialog-pass.h
@@ -27,11 +27,14 @@
 
 gboolean
 gnc_hbci_get_password (GtkWidget *parent,
+		       const char *windowtitle,
 		       const char *heading,
 		       const char *initial_password,
-		       char **password);
+		       char **password,
+		       gboolean hide_input);
 gboolean
 gnc_hbci_get_initial_password (GtkWidget *parent,
+			       const char *windowtitle,
 			       const char *heading,
 			       char **password);
 
Index: hbci-interactionP.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-interactionP.h,v
retrieving revision 1.4.2.2
retrieving revision 1.4.2.3
diff -Lsrc/import-export/hbci/hbci-interactionP.h -Lsrc/import-export/hbci/hbci-interactionP.h -u -r1.4.2.2 -r1.4.2.3
--- src/import-export/hbci/hbci-interactionP.h
+++ src/import-export/hbci/hbci-interactionP.h
@@ -24,9 +24,9 @@
 #ifndef HBCI_INTERACTIONP_H
 #define HBCI_INTERACTIONP_H
 
-#include <openhbci/interactor.h>
-#include <openhbci/progressmonitor.h>
+#include <aqbanking/banking.h>
 #include <gnome.h>
+#include <iconv.h>
 
 
 typedef enum {
@@ -46,6 +46,8 @@
   GtkWidget *job_entry;
   GtkWidget *action_entry;
   GtkWidget *action_progress;
+  /* Counters for progress bar */
+  double action_max;
 
   /* Log window */
   GtkWidget *log_text;
@@ -58,39 +60,37 @@
   const char *format_pin_user_bank;
   const char *format_pin_min_char;
 
-  /* PinKeypad dialog, if used */
-  GtkWidget *pin_keypad_dialog;
-  
+  /* The iconv handler for utf8 -> latin1 conversion */
+  iconv_t gnc_iconv_handler;
+
   /* Flags to keep track on whether an HBCI action is running or
      not. */
   gboolean keepAlive;
   PMon_state state;
 
-  /* Counters for progress bar */
-  int jobs;
-  int current_job;
-  int actions;
-  int current_act;
-
   /* Flag on Whether the PIN should be cached. */
   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;
-};
 
-void delete_GNCInteractor (GNCInteractor *data);
-
-HBCI_ProgressMonitor *
-gnc_hbci_new_pmonitor(GNCInteractor *data);
+  /* Dialogs */
+  int showbox_id;
+  GHashTable *showbox_hash; 
+  GtkWidget *showbox_last;
 
-HBCI_Interactor *
-gnc_hbci_new_interactor(GNCInteractor *data);
+};
 
-void add_log_text (GNCInteractor *data, const char *msg);
+void delete_GNCInteractor (GNCInteractor *data);
 
+void
+gnc_hbci_add_callbacks(AB_BANKING *ba, GNCInteractor *data);
 
+/* Performs the full conversion from the (aaarg) utf8-combi-texts
+   passed from aqbanking into a "latin1-normal-text" format for
+   us. The returned string is owned by the caller. */
+gchar *gnc_hbci_utf8ToLatin1(GNCInteractor *data, const char *utf);
 
 #endif
Index: gnc-hbci-gettrans.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-gettrans.c,v
retrieving revision 1.20.2.3
retrieving revision 1.20.2.4
diff -Lsrc/import-export/hbci/gnc-hbci-gettrans.c -Lsrc/import-export/hbci/gnc-hbci-gettrans.c -u -r1.20.2.3 -r1.20.2.4
--- 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 <openhbci/api.h>
-
 #include "gnc-ui.h"
 #include "gnc-numeric.h"
 #include "date.h"
@@ -46,9 +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 (const HBCI_Transaction *trans, void *user_data);
+static AB_TRANSACTION *trans_list_cb(AB_TRANSACTION *reportn, void *user_data);
 
 struct trans_list_data 
 {
@@ -60,71 +58,60 @@
 void
 gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc)
 {
-  HBCI_API *api = NULL;
-  const HBCI_Account *h_acc = NULL;
+  AB_BANKING *api = NULL;
+  const AB_ACCOUNT *h_acc = NULL;
   GNCInteractor *interactor = NULL;
-  const HBCI_Customer *customer = NULL;
   
   g_assert(parent);
   g_assert(gnc_acc);
 
   /* Get the api */
-  api = gnc_hbci_api_new_currentbook (parent, &interactor);
+  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);
 
-  /* 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",
-     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_OutboxJobGetTransactions *trans_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 */
-    trans_job = 
-      HBCI_OutboxJobGetTransactions_new (customer, 
-					 (HBCI_Account *)h_acc,
-					 from_date,
-					 to_date);
-    HBCI_Date_delete (from_date);
-    HBCI_Date_delete (to_date);
-    job = HBCI_OutboxJobGetTransactions_OutboxJob (trans_job);
-    g_assert (job);
+    job = AB_JobGetTransactions_new((AB_ACCOUNT*)h_acc);
+    if (AB_Job_CheckAvailability(job)) {
+      printf("gnc_hbci_gettrans: Oops, job not available. Aborting.\n");
+      /* FIXME: free unneeded data */
+      return;
+    }
+    AB_JobGetTransactions_SetFromTime(job, from_date);
+    AB_JobGetTransactions_SetToTime(job, to_date);
 
-    /* Add job to HBCI_API queue. */
-    HBCI_API_addJob (api, job);
+    /* Add job to AB_BANKING queue. */
+    AB_Banking_EnqueueJob(api, job);
 
     /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (parent, api, job, interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      HBCI_API_clearQueueByStatus (api, HBCI_JOB_STATUS_NONE);
+    if (!gnc_AB_BANKING_execute (parent, api, job, interactor)) {
+      /* AB_BANKING_executeOutbox failed. */
+      AB_Banking_DequeueJob(api, job);
+      AB_Banking_DelFinishedJob(api, job);
+      AB_Banking_DelPendingJob(api, job);
       return;
     }
 
@@ -132,11 +119,13 @@
     gnc_hbci_set_account_trans_retrieval (gnc_acc, until_timespec);
 
     /* Now finish the job duties. */
-    gnc_hbci_gettrans_final(parent, gnc_acc, trans_job, FALSE);
+    gnc_hbci_gettrans_final(parent, gnc_acc, job, FALSE);
 
     /* Clean up behind ourself. */
-    HBCI_API_clearQueueByStatus (api, HBCI_JOB_STATUS_NONE);
-    gnc_hbci_api_save (api);
+    AB_Banking_DequeueJob(api, job);
+    AB_Banking_DelFinishedJob(api, job);
+    AB_Banking_DelPendingJob(api, job);
+    gnc_AB_BANKING_fini (api);
     GNCInteractor_hide (interactor);
   }
 }
@@ -148,11 +137,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;
 
@@ -178,19 +166,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;
 }
@@ -201,17 +187,23 @@
 gboolean
 gnc_hbci_gettrans_final(GtkWidget *parent, 
 			Account *gnc_acc, 
-			const HBCI_OutboxJobGetTransactions *trans_job,
+			const AB_JOB *trans_job,
 			gboolean run_until_done)
 {
   /* Now add the retrieved transactions to the gnucash account. */
-  const list_HBCI_Transaction *trans_list;
-      
-  trans_list = HBCI_OutboxJobGetTransactions_transactions (trans_job);
-  /*printf("gnc_hbci_gettrans: Got %d transactions.\n", 
-    list_HBCI_Transaction_size(trans_list));*/
+  AB_TRANSACTION_LIST2 *trans_list;
 
-  if (list_HBCI_Transaction_size(trans_list) > 0) {
+  trans_list = AB_JobGetTransactions_GetTransactions(trans_job);
+  if (!trans_list) {
+    printf("gnc_hbci_gettrans_final: No transactions section. Response was:\n");
+
+    gnome_ok_dialog_parented 
+      (_("The HBCI import returned no transactions for the selected time period."),
+       GTK_WINDOW (parent));
+    return TRUE;
+  }
+  
+  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);
@@ -219,7 +211,7 @@
     data.importer_generic = importer_generic_gui;
     data.gnc_acc = gnc_acc;
 	
-    list_HBCI_Transaction_foreach (trans_list, trans_list_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);
@@ -235,26 +227,28 @@
 }
 
 
-
-/* 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 (const HBCI_Transaction *h_trans, 
-			    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)
 {
-  time_t current_time, tt1, tt2; 
+  time_t current_time;
+  /* time_t tt1, tt2; */
   /*struct tm tm1, tm2;*/
   Account *gnc_acc;
   GNCBook *book;
   Transaction *gnc_trans;
+  const GWEN_TIME *valutaDate, *normalDate;
   Split *split;
   struct trans_list_data *data = user_data;
   g_assert(data);
-  g_assert(h_trans);
+
+  if (!h_trans) return NULL;
 
   gnc_acc = data->gnc_acc;
   g_assert(gnc_acc);
-  
   book = xaccAccountGetBook(gnc_acc);
+
+  /* Create new gnucash transaction for the given hbci one */
   gnc_trans = xaccMallocTransaction(book);
   xaccTransBeginEdit(gnc_trans);
 
@@ -262,32 +256,37 @@
     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));
+  normalDate = AB_Transaction_GetDate(h_trans);
+  valutaDate = AB_Transaction_GetValutaDate(h_trans);
+  if (normalDate && !valutaDate)
+    valutaDate = normalDate;
+  /* Watch out -- any of the GWEN_TIME may be NULL */
+  /*   tt1 = GWEN_Time_toTime_t (normalDate); */
+  /*   tt2 = GWEN_Time_toTime_t (valutaDate); */
   /*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));*/
   
   
   /* Date / Time */
-  xaccTransSetDateSecs
-    (gnc_trans, HBCI_Date_to_time_t (HBCI_Transaction_valutaDate (h_trans)));
-
+  if (valutaDate)
+    xaccTransSetDateSecs
+      (gnc_trans, GWEN_Time_toTime_t (valutaDate));
+  else
+    printf("trans_list_cb: Oops, date 'valutaDate' was NULL.\n");
+    
   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));
-
+    
   {
     /* Number. We use the "customer reference", if there is one. */
-    const char *custref = HBCI_Transaction_customerReference (h_trans);
+    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);
@@ -298,21 +297,24 @@
   /* 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 */
+    const AB_VALUE *h_value = AB_Transaction_GetValue (h_trans);
     gnc_numeric gnc_amount = double_to_gnc_numeric
-      (HBCI_Value_getValue (HBCI_Transaction_value (h_trans)),
+      (h_value ? AB_Value_GetValue (h_value) : 0.0,
        xaccAccountGetCommoditySCU(gnc_acc),
        GNC_RND_ROUND);
+    if (!h_value)
+      printf("trans_list_cb: Oops, value was NULL. Using 0.\n");
     xaccSplitSetBaseValue(split, gnc_amount, xaccAccountGetCommodity(gnc_acc));
   }
-
+    
   /* Memo in the Split. */
   {
     char *g_memo = gnc_hbci_memo_tognc (h_trans);
@@ -325,4 +327,5 @@
   gnc_gen_trans_list_add_trans (data->importer_generic, gnc_trans);
 
   return NULL;
+  
 }
Index: gnc-hbci-actions.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-actions.c,v
retrieving revision 1.10
retrieving revision 1.10.2.1
diff -Lsrc/import-export/hbci/gnc-hbci-actions.c -Lsrc/import-export/hbci/gnc-hbci-actions.c -u -r1.10 -r1.10.2.1
--- src/import-export/hbci/gnc-hbci-actions.c
+++ src/import-export/hbci/gnc-hbci-actions.c
@@ -22,8 +22,8 @@
 
 #include "gnc-hbci-actions.h"
 
-#include <openhbci/api.h>
-#include <openhbci/outboxaccjobs.h>
+#include <openhbci2/api.h>
+#include <openhbci2/outboxaccjobs.h>
 
 /* File intentionally left blank. */
 
Index: gnc-hbci-transfer.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-transfer.h,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -Lsrc/import-export/hbci/gnc-hbci-transfer.h -Lsrc/import-export/hbci/gnc-hbci-transfer.h -u -r1.1.2.2 -r1.1.2.3
--- 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 <openhbci/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.26.2.10
retrieving revision 1.26.2.11
diff -Lsrc/import-export/hbci/druid-hbci-initial.c -Lsrc/import-export/hbci/druid-hbci-initial.c -u -r1.26.2.10 -r1.26.2.11
--- src/import-export/hbci/druid-hbci-initial.c
+++ src/import-export/hbci/druid-hbci-initial.c
@@ -25,12 +25,13 @@
 #include <gnome.h>
 #include <sys/stat.h>
 #include <sys/types.h>
+#include <sys/wait.h>
 #include <unistd.h>
 
 #include "druid-hbci-initial.h"
 #include "druid-hbci-utils.h"
 #include "gnc-hbci-kvp.h"
-#include "dialog-account-pick.h"
+#include "import-account-matcher.h"
 #include "gnc-hbci-utils.h"
 
 #include "dialog-utils.h"
@@ -38,21 +39,15 @@
 #include "gnc-ui-util.h"
 #include "gnc-ui.h"
 #include "gnc-html.h"
+#include "gnc-component-manager.h"
 
-#include <openhbci/api.h>
-#include <openhbci/outboxjobs.h>
-#include <openhbci/outboxjobkeys.h>
-#include <openhbci/mediumrdhbase.h>
+#include <aqbanking/banking.h>
 
-#include <openhbci.h>
+/* #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;
@@ -64,54 +59,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;
+  AB_BANKING *api;
   GNCInteractor *interactor;
 
   /* account match: row_number (int) -> hbci_account */
@@ -122,14 +76,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
@@ -151,17 +97,12 @@
 reset_initial_info (HBCIInitialInfo *info)
 {
   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;
-  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)
@@ -176,18 +117,39 @@
 
   reset_initial_info (info);
   
+  if (info->interactor)
+    GNCInteractor_delete(info->interactor);
+
   if (info->window != NULL) 
     gtk_widget_destroy (info->window);
-    
+
   g_free (info);
 }
 
 
+static gchar *gnc_hbci_account_longname(const AB_ACCOUNT *hacc)
+{
+  g_assert(hacc);
+  const char *bankname = AB_Account_GetBankName (hacc);
+  const char *bankcode = AB_Account_GetBankCode (hacc);
+  /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
+  if (bankname)
+    return g_strdup_printf(_("%s at %s (code %s)"),
+			   AB_Account_GetAccountNumber (hacc),
+			   bankname,
+			   bankcode);
+  else
+    return g_strdup_printf(_("%s at bank code %s"),
+			   AB_Account_GetAccountNumber (hacc),
+			   bankcode);
+}
+
+
 /*******************************************************************
  * update_accountlist widget
  */
-static gpointer
-update_accountlist_acc_cb (const 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];
@@ -199,12 +161,7 @@
   g_assert(info);
   row_text[2] = "";
   
-  row_text[0] = 
-    /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
-    g_strdup_printf(_("%s at %s (code %s)"),
-		    HBCI_Account_accountId (hacc),
-		    HBCI_Bank_name (HBCI_Account_bank (hacc)),
-		    HBCI_Bank_bankCode (HBCI_Account_bank (hacc)));
+  row_text[0] = gnc_hbci_account_longname(hacc);
 		
   /* Get corresponding gnucash account */
   gacc = g_hash_table_lookup (info->gnc_hash, hacc);
@@ -226,36 +183,24 @@
   /* 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, (HBCI_Account*)hacc);
+  g_hash_table_insert (info->hbci_hash, row_key, (AB_ACCOUNT*)hacc);
 
   return NULL;
 }
-static gpointer
-update_accountlist_bank_cb (const HBCI_Bank *bank, gpointer user_data)
-{
-  g_assert(bank);
-
-  return list_HBCI_Account_foreach (HBCI_Bank_accounts (bank),
-				    &update_accountlist_acc_cb,
-				    user_data);
-}
 
 /* Update the account list GtkCList widget */
 static void
 update_accountlist (HBCIInitialInfo *info)
 {
-  const list_HBCI_Bank *banklist;
   int sel_row = 0;
+  AB_BANKING *banking;
+  AB_ACCOUNT_LIST2 *acclist;
 
   g_assert(info);
-  g_assert(info->api);
+  banking = info->api;
+  g_assert(banking);
   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;
 
@@ -268,13 +213,17 @@
   info->hbci_hash = g_hash_table_new (&g_int_hash, &g_int_equal);
   g_hash_table_freeze (info->hbci_hash);
   
-  /* Go through all HBCI banks */
-  list_HBCI_Bank_foreach (banklist, 
-			  &update_accountlist_bank_cb,
-			  info);
+  /* Go through all HBCI accounts */
+  acclist = AB_Banking_GetAccounts(banking);
+  if (acclist)
+    AB_Account_List2_ForEach (acclist,
+			      update_accountlist_acc_cb,
+			      info);
+  else
+    printf("update_accountlist: Oops, account list from AB_Banking is NULL.\n");
 
-  /*printf("HBCI hash has %d entries.\n", g_hash_table_size(info->hbci_hash));*/
-  /*printf("GNC hash has %d entries.\n", g_hash_table_size(info->gnc_hash));*/
+  // 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));
   
   g_hash_table_thaw (info->hbci_hash);
   gtk_clist_thaw (GTK_CLIST (info->accountlist));
@@ -308,273 +257,30 @@
  * 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
+/*************************************************************
+ * GUI callbacks
  */
-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)
-{
-  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) 
-	{
-	  /*fprintf (stderr, "Setting new HBCI version %d\n", newversion); */
-	  HBCI_Bank_setHbciVersion (bank, newversion);
-	  HBCI_Bank_setBPDVersion (bank, 0);
-	  gtk_widget_destroy (dialog);
-	  gnome_ok_dialog_parented 
-	    (_("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)
+static gboolean banking_has_accounts(AB_BANKING *banking)
 {
-  if(!data) return;
-  if(!string) {
-    *(char **)data = NULL;
-  }
-  else {
-    *(char **)data = g_strdup(string);
-  }
+  AB_ACCOUNT_LIST2 *accl;
+  gboolean result;
+  g_assert(banking);
+
+  accl = AB_Banking_GetAccounts(banking);
+  
+  if (accl && (AB_Account_List2_GetSize(accl) > 0))
+    result = TRUE;
+  else
+    result = FALSE;
+
+  if (accl)
+    AB_Account_List2_free(accl);
+  return result;
 }
-static void gnc_hbci_addaccount(HBCIInitialInfo *info, 
-				const HBCI_Customer *cust)
-{
-  HBCI_Bank *bank;
-  const HBCI_User *user;
-  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 \nat 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)) {
-    
-    /* Check if such an account already exists */
-    if ( HBCI_Bank_findAccount (bank, accnr) )
-      {
-	/* Yes, then don't create it again */
-	gnc_error_dialog_parented
-	  (GTK_WINDOW (info->window),
-	   _("An account with this account id at this bank already exists."));
-      }
-    else
-      {
-	/* No, then create it now */
-	acc = HBCI_API_accountFactory(bank, accnr, "");
-	/* Add it to the bank, and the bank will also own the newly
-	   created object. */
-	HBCI_Bank_addAccount(bank, acc, TRUE);
-	/* and add the given customer as first authorized
-	   customer. This needs more work in case there are different
-	   customers here.  */
-	HBCI_Account_addAuthorizedCustomer(acc, cust);
-
-	/* 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);
-}
-/* -------------------------------------- */
-
-
-/*************************************************************
- * GUI callbacks
- */
 
 
 static void
@@ -582,7 +288,10 @@
 	   gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
-  
+
+  /* FIXME: Need to choose a fixed ending procedure here */
+  /* probably not saving because of 'cancel', but for now we save too */
+  gnc_AB_BANKING_fini (info->api);
   delete_initial_druid(info);
 }
 
@@ -592,492 +301,33 @@
 	   gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
+  gboolean successful = TRUE;
   g_assert (info);
 
-
-  if (info->configfile) {
-    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);
-  }
-  
-  {
-    HBCI_Error *err;
-    err = gnc_hbci_api_save (info->api);
-    if (err != NULL) {
-      if (!HBCI_Error_isOk (err)) 
-	printf("on_finish: Error at saving OpenHBCI data: %s.\n",
-	       HBCI_Error_message (err));
-      HBCI_Error_delete (err);
-    }
-  }
-  
-  if (info->gnc_hash)
+  if (successful && info->gnc_hash)
     accounts_save_kvp (info->gnc_hash);
   
+  gnc_AB_BANKING_fini (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));
-    }
-    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));
-
-    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);
-    }
-
-
-  /* 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 (HBCI_API_totalAccounts(api) == 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;
-      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;
-}
-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,
-				       HBCI_Bank_countryCode (bank),
-				       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);
-    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 ? customername : 
-	   /* 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. */
-				       _("Default Customer"));
-      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;
-  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;
+  AB_BANKING *banking = info->api;
+  g_assert(banking);
 
-  {
-    /* Execute a Synchronize job, then a GetAccounts job. */
-    HBCI_OutboxJob *job;
-
-    job = HBCI_OutboxJobGetSystemId_OutboxJob 
-      (HBCI_OutboxJobGetSystemId_new (info->api,
-				      (HBCI_Customer *)info->newcustomer));
-    HBCI_API_addJob (info->api, job);
-
-    /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (info->window, info->api, 
-			       job, info->interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      /*return FALSE;*/
-      /* -- it seems to be no problem if this fails ?! */
-    }
-
-    /* Now the GetAccounts job. */
-    job = HBCI_OutboxJobGetAccounts_OutboxJob 
-      (HBCI_OutboxJobGetAccounts_new ((HBCI_Customer *)info->newcustomer));
-    HBCI_API_addJob (info->api, job);
-
-    /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (info->window, info->api, 
-			       job, info->interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      return FALSE;
-    }
-
-    HBCI_API_clearQueueByStatus (info->api, HBCI_JOB_STATUS_NONE);
-  }
-  
-  return FALSE;
+  if (banking_has_accounts(banking))
+    druid_enable_next_button(info);
+  else
+    druid_disable_next_button(info);
 }
 
 
-
-
 static gboolean 
 on_accountlist_back (GnomeDruidPage  *gnomedruidpage,
 		     gpointer         arg1,
@@ -1103,6 +353,10 @@
 			gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
+  
+  /* Make sure the api reads in the current data */
+  AB_Banking_Fini (info->api);
+  AB_Banking_Init (info->api);
 
   if (info->gnc_hash == NULL)
     info->gnc_hash = gnc_hbci_new_hash_from_kvp (info->api);
@@ -1113,20 +367,37 @@
   update_accountlist(info);
 }
 
+
 static void
 on_accountlist_select_row (GtkCList *clist, gint row,
 			   gint column, GdkEvent *event,
 			   gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
-  HBCI_Account *hbci_acc;
+  AB_ACCOUNT *hbci_acc;
   Account *gnc_acc, *old_value;
+  gchar *longname;
+  gnc_commodity *currency = NULL;
   
   hbci_acc = g_hash_table_lookup (info->hbci_hash, &row);
   if (hbci_acc) {
     old_value = g_hash_table_lookup (info->gnc_hash, hbci_acc);
 
-    gnc_acc = gnc_account_picker_dialog(old_value);
+    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, AB_Account_GetCurrency (hbci_acc));
+    }
+
+    gnc_acc = gnc_import_select_account(NULL, TRUE, longname, currency, BANK,
+					old_value, NULL);
+    g_free(longname);
 
     if (gnc_acc) {
       if (old_value) 
@@ -1144,285 +415,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;
-  g_assert(info);
-
-  if (info->newcustomer == NULL) 
-    return FALSE;
-
-  if (info->gotkeysforCustomer == NULL) {
-    /* Execute a GetKey job. */
-    HBCI_OutboxJob *job;
-    
-    job = HBCI_OutboxJobGetKeys_OutboxJob 
-      (HBCI_OutboxJobGetKeys_new (info->api, info->newcustomer));
-    HBCI_API_addJob (info->api, job);
-
-    /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (info->window, info->api, 
-			       job, info->interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      return FALSE;
-    }
-
-    HBCI_API_clearQueueByStatus (info->api, HBCI_JOB_STATUS_NONE);
-    info->gotkeysforCustomer = info->newcustomer;
-
-  }
-  else if (info->gotkeysforCustomer != info->newcustomer) {
-    printf("on_iniletter_info_next: Oops, already got keys for another customer. Not yet implemented.\n");
-    return TRUE;
-  }
-
-  /* Create Ini-Letter */
-  {
-    char *res;
-    const HBCI_Medium *med;
-    const HBCI_MediumRDHBase *medr;
-    const HBCI_Bank *bank;
-    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);
-
-    bank = HBCI_User_bank (HBCI_Customer_user 
-			   ((HBCI_Customer *)info->newcustomer));
-    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 (HBCI_Customer_user
-			    ((HBCI_Customer *)info->newcustomer));
-    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));
-    
-    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_OutboxJobSendKeys_OutboxJob 
-      (HBCI_OutboxJobSendKeys_new (info->api, info->newcustomer));
-    HBCI_API_addJob (info->api, job);
-
-    /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (info->window, info->api, 
-			       job, info->interactor)) {
-      /* HBCI_API_executeOutbox failed. */
-      return FALSE;
-    }
-
-    HBCI_API_clearQueueByStatus (info->api, 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_userName (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));
-
-  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
@@ -1432,59 +424,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))))
-      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_parented(GTK_WINDOW (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);
@@ -1492,6 +440,90 @@
 }
 
 
+static void
+on_aqhbci_button (GtkButton *button,
+		  gpointer user_data)
+{
+  HBCIInitialInfo *info = user_data;
+  GWEN_BUFFER *buf;
+  int res;
+  const char *backend_name = "aqhbci";
+  const char *wizard_name = "kde_wizard";
+  AB_BANKING *banking = info->api;
+  g_assert(info->druid);
+
+  buf = GWEN_Buffer_new(NULL, 200, 0, 0);
+  AB_Banking_GetWizardPath(banking, backend_name, buf);
+
+  GWEN_Buffer_AppendString(buf, "/");
+  GWEN_Buffer_AppendString(buf, wizard_name);
+  /* {
+    GWEN_PLUGIN_DESCRIPTION_LIST2 *l = 
+      AB_Banking_GetWizardDescrs(banking, backend_name);
+    const GWEN_PLUGIN_DESCRIPTION *x = GWEN_PluginDescription_List2_GetFront(l);
+    // There needs to be a way to find the name here. Currently this doesnt work yet.
+    wizard_name = GWEN_PluginDescription_GetName(x);
+    GWEN_Buffer_AppendString(buf, wizard_name);
+    GWEN_PluginDescription_List2_freeAll(l);
+    } */
+
+  druid_disable_next_button(info);
+  AB_Banking_DeactivateProvider(banking, backend_name);
+  if (strlen(GWEN_Buffer_GetStart(buf)) > 0) {
+    const char *path = GWEN_Buffer_GetStart(buf);
+    int wait_status;
+    int wait_result = 0;
+
+    /* Call the kde wizard */
+    /* res = system(path); */
+    /* In gtk2, this would be g_spawn_async or similar. */
+    AB_Banking_Fini (info->api);
+    {
+      pid_t pid;
+      pid = fork();
+      switch (pid) {
+      case -1:
+	printf("Fork call failed. Cannot start AqHBCI setup wizard.");
+	res = -1;
+	AB_Banking_Init (info->api);
+	break;
+      case 0: /* child */
+	execl(path, path, NULL);
+	printf("Fork call failed. Cannot start AqHBCI setup wizard.");
+	_exit(0);
+      default: /* parent */
+	res = 0;
+	while (wait_result == 0) {
+	  gtk_main_iteration();
+	  wait_result = waitpid(pid, &wait_status, WNOHANG);
+	  if ((wait_result == pid) && WIFEXITED(wait_status))
+	    res = WEXITSTATUS(wait_status);
+	  else
+	    res = -8;
+	}
+	AB_Banking_Init (info->api);
+      }
+    }
+
+    if (res == 0) {
+      res = AB_Banking_ActivateProvider(banking, backend_name);
+      if (res == 0)
+	druid_enable_next_button(info);
+      else {
+	printf("on_aqhbci_button: Oops, after successful aqhbci wizard the activation return nonzero value: %d. \n", res);
+	druid_disable_next_button(info);
+      }
+    }
+    else {
+      printf("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, path);
+      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);
+}
 
 
 
@@ -1504,7 +536,7 @@
   GtkWidget *page;
   
   info = g_new0 (HBCIInitialInfo, 1);
-  
+
   xml = gnc_glade_xml_new ("hbci.glade", "HBCI Init Druid");
 
   info->window = glade_xml_get_widget (xml, "HBCI Init Druid");
@@ -1517,92 +549,19 @@
   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));
+  g_assert(info->api);
+
   {
     /* 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");
@@ -1611,88 +570,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: hbci-progressmon.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/hbci-progressmon.c,v
retrieving revision 1.10.2.6
retrieving revision 1.10.2.7
diff -Lsrc/import-export/hbci/hbci-progressmon.c -Lsrc/import-export/hbci/hbci-progressmon.c -u -r1.10.2.6 -r1.10.2.7
--- src/import-export/hbci/hbci-progressmon.c
+++ src/import-export/hbci/hbci-progressmon.c
@@ -26,370 +26,12 @@
 #include "hbci-interaction.h"
 #include "hbci-interactionP.h"
 
-#include <openhbci/interactorcb.h>
-#include <openhbci/progressmonitorcb.h>
-#include <openhbci.h>
+#include <openhbci2/interactorcb.h>
+#include <openhbci2.h>
 #include "dialog-utils.h"
 #include "druid-utils.h"
 #include "gnc-ui-util.h"
 #include "gnc-ui.h"
 #include "global-options.h"
 
-int debug_pmonitor = FALSE;
-
-
-static void GNCInteractor_setRunning (GNCInteractor *data)
-{
-  g_assert(data);
-  data->state = RUNNING;
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), TRUE);
-  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), FALSE);
-}
-static void GNCInteractor_setFinished (GNCInteractor *data)
-{
-  g_assert(data);
-  data->state = FINISHED;
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
-  if (gtk_toggle_button_get_active
-      (GTK_TOGGLE_BUTTON (data->close_checkbutton)))
-    GNCInteractor_hide (data);
-}
-static void GNCInteractor_setAborted (GNCInteractor *data)
-{
-  g_assert(data);
-  data->state = ABORTED;
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
-  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
-  data->keepAlive = FALSE;
-}
-
-
-/*******************************************************************
- * now the callbacks
- */
-static void transStarted (TransProgressType type,
-			  int jobs, void *user_data)
-{
-  GNCInteractor *data = user_data;
-  g_assert(data);
-  
-  GNCInteractor_setRunning (data);
-
-  /*printf("Executing %d jobs.\n",jobs);*/
-  data->jobs = jobs;
-  data->current_job = 0;
-
-  gtk_entry_set_text (GTK_ENTRY (data->job_entry), "");
-  gtk_entry_set_text (GTK_ENTRY (data->action_entry), "");
-  gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 0.0);
-  if (debug_pmonitor)
-    printf("transStarted-cb: current_job %d, jobs %d, current_act %d, actions %d.\n", 
-	   data->current_job, data->jobs, data->current_act, data->actions);
-
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-}
-static void transFinished (void *user_data)
-{
-  GNCInteractor *data = user_data;
-  g_assert(data);
-  GNCInteractor_setFinished (data);
-  gtk_entry_set_text (GTK_ENTRY (data->job_entry), _("Finished"));
-  gtk_entry_set_text (GTK_ENTRY (data->action_entry), _("Finished"));
-  gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 1.0);
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-  if (debug_pmonitor)
-    printf("transFinished-cb: current_job %d, jobs %d, current_act %d, actions %d.\n", 
-	   data->current_job, data->jobs, data->current_act, data->actions);
-}
-static void jobStarted(JobProgressType type, int actions, void *user_data)
-{
-  GNCInteractor *data = user_data;
-  const char *msg = NULL;
-  g_assert(data);
-    
-  switch(type){
-  case JOB_OPENINGDIALOG:
-    /* 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. */
-    msg = _("Opening Dialog");
-    break;
-  case JOB_CLOSINGDIALOG:
-    msg = _("Closing Dialog");
-    break;
-    /** Opening network connection. */
-  case    JOB_OPENINGNETWORK:
-    msg = _("Opening Network Connection");
-    break;
-    /** Closing network connection. */
-  case    JOB_CLOSINGNETWORK:
-    msg = _("Closing Network Connection");
-    break;
-    /** Get balance */
-  case    JOB_GET_BALANCE:
-    /* Translate those with keeping the leading "Job:", but of course
-       using a translation for "Job". */
-    msg = _("Job: Get Balance");
-    break;
-    /** Get transaction statement */
-  case    JOB_GET_TRANS:
-    msg = _("Job: Get Transactions");
-    break;
-    /** Transfer money */
-  case    JOB_NEW_TRANSFER:
-    msg = _("Job: New Transfer");
-    break;
-    /** Debit note */
-  case    JOB_DEBIT_NOTE:
-    msg = _("Job: Debit Note");
-    break;
-    /** Get standing orders */
-  case    JOB_GET_STO:
-    msg = _("Job: Get Standing Orders");
-    break;
-    /** Create a new standing order */
-  case    JOB_NEW_STO:
-    msg = _("Job: New Standing Order");
-    break;
-    /** Delete a standing order */
-  case    JOB_DELETE_STO:
-    msg = _("Job: Delete Standing Order");
-    break;
-    /** Get account list */
-  case    JOB_GET_ACCOUNTS:
-    msg = _("Job: Retrieve Account List");
-    break;
-    /** Get SystemId */
-  case    JOB_GET_SYSTEMID:
-    msg = _("Job: Get System ID");
-    break;
-    /** Get keys */
-  case    JOB_GET_KEYS:
-    msg = _("Job: Get Keys");
-    break;
-    /** Send keys */
-  case    JOB_SEND_KEYS:
-    msg = _("Job: Send Keys");
-    break;
-    /** Disable keys */
-  case JOB_DISABLE_KEYS:
-    msg = _("Job: Disable Keys");
-    break;
-    /** Change keys */
-  case JOB_CHANGE_KEYS:
-    msg = _("Job: Change Keys");
-    break;
-    /** Change keys */
-  case JOB_GET_STATUS:
-    msg = _("Job: Get Status Reports");
-    break;
-#if 0
-  default:
-    msg = _("Unknown");
-#endif 
-  }
-  g_assert(msg);
-    
-  /*printf("Jobstart (w/ %d actions): %s\n",actions, msg);*/
-  data->actions = actions;
-  data->current_act = 0;
-  gtk_entry_set_text (GTK_ENTRY (data->job_entry), msg);
-  gtk_entry_set_text (GTK_ENTRY (data->action_entry), "");
-  gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 0.0);
-  if (debug_pmonitor)
-    printf("jobStarted-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);
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-}
-static void jobFinished (void *user_data)
-{
-  GNCInteractor *data = user_data;
-  g_assert(data);
-  data->current_job++;
-  gtk_entry_set_text (GTK_ENTRY (data->job_entry), _("Done"));
-  /*gtk_entry_set_text (GTK_ENTRY (data->action_entry), _("Done"));
-    GNCInteractor_setFinished (data);
-    gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 1.0);*/
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-  if (debug_pmonitor)
-    printf("jobFinished-cb: current_job %d, jobs %d, current_act %d, actions %d.\n", 
-	   data->current_job, data->jobs, data->current_act, data->actions);
-}
-
-static void actStarted (ActionProgressType type, void *user_data)
-{
-  GNCInteractor *data = user_data;
-  const char *msg = NULL;
-  g_assert(data);
-  switch (type) {
-    /** Sending message. */
-  case ACT_SENDINGMESSAGE:
-    msg = _("Sending message");
-    break;
-    /** Waiting for response. */
-  case ACT_WAITRESPONSE:
-    msg = _("Waiting for response");
-    break;
-    /** Creating HBCI job. Number of Job will follow in string argument. */
-  case ACT_CREATEHBCIJOB:
-    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;
-  }
-  
-  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);
-}
-static void actFinished (void *user_data)
-{
-  GNCInteractor *data = user_data;
-  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), 
-			       (data->current_act < data->actions) ?
-			       ((float) data->current_act / 
-				(float) data->actions) : 
-			       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);
-  }
-  
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-}
-static void logMsg (const char *msg, void *user_data)
-{
-  /* Note: this isn't used anyway. */
-  GNCInteractor *data = user_data;
-  g_assert(data);
-  
-  printf("logMsg: Logging msg: %s\n", msg);
-  add_log_text (data, msg);
-			    
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-}
-
-void add_log_text (GNCInteractor *data, const char *msg)
-{
-  int pos;
-  g_assert(data);
-  
-  pos = gtk_text_get_length (GTK_TEXT (data->log_text));
-  gtk_editable_insert_text (GTK_EDITABLE (data->log_text),
-			    msg, strlen (msg),
-			    &pos);
-  gtk_editable_insert_text (GTK_EDITABLE (data->log_text),
-			    "\n", 1,
-			    &pos);
-}
-
-static void destr(void *user_data) 
-{
-  GNCInteractor *data = user_data;
-
-  GNCInteractor_delete (data);
-}
-static void
-on_button_clicked (GtkButton *button,
-		   gpointer user_data)
-{
-  GNCInteractor *data = user_data;
-  char *name;
-  g_assert(data);
-  
-  name = gtk_widget_get_name (GTK_WIDGET (button));
-  if (strcmp (name, "abort_button") == 0) {
-    GNCInteractor_setAborted(data);
-  } else if (strcmp (name, "close_button") == 0) {
-    if (data->state != RUNNING) {
-      gtk_widget_hide_all (data->dialog); 
-      /*data->dont_hide = FALSE;*/
-      /*GNCInteractor_hide (data);*/
-    }
-  } else {
-    printf("on_button_clicked: Oops, unknown button: %s\n",
-	   name);
-  }
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
-}
-
-HBCI_ProgressMonitor *
-gnc_hbci_new_pmonitor(GNCInteractor *data)
-{
-  HBCI_ProgressMonitorCB *pmon;
-  GtkWidget *dialog;
-  GladeXML *xml;
-
-  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_connection_dialog");
-
-  g_assert (dialog = glade_xml_get_widget (xml, "HBCI_connection_dialog"));
-  data->dialog = dialog;
-  g_assert (data->job_entry = glade_xml_get_widget (xml, "job_entry"));
-  g_assert (data->action_entry = glade_xml_get_widget (xml, "action_entry"));
-  g_assert (data->action_progress = 
-	    glade_xml_get_widget (xml, "action_progress"));
-  g_assert (data->log_text = glade_xml_get_widget (xml, "log_text"));
-  g_assert (data->abort_button = glade_xml_get_widget (xml, "abort_button"));
-  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
-  g_assert (data->close_button = glade_xml_get_widget (xml, "close_button"));
-  g_assert (data->close_checkbutton = 
-	    glade_xml_get_widget (xml, "close_checkbutton"));
-
-  gtk_toggle_button_set_active 
-    (GTK_TOGGLE_BUTTON (data->close_checkbutton), 
-     gnc_lookup_boolean_option("__gui", "hbci_close_on_finish", TRUE));
-
-  gtk_signal_connect (GTK_OBJECT (data->abort_button), "clicked", 
-		      GTK_SIGNAL_FUNC (on_button_clicked), data);
-  gtk_signal_connect (GTK_OBJECT (data->close_button), "clicked", 
-		      GTK_SIGNAL_FUNC (on_button_clicked), data);
-
-  if (data->parent)
-    gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (data->parent));
-  /*gtk_widget_set_parent (GTK_WIDGET (dialog), data->parent);*/
-
-  gtk_object_ref (GTK_OBJECT (dialog));
-  gtk_widget_hide_all (dialog);
-
-  pmon = HBCI_ProgressMonitorCB_new(&destr,
-				    &transStarted, &transFinished,
-				    &jobStarted, &jobFinished, 
-				    &actStarted, &actFinished, 
-				    &logMsg,
-				    data);
-
-  return HBCI_ProgressMonitorCB_ProgressMonitor(pmon);
-}
+/* currently empty */
Index: gnc-hbci-utils.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-utils.h,v
retrieving revision 1.12.2.3
retrieving revision 1.12.2.4
diff -Lsrc/import-export/hbci/gnc-hbci-utils.h -Lsrc/import-export/hbci/gnc-hbci-utils.h -u -r1.12.2.3 -r1.12.2.4
--- src/import-export/hbci/gnc-hbci-utils.h
+++ src/import-export/hbci/gnc-hbci-utils.h
@@ -25,8 +25,11 @@
 
 #include <glib.h>
 #include <gnome.h>
-#include <openhbci/account.h>
-#include <openhbci/api.h>
+
+#include <aqbanking/banking.h>
+#include <aqbanking/transaction.h>
+#include <aqbanking/account.h>
+
 #include "gnc-ui.h"
 #include "Account.h"
 #include "Transaction.h"
@@ -34,100 +37,82 @@
 
 #include "hbci-interaction.h"
 
-/** Create a new HBCI_API 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
- * an error will be displayed, and NULL will be returned. 
- * 
- * @param filename The name of the OpenHBCI configuration file to use.
- * @param allowNewFile If true, non-existent filename is accepted as well.
- * @param parent When displaying dialogs, use this GtkWidget as parent.
- * @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, 
-			     gboolean allowNewFile, 
-			     GtkWidget *parent,
-			     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
- * the file from the book's kvp frame doesn't exist. Returns NULL also
- * when there was an error upon opening that file.
+
+/** Create a new AB_BANKING and let it load its environment from its
+ * default configuration. 
  *
  * @param parent When displaying dialogs, use this GtkWidget as parent.
  * @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);
+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
- * current book. */
-HBCI_Error * gnc_hbci_api_save (const HBCI_API *api);
+/* Finish using the API for now. Let the API save its current
+ * state. Return nonzero if an error occurred. After this call, you
+ * may only call gnc_AB_BANKING_new_currentbook to get the api again
+ * in a properly initialized state. */
+int gnc_AB_BANKING_fini (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 HBCI_Account was found.
+ * information. Returns NULL if no AB_ACCOUNT was found.
  *
- * @param api The HBCI_API to get the HBCI_Account from.
- * @param gnc_acc The gnucash account to query for HBCI_Account reference data. */
-const 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_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 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. 
  *
@@ -135,8 +120,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. 
  *
@@ -144,8 +129,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. 
  *
@@ -153,9 +138,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.23.2.9
retrieving revision 1.23.2.10
diff -Lsrc/import-export/hbci/gnc-hbci-utils.c -Lsrc/import-export/hbci/gnc-hbci-utils.c -u -r1.23.2.9 -r1.23.2.10
--- src/import-export/hbci/gnc-hbci-utils.c
+++ src/import-export/hbci/gnc-hbci-utils.c
@@ -25,8 +25,7 @@
 
 #include <gnome.h>
 #include <errno.h>
-#include <openhbci.h>
-#include <openhbci/error.h>
+#include <gwenhywfar/directory.h>
 
 #include "gnc-ui.h"
 #include "gnc-hbci-kvp.h"
@@ -38,148 +37,116 @@
 
 /* static short module = MOD_IMPORT; */
 
-HBCI_API *
-gnc_hbci_api_new (const char *filename, gboolean allowNewFile,
-		  GtkWidget *parent, GNCInteractor **inter)
-{
-  HBCI_API *api = NULL;
-  HBCI_Error *err = NULL;
-  char *errstring;
-  
-  if (!filename)
-      return NULL;
-  if (!allowNewFile && 
-      (!g_file_test (filename, G_FILE_TEST_ISFILE | G_FILE_TEST_ISLINK))) 
-    {
-      /* ENOENT is "No such file or directory" */
-      gchar *errstring = g_strdup_printf ("%s: %s", filename, strerror (ENOENT));
-      gnc_warning_dialog_parented 
-	(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);
-      g_free (errstring);
-      return NULL;
-    }
-  
-
-  api = HBCI_API_new (FALSE, TRUE);
-  
-  err = HBCI_API_loadEnvironment (api, filename);
-  if (!HBCI_Error_isOk (err) && !allowNewFile) {
-    errstring = HBCI_Error_errorString (err);
-    HBCI_Error_delete (err);
-    gnc_warning_dialog_parented 
-	(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);
-
-  if (inter)
-    *inter = gnc_hbci_api_interactors (api, parent);
-  else
-    gnc_hbci_api_interactors (api, parent);
-
-  return api;
-}
-
-static HBCI_API *gnc_hbci_api = NULL;
-static char *gnc_hbci_configfile = NULL;
+/* Globale variables for AB_BANKING caching. */
+static AB_BANKING *gnc_AB_BANKING = NULL;
+static int gnc_AB_BANKING_refcnt = 0;
 static GNCInteractor *gnc_hbci_inter = NULL;
 
-HBCI_API * gnc_hbci_api_new_currentbook (GtkWidget *parent, 
-					 GNCInteractor **inter)
+
+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, inter);
-    gnc_hbci_inter = *inter;
-    return gnc_hbci_api;
-  } 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);
-    fprintf(stderr,
-	    "gnc_hbci_api_new_currentbook: Wrong HBCI_API cached; creating new one.\n");
-    return gnc_hbci_api_new_currentbook (parent, inter);
+    AB_BANKING *api = NULL;
+  
+    api = AB_Banking_new ("gnucash", 0);
+    g_assert(api);
+    {
+      int r = AB_Banking_Init(api);
+      if (r != 0)
+	printf("gnc_AB_BANKING_new: Warning: Error %d on AB_Banking_init\n", r);
+    }
+    
+    gnc_hbci_inter = gnc_AB_BANKING_interactors (api, parent);
+    gnc_AB_BANKING = api;
+    
+    if (inter)
+      *inter = gnc_hbci_inter;
+
+    gnc_AB_BANKING_refcnt = 1;
+    return gnc_AB_BANKING;
   } else {
-    /* Correct API cached. */
-    *inter = gnc_hbci_inter;
-    GNCInteractor_reparent (*inter, parent);
-    return gnc_hbci_api;
+    /* API cached. */
+
+    /* Init the API again. */
+    if (gnc_AB_BANKING_refcnt == 0)
+      AB_Banking_Init(gnc_AB_BANKING);
+
+    if (inter) {
+      *inter = gnc_hbci_inter;
+      GNCInteractor_reparent (*inter, parent);
+    }
+    
+    gnc_AB_BANKING_refcnt++;
+    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;
-    gnc_hbci_inter = NULL;
-    g_free (gnc_hbci_configfile);
-    gnc_hbci_configfile = NULL;
+  if (api == 0)
+    api = gnc_AB_BANKING;
+
+  if (api) {
+    if (api == gnc_AB_BANKING) {
+      gnc_AB_BANKING = NULL;
+      gnc_hbci_inter = NULL;
+      if (gnc_AB_BANKING_refcnt > 0)
+	AB_Banking_Fini(api);
+    }
+
+    AB_Banking_free(api);
   }
-  HBCI_API_delete (api);
 }
 
 
-HBCI_Error * gnc_hbci_api_save (const HBCI_API *api)
+int gnc_AB_BANKING_fini (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.", "");
-  
-  return HBCI_API_saveEnvironment (api, file);
+  if (api == gnc_AB_BANKING) {
+    gnc_AB_BANKING_refcnt--;
+    if (gnc_AB_BANKING_refcnt == 0)
+      return AB_Banking_Fini(api);
+  }
+  else
+    return AB_Banking_Fini(api);
+  return 0;
 }
 
 
 
-const 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) 
 {
+  int account_uid = 0;
+  AB_ACCOUNT *hbci_acc = NULL;
   const char *bankcode = NULL, *accountid = NULL;
-  int countrycode = 0;
-  const HBCI_Bank *bank = NULL;
-  const HBCI_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)) {
-    /*printf("gnc_acc %s has blz %s and ccode %d\n",
+  accountid = gnc_hbci_get_account_accountid (gnc_acc);
+  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);
-      if (accountid && (strlen(accountid)>0)) {
-	hbci_acc = HBCI_Bank_findAccount (bank, accountid);
-	if (hbci_acc) {
-	  /*printf("can connect gnc_acc %s to hbci_acc %s\n",
-	    xaccAccountGetName (gnc_acc), 
-	    HBCI_Account_accountId (hbci_acc));*/
-	  return hbci_acc;
-	} /* hbci_acc */
-      } /* accountid */
-    } /* bank */
-  } /* bankcode */
+    hbci_acc = AB_Banking_GetAccount(api, account_uid);
+
+    if (!hbci_acc && bankcode && (strlen(bankcode)>0) &&
+	accountid && (strlen(accountid) > 0)) {
+      printf("gnc_hbci_get_hbci_acc: No AB_ACCOUNT found for UID %d, trying bank code\n", account_uid);
+      hbci_acc = AB_Banking_GetAccountByCodeAndNumber(api, bankcode, accountid);
+    }
+    /*printf("gnc_hbci_get_hbci_acc: return HBCI_Account %p\n", hbci_acc);*/
+    return hbci_acc;
+  } else if (bankcode && (strlen(bankcode)>0) && accountid && (strlen(accountid) > 0)) {
+    hbci_acc = AB_Banking_GetAccountByCodeAndNumber(api, bankcode, accountid);
+    return hbci_acc;
+  }
+
   return NULL;
 }
 
-
+#if 0
 static void *
 print_list_int_cb (int value, void *user_data)
 {
@@ -212,52 +179,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);
@@ -289,99 +233,104 @@
       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_parented (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_parented (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_parented (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_parented (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_parented (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_parented
-      (GTK_WINDOW (parent),
+      (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_parented (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_parented 
-      (GTK_WINDOW (parent),
+      (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_parented 
+    gnc_error_dialog_parented
       (GTK_WINDOW (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_parented 
-      (GTK_WINDOW (parent),
+      (parent,
        _("There was an error when loading the plugin for your security medium \n"
 	 "(see log window). Probably the versions of your currently installed \n"
 	 "OpenHBCI library and of the plugin do not match. In that case you need \n"
 	 "to recompile and reinstall the plugin again. Aborting now."));
     GNCInteractor_hide (inter);
     return FALSE;
-  case HBCI_ERROR_CODE_BAD_MEDIUM:
-    gnc_error_dialog_parented 
-      (GTK_WINDOW (parent),
+  case AB_ERROR_BAD_MEDIUM:
+    gnc_error_dialog_parented
+      (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;
@@ -389,39 +338,104 @@
   
 }
 
+#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)
+{
+  /* Got no sysid. */
+  GWEN_DB_NODE *rsp, *n;
+  g_assert(outbox);
+  if (!inter) 
+    return;
+  
+  rsp = HBCI_Outbox_response(outbox);
+  n = GWEN_DB_GetFirstGroup(rsp);
+  while(n) {
+    if (strcasecmp(GWEN_DB_GroupName(n), "msgresult")==0) {
+      GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
+      while (r) {
+	if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0) {
+	  gchar *logtext;
+	  int resultcode;
+	  const char *text, *elementref, *param;
+	  
+	  resultcode = GWEN_DB_GetIntValue(r, "resultcode", 0, 0);
+	  text = GWEN_DB_GetCharValue(r, "text", 0, "Response without text");
+	  elementref = GWEN_DB_GetCharValue(r, "elementref", 0, "");
+	  param = GWEN_DB_GetCharValue(r, "param", 0, "");
+
+	  if (strlen(elementref)>0 || strlen(param) > 0)
+	    logtext = g_strdup_printf("%s (%d; Elementref %s; Param %s)", text, 
+				      resultcode, elementref, param);
+	  else
+	    logtext = g_strdup_printf("%s (%d)", text, resultcode);
+	  GNCInteractor_add_log_text(inter, logtext);
+	  g_free(logtext);
+	}
+	r = GWEN_DB_GetNextGroup(r);
+      }
+    } 
+    else if (strcasecmp(GWEN_DB_GroupName(n), "segresult")==0) {
+      GWEN_DB_NODE *r = GWEN_DB_GetFirstGroup(n);
+      while (r) {
+	if (strcasecmp(GWEN_DB_GroupName(r), "result") == 0) {
+	}
+	r = GWEN_DB_GetNextGroup(r);
+      }
+    } 
+    n=GWEN_DB_GetNextGroup(n);
+  } // while
+
+  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_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)
     GNCInteractor_show (inter);
 
   if (gnc_lookup_boolean_option("_+Advanced", 
-				"HBCI Verbose Debug Messages", FALSE))
-    HBCI_Hbci_setDebugLevel (4);
-  else
-    HBCI_Hbci_setDebugLevel (0);
+				"HBCI Verbose Debug Messages", FALSE)) {
+/*     GWEN_Logger_SetLevel(0, GWEN_LoggerLevelDebug); */
+/*     HBCI_Hbci_setDebugLevel (4); */
+  }
+/*   else */
+/*     HBCI_Hbci_setDebugLevel (0); */
 
   do {
     if (inter)
       GNCInteractor_show_nodelete (inter);
-    err = HBCI_API_executeQueue (api, TRUE);
-    g_assert (err);
-  } while (gnc_hbci_error_retry (parent, err, inter));
+    err = AB_Banking_ExecuteQueue (api);
+
+    /* Print result codes to interactor */
+/*     gnc_hbci_printresult(queue, 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;
@@ -429,13 +443,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. @§%$! */
@@ -448,6 +460,7 @@
   gchar **res = user_data;
   gchar *tmp1, *tmp2;
 
+  if (!string) return NULL;
   tmp1 = g_strdup (string);
   g_strstrip (tmp1);
 
@@ -469,23 +482,27 @@
 }
 
 
-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;
   char *othername = NULL;
   char *g_descr;
+  const GWEN_STRINGLIST *h_purpose = AB_Transaction_GetPurpose (h_trans);
+  const GWEN_STRINGLIST *h_remotename = AB_Transaction_GetRemoteName (h_trans);
 
   /* Don't use list_string_concat_delim here since we need to
      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);
+  if (h_purpose)
+    GWEN_StringList_ForEach (h_purpose,
+			     &gnc_list_string_cb,
+			     &h_descr);
+  if (h_remotename)
+    GWEN_StringList_ForEach (h_remotename,
+			     &gnc_list_string_cb,
+			     &othername);
   /*DEBUG("HBCI Description '%s'", h_descr);*/
 
   if (othername && (strlen (othername) > 0))
@@ -506,52 +523,57 @@
   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));
+  /*   char *h_transactionText =  */
+  /*     g_strdup (AB_TRANSACTION_transactionText (h_trans)); */
+  const char *h_remoteAccountNumber = 
+    AB_Transaction_GetRemoteAccountNumber (h_trans);
+  const char *h_remoteBankCode = 
+    AB_Transaction_GetRemoteBankCode (h_trans);
   char *h_otherAccountId =
-    g_strdup (HBCI_Transaction_otherAccountId (h_trans));
+    g_strdup (h_remoteAccountNumber ? h_remoteAccountNumber : _("unknown"));
   char *h_otherBankCode =
-    g_strdup (HBCI_Transaction_otherBankCode (h_trans));
+    g_strdup (h_remoteBankCode ? h_remoteBankCode : _("unknown"));
   char *g_memo;
 
-  g_strstrip (h_transactionText);
+  /*   g_strstrip (h_transactionText); */
   g_strstrip (h_otherAccountId);
   g_strstrip (h_otherBankCode);
 
   g_memo = 
-    (h_transactionText && (strlen(h_transactionText) > 0) ?
-     g_strdup_printf ("%s %s %s %s %s",
-		      h_transactionText,
+    (h_otherAccountId && (strlen (h_otherAccountId) > 0) ?
+     g_strdup_printf ("%s %s %s %s",
 		      _("Account"), h_otherAccountId,
 		      _("Bank"), h_otherBankCode) :
-     (h_otherAccountId && (strlen (h_otherAccountId) > 0) ?
-      g_strdup_printf ("%s %s %s %s",
-		       _("Account"), h_otherAccountId,
-		       _("Bank"), h_otherBankCode) :
-      g_strdup ("")));
+     g_strdup (""));
     
-  g_free (h_transactionText);
   g_free (h_otherAccountId);
   g_free (h_otherBankCode);
   return g_memo;
 }
 
 
+#if 0
 /** Return the only customer that can act on the specified account, or
     NULL if none was found. */
 const HBCI_Customer *
-gnc_hbci_get_first_customer(const HBCI_Account *h_acc)
+gnc_hbci_get_first_customer(const AB_ACCOUNT *h_acc)
 {
   /* Get one customer. */
-  const list_HBCI_Customer *custlist;
-    
-  custlist = HBCI_Account_authorizedCustomers (h_acc);
-  g_assert (custlist);
-  return choose_one_customer(gnc_ui_get_toplevel (), custlist);
+  const list_HBCI_User *userlist;
+  const HBCI_Bank *bank;
+  const HBCI_User *user;
+  g_assert(h_acc);
+  
+  bank = AB_ACCOUNT_bank (h_acc);
+  userlist = HBCI_Bank_users (bank);
+  g_assert (userlist);
+  user = choose_one_user(gnc_ui_get_toplevel (), userlist);
+  g_assert (user);
+  return choose_one_customer(gnc_ui_get_toplevel (), HBCI_User_customers (user));
 }
 
 const char *bank_to_str (const HBCI_Bank *bank)
@@ -678,7 +700,7 @@
 			 * is the name of the bank. %s is the bank
 			 * code. */
 			g_strdup_printf (_("%s (%s) at bank %s (%s)"),
-					 HBCI_Customer_custName (customer),
+					 HBCI_Customer_name (customer),
 					 HBCI_Customer_custId (customer),
 					 bank_to_str (HBCI_User_bank(HBCI_Customer_user(customer))),
 					 HBCI_Bank_bankCode (HBCI_User_bank(HBCI_Customer_user(customer)))));
@@ -754,7 +776,7 @@
 	radio_list = g_list_append
 	    (radio_list, 
 	     g_strdup_printf (_("%s (%s) at bank %s (%s)"),
-			      HBCI_User_userName (user),
+			      HBCI_User_name (user),
 			      HBCI_User_userId (user),
 			      bank_to_str (HBCI_User_bank(user)),
 			      HBCI_Bank_bankCode (HBCI_User_bank(user))));
@@ -792,3 +814,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.13.2.5
retrieving revision 1.13.2.6
diff -Lsrc/import-export/hbci/gnc-hbci-getbalance.c -Lsrc/import-export/hbci/gnc-hbci-getbalance.c -u -r1.13.2.5 -r1.13.2.6
--- 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 <openhbci/api.h>
+#include <aqbanking/banking.h>
 
 #include "gnc-ui.h"
 #include "gnc-numeric.h"
@@ -32,42 +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_OutboxJobGetBalance *balance_job,
-				    const 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,
-		time_t tt)
+		const char *date_str,
+		const char *time_str)
 {
-  char *str = HBCI_Value_toReadableString (val);
-  printf("GetBalance: %s%s %s at date %s",
+  char *str = gnc_AB_VALUE_toReadableString (val);
+  printf("GetBalance: %s%s %s at date %s %s",
 	 (negative ? "-" : ""), str, 
-	 name, ctime(&tt));
+	 name, date_str, time_str);
   free (str);
 }
+#endif 
 
 
 void
 gnc_hbci_getbalance (GtkWidget *parent, Account *gnc_acc)
 {
-  HBCI_API *api = NULL;
-  const HBCI_Account *h_acc = NULL;
+  AB_BANKING *api = NULL;
+  const AB_ACCOUNT *h_acc = NULL;
   GNCInteractor *interactor = NULL;
-  const HBCI_Customer *customer = NULL;
   
   g_assert(parent);
   if (gnc_acc == NULL)
     return;
 
   /* Get API */
-  api = gnc_hbci_api_new_currentbook (parent, &interactor);
+  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);
@@ -76,36 +78,34 @@
   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",
-     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_OutboxJobGetBalance *balance_job;
-    HBCI_OutboxJob *job;
-    
-    balance_job = 
-      HBCI_OutboxJobGetBalance_new (customer, (HBCI_Account *)h_acc);
-    job = HBCI_OutboxJobGetBalance_OutboxJob (balance_job);
-    g_assert (job);
+    AB_JOB *job;
 
+    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 */
-    HBCI_API_addJob (api, job);
+    AB_Banking_EnqueueJob(api, job);
 
     /* Execute Outbox. */
-    if (!gnc_hbci_api_execute (parent, api, job, interactor)) {
+    if (!gnc_AB_BANKING_execute (parent, api, job, interactor)) {
 
-      /* HBCI_API_executeOutbox failed. */
-      HBCI_API_clearQueueByStatus (api, HBCI_JOB_STATUS_NONE);
+      /* AB_BANKING_executeOutbox failed. */
+      AB_Banking_DequeueJob(api, job);
+      AB_Banking_DelFinishedJob(api, job);
+      AB_Banking_DelPendingJob(api, job);
+      /* FIXME: free unneeded data */
       return;
     }
 
@@ -114,66 +114,75 @@
     /* Finish this job. */
     gnc_hbci_getbalance_finish (parent, 
 				gnc_acc,
-				balance_job);
+				job);
 
     /* Clean up after ourselves. */
-    HBCI_API_clearQueueByStatus (api, HBCI_JOB_STATUS_NONE);
-    gnc_hbci_api_save (api);
+    AB_Banking_DequeueJob(api, job);
+    AB_Banking_DelFinishedJob(api, job);
+    AB_Banking_DelPendingJob(api, job);
+    gnc_AB_BANKING_fini (api);
     GNCInteractor_hide (interactor);
   }
 }
 
 
-
-void gnc_hbci_getbalance_debugprint(HBCI_OutboxJobGetBalance *balance_job,
-				    const HBCI_Account *h_acc)
+#if 0
+void gnc_hbci_getbalance_debugprint(AB_JOB *job,
+				    const AB_ACCOUNT *h_acc)
 {
-  const HBCI_AccountBalance *acc_bal;
-  const HBCI_Balance *noted_bal, *booked_bal;
-  time_t balance_tt, noted_tt, booked_tt;
-	    
-  acc_bal = HBCI_OutboxJobGetBalance_getBalance (balance_job);
-  balance_tt = 
-    HBCI_DateTime_to_time_t (HBCI_AccountBalance_date (acc_bal), 
-			     HBCI_AccountBalance_time (acc_bal));
-    
-  booked_bal = HBCI_AccountBalance_bookedBalance (acc_bal);
-  booked_tt = HBCI_DateTime_to_time_t (HBCI_Balance_date (booked_bal), 
-				       HBCI_Balance_time (booked_bal));
-  
-  noted_bal = HBCI_AccountBalance_notedBalance (acc_bal);
-  noted_tt = HBCI_DateTime_to_time_t (HBCI_Balance_date (noted_bal), 
-				      HBCI_Balance_time (noted_bal));
+  GWEN_DB_NODE *response, *acc_bal;
+  GWEN_DB_NODE *noted_grp, *booked_grp;
+  AB_VALUE *booked_val, *noted_val;
+  /* time_t balance_tt, noted_tt, booked_tt; */
+	
+  response = HBCI_Job_responseData(AB_JOB_Job(job));
+  if (!response)
+    return;
+  acc_bal =GWEN_DB_GetGroup(response, 
+			    GWEN_PATH_FLAGS_NAMEMUSTEXIST, "balance");
+  if (!acc_bal) 
+    return;
+
+  noted_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "noted");
+  booked_grp = GWEN_DB_GetGroup(response, GWEN_PATH_FLAGS_NAMEMUSTEXIST, "booked");
+
+  booked_val = AB_VALUE_new(GWEN_DB_GetCharValue(booked_grp, "value", 0, "0"),
+			      GWEN_DB_GetCharValue(booked_grp, "currency", 0, "EUR"));
+  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",
-	 HBCI_Account_accountId (h_acc));
+	 AB_ACCOUNT_accountId (h_acc));
   bal_print_debug("Booked balance",
-		  HBCI_Balance_value (booked_bal),
-		  HBCI_Balance_isDebit (booked_bal),
-		  booked_tt);
+		  booked_val,
+		  (strcasecmp(GWEN_DB_GetCharValue(booked_grp, "debitmark", 0, "C"),"D")==0),
+		  GWEN_DB_GetCharValue(booked_grp, "date", 0, ""),
+		  GWEN_DB_GetCharValue(booked_grp, "time", 0, ""));
   bal_print_debug("Noted balance",
-		  HBCI_Balance_value (noted_bal),
-		  HBCI_Balance_isDebit (noted_bal),
-		  noted_tt);
-  bal_print_debug("Bank Line", 
-		  HBCI_AccountBalance_bankLine (acc_bal), FALSE,
-		  balance_tt);
-  bal_print_debug("Disposable amount",
-		  HBCI_AccountBalance_disposable (acc_bal), FALSE,
-		  balance_tt);
-  bal_print_debug("Already disposed",
-		  HBCI_AccountBalance_disposed (acc_bal), FALSE,
-		  balance_tt);
+		  noted_val,
+		  (strcasecmp(GWEN_DB_GetCharValue(noted_grp, "debitmark", 0, "C"),"D")==0),
+		  GWEN_DB_GetCharValue(noted_grp, "date", 0, ""),
+		  GWEN_DB_GetCharValue(noted_grp, "time", 0, ""));
+/*   bal_print_debug("Bank Line",  */
+/* 		  AB_ACCOUNTBalance_bankLine (acc_bal), FALSE, */
+/* 		  balance_tt); */
+/*   bal_print_debug("Disposable amount", */
+/* 		  AB_ACCOUNTBalance_disposable (acc_bal), FALSE, */
+/* 		  balance_tt); */
+/*   bal_print_debug("Already disposed", */
+/* 		  AB_ACCOUNTBalance_disposed (acc_bal), FALSE, */
+/* 		  balance_tt); */
+  AB_VALUE_delete(booked_val);
+  AB_VALUE_delete(noted_val);
 }
+#endif
 
 static gchar*
 bal_print_balance(const char *format,
-		  const HBCI_Value *val,
-		  gboolean negative)
+		  const AB_VALUE *val)
 {
-  char *str = HBCI_Value_toReadableString (val);
+  char *str = gnc_AB_VALUE_toReadableString (val);
   char *res = g_strdup_printf(format, 
-			      (negative ? "-" : ""), 
 			      str);
   free (str);
   return res;
@@ -184,33 +193,37 @@
 gboolean
 gnc_hbci_getbalance_finish (GtkWidget *parent, 
 			    Account *gnc_acc,
-			    const HBCI_OutboxJobGetBalance *balance_job)
+			    const AB_JOB *job)
 {
-  const HBCI_AccountBalance *acc_bal;
-  const HBCI_Balance *noted_bal, *booked_bal;
-  const HBCI_Value *booked_val; 
+  const AB_ACCOUNT_STATUS *response;
+  const AB_BALANCE *noted_grp, *booked_grp;
+  const AB_VALUE *booked_val, *noted_val;
+
   time_t booked_tt;
-  /*time_t balance_tt, noted_tt;*/
-  gboolean booked_debit;
+
   gboolean dialogres;
-	    
-  acc_bal = HBCI_OutboxJobGetBalance_getBalance (balance_job);
-  /*balance_tt = 
-    HBCI_DateTime_to_time_t (HBCI_AccountBalance_date (acc_bal), 
-    HBCI_AccountBalance_time (acc_bal));*/
-    
-  booked_bal = HBCI_AccountBalance_bookedBalance (acc_bal);
-  booked_tt = HBCI_DateTime_to_time_t (HBCI_Balance_date (booked_bal), 
-				       HBCI_Balance_time (booked_bal));
-  booked_val = HBCI_Balance_value (booked_bal);
-  booked_debit = HBCI_Balance_isDebit (booked_bal);
+
+  response = AB_JobGetBalance_GetAccountStatus((AB_JOB*)job);
+  if (!response) {
+    printf("gnc_hbci_getbalance_finish: Oops, response == NULL.\n");
+    return TRUE;
+  }
+
+  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.\n");
+    return TRUE;
+  }
+  booked_val = AB_Balance_GetValue(booked_grp);
+  
+  noted_val = AB_Balance_GetValue(noted_grp);
   
-  noted_bal = HBCI_AccountBalance_notedBalance (acc_bal);
-  /*noted_tt = HBCI_DateTime_to_time_t (HBCI_Balance_date (noted_bal), 
-    HBCI_Balance_time (noted_bal));*/
+  booked_tt = GWEN_Time_toTime_t (AB_Balance_GetTime(booked_grp));
     
-  if ((HBCI_Value_getValue (HBCI_Balance_value (noted_bal)) == 0) &&
-      (HBCI_Value_getValue (HBCI_Balance_value (booked_bal)) == 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
@@ -228,27 +241,19 @@
     }
   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
-	  * negative or "" if it is positive. The second %s is the
-	  * amount. */
 	 _("Result of HBCI job: \n"
-	   "Account booked balance is %s%s\n"),
-	 (booked_debit ? "-" : ""),
+	   "Account booked balance is %s\n"),
 	 booked_str);
       char *message2 = 
-	((HBCI_Value_getValue (HBCI_Balance_value (noted_bal)) == 0) ?
+	((AB_Value_GetValue (noted_val) == 0) ?
 	 g_strdup_printf("%s", "") :
 	 bal_print_balance
-	 /* Translators: The first %s is "-" if this amount is
-	  * negative or "" if it is positive. The second %s is the
-	  * amount. */
 	 (_("For your information: This account also \n"
-	    "has a noted balance of %s%s\n"),
-	  HBCI_Balance_value (noted_bal),
-	  HBCI_Balance_isDebit (noted_bal)));
+	    "has a noted balance of %s\n"),
+	  noted_val));
       const char *message3 = _("Reconcile account now?");
 
       dialogres = gnc_verify_dialog_parented
@@ -265,15 +270,13 @@
       
   if (dialogres) 
     {
-      gnc_numeric abs_value =
-	double_to_gnc_numeric (HBCI_Value_getValue (booked_val),
+      gnc_numeric value =
+	double_to_gnc_numeric (AB_Value_GetValue (booked_val),
 			       xaccAccountGetCommoditySCU(gnc_acc),
 			       GNC_RND_ROUND);
       recnWindowWithBalance (parent, 
 			     gnc_acc, 
-			     (booked_debit 
-			      ? gnc_numeric_neg (abs_value)
-			      : abs_value),
+			     value,
 			     booked_tt);
     }
       
Index: dialog-hbcitrans.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-hbcitrans.h,v
retrieving revision 1.3.2.5
retrieving revision 1.3.2.6
diff -Lsrc/import-export/hbci/dialog-hbcitrans.h -Lsrc/import-export/hbci/dialog-hbcitrans.h -u -r1.3.2.5 -r1.3.2.6
--- src/import-export/hbci/dialog-hbcitrans.h
+++ src/import-export/hbci/dialog-hbcitrans.h
@@ -27,14 +27,12 @@
 
 #include <gnome.h>
 
-#include <openhbci/api.h>
-#include <openhbci/account.h>
-#include <openhbci/customer.h>
-#include <openhbci/transaction.h>
-#include <openhbci/outboxaccjobs.h>
+#include <aqbanking/banking.h>
+#include <aqbanking/transaction.h>
+#include <aqbanking/job.h>
 
 #include "Account.h"
-#include "hbci-interaction.h"
+#include "gnc-hbci-utils.h"
 
 /** The dialog data structure. */
 typedef struct _trans_data HBCITransDialog;
@@ -45,11 +43,11 @@
 } GNC_HBCI_Transtype;
 
 
-/*HBCI_Transaction *
+/*AB_TRANSACTION *
 gnc_hbci_trans (GtkWidget *parent,
-		HBCI_API *api,
+		AB_BANKING *api,
 		GNCInteractor *interactor,
-		const HBCI_Account *h_acc,
+		const AB_ACCOUNT *h_acc,
 		const HBCI_Customer *customer,
 		Account *gnc_acc,
 		GNC_HBCI_Transtype type,
@@ -59,8 +57,7 @@
  * specified by the arguments, and return a pointer to it. */
 HBCITransDialog *
 gnc_hbci_dialog_new (GtkWidget *parent,
-		     const HBCI_Account *h_acc,
-		     const HBCI_Customer *customer,
+		     const AB_ACCOUNT *h_acc,
 		     Account *gnc_acc,
 		     GNC_HBCI_Transtype trans_type,
 		     GList *templ);
@@ -73,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 */
@@ -85,11 +82,10 @@
 
 
 int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td, 
-				 const HBCI_Account *h_acc);
-HBCI_OutboxJob *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, HBCI_API *api,
-			      const HBCI_Customer *customer, 
-			      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,8 +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_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.1.2.1
retrieving revision 1.1.2.2
diff -Lsrc/import-export/hbci/gnc-hbci-gettrans.h -Lsrc/import-export/hbci/gnc-hbci-gettrans.h -u -r1.1.2.1 -r1.1.2.2
--- 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 <openhbci/outboxaccjobs.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_OutboxJobGetTransactions *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.16.2.12
retrieving revision 1.16.2.13
diff -Lsrc/import-export/hbci/hbci-interaction.c -Lsrc/import-export/hbci/hbci-interaction.c -u -r1.16.2.12 -r1.16.2.13
--- src/import-export/hbci/hbci-interaction.c
+++ src/import-export/hbci/hbci-interaction.c
@@ -28,8 +28,7 @@
 #include "hbci-interaction.h"
 #include "hbci-interactionP.h"
 
-#include <openhbci/interactorcb.h>
-#include <openhbci/progressmonitorcb.h>
+#include <aqbanking/banking.h>
 #include "dialog-utils.h"
 #include "druid-utils.h"
 #include "gnc-ui-util.h"
@@ -39,33 +38,97 @@
 #include "dialog-pass.h"
 #include "gnc-hbci-utils.h"
 
-#include <openhbci.h>
+#include <gwenhywfar/bio_buffer.h>
+#include <gwenhywfar/xml.h>
+
+#include <iconv.h>
 
 #define PREF_TAB_ONLINE_BANKING N_("Online Banking & Importing")
 
+gchar *gnc__extractText(const char *text);
 
 /** 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;
   
   data = g_new0 (GNCInteractor, 1);
   data->parent = parent;
+  data->gnc_iconv_handler = iconv_open("ISO8859-1", "UTF-8");
+  g_assert(data->gnc_iconv_handler != (iconv_t)(-1));
   data->keepAlive = TRUE;
   data->cache_valid = FALSE;
   data->cache_pin = 
     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);
-  /* Set HBCI_Progressmonitor */
-  HBCI_API_setMonitor(api, gnc_hbci_new_pmonitor(data), TRUE);
+  gnc_hbci_add_callbacks(api, data);
   return data;
 }
 
+void GNCInteractor_delete(GNCInteractor *data)
+{
+  if (data == NULL)
+    return;
+  if (data->dialog != NULL) {
+    gnc_set_boolean_option ("__gui", "hbci_close_on_finish",
+			    gtk_toggle_button_get_active 
+			    (GTK_TOGGLE_BUTTON (data->close_checkbutton)));
+    gtk_object_unref (GTK_OBJECT (data->dialog));
+    gtk_widget_destroy (data->dialog);
+  }
+  
+  data->dialog = NULL;
+
+  g_hash_table_destroy(data->showbox_hash);
+  iconv_close(data->gnc_iconv_handler);
+
+  g_free (data);
+}
+
+
+
+/* ************************************************************
+ */
+
+
+GtkWidget *GNCInteractor_parent(GNCInteractor *i)
+{
+  g_assert(i);
+  return i->parent;
+}
+
+static void GNCInteractor_setRunning (GNCInteractor *data)
+{
+  g_assert(data);
+  data->state = RUNNING;
+  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), TRUE);
+  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), FALSE);
+}
+static void GNCInteractor_setFinished (GNCInteractor *data)
+{
+  g_assert(data);
+  data->state = FINISHED;
+  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
+  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
+  if (gtk_toggle_button_get_active
+      (GTK_TOGGLE_BUTTON (data->close_checkbutton)))
+    GNCInteractor_hide (data);
+}
+static void GNCInteractor_setAborted (GNCInteractor *data)
+{
+  g_assert(data);
+  data->state = ABORTED;
+  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
+  gtk_widget_set_sensitive (GTK_WIDGET (data->close_button), TRUE);
+  data->keepAlive = FALSE;
+}
+
+
 gboolean GNCInteractor_aborted(const GNCInteractor *i)
 {
   g_assert(i);
@@ -109,21 +172,6 @@
 			  (GTK_TOGGLE_BUTTON (i->close_checkbutton)));
 }
 
-void GNCInteractor_delete(GNCInteractor *data)
-{
-  if (data == NULL)
-    return;
-  if (data->dialog != NULL) {
-    gnc_set_boolean_option ("__gui", "hbci_close_on_finish",
-			    gtk_toggle_button_get_active 
-			    (GTK_TOGGLE_BUTTON (data->close_checkbutton)));
-    gtk_object_unref (GTK_OBJECT (data->dialog));
-    gtk_widget_destroy (data->dialog);
-  }
-  
-  data->dialog = NULL;
-}
-
 void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value)
 {
   g_assert(i);
@@ -137,7 +185,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)
 {
@@ -154,99 +202,141 @@
     }
 }
 
+/* ************************************************************ 
+ */
+
+/* This function extracts the normal text part out of the
+   combi-strings that are passed from aqbanking. */
+gchar *gnc__extractText(const char *text) 
+{
+  gchar *res;
+  GWEN_BUFFEREDIO *bio;
+  GWEN_XMLNODE *xmlNode;
+  GWEN_BUFFER *buf;
+  int rv;
+
+  if (!text)
+    text = "";
+
+  buf=GWEN_Buffer_new(0, 256, 0, 1);
+  GWEN_Buffer_AppendString(buf, text);
+  GWEN_Buffer_Rewind(buf);
+
+  /* check whether there is a html tag */
+  bio=GWEN_BufferedIO_Buffer2_new(buf, 1);
+  GWEN_BufferedIO_SetReadBuffer(bio, 0, 256);
+  xmlNode=GWEN_XMLNode_new(GWEN_XMLNodeTypeTag, "html");
+  rv=GWEN_XML_Parse(xmlNode, bio,
+		    GWEN_XML_FLAGS_DEFAULT |
+		    GWEN_XML_FLAGS_HANDLE_OPEN_HTMLTAGS |
+		    GWEN_XML_FLAGS_NO_CONDENSE |
+		    GWEN_XML_FLAGS_KEEP_CNTRL);
+  GWEN_BufferedIO_Close(bio);
+  GWEN_BufferedIO_free(bio);
+
+  if (rv) {
+    res = g_strdup(text);
+  }
+  else {
+    GWEN_XMLNODE *nn;
+
+    nn=GWEN_XMLNode_GetFirstData(xmlNode);
+    if (nn) {
+      res = g_strdup(GWEN_XMLNode_GetData(nn));
+    }
+    else {
+      res = g_strdup(text);
+    }
+  }
+  GWEN_XMLNode_free(xmlNode);
+  return res;
+}
+
+
+char *gnc_hbci_utf8ToLatin1(GNCInteractor *data, const char *utf)
+{
+  int inbytes, outbytes;
+  char *utf8extracted, *latin1;
+  char *inbuffer, *outbuffer;
+
+  g_assert(data);
+  if (!utf) return g_strdup("");
+
+  /* Get rid of the aaaarg html-combi-text part */
+  utf8extracted = gnc__extractText(utf);
+/*   printf("Extracted \"%s\" into \"%s\"\n", utf, utf8extracted); */
+
+  inbuffer = utf8extracted;
+  inbytes = strlen(inbuffer);
+  outbytes = inbytes + 2;
+  latin1 = g_strndup(inbuffer, outbytes);
+  outbuffer = latin1;
+
+  iconv(data->gnc_iconv_handler, &inbuffer, &inbytes,
+	&outbuffer, &outbytes);
+  if (outbytes > 0)
+    *outbuffer = '\0';
+
+/*   printf("Converted \"%s\" into \"%s\"\n", utf8extracted, latin1); */
+  g_free(utf8extracted);
+  return latin1;
+}
+
 /********************************************************
  * Now all the callback functions 
  */
-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 *utf8title,
+		      const char *utf8text,
+		      char *resultbuffer,
+		      int minsize,
+		      int maxLen)
 {
-  GNCInteractor *data = user_data;
-  const HBCI_Bank *bank = NULL;
-  char *msgstr = NULL, *passwd = NULL;
+  GNCInteractor *data;
+  char *passwd = NULL;
   int retval = 0;
+  int newPin;
+  int hideInput;
+  gchar *title, *text;
+
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
   g_assert(data);
+  g_assert(maxLen > minsize);
+
+  text = gnc_hbci_utf8ToLatin1(data, utf8text);
+  title = gnc_hbci_utf8ToLatin1(data, utf8title);
+
+  newPin = (flags | AB_BANKING_INPUT_FLAGS_CONFIRM) == 0;
+  hideInput = (flags | AB_BANKING_INPUT_FLAGS_SHOW) != 0;
 
   while (TRUE) {
-    const char *username;
-    username =
-      (user ?
-       (strlen (HBCI_User_userName (user)) > 0 ? HBCI_User_userName (user) :
-	(HBCI_User_userId (user) ? HBCI_User_userId (user) :
-	 _("Unknown"))) : 
-       _("Unknown"));
-    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) {
+      if (!hideInput)
+	printf("inputBoxCB: Oops, hideInput==false and newPin==true, i.e. the input is supposed to be readable -- not implemented (since I thought this does not make sense when entering a new PIN).\n");
       retval = gnc_hbci_get_initial_password (data->parent,
-					      msgstr,
+					      title,
+					      text,
 					      &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);
-	return 1;
+	strcpy(resultbuffer, data->pw);
+	return 0;
       }
       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."));
-	
 	retval = gnc_hbci_get_password (data->parent,
-					msgstr,
+					title,
+					text,
 					NULL,
-					&passwd);
-	g_free (msgstr);
+					&passwd,
+					hideInput);
       } /* user == data->user */
     } /* newPin */
     
@@ -267,288 +357,374 @@
 	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;
       }
       else 
 	g_free (memset (passwd, 0, strlen (passwd)));
-      return 1;
+      g_free(title);
+      g_free(text);
+      return 0;
     }
   }
   
   /* User wanted to abort. */
-  return 0;
+  g_free(title);
+  g_free(text);
+  return 1;
+}
+
+static int keepAlive(void *user_data)
+{
+  GNCInteractor *data = user_data;
+  g_assert(data);
+  /*fprintf(stdout, "my-keepAlive: returning 1\n");*/
+
+  /* Let the widgets be redrawn */
+  while (g_main_iteration (FALSE));
+
+  return data->keepAlive;
 }
 
 
-static int msgInsertMediumOrAbort(const HBCI_User *user, 
-				MediumType mtype, 
-				void *user_data)
+static void destr(void *bp, 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 = 
-      (HBCI_User_userName (user) ? HBCI_User_userName (user) :
-       (HBCI_User_userId (user) ? HBCI_User_userId (user) :
-	_("Unknown")));
-    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);
-    }
+  if (data == NULL)
+    return;
+
+  if (data->pw) {
+    memset (data->pw, 0, strlen(data->pw));
+    g_free (data->pw);
+    data->pw = NULL;
   }
-  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_parented (data->parent,
-					  GNC_VERIFY_OK, 
-					  "%s", msgstr);
-  g_free (msgstr);
-  
-  return (retval == GNC_VERIFY_OK);
+  GNCInteractor_delete (data);
 }
 
+/* ************************************************************ 
+ */
 
-static int msgInsertCorrectMediumOrAbort(const HBCI_User *user, 
-				       MediumType mtype, 
-				       void *user_data)
+static void 
+hideBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
 {
-  GNCInteractor *data = user_data;
-  const HBCI_Bank * b = NULL;
-  char *msgstr = NULL;
-  GNCVerifyResult retval;
-  g_assert(data);
-
-  if (user != NULL) {
-    const char *username = 
-      (HBCI_User_userName (user) ? HBCI_User_userName (user) :
-       (HBCI_User_userId (user) ? HBCI_User_userId (user) :
-	_("Unknown")));
-    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);
-      }
+  GNCInteractor *data;
+  GtkWidget *dialog;
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
+  g_assert(data);
+
+  if (id > 0) {
+    dialog = g_hash_table_lookup(data->showbox_hash, (gpointer)id);
+  } else {
+    dialog = data->showbox_last;
   }
-  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_parented (data->parent,
-					  GNC_VERIFY_OK,
-					  "%s", msgstr);
-  g_free (msgstr);
+  if (dialog) {
+    gnome_dialog_close (GNOME_DIALOG (dialog));
+    gtk_widget_destroy (dialog);
+    g_hash_table_remove(data->showbox_hash, (gpointer)id);
+  }
+}
+
+static GWEN_TYPE_UINT32
+showBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags,
+	  const char *utf8title, const char *utf8text)
+{
+  GtkWidget *dialog;
+  GNCInteractor *data;
+  GWEN_TYPE_UINT32 result;
+  gchar *title, *text;
+
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
+  g_assert(data);
   
-  return (retval == GNC_VERIFY_OK);
+  text = gnc_hbci_utf8ToLatin1(data, utf8text);
+  title = gnc_hbci_utf8ToLatin1(data, utf8title);
+
+  /* Create new dialog */
+  dialog = gnome_ok_dialog_parented (text, GTK_WINDOW (data->parent));
+  if (title && (strlen(title) > 0))
+    gtk_window_set_title (GTK_WINDOW (dialog), title);
+  gnome_dialog_close_hides (GNOME_DIALOG(dialog), TRUE);
+  gtk_widget_show_all (dialog);
+
+  result = data->showbox_id;
+  g_hash_table_insert(data->showbox_hash, (gpointer)result, dialog);
+  data->showbox_id++;
+  data->showbox_last = dialog;
+
+  g_free(title);
+  g_free(text);
+  return result;
 }
 
+/* ************************************************************ 
+ */
 
-static void msgStateResponse(const char *msg, void *user_data)
+static int messageBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 flags, 
+			const char *utf8title, const char *utf8text, 
+			const char *b1, const char *b2, const char *b3)
 {
-  GNCInteractor *data = user_data;
+  GNCInteractor *data;
+  GtkWidget *dialog, *label;
+  int result;
+  gchar *text, *title, *b1text, *b2text, *b3text;
+
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
   g_assert(data);
 
-  add_log_text (data, msg);
-  /*fprintf(stdout,"hbci-initial-druid-msgStateResponse: %s\n",msg);*/
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
+  text = gnc_hbci_utf8ToLatin1(data, utf8text);
+  title = gnc_hbci_utf8ToLatin1(data, utf8title);
+  b1text = gnc_hbci_utf8ToLatin1(data, b1);
+  b2text = gnc_hbci_utf8ToLatin1(data, b2);
+  b3text = gnc_hbci_utf8ToLatin1(data, b3);
+
+  dialog = gnome_dialog_new (title, 
+			     b1 ? b1text : NULL,
+			     b2 ? b2text : NULL,
+			     b3 ? b3text : NULL,
+			     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);
+    g_free(title);
+    g_free(text);
+    g_free(b1text);
+    g_free(b2text);
+    g_free(b3text);
+    return 0;
+  }
+  g_free(title);
+  g_free(text);
+  g_free(b1text);
+  g_free(b2text);
+  g_free(b3text);
+  return result+1;
 }
 
-static int keepAlive(void *user_data)
+/* ************************************************************ 
+ */
+
+#define progress_id 4711
+
+static GWEN_TYPE_UINT32 progressStartCB(AB_BANKING *ab, const char *utf8title, 
+					const char *utf8text, GWEN_TYPE_UINT32 total)
 {
-  GNCInteractor *data = user_data;
-  g_assert(data);
-  /*fprintf(stdout, "my-keepAlive: returning 1\n");*/
+  GNCInteractor *data;
+  gchar *title, *text;
 
-  /* Let the widgets be redrawn */
-  while (g_main_iteration (FALSE));
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
+  g_assert(data);
+  
+  text = gnc_hbci_utf8ToLatin1(data, utf8text);
+  title = gnc_hbci_utf8ToLatin1(data, utf8title);
 
-  return data->keepAlive;
+  /* Now set the text etc */
+  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); */
+
+  /* Set progress bar */
+  gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 
+			       0.0);
+  data->action_max = total;
+  GNCInteractor_setRunning(data);
+  printf("progressStartCB: Action \"%s\" started, total %d.\n",
+	 text, total);
+
+  /* Show the dialog */
+  GNCInteractor_show(data);
+
+  g_free(title);
+  g_free(text);
+  return progress_id;
 }
 
-static void destr(void *user_data) 
+static int progressAdvanceCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id, 
+			     GWEN_TYPE_UINT32 progress)
 {
-  GNCInteractor *data = user_data;
-  if (data == NULL)
-    return;
+  GNCInteractor *data;
 
-  if (data->pw) {
-    memset (data->pw, 0, strlen(data->pw));
-    g_free (data->pw);
+  g_assert(ab);
+  data = AB_Banking_GetUserData(ab);
+  g_assert(data);
+
+  if ((id != 0) && (id != progress_id)) {
+/*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
+  }
+
+  if (progress != AB_BANKING_PROGRESS_NONE) {
+    printf("progressLogCB: Progress set to %d out of %f.\n", 
+	   progress, data->action_max);
+    if (progress <= data->action_max) 
+      gtk_progress_set_percentage (GTK_PROGRESS (data->action_progress), 
+				   progress/data->action_max);
   }
+
+  keepAlive(data);
+  return 0;
 }
 
-static void 
-msgEndInputPinViaKeypadCB(const HBCI_User *user, void *user_data)
+
+static int progressLogCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id, 
+			 AB_BANKING_LOGLEVEL level, const char *utf8text)
 {
-  GNCInteractor *data = user_data;
+  GNCInteractor *data;
+  gchar *text;
+
+  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;
+
+  text = gnc_hbci_utf8ToLatin1(data, utf8text);
+
+  if ((id != 0) && (id != progress_id)) {
+/*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
   }
+
+  printf("progressLogCB: Logging msg: %s\n", text);
+  GNCInteractor_add_log_text (data, text);
+
+  g_free(text);
+  keepAlive(data);
+  return 0;
 }
 
-static void 
-msgStartInputPinViaKeypadCB(const HBCI_User *user, void *user_data)
+static int progressEndCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
 {
-  const HBCI_Bank *bank;
-  char *msgstr;
-  GtkWidget *dialog;
-  GNCInteractor *data = user_data;
-  
+  GNCInteractor *data;
+  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 = 
-      (HBCI_User_userName (user) ? HBCI_User_userName (user) :
-       (HBCI_User_userId (user) ? HBCI_User_userId (user) :
-	_("Unknown")));
-    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);
-    }
+  if ((id != 0) && (id != progress_id)) {
+/*     printf("progressLogCB: Oops, wrong progress id %d -- ignored.\n", id); */
   }
-  else 
-    msgstr = g_strdup ( _("Please enter PIN for \n"
-			  "the newly created user \n"
-			  "at the keypad of your chip card reader."));
 
-  /* 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;
+  GNCInteractor_setFinished(data);
+
+  keepAlive(data);
+  return 0;
+}
 
-  g_free (msgstr);
+
+
+/* ************************************************************ 
+ */
+
+int debug_pmonitor = FALSE;
+void GNCInteractor_add_log_text (GNCInteractor *data, const char *msg)
+{
+  int pos;
+  g_assert(data);
+  
+  pos = gtk_text_get_length (GTK_TEXT (data->log_text));
+  gtk_editable_insert_text (GTK_EDITABLE (data->log_text),
+			    msg, strlen (msg),
+			    &pos);
+  gtk_editable_insert_text (GTK_EDITABLE (data->log_text),
+			    "\n", 1,
+			    &pos);
 }
 
+static void
+on_button_clicked (GtkButton *button,
+		   gpointer user_data)
+{
+  GNCInteractor *data = user_data;
+  char *name;
+  g_assert(data);
+  
+  name = gtk_widget_get_name (GTK_WIDGET (button));
+  if (strcmp (name, "abort_button") == 0) {
+    GNCInteractor_setAborted(data);
+  } else if (strcmp (name, "close_button") == 0) {
+    if (data->state != RUNNING) {
+      gtk_widget_hide_all (data->dialog); 
+      /*data->dont_hide = FALSE;*/
+      /*GNCInteractor_hide (data);*/
+    }
+  } else {
+    printf("on_button_clicked: Oops, unknown button: %s\n",
+	   name);
+  }
+  /* Let the widgets be redrawn */
+  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;
+
+  /* Create the progress dialog window */
+  xml = gnc_glade_xml_new ("hbci.glade", "HBCI_connection_dialog");
+
+  g_assert (dialog = glade_xml_get_widget (xml, "HBCI_connection_dialog"));
+  data->dialog = dialog;
+  g_assert (data->job_entry = glade_xml_get_widget (xml, "job_entry"));
+  g_assert (data->action_entry = glade_xml_get_widget (xml, "action_entry"));
+  g_assert (data->action_progress = 
+	    glade_xml_get_widget (xml, "action_progress"));
+  g_assert (data->log_text = glade_xml_get_widget (xml, "log_text"));
+  g_assert (data->abort_button = glade_xml_get_widget (xml, "abort_button"));
+  gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
+  g_assert (data->close_button = glade_xml_get_widget (xml, "close_button"));
+  g_assert (data->close_checkbutton = 
+	    glade_xml_get_widget (xml, "close_checkbutton"));
+
+  /* grey out the progress bar -- its unused at the moment */
+  gtk_widget_set_sensitive (data->action_progress, FALSE);
+  gtk_toggle_button_set_active 
+    (GTK_TOGGLE_BUTTON (data->close_checkbutton), 
+     gnc_lookup_boolean_option("__gui", "hbci_close_on_finish", TRUE));
+
+  gtk_signal_connect (GTK_OBJECT (data->abort_button), "clicked", 
+		      GTK_SIGNAL_FUNC (on_button_clicked), data);
+  gtk_signal_connect (GTK_OBJECT (data->close_button), "clicked", 
+		      GTK_SIGNAL_FUNC (on_button_clicked), data);
+
+  if (data->parent)
+    gnome_dialog_set_parent (GNOME_DIALOG (dialog), GTK_WINDOW (data->parent));
+  /*gtk_widget_set_parent (GTK_WIDGET (dialog), data->parent);*/
+
+  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);
 
-  inter = HBCI_InteractorCB_new2(&destr,
-				 &msgInputPin,
-				 &msgInsertMediumOrAbort,
-				 &msgInsertCorrectMediumOrAbort,
-				 &msgStateResponse,
-				 &keepAlive,
-				 &msgStartInputPinViaKeypadCB,
-				 &msgEndInputPinViaKeypadCB,
-				 data);
+  AB_Banking_SetUserData(ab, 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.7.2.8
retrieving revision 1.7.2.9
diff -Lsrc/import-export/hbci/gnc-hbci-transfer.c -Lsrc/import-export/hbci/gnc-hbci-transfer.c -u -r1.7.2.8 -r1.7.2.9
--- 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 <openhbci/api.h>
-#include <openhbci/outboxaccjobs.h>
+#include <aqbanking/banking.h>
 
 #include "gnc-ui.h"
 #include "gnc-numeric.h"
@@ -48,16 +47,15 @@
 gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc,
 		    GNC_HBCI_Transtype trans_type)
 {
-  HBCI_API *api = NULL;
-  const HBCI_Account *h_acc = NULL;
+  AB_BANKING *api = NULL;
+  const AB_ACCOUNT *h_acc = NULL;
   GNCInteractor *interactor = NULL;
-  const HBCI_Customer *customer = NULL;
   
   g_assert(parent);
   g_assert(gnc_acc);
 
   /* Get API */
-  api = gnc_hbci_api_new_currentbook (parent, &interactor);
+  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;
@@ -71,13 +69,8 @@
     return;
   }
   /*printf("gnc_hbci_maketrans: HBCI account no. %s found.\n",
-    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
@@ -88,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 */
@@ -114,23 +107,27 @@
       gnc_hbci_dialog_hide(td);
 
       {
-	HBCI_OutboxJob *job = 
-	  gnc_hbci_trans_dialog_enqueue(td, api, customer, 
-					(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. */
 	successful = gnc_hbci_maketrans_final (td, gnc_acc, trans_type);
 
 	/* User pressed cancel? Then go back to HBCI transaction */
-	if (!successful)
+	if (!successful) {
+	  AB_Banking_DequeueJob (api, job);
+	  AB_Job_free (job);
 	  continue;
+	}
 
 	if (result == 0) {
 
 	  /* 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, job, interactor);
+	  successful = gnc_hbci_trans_dialog_execute(td, api, 
+						     job, interactor);
 
 	  if (!successful) {
 	    /* HBCI job failed -- then remove gnc txn from the books. */
@@ -138,8 +135,15 @@
 	    xaccTransBeginEdit(gtrans);
 	    xaccTransDestroy(gtrans);
 	    xaccTransCommitEdit(gtrans);
+
+/* 	    AB_Banking_DequeueJob(api, job); */
+/* 	    AB_Banking_DelFinishedJob(api, job); */
+/* 	    AB_Banking_DelPendingJob(api, job); */
 	  }
 	  
+	  AB_Banking_DequeueJob(api, job);
+	  AB_Banking_DelFinishedJob(api, job);
+	  AB_Banking_DelPendingJob(api, job);
 	} /* result == 0 */
 	else {
 	  /* huh? Only result == 0 should be possible. Simply ignore
@@ -159,8 +163,7 @@
       }*/
 
     /* Just to be on the safe side, clear queue once again. */
-    HBCI_API_clearQueueByStatus (api, HBCI_JOB_STATUS_NONE);
-    gnc_hbci_api_save (api);
+    gnc_AB_BANKING_fini (api);
     gnc_hbci_dialog_delete(td);
     gnc_trans_templ_delete_glist (template_list);
     
@@ -196,7 +199,7 @@
 {
   gnc_numeric amount;
   XferDialog *transdialog;
-  const HBCI_Transaction *h_trans;
+  const AB_TRANSACTION *h_trans;
   gboolean run_until_done = TRUE;
   g_assert(td);
 
@@ -217,7 +220,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.22.2.2
retrieving revision 1.22.2.3
diff -Lsrc/import-export/hbci/Makefile.am -Lsrc/import-export/hbci/Makefile.am -u -r1.22.2.2 -r1.22.2.3
--- 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-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 \
-  hbci-progressmon.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,7 +30,6 @@
   dialog-pass.h \
   druid-hbci-initial.h \
   druid-hbci-utils.h \
-  gnc-hbci-actions.h \
   gnc-hbci-cb.h \
   gnc-hbci-getbalance.h \
   gnc-hbci-gettrans.h \
@@ -51,7 +51,8 @@
   ${GLADE_LIBS} \
   ${GLIB_LIBS} \
   ${GNOMEUI_LIBS} \
-  ${HBCI_LIBS}
+  ${HBCI_LIBS} \
+  ${GNOME_XML_LIB}
 
 gncscmdir = ${GNC_SCM_INSTALL_DIR}/hbci
 
@@ -80,7 +81,8 @@
   ${GLADE_CFLAGS} \
   ${GNOME_INCLUDEDIR} \
   ${GTKHTML_CFLAGS} \
-  ${HBCI_CFLAGS}
+  ${HBCI_CFLAGS} \
+  ${GNOME_XML_CFLAGS}
 
 #gladedir = $(GNC_GLADE_DIR)
 #glade_DATA = 
Index: druid-hbci-utils.h
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/druid-hbci-utils.h,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -Lsrc/import-export/hbci/druid-hbci-utils.h -Lsrc/import-export/hbci/druid-hbci-utils.h -u -r1.3 -r1.3.2.1
--- src/import-export/hbci/druid-hbci-utils.h
+++ src/import-export/hbci/druid-hbci-utils.h
@@ -24,9 +24,9 @@
 #define DRUID_HBCI_UTILS_H
 
 #include <gnome.h>
-#include <openhbci/api.h>
+#include <aqbanking/banking.h>
 #include "hbci-interaction.h"
-
+#include "gnc-hbci-utils.h"
 
 /** Save the reference strings to the HBCI accounts in the kvp's of
  * the gnucash accounts. Each value will only be set if it is
@@ -36,23 +36,23 @@
 
 
 /** 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);
 
 gboolean
-gnc_test_dir_exist_error (GtkWindow *parent, const char *filename);
+gnc_test_dir_exist_error (GtkWidget *parent, const char *filename);
 
 
 #endif
Index: dialog-pass.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/dialog-pass.c,v
retrieving revision 1.3
retrieving revision 1.3.2.1
diff -Lsrc/import-export/hbci/dialog-pass.c -Lsrc/import-export/hbci/dialog-pass.c -u -r1.3 -r1.3.2.1
--- src/import-export/hbci/dialog-pass.c
+++ src/import-export/hbci/dialog-pass.c
@@ -31,9 +31,11 @@
 
 gboolean
 gnc_hbci_get_password (GtkWidget *parent,
+		       const char *windowtitle,
 		       const char *heading,
 		       const char *initial_password,
-		       char **password)
+		       char **password,
+		       gboolean hide_input)
 {
   GtkWidget *dialog;
   GtkWidget *heading_label;
@@ -59,11 +61,15 @@
   gnome_dialog_editable_enters (GNOME_DIALOG (dialog),
                                 GTK_EDITABLE (password_entry));
 
+  if (windowtitle)
+    gtk_window_set_title (GTK_WINDOW (dialog), windowtitle);
+
   if (heading)
     gtk_label_set_text (GTK_LABEL (heading_label), heading);
 
   if (initial_password)
     gtk_entry_set_text (GTK_ENTRY (password_entry), initial_password);
+  gtk_entry_set_visibility (GTK_ENTRY (password_entry), !hide_input);
 
   gtk_widget_grab_focus (password_entry);
 
@@ -90,6 +96,7 @@
 
 gboolean
 gnc_hbci_get_initial_password (GtkWidget *parent,
+			       const char *windowtitle,
 			       const char *heading,
 			       char **password)
 {
@@ -121,6 +128,9 @@
   gnome_dialog_editable_enters (GNOME_DIALOG (dialog),
                                 GTK_EDITABLE (confirm_entry));
 
+  if (windowtitle)
+    gtk_window_set_title (GTK_WINDOW (dialog), windowtitle);
+
   if (heading)
     gtk_label_set_text (GTK_LABEL (heading_label), heading);
 
@@ -152,10 +162,9 @@
       break;
 
     /* strings didn't match */
-    if (gnc_ok_cancel_dialog_parented (parent, 
-				       GNC_VERIFY_OK,
-				       _("The two passwords didn't match. \n"
-					 "Please try again."))
+    if (gnc_ok_cancel_dialog_parented (parent, GNC_VERIFY_OK,
+			      _("The two passwords didn't match. \n"
+				"Please try again."))
 	== GNC_VERIFY_CANCEL)
       break;
   }
Index: gnc-hbci-kvp.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/gnc-hbci-kvp.c,v
retrieving revision 1.4.2.1
retrieving revision 1.4.2.2
diff -Lsrc/import-export/hbci/gnc-hbci-kvp.c -Lsrc/import-export/hbci/gnc-hbci-kvp.c -u -r1.4.2.1 -r1.4.2.2
--- src/import-export/hbci/gnc-hbci-kvp.c
+++ src/import-export/hbci/gnc-hbci-kvp.c
@@ -21,12 +21,15 @@
 \********************************************************************/
 
 #include "gnc-hbci-kvp.h"
+#include <stdio.h>
 
 #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 */
 char *gnc_hbci_get_account_accountid (Account *a)
@@ -47,12 +50,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);
@@ -77,6 +74,26 @@
   kvp_frame_set_slot_nc (frame, HBCI_COUNTRY_CODE, value);
   xaccAccountCommitEdit (a);
 }
+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);
@@ -119,13 +136,35 @@
   gnc_book_kvp_changed (b);
 }
 
+#if 0
+GList *gnc_hbci_get_book_account_list (GNCBook *b)
+{
+  kvp_frame *frame = gnc_hbci_get_book_kvp (b);
+  kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNTS);
+  return kvp_value_get_glist (value);
+}
+void gnc_hbci_set_book_account_list (GNCBook *b, GList *account_list)
+{
+  kvp_frame *frame = gnc_hbci_get_book_kvp (b);
+  kvp_value *value = kvp_value_new_glist_nc (account_list);
+  kvp_frame_set_slot_nc (frame, HBCI_ACCOUNTS, value);
+  gnc_book_kvp_changed (b);
+}
+#endif
+
 
 /* lowlevel */
 /* getters  for kvp frame in book */
 kvp_frame *gnc_hbci_get_book_kvp (GNCBook *b)
 {
   kvp_frame *toplevel = gnc_book_get_slots (b);
-  return kvp_frame_get_frame (toplevel, HBCI_KEY, NULL);
+  kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY, NULL);
+  g_assert(result);
+  /*  if (!result) {
+      result = kvp_frame_new();
+      kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
+      } */
+  return result;
 }
 
 
@@ -134,5 +173,11 @@
 kvp_frame *gnc_hbci_get_account_kvp (Account *a)
 {
   kvp_frame *toplevel = xaccAccountGetSlots (a);
-  return kvp_frame_get_frame (toplevel, HBCI_KEY, NULL);
+  kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY, NULL);
+  g_assert(result);
+  /* if (!result) {
+      result = kvp_frame_new();
+      kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
+      }*/
+  return result;
 }
Index: hbci.glade
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/hbci/glade/hbci.glade,v
retrieving revision 1.26.2.7
retrieving revision 1.26.2.8
diff -Lsrc/import-export/hbci/glade/hbci.glade -Lsrc/import-export/hbci/glade/hbci.glade -u -r1.26.2.7 -r1.26.2.8
--- 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,1134 +111,39 @@
 	    <spacing>0</spacing>
 
 	    <widget>
-	      <class>GtkHBox</class>
-	      <name>hbox108</name>
-	      <border_width>5</border_width>
-	      <homogeneous>False</homogeneous>
-	      <spacing>5</spacing>
-	      <child>
-		<padding>0</padding>
-		<expand>True</expand>
-		<fill>True</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>
-		<child>
-		  <padding>0</padding>
-		  <expand>False</expand>
-		  <fill>False</fill>
-		</child>
-	      </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>
-	      </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>
+	      <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>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>
-    </widget>
-
-    <widget>
-      <class>GnomeDruidPageStandard</class>
-      <name>bank_page</name>
-      <title>Enter Bank 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>vbox130</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>frame54</name>
-	  <label>Bank 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>table1</name>
-	    <border_width>20</border_width>
-	    <rows>2</rows>
-	    <columns>3</columns>
-	    <homogeneous>False</homogeneous>
-	    <row_spacing>5</row_spacing>
-	    <column_spacing>0</column_spacing>
-
-	    <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>
-	      <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>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>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>
-
-	    <widget>
-	      <class>GtkLabel</class>
-	      <name>label8477398</name>
-	      <label>Bank Code</label>
-	      <justify>GTK_JUSTIFY_RIGHT</justify>
-	      <wrap>False</wrap>
-	      <xalign>0</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>
-	      </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>
-
-	    <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>
-
-	    <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>
-	  </widget>
-	</widget>
-      </widget>
-    </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>
-
-	    <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>
+	      <wrap>True</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>
+	      <xpad>10</xpad>
+	      <ypad>0</ypad>
+	      <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>GtkHBox</class>
+	      <name>hbox118</name>
+	      <border_width>9</border_width>
+	      <homogeneous>False</homogeneous>
+	      <spacing>0</spacing>
+	      <child>
+		<padding>0</padding>
+		<expand>False</expand>
+		<fill>False</fill>
+	      </child>
 
 	      <widget>
 		<class>GtkButton</class>
-		<name>addbank_button</name>
+		<name>aqhbci_button</name>
 		<can_focus>True</can_focus>
-		<label>Add 
-Bank</label>
+		<label>Start AqHBCI Wizard</label>
 		<relief>GTK_RELIEF_NORMAL</relief>
 		<child>
 		  <padding>0</padding>
@@ -1248,17 +153,7 @@
 	      </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>
+		<class>Placeholder</class>
 	      </widget>
 	    </widget>
 	  </widget>
@@ -1267,83 +162,9 @@
     </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>
+      <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>
@@ -1351,7 +172,8 @@
       <widget>
 	<class>GtkVBox</class>
 	<child_name>GnomeDruidPageStandard:vbox</child_name>
-	<name>druid-vbox8</name>
+	<name>druid-vbox3</name>
+	<border_width>10</border_width>
 	<homogeneous>False</homogeneous>
 	<spacing>0</spacing>
 	<child>
@@ -1361,8 +183,8 @@
 	</child>
 
 	<widget>
-	  <class>GtkVBox</class>
-	  <name>iniletter_server_vbox</name>
+	  <class>GtkHBox</class>
+	  <name>hbox112</name>
 	  <homogeneous>False</homogeneous>
 	  <spacing>0</spacing>
 	  <child>
@@ -1372,238 +194,146 @@
 	  </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>
+	    <class>GtkVBox</class>
+	    <name>vbox157</name>
 	    <homogeneous>False</homogeneous>
-	    <spacing>10</spacing>
+	    <spacing>0</spacing>
 	    <child>
 	      <padding>0</padding>
-	      <expand>False</expand>
+	      <expand>True</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 'Print' anyway.) </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>
+	      <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>
-	  </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>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>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>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>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>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>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>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>Placeholder</class>
+	    <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>
-
-	<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. Please print out a paper copy 
-by pressing 'Print'. (If you cannot see anything, press 'Print' anyway.) 
-Then press 'Next'.</label>
-	    <justify>GTK_JUSTIFY_LEFT</justify>
-	    <wrap>False</wrap>
-	    <xalign>0</xalign>
-	    <yalign>0</yalign>
-	    <xpad>0</xpad>
-	    <ypad>0</ypad>
+	    <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>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>
+	      <class>GtkVBox</class>
+	      <name>vbox144</name>
+	      <border_width>5</border_width>
+	      <homogeneous>False</homogeneous>
+	      <spacing>5</spacing>
+
+	      <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>
       </widget>
@@ -1617,14 +347,13 @@
 	<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.
+      <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.
 
-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>
@@ -2031,30 +760,6 @@
 	</widget>
 
 	<widget>
-	  <class>GtkEntry</class>
-	  <name>purpose_entry</name>
-	  <can_focus>True</can_focus>
-	  <editable>True</editable>
-	  <text_visible>True</text_visible>
-	  <text_max_length>27</text_max_length>
-	  <text></text>
-	  <child>
-	    <left_attach>0</left_attach>
-	    <right_attach>3</right_attach>
-	    <top_attach>11</top_attach>
-	    <bottom_attach>12</bottom_attach>
-	    <xpad>0</xpad>
-	    <ypad>0</ypad>
-	    <xexpand>True</xexpand>
-	    <yexpand>False</yexpand>
-	    <xshrink>False</xshrink>
-	    <yshrink>False</yshrink>
-	    <xfill>True</xfill>
-	    <yfill>False</yfill>
-	  </child>
-	</widget>
-
-	<widget>
 	  <class>GtkLabel</class>
 	  <name>label8877435</name>
 	  <label>Payment Purpose continued</label>
@@ -2081,30 +786,6 @@
 	</widget>
 
 	<widget>
-	  <class>GtkEntry</class>
-	  <name>purpose_cont_entry</name>
-	  <can_focus>True</can_focus>
-	  <editable>True</editable>
-	  <text_visible>True</text_visible>
-	  <text_max_length>27</text_max_length>
-	  <text></text>
-	  <child>
-	    <left_attach>0</left_attach>
-	    <right_attach>3</right_attach>
-	    <top_attach>13</top_attach>
-	    <bottom_attach>14</bottom_attach>
-	    <xpad>0</xpad>
-	    <ypad>0</ypad>
-	    <xexpand>True</xexpand>
-	    <yexpand>False</yexpand>
-	    <xshrink>False</xshrink>
-	    <yshrink>False</yshrink>
-	    <xfill>True</xfill>
-	    <yfill>False</yfill>
-	  </child>
-	</widget>
-
-	<widget>
 	  <class>GtkLabel</class>
 	  <name>orig_name_heading</name>
 	  <label>Originator Name</label>
@@ -2586,6 +1267,102 @@
 	    <yfill>True</yfill>
 	  </child>
 	</widget>
+
+	<widget>
+	  <class>GtkEntry</class>
+	  <name>purpose_entry</name>
+	  <can_focus>True</can_focus>
+	  <editable>True</editable>
+	  <text_visible>True</text_visible>
+	  <text_max_length>27</text_max_length>
+	  <text></text>
+	  <child>
+	    <left_attach>0</left_attach>
+	    <right_attach>1</right_attach>
+	    <top_attach>11</top_attach>
+	    <bottom_attach>12</bottom_attach>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <xexpand>True</xexpand>
+	    <yexpand>False</yexpand>
+	    <xshrink>False</xshrink>
+	    <yshrink>False</yshrink>
+	    <xfill>True</xfill>
+	    <yfill>False</yfill>
+	  </child>
+	</widget>
+
+	<widget>
+	  <class>GtkEntry</class>
+	  <name>purpose_cont2_entry</name>
+	  <can_focus>True</can_focus>
+	  <editable>True</editable>
+	  <text_visible>True</text_visible>
+	  <text_max_length>27</text_max_length>
+	  <text></text>
+	  <child>
+	    <left_attach>0</left_attach>
+	    <right_attach>1</right_attach>
+	    <top_attach>13</top_attach>
+	    <bottom_attach>14</bottom_attach>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <xexpand>True</xexpand>
+	    <yexpand>False</yexpand>
+	    <xshrink>False</xshrink>
+	    <yshrink>False</yshrink>
+	    <xfill>True</xfill>
+	    <yfill>False</yfill>
+	  </child>
+	</widget>
+
+	<widget>
+	  <class>GtkEntry</class>
+	  <name>purpose_cont_entry</name>
+	  <can_focus>True</can_focus>
+	  <editable>True</editable>
+	  <text_visible>True</text_visible>
+	  <text_max_length>27</text_max_length>
+	  <text></text>
+	  <child>
+	    <left_attach>2</left_attach>
+	    <right_attach>3</right_attach>
+	    <top_attach>11</top_attach>
+	    <bottom_attach>12</bottom_attach>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <xexpand>True</xexpand>
+	    <yexpand>False</yexpand>
+	    <xshrink>False</xshrink>
+	    <yshrink>False</yshrink>
+	    <xfill>True</xfill>
+	    <yfill>False</yfill>
+	  </child>
+	</widget>
+
+	<widget>
+	  <class>GtkEntry</class>
+	  <name>purpose_cont3_entry</name>
+	  <can_focus>True</can_focus>
+	  <editable>True</editable>
+	  <text_visible>True</text_visible>
+	  <text_max_length>27</text_max_length>
+	  <text></text>
+	  <child>
+	    <left_attach>2</left_attach>
+	    <right_attach>3</right_attach>
+	    <top_attach>13</top_attach>
+	    <bottom_attach>14</bottom_attach>
+	    <xpad>0</xpad>
+	    <ypad>0</ypad>
+	    <xexpand>True</xexpand>
+	    <yexpand>False</yexpand>
+	    <xshrink>False</xshrink>
+	    <yshrink>False</yshrink>
+	    <xfill>True</xfill>
+	    <yfill>False</yfill>
+	  </child>
+	</widget>
       </widget>
     </widget>
   </widget>


More information about the gnucash-changes mailing list