r20106 - gnucash/trunk - Remove the old "import-export/hbci" module because it is no longer supported.
Christian Stimming
cstim at code.gnucash.org
Sat Jan 15 04:52:54 EST 2011
Author: cstim
Date: 2011-01-15 04:52:53 -0500 (Sat, 15 Jan 2011)
New Revision: 20106
Trac: http://svn.gnucash.org/trac/changeset/20106
Removed:
gnucash/trunk/src/import-export/hbci/HACKING-HBCITEST.txt
gnucash/trunk/src/import-export/hbci/Makefile.am
gnucash/trunk/src/import-export/hbci/dialog-daterange.c
gnucash/trunk/src/import-export/hbci/dialog-daterange.h
gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c
gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h
gnucash/trunk/src/import-export/hbci/dialog-pass.c
gnucash/trunk/src/import-export/hbci/dialog-pass.h
gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
gnucash/trunk/src/import-export/hbci/druid-hbci-initial.h
gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c
gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h
gnucash/trunk/src/import-export/hbci/glade/Makefile.am
gnucash/trunk/src/import-export/hbci/glade/hbci.glade
gnucash/trunk/src/import-export/hbci/glade/hbcipass.glade
gnucash/trunk/src/import-export/hbci/glade/hbciprefs.glade
gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c
gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h
gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.h
gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h
gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h
gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.h
gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h
gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h
gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h
gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci-ui.xml
gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c
gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h
gnucash/trunk/src/import-export/hbci/gncmod-hbci.c
gnucash/trunk/src/import-export/hbci/hbci-interaction.c
gnucash/trunk/src/import-export/hbci/hbci-interaction.h
gnucash/trunk/src/import-export/hbci/hbci-interactionP.h
gnucash/trunk/src/import-export/hbci/schemas/Makefile.am
gnucash/trunk/src/import-export/hbci/schemas/apps_gnucash_dialog_hbci.schemas.in
gnucash/trunk/src/import-export/hbci/test/Makefile.am
gnucash/trunk/src/import-export/hbci/test/test-link-module.c
Modified:
gnucash/trunk/configure.ac
gnucash/trunk/src/bin/gnucash-bin.c
gnucash/trunk/src/import-export/Makefile.am
Log:
Remove the old "import-export/hbci" module because it is no longer supported.
The newer "import-export/aqbanking" has been in use since aqbanking-3.0.0.
As it turned out, we require aqbanking-4.0.0 now anyway, which was
release 2009-05-30. Consequently, the old module isn't being maintained
by us and so needs to be removed.
Modified: gnucash/trunk/configure.ac
===================================================================
--- gnucash/trunk/configure.ac 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/configure.ac 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1444,10 +1444,6 @@
src/import-export/log-replay/Makefile
src/import-export/aqbanking/Makefile
src/import-export/aqbanking/schemas/Makefile
- src/import-export/hbci/Makefile
- src/import-export/hbci/glade/Makefile
- src/import-export/hbci/schemas/Makefile
- src/import-export/hbci/test/Makefile
src/libqof/Makefile
src/libqof/qof/Makefile
src/optional/Makefile
Modified: gnucash/trunk/src/bin/gnucash-bin.c
===================================================================
--- gnucash/trunk/src/bin/gnucash-bin.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/bin/gnucash-bin.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -572,7 +572,6 @@
{ "gnucash/import-export/csv", 0, TRUE },
{ "gnucash/import-export/log-replay", 0, TRUE },
{ "gnucash/import-export/aqbanking", 0, TRUE },
- { "gnucash/import-export/hbci", 0, TRUE },
{ "gnucash/report/report-system", 0, FALSE },
{ "gnucash/report/stylesheets", 0, FALSE },
{ "gnucash/report/standard-reports", 0, FALSE },
Modified: gnucash/trunk/src/import-export/Makefile.am
===================================================================
--- gnucash/trunk/src/import-export/Makefile.am 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/Makefile.am 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,7 +1,7 @@
SUBDIRS = . schemas qif qif-import \
${OFX_DIR} ${AQBANKING_DIR} log-replay test csv
DIST_SUBDIRS = schemas qif qif-import qif-io-core \
- ofx aqbanking hbci log-replay test csv
+ ofx aqbanking log-replay test csv
pkglib_LTLIBRARIES=libgncmod-generic-import.la
Deleted: gnucash/trunk/src/import-export/hbci/HACKING-HBCITEST.txt
===================================================================
--- gnucash/trunk/src/import-export/hbci/HACKING-HBCITEST.txt 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/HACKING-HBCITEST.txt 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,56 +0,0 @@
-By Christian Stimming, 2005-01-11
-
-Hi all developers,
-
-as you know, Gnucash includes support for the German online banking
-protocol HBCI, and I usually emphasize that anyone outside Germany will
-be unable to use all these cool features. But it recently came to my
-mind that there is a test server, simulating a HBCI bank, which is run
-by a friend of us (Stefan Palme), and he is able to give the Gnucash
-developers something like a test account for, well, testing purposes.
-
-One authentification method of the HBCI protocol requires only a PIN for
-login, and a TAN (transaction number) for each issued online order. We
-can use this as a shared test account, because anyone who knows the PIN
-(and some TANs) can use it. So I invite all you fellow developers to
-install the HBCI features of gnucash, start the HBCI setup druid, setup
-a Pin/Tan-based HBCI account, and just try out all the possible
-features. Naturally, this test account won't move any real money around )
-
-(The Pin/Tan authentification method was added in 1.8.10 when changing
-the HBCI library to Aqbanking. This method is rather insecure, but since
-it is very simple to use there is quite some demand for it. So we
-eventually implemented it in gnucash. I wouldn't recommend this for real
-online banking if there is any of the other HBCI authentification
-methods like chip cards or RSA keys available.)
-
-Here's what you need to enter in the HBCI setup druid:
-* "Use Pin/Tan mode"
-* Bank Code: 80007777
- Server: www.hora-obscura.de/pintan/PinTanServlet
- (the URL changed on 2005-01-15)
-
- User-Name: (something arbitrary; only for yourself)
- User-Id: gnucash
- Customer-Id: gnucash [or as a second customer: gnucash2]
-* Then press next all the time
-* For this user the PIN is: 12345
-* The setup druid should automatically recognize that this account
- offers access to the account numbers "2501111538" and "2501111539"
-* That finishes the setup.
-
-If you want to send money between these two account numbers back and
-forth, you can do so by using any of the following TANs:
- 11111111
- 22222222
- ...
- 99999999
-
-Enjoy! Don't hesitate to notify me if anything is broke.
-
-Christian stimming at tuhh.de
-
-
-There's an administrator web frontend reachable under
-https://www.hora-obscura.de/hbci wheren the used TANs can be
-resetted. The password for this can be asked from Christian Stimming.
Deleted: gnucash/trunk/src/import-export/hbci/Makefile.am
===================================================================
--- gnucash/trunk/src/import-export/hbci/Makefile.am 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/Makefile.am 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,90 +0,0 @@
-SUBDIRS = . glade schemas test
-
-pkglib_LTLIBRARIES = libgncmod-hbci.la
-
-libgncmod_hbci_la_SOURCES = \
- dialog-daterange.c \
- dialog-hbcitrans.c \
- dialog-pass.c \
- gnc-file-aqb-import.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 \
- gnc-plugin-hbci.c \
- hbci-interaction.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 = \
- gnc-hbci-actions.c
-
-noinst_HEADERS = \
- dialog-daterange.h \
- dialog-hbcitrans.h \
- dialog-pass.h \
- druid-hbci-initial.h \
- druid-hbci-utils.h \
- gnc-file-aqb-import.h \
- gnc-hbci-getbalance.h \
- gnc-hbci-gettrans.h \
- gnc-hbci-kvp.h \
- gnc-hbci-transfer.h \
- gnc-hbci-trans-templ.h \
- gnc-hbci-utils.h \
- gnc-plugin-hbci.h \
- hbci-interaction.h \
- hbci-interactionP.h
-
-libgncmod_hbci_la_LDFLAGS = -avoid-version
-
-libgncmod_hbci_la_LIBADD = \
- ${top_builddir}/src/import-export/libgncmod-generic-import.la \
- ${top_builddir}/src/gnome/libgnc-gnome.la \
- ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
- ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
- ${top_builddir}/src/engine/libgncmod-engine.la \
- ${top_builddir}/src/core-utils/libgnc-core-utils.la \
- ${top_builddir}/src/gnc-module/libgnc-module.la \
- ${top_builddir}/src/libqof/qof/libgnc-qof.la \
- ${GNOME_LIBS} \
- ${GLADE_LIBS} \
- ${GLIB_LIBS} \
- ${AQBANKING_LIBS}
-
-AM_CPPFLAGS = \
- -I${top_srcdir}/src \
- -I${top_srcdir}/src/core-utils \
- -I${top_srcdir}/src/engine \
- -I${top_srcdir}/src/gnc-module \
- -I${top_srcdir}/src/app-utils \
- -I${top_srcdir}/src/gnome \
- -I${top_srcdir}/src/gnome-utils \
- -I${top_srcdir}/src/import-export \
- -I${top_srcdir}/src/register \
- -I${top_srcdir}/src/register/register-core \
- -I${top_srcdir}/src/register/register-gnome \
- -I${top_srcdir}/src/register/ledger-core \
- -I${top_srcdir}/src/libqof/qof \
- ${GUILE_INCS} \
- ${GNOME_CFLAGS} \
- ${GLADE_CFLAGS} \
- ${GLIB_CFLAGS} \
- ${AQBANKING_CFLAGS}
-
-#gladedir = $(GNC_GLADE_DIR)
-#glade_DATA =
-
-uidir = $(GNC_UI_DIR)
-ui_DATA = \
- gnc-plugin-hbci-ui.xml
-
-EXTRA_DIST = ${gncscm_DATA} ${libgncmod_hbci_la_empty} ${ui_DATA}
-
-INCLUDES = -DG_LOG_DOMAIN=\"gnc.import.hbci\"
Deleted: gnucash/trunk/src/import-export/hbci/dialog-daterange.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-daterange.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/dialog-daterange.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,143 +0,0 @@
-/********************************************************************\
- * dialog-daterange.c -- dialog for date range entry *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-
-#include "dialog-utils.h"
-#include "gnc-ui.h"
-#include "gnc-date-edit.h"
-#include "dialog-daterange.h"
-
-typedef struct
-{
- GtkWidget *enter_from_button;
- GtkWidget *enter_to_button;
- GtkWidget *from_dateedit;
- GtkWidget *to_dateedit;
-} DaterangeInfo;
-
-void on_button_toggled (GtkToggleButton *button, gpointer user_data);
-
-
-gboolean
-gnc_hbci_enter_daterange (GtkWidget *parent,
- const char *heading,
- Timespec *from_date,
- gboolean *last_retv_date,
- gboolean *first_possible_date,
- Timespec *to_date,
- gboolean *to_now)
-{
- GtkWidget *dialog;
- GladeXML *xml;
- gint result;
- DaterangeInfo info;
-
- GtkWidget *heading_label;
- GtkWidget *last_retrieval_button;
- GtkWidget *first_button;
- GtkWidget *now_button;
-
- xml = gnc_glade_xml_new ("hbci.glade", "HBCI_daterange_dialog");
-
- dialog = glade_xml_get_widget (xml, "HBCI_daterange_dialog");
-
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
-
- heading_label = glade_xml_get_widget (xml, "heading_label");
- last_retrieval_button = glade_xml_get_widget (xml, "last_retrieval_button");
- first_button = glade_xml_get_widget (xml, "first_button");
- info.enter_from_button = glade_xml_get_widget (xml, "enter_from_button");
- info.enter_to_button = glade_xml_get_widget (xml, "enter_to_button");
- now_button = glade_xml_get_widget (xml, "now_button");
-
- info.from_dateedit = gnc_date_edit_new_ts (*from_date, FALSE, FALSE);
- gtk_container_add (GTK_CONTAINER (glade_xml_get_widget
- (xml, "enter_from_box")),
- info.from_dateedit);
-
- info.to_dateedit = gnc_date_edit_new_ts (*to_date, FALSE, FALSE);
- gtk_container_add (GTK_CONTAINER (glade_xml_get_widget
- (xml, "enter_to_box")),
- info.to_dateedit);
-
- if (*last_retv_date == FALSE)
- {
- gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (first_button), TRUE);
- gtk_widget_set_sensitive (last_retrieval_button, FALSE);
- }
-
- gtk_widget_set_sensitive (info.from_dateedit, FALSE);
- gtk_widget_set_sensitive (info.to_dateedit, FALSE);
- g_signal_connect (info.enter_from_button, "toggled",
- G_CALLBACK (on_button_toggled), &info);
- g_signal_connect (info.enter_to_button, "toggled",
- G_CALLBACK (on_button_toggled), &info);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
-
- if (heading)
- gtk_label_set_text (GTK_LABEL (heading_label), heading);
-
- gtk_widget_grab_focus (glade_xml_get_widget (xml, "ok_button"));
-
- gtk_widget_show_all (GTK_WIDGET (dialog));
-
- result = gtk_dialog_run (GTK_DIALOG (dialog));
- if (result >= 0)
- gtk_widget_hide (GTK_WIDGET (dialog));
-
- if (result == 1)
- {
- *from_date = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (info.from_dateedit));
- *last_retv_date = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (last_retrieval_button));
- *first_possible_date = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (first_button));
- *to_date = gnc_date_edit_get_date_ts (GNC_DATE_EDIT (info.to_dateedit));
- *to_now = gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (now_button));
-
- gtk_widget_destroy (GTK_WIDGET (dialog));
- return TRUE;
- }
-
- if (result >= 0)
- gtk_widget_destroy (GTK_WIDGET (dialog));
- return FALSE;
-}
-
-void on_button_toggled (GtkToggleButton *button, gpointer user_data)
-{
- DaterangeInfo *info = user_data;
- g_assert (info);
-
- gtk_widget_set_sensitive (info->from_dateedit,
- gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (info->enter_from_button)));
- gtk_widget_set_sensitive (info->to_dateedit,
- gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (info->enter_to_button)));
-}
Deleted: gnucash/trunk/src/import-export/hbci/dialog-daterange.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-daterange.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/dialog-daterange.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,39 +0,0 @@
-/********************************************************************\
- * dialog-daterange.h -- dialog for date range entry *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef DIALOG_DATERANGE_H
-#define DIALOG_DATERANGE_H
-
-#include "qof.h"
-
-gboolean
-gnc_hbci_enter_daterange (GtkWidget *parent,
- const char *heading,
- Timespec *from_date,
- gboolean *last_retv_date,
- gboolean *first_possible_date,
- Timespec *to_date,
- gboolean *to_now);
-
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,1118 +0,0 @@
-/********************************************************************\
- * dialog-hbcitrans.c -- dialog for hbci transaction *
- * Copyright (C) 2002 Christian Stimming *
- * Copyright (C) 2004 Bernd Wagner (changes for *
- * online transaction templates) *
- * Copyright (c) 2006 David Hampton <hampton at employees.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-
-#include <gnome.h>
-#include <glib/gi18n.h>
-#include <aqbanking/version.h>
-#include <aqbanking/account.h>
-#include <aqbanking/jobsingletransfer.h>
-#include <aqbanking/jobsingledebitnote.h>
-#include <aqbanking/jobinternaltransfer.h>
-#include <iconv.h>
-
-#include "dialog-utils.h"
-#include "gnc-glib-utils.h"
-#include "gnc-ui.h"
-#include "gnc-amount-edit.h"
-#include "dialog-transfer.h"
-
-#include "gnc-hbci-utils.h"
-#include "gnc-hbci-trans-templ.h"
-#include "dialog-hbcitrans.h"
-#if HAVE_KTOBLZCHECK_H
-# include <ktoblzcheck.h>
-#endif
-
-#define TEMPLATE_LABEL "template"
-
-typedef enum
-{
- TEMPLATE_NAME,
- TEMPLATE_POINTER,
- TEMPLATE_NUM_COLUMNS
-} TemplateListColumns;
-
-/* -------------------------------------- */
-/* Data structure */
-/* -------------------------------------- */
-struct _trans_data
-{
- /* The dialog itself */
- GtkWidget *dialog;
- GtkWidget *parent;
-
- /* Whether this is a transfer or a direct debit */
- GNC_HBCI_Transtype trans_type;
-
- /* Recipient */
- GtkWidget *recp_name_entry;
- GtkWidget *recp_account_entry;
- GtkWidget *recp_bankcode_entry;
-
- /* Amount */
- GtkWidget *amount_edit;
-
- /* 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;
-
- /* The template choosing GtkTreeView/GtkListStore */
- GtkTreeView *template_gtktreeview;
- GtkListStore *template_list_store;
-
- /* Flag, if template list has been changed */
- gboolean templ_changed;
-
- /* The HBCI transaction that got created here */
- AB_TRANSACTION *hbci_trans;
-
- /* The gnucash transaction dialog where the user specifies the gnucash transaction. */
- XferDialog *gnc_trans_dialog;
-
- /* The Gnucash transaction that got created here */
- Transaction *gnc_trans;
-
-#if HAVE_KTOBLZCHECK_H
- /* object for Account number checking */
- AccountNumberCheck *blzcheck;
-#endif
-};
-
-
-void gnc_hbci_dialog_delete(HBCITransDialog *td)
-{
- if (!td) return;
- /* Unregister handler for transaction creation callback */
- if (td->gnc_trans_dialog)
- gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
- if (td->hbci_trans)
- AB_Transaction_free (td->hbci_trans);
-
- if (td->dialog)
- gtk_widget_destroy (GTK_WIDGET (td->dialog));
-#if HAVE_KTOBLZCHECK_H
- AccountNumberCheck_delete(td->blzcheck);
-#endif
-}
-
-static gboolean
-get_templ_helper (GtkTreeModel *model,
- GtkTreePath *path,
- GtkTreeIter *iter,
- gpointer data)
-{
- GList **list = data;
- GNCTransTempl *templ;
-
- gtk_tree_model_get (model, iter,
- TEMPLATE_POINTER, &templ,
- -1);
- *list = g_list_append(*list, templ);
- return FALSE; /* continue */
-}
-
-GList *gnc_hbci_dialog_get_templ(const HBCITransDialog *td)
-{
- GList *list = NULL;
-
- g_assert(td);
- gtk_tree_model_foreach(GTK_TREE_MODEL(td->template_list_store),
- get_templ_helper, &list);
- return list;
-}
-GtkWidget *gnc_hbci_dialog_get_parent(const HBCITransDialog *td)
-{
- g_assert(td);
- return td->parent;
-}
-const AB_TRANSACTION *gnc_hbci_dialog_get_htrans(const HBCITransDialog *td)
-{
- g_assert(td);
- return td->hbci_trans;
-}
-Transaction *gnc_hbci_dialog_get_gtrans(const HBCITransDialog *td)
-{
- g_assert(td);
- return td->gnc_trans;
-}
-gboolean gnc_hbci_dialog_get_templ_changed(const HBCITransDialog *td)
-{
- g_assert(td);
- return td->templ_changed;
-}
-void gnc_hbci_dialog_hide(HBCITransDialog *td)
-{
- g_assert(td);
- gtk_widget_hide_all (td->dialog);
-}
-void gnc_hbci_dialog_show(HBCITransDialog *td)
-{
- g_assert(td);
- gtk_widget_show_all (td->dialog);
-}
-
-
-/* -------------------------------------- */
-/* Prototypes; callbacks for dialog function */
-/* -------------------------------------- */
-
-AB_TRANSACTION *
-hbci_trans_fill_values(const AB_ACCOUNT *h_acc, HBCITransDialog *td);
-gboolean
-check_ktoblzcheck(GtkWidget *parent, const HBCITransDialog *td,
- const AB_TRANSACTION *trans);
-
-void on_template_list_selection_changed(GtkTreeSelection *selection, gpointer user_data);
-
-void template_selection_cb(GtkButton *b, gpointer user_data);
-void add_template_cb(GtkButton *b, gpointer user_data);
-void moveup_template_cb(GtkButton *button, gpointer user_data);
-void movedown_template_cb(GtkButton *button, gpointer user_data);
-void sort_template_cb(GtkButton *button, gpointer user_data);
-void del_template_cb(GtkButton *button, gpointer user_data);
-
-void blz_changed_cb(GtkEditable *e, gpointer user_data);
-
-
-
-/* -------------------------------------- */
-/* Main dialog function */
-/* -------------------------------------- */
-
-/* doesn't exist any longer */
-
-/* ************************************************************
- * constructor
- */
-
-static void fill_template_list_func(gpointer data, gpointer user_data)
-{
- GNCTransTempl *templ = data;
- GtkListStore *list_store = user_data;
- GtkTreeIter iter;
-
- g_assert(templ);
- g_assert(list_store);
-
- gtk_list_store_append(list_store, &iter);
- gtk_list_store_set(list_store, &iter,
- TEMPLATE_NAME, gnc_trans_templ_get_name(templ),
- TEMPLATE_POINTER, templ,
- -1);
-}
-
-HBCITransDialog *
-gnc_hbci_dialog_new (GtkWidget *parent,
- const AB_ACCOUNT *h_acc,
- Account *gnc_acc,
- GNC_HBCI_Transtype trans_type,
- GList *templates)
-{
- GladeXML *xml;
- const char *hbci_bankid;
- HBCITransDialog *td;
- GtkTreeSelection *selection;
- GtkTreeViewColumn *column;
- GtkCellRenderer *renderer;
-
- td = g_new0(HBCITransDialog, 1);
-
- td->parent = parent;
- td->trans_type = trans_type;
- g_assert (h_acc);
- hbci_bankid = AB_Account_GetBankCode(h_acc);
-#if HAVE_KTOBLZCHECK_H
- td->blzcheck = AccountNumberCheck_new();
-#endif
-
- xml = gnc_glade_xml_new ("hbci.glade", "HBCI_trans_dialog");
-
- td->dialog = glade_xml_get_widget (xml, "HBCI_trans_dialog");
-
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (td->dialog),
- GTK_WINDOW (parent));
-
- {
- gchar *hbci_bankname, *hbci_ownername;
- GtkWidget *heading_label;
- GtkWidget *recp_name_heading;
- GtkWidget *recp_account_heading;
- GtkWidget *recp_bankcode_heading;
- GtkWidget *amount_hbox;
- GtkWidget *orig_name_label;
- GtkWidget *orig_account_label;
- GtkWidget *orig_bankname_label;
- GtkWidget *orig_bankcode_label;
- GtkWidget *orig_name_heading;
- GtkWidget *orig_account_heading;
- GtkWidget *orig_bankname_heading;
- GtkWidget *orig_bankcode_heading;
- GtkWidget *exec_later_button;
- GtkWidget *add_templ_button;
- GtkWidget *moveup_templ_button;
- GtkWidget *movedown_templ_button;
- GtkWidget *sort_templ_button;
- GtkWidget *del_templ_button;
-
- g_assert
- ((heading_label = glade_xml_get_widget (xml, "heading_label")) != NULL);
- g_assert
- ((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")) != NULL);
- g_assert
- ((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")) != NULL);
- g_assert
- ((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")) != NULL);
- g_assert
- ((td->recp_bankname_label = glade_xml_get_widget (xml, "recp_bankname_label")) != NULL);
- g_assert
- ((amount_hbox = glade_xml_get_widget (xml, "amount_hbox")) != NULL);
- g_assert
- ((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")) != NULL);
- g_assert
- ((td->purpose_cont2_entry = glade_xml_get_widget (xml, "purpose_cont2_entry")) != NULL);
- g_assert
- ((td->purpose_cont3_entry = glade_xml_get_widget (xml, "purpose_cont3_entry")) != NULL);
- g_assert
- ((orig_name_label = glade_xml_get_widget (xml, "orig_name_label")) != NULL);
- g_assert
- ((orig_account_label = glade_xml_get_widget (xml, "orig_account_label")) != NULL);
- g_assert
- ((orig_bankname_label = glade_xml_get_widget (xml, "orig_bankname_label")) != NULL);
- g_assert
- ((orig_bankcode_label = glade_xml_get_widget (xml, "orig_bankcode_label")) != NULL);
- g_assert
- ((orig_name_heading = glade_xml_get_widget (xml, "orig_name_heading")) != NULL);
- g_assert
- ((orig_account_heading = glade_xml_get_widget (xml, "orig_account_heading")) != NULL);
- g_assert
- ((orig_bankname_heading = glade_xml_get_widget (xml, "orig_bankname_heading")) != NULL);
- g_assert
- ((orig_bankcode_heading = glade_xml_get_widget (xml, "orig_bankcode_heading")) != NULL);
- g_assert
- ((exec_later_button = glade_xml_get_widget (xml, "exec_later_button")) != NULL);
- g_assert
- ((td->template_gtktreeview = GTK_TREE_VIEW(glade_xml_get_widget (xml, "template_list"))) != NULL);
- g_assert
- ((add_templ_button = glade_xml_get_widget (xml, "add_templ_button")) != NULL);
- g_assert
- ((moveup_templ_button = glade_xml_get_widget (xml, "moveup_templ_button")) != NULL);
- g_assert
- ((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);
- gnc_amount_edit_set_evaluate_on_enter (GNC_AMOUNT_EDIT (td->amount_edit),
- TRUE);
- gnc_amount_edit_set_fraction (GNC_AMOUNT_EDIT (td->amount_edit),
- xaccAccountGetCommoditySCU (gnc_acc));
-
- /* Check for what kind of transaction this should be, and change
- the labels accordingly. */
- switch (trans_type)
- {
- case SINGLE_TRANSFER:
- case SINGLE_INTERNAL_TRANSFER:
- /* all labels are already set */
- break;
- case SINGLE_DEBITNOTE:
- gtk_label_set_text (GTK_LABEL (heading_label),
- /* Translators: Strings from this file are needed only in
- * countries that have one of aqbanking's Online Banking
- * techniques available. This is 'OFX DirectConnect'
- * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
- * (Switzerland). If none of these techniques are available
- * in your country, you may safely ignore strings from the
- * import-export/hbci subdirectory. */
- _("Enter an Online Direct Debit Note"));
-
- gtk_label_set_text (GTK_LABEL (recp_name_heading),
- _("Debited Account Owner"));
- gtk_label_set_text (GTK_LABEL (recp_account_heading),
- _("Debited Account Number"));
- gtk_label_set_text (GTK_LABEL (recp_bankcode_heading),
- _("Debited Account Bank Code"));
-
- gtk_label_set_text (GTK_LABEL (orig_name_heading),
- _("Credited Account Owner"));
- gtk_label_set_text (GTK_LABEL (orig_account_heading),
- _("Credited Account Number"));
- gtk_label_set_text (GTK_LABEL (orig_bankcode_heading),
- _("Credited Account Bank Code"));
- break;
-
- default:
- g_critical("dialog-hbcitrans: Oops, unknown GNC_HBCI_Transtype %d.\n",
- trans_type);
- }
-
- /* Make this button insensitive since it's still unimplemented. */
- gtk_widget_destroy (exec_later_button);
-
- /* aqbanking up to 2.3.0 did not guarantee the following strings
- to be correct utf8; mentioned in bug#351371. */
- hbci_bankname =
- gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName(h_acc));
- hbci_ownername =
- gnc_utf8_strip_invalid_strdup (AB_Account_GetOwnerName(h_acc));
-
- /* Fill in the values from the objects */
- gtk_label_set_text (GTK_LABEL (orig_name_label),
- hbci_ownername);
- gtk_label_set_text (GTK_LABEL (orig_account_label),
- AB_Account_GetAccountNumber (h_acc));
- gtk_label_set_text (GTK_LABEL (orig_bankname_label),
- (hbci_bankname && (strlen(hbci_bankname) > 0) ?
- hbci_bankname :
- _("(unknown)")));
- gtk_label_set_text (GTK_LABEL (orig_bankcode_label),
- hbci_bankid);
- g_free (hbci_ownername);
- g_free (hbci_bankname);
-
- /* fill list for choosing a transaction template */
- gtk_tree_view_set_headers_visible(td->template_gtktreeview, FALSE);
- td->template_list_store = gtk_list_store_new(TEMPLATE_NUM_COLUMNS,
- G_TYPE_STRING,
- G_TYPE_POINTER);
- gtk_tree_view_set_model(td->template_gtktreeview,
- GTK_TREE_MODEL(td->template_list_store));
- g_object_unref(td->template_list_store);
- g_list_foreach(templates, fill_template_list_func, td->template_list_store);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes ("Template Name",
- renderer,
- "text", TEMPLATE_NAME,
- NULL);
- gtk_tree_view_append_column(td->template_gtktreeview, column);
-
- td->templ_changed = FALSE;
-
- /* Connect signals */
- selection = gtk_tree_view_get_selection(td->template_gtktreeview);
- g_signal_connect (selection, "changed",
- G_CALLBACK (on_template_list_selection_changed),
- td);
-
- g_signal_connect (add_templ_button, "clicked",
- G_CALLBACK(add_template_cb), td);
- g_signal_connect (moveup_templ_button, "clicked",
- G_CALLBACK (moveup_template_cb),
- td);
-
- g_signal_connect (movedown_templ_button, "clicked",
- G_CALLBACK (movedown_template_cb),
- td);
-
- g_signal_connect (sort_templ_button, "clicked",
- G_CALLBACK (sort_template_cb),
- td);
-
- g_signal_connect (del_templ_button, "clicked",
- G_CALLBACK (del_template_cb),
- td);
-
- g_signal_connect (td->recp_bankcode_entry, "changed",
- G_CALLBACK(blz_changed_cb), td);
-
- } /* GtkWidget declarations/definitions */
-
- return td;
-}
-
-
-/* ************************************************************
- * Now all the functions where the action happens.
- */
-
-int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td,
- const AB_ACCOUNT *h_acc)
-{
- gint result;
- int max_purpose_lines;
- gboolean values_ok;
-
- {
- AB_JOB *job = AB_JobSingleTransfer_new((AB_ACCOUNT *)h_acc);
- if (AB_Job_CheckAvailability(job))
- {
- g_warning("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
- return GTK_RESPONSE_CANCEL;
- }
- {
- const AB_TRANSACTION_LIMITS *joblimits = AB_JobSingleTransfer_GetFieldLimits(job);
- max_purpose_lines = (joblimits ?
- AB_TransactionLimits_GetMaxLinesPurpose (joblimits) :
- 2);
- }
- /* 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
- {
-
- /* Make sure to show the dialog here */
- gtk_widget_show_all (td->dialog);
-
- /* Now run the dialog until it gets closed by a button press. */
- result = gtk_dialog_run (GTK_DIALOG (td->dialog));
- /* g_message("hbci_trans: result button was %d.\n", result); */
-
- /* The dialog gets hidden anyway as soon as any button is pressed. */
- gtk_widget_hide_all (td->dialog);
-
- /* Was cancel pressed or dialog closed?
- * GNC_RESPONSE_NOW == execute now
- * GNC_RESPONSE_LATER == scheduled for later execution (currently unimplemented)
- * GTK_RESPONSE_CANCEL == cancel
- * GTK_RESPONSE_DELETE_EVENT == window destroyed */
- if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER))
- {
- gtk_widget_destroy (GTK_WIDGET (td->dialog));
- td->dialog = NULL;
- return GTK_RESPONSE_CANCEL;
- }
-
- /* Now fill in the values from the entry fields into a new
- AB_TRANSACTION. */
- td->hbci_trans = hbci_trans_fill_values(h_acc, td);
- values_ok = TRUE;
-
- /*printf("dialog-hbcitrans: Got value as %s .\n",
- 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
- (td->dialog,
- TRUE,
- "%s",
- _("The amount is zero or the amount field could not be "
- "interpreted correctly. You might have mixed up decimal "
- "point and comma, compared to your locale settings. "
- "This does not result in a valid online transfer job. \n"
- "\n"
- "Do you want to enter the job again?"));
- if (values_ok)
- {
- AB_Transaction_free (td->hbci_trans);
- td->hbci_trans = NULL;
- return GTK_RESPONSE_CANCEL;
- }
- continue;
- } /* check Transaction_value */
-
- {
- char *purpose = gnc_hbci_getpurpose (td->hbci_trans);
- if (strlen(purpose) == 0)
- {
- gtk_widget_show_all (td->dialog);
- values_ok = !gnc_verify_dialog
- (GTK_WIDGET (td->dialog),
- TRUE,
- "%s",
- _("You did not enter any transaction purpose. A purpose is "
- "required for an online transfer.\n"
- "\n"
- "Do you want to enter the job again?"));
- if (values_ok)
- {
- AB_Transaction_free (td->hbci_trans);
- td->hbci_trans = NULL;
- return GTK_RESPONSE_CANCEL;
- }
- continue;
- } /* check Transaction_purpose */
- }
-
- {
- char *othername = gnc_hbci_getremotename (td->hbci_trans);
- if (!othername || (strlen (othername) == 0))
- {
- gtk_widget_show_all (td->dialog);
- values_ok = !gnc_verify_dialog
- (GTK_WIDGET (td->dialog),
- TRUE,
- "%s",
- _("You did not enter a recipient name. A recipient name is "
- "required for an online transfer.\n"
- "\n"
- "Do you want to enter the job again?"));
- if (othername)
- g_free (othername);
- if (values_ok)
- {
- AB_Transaction_free (td->hbci_trans);
- td->hbci_trans = NULL;
- return GTK_RESPONSE_CANCEL;
- }
- continue;
- } /* check Recipient Name (in aqbanking: Remote Name) */
- }
-
- /* FIXME: If this is a direct debit, set the textkey/ "Textschluessel"/
- transactionCode according to some GUI selection here!! */
- /*if (td->trans_type == SINGLE_DEBITNOTE)
- 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);
-
- }
- while (!values_ok);
-
- return result;
-}
-
-/** Create a new AB_TRANSACTION, fill the values from the entry
- fields into it and return it. The caller must
- 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 */
- AB_TRANSACTION *trans = AB_Transaction_new();
- gchar *tmpchar;
-
- /* The internal source encoding is returned by
- gnc_hbci_book_encoding(), which is hard-coded so far. This needs
- to be fixed for the gnome2 version; the source encoding is then
- probably utf-8 as well. iconv is also used in
- gnc_AB_BANKING_interactors() in hbci-interaction.c. */
- GIConv gnc_iconv_handler =
- g_iconv_open(gnc_hbci_AQBANKING_encoding(), gnc_hbci_book_encoding());
- g_assert(gnc_iconv_handler != (GIConv)(-1));
-
- /* OpenHBCI newer than 0.9.8: use account's bankCode values
- * instead of the bank's ones since this is what some banks
- * require. */
- AB_Transaction_SetLocalBankCode (trans,
- AB_Account_GetBankCode (h_acc));
- AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (h_acc));
- AB_Transaction_SetLocalCountry (trans, "DE");
-
- AB_Transaction_SetRemoteBankCode
- (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)));
- /* g_message("Got otherBankCode %s.\n",
- AB_Transaction_otherBankCode (trans)); */
- AB_Transaction_SetRemoteAccountNumber
- (trans, gtk_entry_get_text (GTK_ENTRY (td->recp_account_entry)));
- /* g_message("Got otherAccountId %s.\n",
- AB_Transaction_otherAccountId (trans)); */
- AB_Transaction_SetRemoteCountry (trans, "DE");
-
- /* Convert the result of GTK_ENTRY into UTF-8 */
- tmpchar = gnc_call_iconv(gnc_iconv_handler,
- gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)));
- AB_Transaction_AddRemoteName (trans, tmpchar, FALSE);
- g_free (tmpchar);
-
- /* The last argument means: If TRUE, then the string will be only be
- appended if it doesn't exist yet. */
- /* Convert the result of GTK_ENTRY into UTF-8 */
- tmpchar = gnc_call_iconv(gnc_iconv_handler,
- gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)));
- AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
- g_free (tmpchar);
- tmpchar = gnc_call_iconv(gnc_iconv_handler,
- gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
- if (strlen(tmpchar) > 0)
- AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
- g_free (tmpchar);
- tmpchar = gnc_call_iconv(gnc_iconv_handler,
- gtk_entry_get_text (GTK_ENTRY (td->purpose_cont2_entry)));
- if (strlen(tmpchar) > 0)
- AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
- g_free (tmpchar);
- tmpchar = gnc_call_iconv(gnc_iconv_handler,
- gtk_entry_get_text (GTK_ENTRY (td->purpose_cont3_entry)));
- if (strlen(tmpchar) > 0)
- AB_Transaction_AddPurpose (trans, tmpchar, FALSE);
- g_free (tmpchar);
-
- /* FIXME: Replace "EUR" by account-dependent string here. */
- AB_Transaction_SetValue
- (trans, AB_Value_new
- (gnc_amount_edit_get_damount (GNC_AMOUNT_EDIT (td->amount_edit)), "EUR"));
-
- /* If this is a direct debit, a textkey/ "Textschluessel"/
- transactionCode different from the default has to be set. */
- switch (td->trans_type)
- {
- case SINGLE_DEBITNOTE:
- /* AB_Transaction_SetTransactionCode (trans, 05); */
- AB_Transaction_SetTextKey (trans, 05);
- break;
- default:
- /* AB_Transaction_SetTransactionCode (trans, 51); */
- AB_Transaction_SetTextKey (trans, 51);
- }
-
- g_iconv_close(gnc_iconv_handler);
- return trans;
-}
-
-/** 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 AB_TRANSACTION *trans)
-{
-#if HAVE_KTOBLZCHECK_H
- int blzresult;
- const char *blztext;
- gboolean values_ok = TRUE;
-
- blzresult = AccountNumberCheck_check
- (td->blzcheck,
- AB_Transaction_GetRemoteBankCode (trans),
- AB_Transaction_GetRemoteAccountNumber (trans));
- switch (blzresult)
- {
- case 2:
- gtk_widget_show_all (parent);
- values_ok = gnc_verify_dialog
- (parent,
- TRUE,
- _("The internal check of the destination account number '%s' "
- "at the specified bank with bank code '%s' failed. This means "
- "the account number might contain an error. Should the online "
- "transfer job be sent with this account number anyway?"),
- AB_Transaction_GetRemoteAccountNumber (trans),
- AB_Transaction_GetRemoteBankCode (trans));
- blztext = "Kontonummer wahrscheinlich falsch";
- break;
- case 0:
- blztext = "Kontonummer ok";
- break;
- case 3:
- blztext = "bank unbekannt";
- break;
- default:
- case 1:
- blztext = "unbekannt aus unbekanntem grund";
- break;
- }
-
- /*printf("gnc_hbci_trans: KtoBlzCheck said check is %d = %s\n",
- blzresult, blztext);*/
- return values_ok;
-#else
- return TRUE;
-#endif
-}
-
-AB_JOB *
-gnc_hbci_trans_dialog_enqueue(const AB_TRANSACTION *hbci_trans, AB_BANKING *api,
- AB_ACCOUNT *h_acc,
- GNC_HBCI_Transtype trans_type)
-{
- AB_JOB *job;
-
- /* Create a Do-Transaction (Transfer) job. */
- switch (trans_type)
- {
- case SINGLE_DEBITNOTE:
- job = AB_JobSingleDebitNote_new(h_acc);
- break;
- case SINGLE_INTERNAL_TRANSFER:
- job = AB_JobInternalTransfer_new(h_acc);
- break;
- default:
- case SINGLE_TRANSFER:
- job = AB_JobSingleTransfer_new(h_acc);
- };
- if (AB_Job_CheckAvailability(job))
- {
- g_warning("gnc_hbci_trans_dialog_enqueue: Oops, job not available. Aborting.\n");
- return NULL;
- }
-
- switch (trans_type)
- {
- case SINGLE_DEBITNOTE:
- AB_JobSingleDebitNote_SetTransaction(job, hbci_trans);
- break;
- case SINGLE_INTERNAL_TRANSFER:
- AB_JobInternalTransfer_SetTransaction(job, hbci_trans);
- break;
- default:
- case SINGLE_TRANSFER:
- AB_JobSingleTransfer_SetTransaction(job, hbci_trans);
- };
-
- /* Add job to queue */
- AB_Banking_EnqueueJob(api, job);
-
- return job;
-}
-
-gboolean
-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_AB_BANKING_execute (td->parent, api, job, interactor);
-
- /*printf("dialog-hbcitrans: Ok, result of api_execute was %d.\n",
- successful);*/
-
- if (!successful)
- {
- /* AB_BANKING_executeOutbox failed. */
- if ((AB_Job_GetStatus (job) == AB_Job_StatusPending) ||
- (AB_Job_GetStatus (job) == AB_Job_StatusError))
- successful = !gnc_verify_dialog
- (td->parent,
- FALSE,
- "%s",
- _("The job was sent to the bank successfully, but the "
- "bank is refusing to execute the job. Please check "
- "the log window for the exact error message of the "
- "bank. The line with the error message contains a "
- "code number that is greater than 9000.\n"
- "\n"
- "Do you want to enter the job again?"));
-
- 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. */
- /* FIXME: need to do AB_Banking_DequeueJob(api, job); */
- return successful;
-}
-
-
-/* -------------------------------------- */
-/* Callbacks */
-/* -------------------------------------- */
-static void fill_entry(const char *str, GtkWidget *entry)
-{
- gtk_entry_set_text (GTK_ENTRY (entry), str ? str : "");
-}
-
-
-void
-on_template_list_selection_changed (GtkTreeSelection *selection,
- gpointer user_data)
-{
- HBCITransDialog *td = user_data;
- GNCTransTempl *templ;
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- g_assert(td);
-
- if (!gtk_tree_selection_get_selected(selection, &model, &iter))
- return;
- gtk_tree_model_get(model, &iter, TEMPLATE_POINTER, &templ, -1);
-
- fill_entry(gnc_trans_templ_get_recp_name(templ), td->recp_name_entry);
- fill_entry(gnc_trans_templ_get_recp_account(templ), td->recp_account_entry);
- fill_entry(gnc_trans_templ_get_recp_bankcode(templ), td->recp_bankcode_entry);
- fill_entry(gnc_trans_templ_get_purpose(templ), td->purpose_entry);
- fill_entry(gnc_trans_templ_get_purpose_cont(templ), td->purpose_cont_entry);
-
- gnc_amount_edit_set_amount (GNC_AMOUNT_EDIT (td->amount_edit),
- gnc_trans_templ_get_amount (templ));
-
-}
-
-
-void blz_changed_cb(GtkEditable *e, gpointer user_data)
-{
-#if HAVE_KTOBLZCHECK_H
- HBCITransDialog *td = user_data;
- const AccountNumberCheck_Record *record;
- g_assert(td);
-
- record = AccountNumberCheck_findBank
- (td->blzcheck,
- gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)));
-
- if (record)
- {
- const char *bankname = AccountNumberCheck_Record_bankName (record);
- GError *error = NULL;
- const char *ktoblzcheck_encoding =
-#ifdef KTOBLZCHECK_VERSION_MAJOR
- /* This version number macro has been added in
- ktoblzcheck-1.10, but this function exists already since
- ktoblzcheck-1.7, so we're on the safe side. */
- AccountNumberCheck_stringEncoding()
-#else
- /* Every ktoblzcheck release before 1.10 is guaranteed to
- return strings only in ISO-8859-15. */
- "ISO-8859-15"
-#endif
- ;
- gchar *utf8_bankname = g_convert (bankname, strlen(bankname),
- "UTF-8", ktoblzcheck_encoding,
- NULL, NULL, &error);
- if (error != NULL)
- {
- g_critical ("Error converting bankname \"%s\" to UTF-8\n", bankname);
- g_error_free (error);
- /* Conversion was erroneous, so don't use the string */
- utf8_bankname = g_strdup (_("(unknown)"));
- }
- gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
- (strlen(utf8_bankname) > 0 ?
- utf8_bankname : _("(unknown)")));
- g_free (utf8_bankname);
- gtk_widget_show_all (td->recp_bankname_label);
-
- /*printf("blz_changed_cb: KtoBlzCheck said check is bank is '%s' at '%s'.\n",
- bankname,
- AccountNumberCheck_Record_location (record));*/
-
- }
- else
- {
- gtk_label_set_text (GTK_LABEL (td->recp_bankname_label),
- _("(unknown)"));
- gtk_widget_show_all (td->recp_bankname_label);
- }
-#endif
-}
-
-/* -------------------------------------- */
-/* -------------------------------------- */
-
-void add_template_cb(GtkButton *b,
- gpointer user_data)
-{
- HBCITransDialog *td = user_data;
- GtkWidget *dlg;
- const gchar *name;
- int retval = -1;
- GladeXML *xml;
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter cur_iter, new_iter;
- GtkWidget *entry;
-
- g_assert(td);
-
- xml = gnc_glade_xml_new ("hbci.glade", "HBCI_template_name_dialog");
-
- dlg = glade_xml_get_widget (xml, "HBCI_template_name_dialog");
- entry = glade_xml_get_widget (xml, "template_name");
- gtk_entry_set_text(GTK_ENTRY(entry),
- gtk_entry_get_text(GTK_ENTRY(td->recp_name_entry)));
-
- retval = gtk_dialog_run(GTK_DIALOG(dlg));
-
- if (retval == GTK_RESPONSE_OK)
- {
- name = gtk_entry_get_text(GTK_ENTRY(entry));
-
- if (name && (strlen(name) > 0))
- {
- GNCTransTempl *r;
- /*printf("add_template_cb: adding template '%s'\n", name);*/
- r = gnc_trans_templ_new_full
- (name,
- gtk_entry_get_text (GTK_ENTRY (td->recp_name_entry)),
- gtk_entry_get_text (GTK_ENTRY (td->recp_account_entry)),
- gtk_entry_get_text (GTK_ENTRY (td->recp_bankcode_entry)),
- gnc_amount_edit_get_amount (GNC_AMOUNT_EDIT (td->amount_edit)),
- gtk_entry_get_text (GTK_ENTRY (td->purpose_entry)),
- gtk_entry_get_text (GTK_ENTRY (td->purpose_cont_entry)));
-
- selection = gtk_tree_view_get_selection(td->template_gtktreeview);
- if (gtk_tree_selection_get_selected(selection, &model, &cur_iter))
- {
- gtk_list_store_insert_after(td->template_list_store,
- &new_iter, &cur_iter);
- }
- else
- {
- gtk_list_store_append(GTK_LIST_STORE(model), &new_iter);
- }
- gtk_list_store_set(td->template_list_store, &new_iter,
- TEMPLATE_NAME, name,
- TEMPLATE_POINTER, r,
- -1);
- td->templ_changed = TRUE;
- }
- }
- gtk_widget_destroy(dlg);
- // g_object_unref(xml);
-}
-
-
-void
-moveup_template_cb(GtkButton *button,
- gpointer user_data)
-{
- HBCITransDialog *td = user_data;
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter iter, prev_iter;
- GtkTreePath *prev_path;
-
- g_assert(td);
-
- selection = gtk_tree_view_get_selection(td->template_gtktreeview);
- if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- return;
-
- prev_path = gtk_tree_model_get_path(model, &iter);
- if (gtk_tree_path_prev(prev_path))
- {
- if (gtk_tree_model_get_iter(model, &prev_iter, prev_path))
- {
- gtk_list_store_move_before(GTK_LIST_STORE(model), &iter, &prev_iter);
- td->templ_changed = TRUE;
- }
- }
-
- gtk_tree_path_free(prev_path);
-}
-
-
-void
-movedown_template_cb(GtkButton *button,
- gpointer user_data)
-{
- HBCITransDialog *td = user_data;
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter iter, next_iter;
-
- g_assert(td);
-
- selection = gtk_tree_view_get_selection(td->template_gtktreeview);
- if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- return;
-
- next_iter = iter;
- if (gtk_tree_model_iter_next(model, &next_iter))
- {
- gtk_list_store_move_after(GTK_LIST_STORE(model), &iter, &next_iter);
- td->templ_changed = TRUE;
- }
-}
-
-void
-sort_template_cb(GtkButton *button,
- gpointer user_data)
-{
- HBCITransDialog *td = user_data;
- g_assert(td);
-
- gtk_tree_sortable_set_sort_column_id
- (GTK_TREE_SORTABLE(td->template_list_store),
- TEMPLATE_NAME, GTK_SORT_ASCENDING);
- gtk_tree_sortable_set_sort_column_id
- (GTK_TREE_SORTABLE(td->template_list_store),
- GTK_TREE_SORTABLE_UNSORTED_SORT_COLUMN_ID,
- GTK_SORT_ASCENDING);
- td->templ_changed = TRUE;
-}
-
-
-
-void
-del_template_cb(GtkButton *button,
- gpointer user_data)
-{
- HBCITransDialog *td = user_data;
- GtkTreeSelection *selection;
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- g_assert(td);
-
- selection = gtk_tree_view_get_selection(td->template_gtktreeview);
- if (!gtk_tree_selection_get_selected (selection, &model, &iter))
- return;
-
- gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
- td->templ_changed = TRUE;
-}
-
-
-
-void gnc_hbci_dialog_xfer_cb(Transaction *trans, gpointer user_data)
-{
- HBCITransDialog *td = user_data;
- g_assert(td);
- if (trans)
- {
- td->gnc_trans = trans;
- /* Unregister handler for transaction creation callback */
- if (td->gnc_trans_dialog)
- gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
- td->gnc_trans_dialog = NULL;
- }
- else
- {
- if (td->gnc_trans_dialog)
- {
- gnc_xfer_dialog_set_txn_cb(td->gnc_trans_dialog, NULL, NULL);
- td->gnc_trans_dialog = NULL;
- }
- }
- return;
-}
Deleted: gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/dialog-hbcitrans.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,105 +0,0 @@
-/********************************************************************\
- * dialog-hbcitrans.h -- dialog for HBCI transaction data *
- * Copyright (C) 2002 Christian Stimming *
- * Copyright (C) 2004 Bernd Wagner (changes for *
- * online transaction templates) *
- * Copyright (c) 2006 David Hampton <hampton at employees.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef DIALOG_HBCITRANS_H
-#define DIALOG_HBCITRANS_H
-
-#include <aqbanking/banking.h>
-#include <aqbanking/transaction.h>
-#include <aqbanking/job.h>
-
-#include "Account.h"
-#include "gnc-hbci-utils.h"
-
-/** The dialog data structure. */
-typedef struct _trans_data HBCITransDialog;
-
-typedef enum GNC_HBCI_Transtype
-{
- SINGLE_TRANSFER = 0,
- SINGLE_DEBITNOTE,
- SINGLE_INTERNAL_TRANSFER
-} GNC_HBCI_Transtype;
-
-#define GNC_RESPONSE_NOW GTK_RESPONSE_YES
-#define GNC_RESPONSE_LATER 3
-
-/*AB_TRANSACTION *
-gnc_hbci_trans (GtkWidget *parent,
- AB_BANKING *api,
- GNCInteractor *interactor,
- const AB_ACCOUNT *h_acc,
- const HBCI_Customer *customer,
- Account *gnc_acc,
- GNC_HBCI_Transtype type,
- GList **templ);*/
-
-/** Constructor: Create a new HBCITransDialog, fill in the values as
- * specified by the arguments, and return a pointer to it. */
-HBCITransDialog *
-gnc_hbci_dialog_new (GtkWidget *parent,
- const AB_ACCOUNT *h_acc,
- Account *gnc_acc,
- GNC_HBCI_Transtype trans_type,
- GList *templ);
-/** Destructor */
-void gnc_hbci_dialog_delete(HBCITransDialog *td);
-
-/** Return the parent widget */
-GtkWidget *gnc_hbci_dialog_get_parent(const HBCITransDialog *td);
-/** Return the GList of transaction templates. */
-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 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 */
-void gnc_hbci_dialog_hide(HBCITransDialog *td);
-/** Show the dialog */
-void gnc_hbci_dialog_show(HBCITransDialog *td);
-
-
-
-int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td,
- const AB_ACCOUNT *h_acc);
-AB_JOB *
-gnc_hbci_trans_dialog_enqueue(const AB_TRANSACTION *hbci_trans, 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. */
-void gnc_hbci_dialog_xfer_cb(Transaction *trans, gpointer user_data);
-
-/** Execute the OutboxJob, delete it when finished. Returns TRUE if
- * the application should continue, and FALSE if the user wants to
- * enter this job again. */
-gboolean
-gnc_hbci_trans_dialog_execute(HBCITransDialog *td, AB_BANKING *api,
- AB_JOB *job, GNCInteractor *interactor);
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/dialog-pass.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-pass.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/dialog-pass.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,155 +0,0 @@
-/********************************************************************\
- * dialog-pass.c -- dialog for password entry *
- * Copyright (C) 2002 Christian Stimming *
- * heavily copied from Dave Peticolas <dave at krondo.com> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "dialog-utils.h"
-#include "gnc-ui.h"
-#include "dialog-pass.h"
-
-gboolean
-gnc_hbci_get_password (GtkWidget *parent,
- const char *windowtitle,
- const char *heading,
- const char *initial_password,
- char **password,
- gboolean hide_input)
-{
- GtkWidget *dialog;
- GtkWidget *heading_label;
- GtkWidget *password_entry;
- GladeXML *xml;
- gint result;
-
- g_return_val_if_fail (password != NULL, FALSE);
-
- xml = gnc_glade_xml_new ("hbcipass.glade", "Password Dialog");
-
- dialog = glade_xml_get_widget (xml, "Password Dialog");
-
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
-
- heading_label = glade_xml_get_widget (xml, "heading_label");
- password_entry = glade_xml_get_widget (xml, "password_entry");
- g_assert(heading_label && password_entry);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
-
- gtk_entry_set_activates_default (GTK_ENTRY (password_entry), TRUE);
-
- 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);
-
- result = gtk_dialog_run (GTK_DIALOG (dialog));
-
- if (result == 1) /* the hand-assigned response value */
- {
- *password = g_strdup (gtk_entry_get_text (GTK_ENTRY (password_entry)) );
- gtk_widget_destroy(dialog);
- return TRUE;
- }
- gtk_widget_destroy(dialog);
-
- *password = NULL;
- return FALSE;
-}
-
-
-gboolean
-gnc_hbci_get_initial_password (GtkWidget *parent,
- const char *windowtitle,
- const char *heading,
- char **password)
-{
- GtkWidget *dialog;
- GtkWidget *heading_label;
- GtkWidget *password_entry;
- GtkWidget *confirm_entry;
- GladeXML *xml;
- gint result;
-
- g_return_val_if_fail (password != NULL, FALSE);
-
- xml = gnc_glade_xml_new ("hbcipass.glade", "Initial Password Dialog");
-
- dialog = glade_xml_get_widget (xml, "Initial Password Dialog");
-
- if (parent)
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (parent));
-
- heading_label = glade_xml_get_widget (xml, "heading_label");
- password_entry = glade_xml_get_widget (xml, "password_entry");
- confirm_entry = glade_xml_get_widget (xml, "confirm_entry");
- g_assert(heading_label && password_entry && confirm_entry);
-
- gtk_dialog_set_default_response (GTK_DIALOG (dialog), 1);
-
- gtk_entry_set_activates_default (GTK_ENTRY (password_entry), FALSE);
- gtk_entry_set_activates_default (GTK_ENTRY (confirm_entry), TRUE);
-
- if (windowtitle)
- gtk_window_set_title (GTK_WINDOW (dialog), windowtitle);
-
- if (heading)
- gtk_label_set_text (GTK_LABEL (heading_label), heading);
-
- while (TRUE)
- {
- result = gtk_dialog_run (GTK_DIALOG (dialog));
-
- if (result == 1) /* the hand-assigned response value */
- {
- const char *pw = gtk_entry_get_text (GTK_ENTRY (password_entry));
- const char *confirm = gtk_entry_get_text (GTK_ENTRY (confirm_entry));
- if (strcmp (pw, confirm) == 0)
- {
- *password = g_strdup(pw);
- gtk_widget_destroy (GTK_WIDGET (dialog));
- return TRUE;
- }
- }
- else
- break;
-
- /* strings didn't match */
- if (gnc_ok_cancel_dialog (parent, GTK_RESPONSE_OK,
- _("The two passwords didn't match. "
- "Please try again."))
- != GTK_RESPONSE_OK)
- break;
- }
- *password = NULL;
- gtk_widget_destroy (GTK_WIDGET (dialog));
- return FALSE;
-}
Deleted: gnucash/trunk/src/import-export/hbci/dialog-pass.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/dialog-pass.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/dialog-pass.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,40 +0,0 @@
-/********************************************************************\
- * dialog-pass.h -- dialog for password entry *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef DIALOG_PASS_H
-#define DIALOG_PASS_H
-
-gboolean
-gnc_hbci_get_password (GtkWidget *parent,
- const char *windowtitle,
- const char *heading,
- const char *initial_password,
- char **password,
- gboolean hide_input);
-gboolean
-gnc_hbci_get_initial_password (GtkWidget *parent,
- const char *windowtitle,
- const char *heading,
- char **password);
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-initial.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,822 +0,0 @@
-/********************************************************************\
- * druid-hbci-initial.c -- hbci creation functionality *
- * Copyright (C) 2002 Christian Stimming *
- * Copyright (c) 2006 David Hampton <hampton at employees.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gnome.h>
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include <sys/types.h>
-#include <sys/stat.h>
-#ifdef HAVE_SYS_WAIT_H
-# include <sys/wait.h>
-#endif
-#include <fcntl.h>
-#include <unistd.h>
-
-#include "druid-hbci-initial.h"
-#include "druid-hbci-utils.h"
-#include "gnc-hbci-kvp.h"
-#include "import-account-matcher.h"
-#include "gnc-hbci-utils.h"
-
-#include "gnc-glib-utils.h"
-#include "dialog-utils.h"
-#include "druid-utils.h"
-#include "gnc-ui-util.h"
-#include "gnc-ui.h"
-//#include "gnc-html.h"
-//#include "import-account-matcher.h"
-#include "gnc-component-manager.h"
-#include "gnc-session.h"
-
-#include <aqbanking/banking.h>
-#include <aqbanking/version.h>
-#include <gwenhywfar/stringlist.h>
-#include <gwenhywfar/version.h>
-
-#define DRUID_HBCI_IMPORT_CM_CLASS "druid-hbci-import"
-/* #define DEFAULT_HBCI_VERSION 201 */
-
-enum account_list_cols
-{
- ACCOUNT_LIST_COL_INDEX = 0,
- ACCOUNT_LIST_COL_HBCI_NAME,
- ACCOUNT_LIST_COL_HBCI_ACCT,
- ACCOUNT_LIST_COL_GNC_NAME,
- ACCOUNT_LIST_COL_CHECKED,
- NUM_ACCOUNT_LIST_COLS
-};
-
-struct _hbciinitialinfo
-{
- GtkWidget *window;
- GtkWidget *druid;
-
- /* configfile page */
- GtkWidget *filepage;
-
- /* account match page */
- GtkWidget *accountpage;
- GtkTreeView *accountview;
- GtkListStore *accountstore;
-
- /* OpenHBCI stuff */
- AB_BANKING *api;
- GNCInteractor *interactor;
-
- /* hbci_account (direct) -> gnucash_account -- DO NOT DELETE THE KEYS! */
- GHashTable *gnc_hash;
-
-};
-
-/* Is TRUE as long as the druid is opened and running. Is being
- used to catch a window close event during waiting for a child
- process. */
-static gboolean hbci_druid_is_active = FALSE;
-
-static void
-reset_initial_info (HBCIInitialInfo *info)
-{
- if (info == NULL) return;
-
- if (info->api != NULL)
- {
- gnc_AB_BANKING_delete (info->api);
- }
- info->api = NULL;
-
- if (info->gnc_hash != NULL)
- g_hash_table_destroy (info->gnc_hash);
- info->gnc_hash = NULL;
-}
-
-static void
-delete_initial_druid (HBCIInitialInfo *info)
-{
- if (info == NULL) return;
-
- gnc_unregister_gui_component_by_data(DRUID_HBCI_IMPORT_CM_CLASS, info);
-
- reset_initial_info (info);
-
- /* if (info->interactor)
- GNCInteractor_delete(info->interactor); -- being destroyed by AB_BANKING*/
-
- if (info->window != NULL)
- gtk_widget_destroy (info->window);
-
- hbci_druid_is_active = FALSE;
- g_free (info);
-}
-
-
-static gchar *gnc_hbci_account_longname(const AB_ACCOUNT *hacc)
-{
- gchar *bankname;
- gchar *result;
- const char *bankcode;
- g_assert(hacc);
- bankname =
- gnc_utf8_strip_invalid_strdup (AB_Account_GetBankName (hacc));
- bankcode = AB_Account_GetBankCode (hacc);
- /* Translators: Strings are 1. Account code, 2. Bank name, 3. Bank code. */
- if (strlen(bankname) > 0)
- result = g_strdup_printf(_("%s at %s (code %s)"),
- AB_Account_GetAccountNumber (hacc),
- bankname,
- bankcode);
- else
- result = g_strdup_printf(_("%s at bank code %s"),
- AB_Account_GetAccountNumber (hacc),
- bankcode);
- g_free (bankname);
- return result;
-}
-
-
-/*******************************************************************
- * update_accountlist widget
- */
-static AB_ACCOUNT *
-update_accountlist_acc_cb (AB_ACCOUNT *hacc, gpointer user_data)
-{
- HBCIInitialInfo *info = user_data;
- gchar *gnc_name, *hbci_name;
- Account *gacc;
- GtkTreeIter iter;
-
- g_assert(hacc);
- g_assert(info);
-
- hbci_name = gnc_hbci_account_longname(hacc);
-
- /* Get corresponding gnucash account */
- gacc = g_hash_table_lookup (info->gnc_hash, hacc);
-
- /* Build the text for the gnucash account. */
- if (gacc == NULL)
- gnc_name = g_strdup("");
- else
- gnc_name = gnc_account_get_full_name (gacc);
-
- gtk_list_store_append(info->accountstore, &iter);
- gtk_list_store_set(info->accountstore, &iter,
- ACCOUNT_LIST_COL_HBCI_NAME, hbci_name,
- ACCOUNT_LIST_COL_HBCI_ACCT, hacc,
- ACCOUNT_LIST_COL_GNC_NAME, gnc_name,
- ACCOUNT_LIST_COL_CHECKED, FALSE,
- -1);
-
- g_free(gnc_name);
- g_free(hbci_name);
- return NULL;
-}
-
-/* Update the account list GtkListStore widget */
-static void
-update_accountlist (HBCIInitialInfo *info)
-{
- AB_BANKING *banking;
- AB_ACCOUNT_LIST2 *acclist;
- GtkTreeModel *model;
- GtkTreeSelection *selection;
- GtkTreeIter iter;
- GtkTreePath *path = NULL;
-
- g_assert(info);
- banking = info->api;
- g_assert(banking);
- g_assert(info->gnc_hash);
-
- /* Store old selected row here. */
- selection = gtk_tree_view_get_selection(info->accountview);
- if (gtk_tree_selection_get_selected(selection, &model, &iter))
- path = gtk_tree_model_get_path(model, &iter);
-
- /* Delete old list */
- gtk_list_store_clear(info->accountstore);
-
- /* Go through all HBCI accounts */
- acclist = AB_Banking_GetAccounts(banking);
- if (acclist)
- AB_Account_List2_ForEach (acclist,
- update_accountlist_acc_cb,
- info);
- else
- g_warning("update_accountlist: Oops, account list from AB_Banking is NULL.\n");
-
- /* g_message("update_accountlist: GNC hash has %d entries.\n", g_hash_table_size(info->gnc_hash)); */
-
- if (path)
- {
- gtk_tree_selection_select_path(selection, path);
- gtk_tree_view_scroll_to_cell(info->accountview, path, NULL, FALSE, 0.0, 0.0);
- gtk_tree_path_free(path);
- }
-}
-/*
- * end update_accountlist
- *******************************************************************/
-
-/*******************************************************************
- *
- * Button enabling */
-static void
-druid_enable_next_button(HBCIInitialInfo *info)
-{
- g_assert(info);
- gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
- TRUE, TRUE, TRUE, TRUE);
-}
-static void
-druid_disable_next_button(HBCIInitialInfo *info)
-{
- g_assert(info);
- gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
- TRUE, FALSE, TRUE, TRUE);
-}
-/*
- * end button enabling
- *******************************************************************/
-
-
-
-/*************************************************************
- * GUI callbacks
- */
-
-static gboolean banking_has_accounts(AB_BANKING *banking)
-{
- 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
-cm_close_handler(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);
-}
-
-static void
-on_cancel (GnomeDruid *gnomedruid,
- gpointer user_data)
-{
- cm_close_handler(user_data);
-}
-
-static void
-on_finish (GnomeDruidPage *gnomedruidpage,
- gpointer arg1,
- gpointer user_data)
-{
- HBCIInitialInfo *info = user_data;
- gboolean successful = TRUE;
- g_assert (info);
-
- if (successful && info->gnc_hash)
- accounts_save_kvp (info->gnc_hash);
-
- gnc_AB_BANKING_fini (info->api);
- delete_initial_druid(info);
-}
-
-
-static void
-on_aqbutton_prepare (GnomeDruidPage *gnomedruidpage,
- gpointer arg1,
- gpointer user_data)
-{
- HBCIInitialInfo *info = user_data;
- AB_BANKING *banking = info->api;
- g_assert(banking);
-
- if (banking_has_accounts(banking))
- druid_enable_next_button(info);
- else
- druid_disable_next_button(info);
-}
-
-
-static void
-on_accountlist_prepare (GnomeDruidPage *gnomedruidpage,
- gpointer arg1,
- 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);
-
- gnome_druid_set_buttons_sensitive (GNOME_DRUID (info->druid),
- FALSE, TRUE, TRUE, TRUE);
-
- update_accountlist(info);
-}
-
-
-static void
-on_accountlist_changed (GtkTreeSelection *selection,
- gpointer user_data)
-{
- HBCIInitialInfo *info = user_data;
- AB_ACCOUNT *hbci_acc;
- Account *gnc_acc, *old_value;
- gchar *longname, *gnc_name;
- gnc_commodity *currency = NULL;
- GtkTreeModel *model;
- GtkTreeIter iter;
-
- if (!gtk_tree_selection_get_selected(selection, &model, &iter))
- return;
- gtk_tree_selection_unselect_iter(selection, &iter);
- gtk_tree_model_get(model, &iter,
- ACCOUNT_LIST_COL_HBCI_ACCT, &hbci_acc,
- -1);
-
- if (hbci_acc)
- {
- old_value = g_hash_table_lookup (info->gnc_hash, hbci_acc);
-
- /* g_message("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_commodity_table_get_table (gnc_get_current_book ()),
- GNC_COMMODITY_NS_CURRENCY, AB_Account_GetCurrency (hbci_acc));
- }
-
- gnc_acc = gnc_import_select_account(info->window,
- NULL, TRUE, longname, currency,
- ACCT_TYPE_BANK, old_value, NULL);
- g_free(longname);
-
- if (gnc_acc)
- {
- if (old_value)
- g_hash_table_remove (info->gnc_hash, hbci_acc);
- g_hash_table_insert (info->gnc_hash, hbci_acc, gnc_acc);
- gnc_name = gnc_account_get_full_name (gnc_acc);
- gtk_list_store_set(info->accountstore, &iter,
- ACCOUNT_LIST_COL_GNC_NAME, gnc_name,
- -1);
- g_free(gnc_name);
- }
- else
- {
- gtk_list_store_set(info->accountstore, &iter,
- ACCOUNT_LIST_COL_GNC_NAME, "",
- -1);
- }
- } /* hbci_acc */
-}
-
-
-
-static void
-on_child_exit (GPid pid, gint status, gpointer data)
-{
- gint *data_status = data;
-#ifdef G_OS_WIN32
- *data_status = status;
-#else
- *data_status = WEXITSTATUS (status);
-#endif
-
- g_spawn_close_pid (pid);
- gtk_main_quit ();
-}
-
-
-#if (AQBANKING_VERSION_MAJOR > 1) || \
- ((AQBANKING_VERSION_MAJOR == 1) && \
- (AQBANKING_VERSION_MINOR == 9) && \
- (AQBANKING_VERSION_PATCHLEVEL > 0))
-/* The wizard choice has changed with aqbanking >= 1.9.1; we don't
- need to specify a "backend" for the wizard anymore but instead
- there is only one wizard for all backends now. */
-# define AQBANKING_WIZARD_ALLBACKENDS
-#else
-# undef AQBANKING_WIZARD_ALLBACKENDS
-#endif
-
-static void
-on_aqhbci_button (GtkButton *button,
- gpointer user_data)
-{
- HBCIInitialInfo *info = user_data;
- GWEN_BUFFER *buf;
- int res;
- char *backend_name;
-
- /* This is the point where we look for and start an external
- application shipped with aqhbci that contains the setup druid for
- AqBanking related stuff. It requires qt (but not kde). This
- application contains the very verbose step-by-step setup wizard
- for the AqBanking account, and the application is shared with other
- AqBanking-based financial managers that offer the AqBanking features
- (e.g. KMyMoney). See gnucash-devel discussion here
- https://lists.gnucash.org/pipermail/gnucash-devel/2004-December/012351.html
- */
- gboolean wizard_exists;
- gboolean qt_probably_unavailable = FALSE;
- const char *wizard_path;
- AB_BANKING *banking = info->api;
- g_assert(info->druid);
-
- /* See note above about wizard choice. */
-#ifndef AQBANKING_WIZARD_ALLBACKENDS
- {
- GWEN_PLUGIN_DESCRIPTION_LIST2 *pluginlist;
- const char *backend_name_nc;
-
- /* Get list of all backends, active or inactive */
- pluginlist = AB_Banking_GetProviderDescrs (banking);
-
- /* If there is only one backend, use it, otherwise ask the user */
- if (!pluginlist || (GWEN_PluginDescription_List2_GetSize(pluginlist) < 1))
- /* No backend at all? Try aqhbci */
- backend_name_nc = "aqhbci";
- else
- {
- GWEN_PLUGIN_DESCRIPTION_LIST2_ITERATOR *pluginlist_it =
- GWEN_PluginDescription_List2_First(pluginlist);
- GWEN_PLUGIN_DESCRIPTION *plugindescr;
- g_assert (pluginlist_it);
-
- plugindescr = GWEN_PluginDescription_List2Iterator_Data (pluginlist_it);
- if (GWEN_PluginDescription_List2_GetSize(pluginlist) == 1)
- /* Only one backend? Use it */
- backend_name_nc = GWEN_PluginDescription_GetName(plugindescr);
- else
- {
- /* Present a selection dialog to select a particular backend */
- GList *radio_list = NULL;
- int x;
-
- while (plugindescr)
- {
- radio_list =
- g_list_append(radio_list,
- g_strdup_printf("%s: %s",
- GWEN_PluginDescription_GetName(plugindescr),
- GWEN_PluginDescription_GetShortDescr(plugindescr)));
- plugindescr = GWEN_PluginDescription_List2Iterator_Next (pluginlist_it);
- }
- GWEN_PluginDescription_List2Iterator_free(pluginlist_it);
-
- x = gnc_choose_radio_option_dialog
- (GTK_WIDGET(info->window),
- _("Choose AqBanking Backend"),
- _("Please choose an AqBanking backend to be configured"),
- _("Co_nfigure"),
- 0,
- radio_list);
- g_list_free(radio_list);
-
- /* User pressed cancel in choice dialog */
- if (x == -1)
- {
- if (pluginlist)
- GWEN_PluginDescription_List2_freeAll(pluginlist);
-#if ((GWENHYWFAR_VERSION_MAJOR < 1) || \
- ((GWENHYWFAR_VERSION_MAJOR == 1) && \
- ((GWENHYWFAR_VERSION_MINOR < 98))))
- /* Memory cleanup needed for gwenhywfar<1.98.x but not for
- gwenhywfar>=1.98.x */
- if (pluginlist)
- GWEN_PluginDescription_List2_free(pluginlist);
-#endif
- return;
- }
-
- pluginlist_it = GWEN_PluginDescription_List2_First(pluginlist);
- plugindescr = GWEN_PluginDescription_List2Iterator_Data (pluginlist_it);
- while (x > 0)
- {
- plugindescr = GWEN_PluginDescription_List2Iterator_Next (pluginlist_it);
- x--;
- }
- backend_name_nc = GWEN_PluginDescription_GetName(plugindescr);
- }
- GWEN_PluginDescription_List2Iterator_free(pluginlist_it);
- }
-
- /* Allocate the backend name again because the PluginDescr list will
- be freed */
- backend_name = g_strdup (backend_name_nc);
- if (pluginlist)
- GWEN_PluginDescription_List2_freeAll (pluginlist);
-#if ((GWENHYWFAR_VERSION_MAJOR < 1) || \
- ((GWENHYWFAR_VERSION_MAJOR == 1) && \
- ((GWENHYWFAR_VERSION_MINOR < 98))))
- /* Memory cleanup needed for gwenhywfar<1.98.x but not for
- gwenhywfar>=1.98.x */
- if (pluginlist)
- GWEN_PluginDescription_List2_free (pluginlist);
-#endif
- }
-
-#else /* AQBANKING_WIZARD_ALLBACKENDS */
- backend_name = g_strdup("");
-#endif /* AQBANKING_WIZARD_ALLBACKENDS */
-
- /* ***** */
-
- /* Now find out the wizard name for that backend */
- buf = GWEN_Buffer_new(NULL, 300, 0, 0);
- AB_Banking_FindWizard(banking, backend_name, NULL, buf);
- wizard_exists = (strlen(GWEN_Buffer_GetStart(buf)) > 0);
- wizard_path = GWEN_Buffer_GetStart(buf);
-
- if (wizard_exists)
- {
- /* Really check whether the file exists */
- int fd = g_open( wizard_path, O_RDONLY, 0 );
- if ( fd == -1)
- wizard_exists = FALSE;
- else
- close( fd );
- }
-
-#ifdef G_OS_WIN32
- {
- const char *check_file = "qtdemo.exe";
- gchar *found_program = g_find_program_in_path(check_file);
- if (found_program)
- {
- g_debug("Yes, we found the Qt demo program in %s\n", found_program);
- g_free(found_program);
- }
- else
- {
- g_warning("Ouch, no Qt demo program was found. Qt not installed?\n");
- qt_probably_unavailable = TRUE;
- }
- }
-#endif
-
- druid_disable_next_button(info);
- /* AB_Banking_DeactivateProvider(banking, backend_name); */
- if (wizard_exists)
- {
- /* Call the qt wizard. See the note above about why this approach
- is chosen. */
-
-#if ((AQBANKING_VERSION_MAJOR == 2) && \
- (AQBANKING_VERSION_MINOR >= 3))
- /* With aqbanking>=2.3.0, we can directly activate all backends
- here. Reduces user confusion. But in aqbanking-3.x this won't
- be needed anymore. */
- AB_Banking_ActivateAllProviders (info->api);
-#endif
-
- /* Reset existing mapping tables */
- AB_Banking_Fini (info->api);
- if (info->gnc_hash != NULL)
- g_hash_table_destroy (info->gnc_hash);
- info->gnc_hash = NULL;
-
- {
- GPid pid;
- GError *error = NULL;
- gchar *argv[2];
- gboolean spawned;
-
- argv[0] = g_strdup (wizard_path);
- argv[1] = NULL;
- spawned = g_spawn_async (NULL, argv, NULL, G_SPAWN_DO_NOT_REAP_CHILD,
- NULL, NULL, &pid, &error);
- g_free (argv[0]);
-
- if (error)
- g_critical("Error on starting AqBanking setup wizard: Code %d: %s",
- error->code,
- error->message ? error->message : "(null)");
-
- if (!spawned)
- {
- g_critical("Could not start AqBanking setup wizard: %s",
- error->message ? error->message : "(null)");
- g_error_free (error);
- res = -1;
- }
- else
- {
- g_child_watch_add (pid, on_child_exit, &res);
- hbci_druid_is_active = TRUE;
- gtk_main ();
- if (!hbci_druid_is_active)
- {
- /* Just in case the druid has been canceled in the meantime. */
- g_free (backend_name);
- GWEN_Buffer_free(buf);
- return;
- }
- }
- AB_Banking_Init (info->api);
- }
-
- if (res == 0)
- {
-#ifndef AQBANKING_WIZARD_ALLBACKENDS
- res = AB_Banking_ActivateProvider(banking, backend_name);
-#endif
- if ((res == 0) || (res == AB_ERROR_FOUND))
- druid_enable_next_button(info);
- else
- {
- g_warning("on_aqhbci_button: Oops, after successful wizard the activation return nonzero value: %d. \n", res);
- druid_disable_next_button(info);
- }
- }
- else
- {
- if (qt_probably_unavailable)
- {
- g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, wizard_path);
- gnc_error_dialog
- (info->window,
- _("The external program \"AqBanking Setup Wizard\" failed "
- "to run successfully because the "
- "additional software \"Qt\" was not found. "
- "Please install the \"Qt/Windows Open Source Edition\" "
- "from Trolltech by downloading it from www.trolltech.com"
- "\n\n"
- "If you have installed Qt already, you will have to adapt "
- "the PATH variable of your system appropriately. "
- "Contact the GnuCash developers if you need further "
- "assistance on how to install Qt correctly."
- "\n\n"
- "Online Banking cannot be setup without Qt. Press \"Close\" "
- "now, then \"Cancel\" to cancel the Online Banking setup."));
- }
- else
- {
- g_warning("on_aqhbci_button: Oops, aqhbci wizard return nonzero value: %d. The called program was \"%s\".\n", res, wizard_path);
- gnc_error_dialog
- (info->window,
- _("The external program \"AqBanking Setup Wizard\" failed "
- "to run successfully. Online Banking can only be setup "
- "if this wizard has run successfully. "
- "Please try running the \"AqBanking Setup Wizard\" again."));
- }
- druid_disable_next_button(info);
- }
- }
- else
- {
- g_warning("on_aqhbci_button: Oops, no aqhbci setup wizard found.");
- gnc_error_dialog
- (info->window,
- _("The external program \"AqBanking Setup Wizard\" has not "
- "been found. \n\n"
- "The %s package should include the "
- "program \"qt3-wizard\". Please check your installation to "
- "ensure this program is present. On some distributions this "
- "may require installing additional packages."), QT3_WIZARD_PACKAGE);
- druid_disable_next_button(info);
- }
- g_free (backend_name);
- GWEN_Buffer_free(buf);
-}
-
-
-
-
-
-void gnc_hbci_initial_druid (void)
-{
- HBCIInitialInfo *info;
- GladeXML *xml;
- GtkWidget *page;
- GtkCellRenderer *renderer;
- GtkTreeViewColumn *column;
- GtkTreeSelection *selection;
- gint component_id;
-
- 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");
-
- info->druid = glade_xml_get_widget (xml, "hbci_init_druid");
- gnc_druid_set_colors (GNOME_DRUID (info->druid));
-
- glade_xml_signal_connect_data (xml, "on_finish",
- G_CALLBACK (on_finish), info);
- glade_xml_signal_connect_data (xml, "on_cancel",
- G_CALLBACK (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;
- g_signal_connect (page, "prepare",
- G_CALLBACK (on_aqbutton_prepare), info);
- g_signal_connect (glade_xml_get_widget (xml, "aqhbci_button"),
- "clicked",
- G_CALLBACK (on_aqhbci_button), info);
- }
- {
- page = glade_xml_get_widget(xml, "account_match_page");
- info->accountpage = page;
- info->accountview =
- GTK_TREE_VIEW(glade_xml_get_widget(xml, "account_page_view"));
- info->accountstore = gtk_list_store_new(NUM_ACCOUNT_LIST_COLS,
- G_TYPE_INT, G_TYPE_STRING,
- G_TYPE_POINTER, G_TYPE_STRING,
- G_TYPE_BOOLEAN);
- gtk_tree_view_set_model(info->accountview, GTK_TREE_MODEL(info->accountstore));
- g_object_unref(info->accountstore);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("Online Banking Account Name"),
- renderer,
- "text", ACCOUNT_LIST_COL_HBCI_NAME,
- NULL);
- gtk_tree_view_append_column(info->accountview, column);
-
- renderer = gtk_cell_renderer_text_new();
- column = gtk_tree_view_column_new_with_attributes(_("GnuCash Account Name"),
- renderer,
- "text", ACCOUNT_LIST_COL_GNC_NAME,
- NULL);
- gtk_tree_view_append_column(info->accountview, column);
- gtk_tree_view_column_set_expand(column, TRUE);
-
- renderer = gtk_cell_renderer_toggle_new();
- column = gtk_tree_view_column_new_with_attributes(_("New?"),
- renderer,
- "active", ACCOUNT_LIST_COL_CHECKED,
- NULL);
- gtk_tree_view_append_column(info->accountview, column);
-
- selection = gtk_tree_view_get_selection(info->accountview);
- g_signal_connect (selection, "changed",
- G_CALLBACK (on_accountlist_changed), info);
- g_signal_connect (page, "prepare",
- G_CALLBACK (on_accountlist_prepare), info);
- }
-
- component_id = gnc_register_gui_component(DRUID_HBCI_IMPORT_CM_CLASS,
- NULL, cm_close_handler,
- info);
- gnc_gui_component_set_session(component_id, gnc_get_current_session());
-
- /*g_signal_connect (dialog, "destroy",*/
- /* G_CALLBACK(gnc_hierarchy_destroy_cb), NULL);*/
-
- gtk_widget_show_all (info->window);
-}
Deleted: gnucash/trunk/src/import-export/hbci/druid-hbci-initial.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-initial.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-initial.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,33 +0,0 @@
-/********************************************************************\
- * druid-hbci-initial.h -- hbci creation functionality *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef DRUID_HBCI_INITIAL_H
-#define DRUID_HBCI_INITIAL_H
-
-#include <libguile.h>
-
-void gnc_hbci_initial_druid (void);
-
-typedef struct _hbciinitialinfo HBCIInitialInfo;
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-utils.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,177 +0,0 @@
-/********************************************************************\
- * druid-hbci-utils.c -- hbci creation functionality *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <sys/stat.h>
-#include <sys/types.h>
-#include <unistd.h>
-
-#include "druid-hbci-utils.h"
-#include "gnc-hbci-kvp.h"
-#include "gnc-hbci-utils.h"
-#include "druid-utils.h"
-#include "gnc-ui-util.h"
-#include "gnc-ui.h"
-
-/**
- * Save the reference strings to the HBCI accounts in the kvp's of the
- * gnucash accounts.*/
-static void
-accounts_save_kvp_cb (gpointer key, gpointer value, gpointer user_data)
-{
- AB_ACCOUNT *hbci_acc = key;
- Account *gnc_acc = value;
- g_assert(hbci_acc);
- g_assert(gnc_acc);
-
- if (gnc_hbci_get_account_uid(gnc_acc) !=
- AB_Account_GetUniqueId(hbci_acc))
- gnc_hbci_set_account_uid
- (gnc_acc, AB_Account_GetUniqueId(hbci_acc));
-
- 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, AB_Account_GetBankCode(hbci_acc));
-}
-
-static void 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, "");
-}
-
-/* hash is a DIRECT hash from each HBCI account to each gnucash
- account. */
-void
-accounts_save_kvp (GHashTable *hash)
-{
- Account *root;
- g_assert(hash);
-
- root = gnc_book_get_root_account (gnc_get_current_book ());
- gnc_account_foreach_descendant (root, accounts_clear_kvp, NULL);
-
- g_hash_table_foreach (hash, &accounts_save_kvp_cb, NULL);
-}
-/*
-******************************************************/
-
-
-
-void
-update_accounts (GtkWidget *parent, AB_BANKING *api, GNCInteractor *inter)
-{
- g_assert(api);
-
-}
-
-
-
-struct hbci_acc_cb_data
-{
- AB_BANKING *api;
- GHashTable *hash;
-};
-
-static void
-gnc_hbci_new_hash_from_kvp_cb (Account *gnc_acc, gpointer user_data)
-{
- struct hbci_acc_cb_data *data = user_data;
- AB_ACCOUNT *hbci_acc = NULL;
-
- 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);
- }
-}
-
-GHashTable *
-gnc_hbci_new_hash_from_kvp (AB_BANKING *api)
-{
- GHashTable *hash;
-
- hash = g_hash_table_new (&g_direct_hash, &g_direct_equal);
- if (api)
- {
- struct hbci_acc_cb_data data;
- Account *root = gnc_book_get_root_account (gnc_get_current_book ());
- data.api = api;
- data.hash = hash;
- gnc_account_foreach_descendant(root, gnc_hbci_new_hash_from_kvp_cb, &data);
- }
- return hash;
-}
-
-
-gboolean
-gnc_verify_exist_or_new_file (GtkWidget *parent, const char *filename)
-{
- g_assert (parent);
-
- if (g_file_test (filename, G_FILE_TEST_IS_REGULAR | G_FILE_TEST_IS_SYMLINK))
- {
- return TRUE;
- }
-
- return gnc_verify_dialog
- (parent, TRUE,
- _("The file %s does not exist. Would you like to create it now?"),
- filename ? filename : _("(null)"));
-}
-
-gboolean
-gnc_test_dir_exist_error (GtkWindow *parent, const char *filename)
-{
- char *dirname = g_path_get_dirname (filename);
- gboolean dirtest = g_file_test (dirname, G_FILE_TEST_IS_DIR);
- g_free (dirname);
- if (!dirtest)
- {
- gnc_error_dialog
- (GTK_WIDGET (parent),
- _("The directory for file %s does not exist. "
- "Please choose another place for this file."),
- filename ? filename : _("(null)"));
- return FALSE;
- }
- return TRUE;
-}
-
-
Deleted: gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/druid-hbci-utils.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,57 +0,0 @@
-/********************************************************************\
- * druid-hbci-utils.h -- hbci creation functionality *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef DRUID_HBCI_UTILS_H
-#define DRUID_HBCI_UTILS_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
- * different to the value stored beforehand. If any value has been
- * set, the book and/or accounts will be marked 'dirty'. */
-void accounts_save_kvp (GHashTable *hash);
-
-
-/** Update the account list in all the banks stored in this
- * 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, 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 (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);
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/glade/Makefile.am
===================================================================
--- gnucash/trunk/src/import-export/hbci/glade/Makefile.am 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/glade/Makefile.am 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,7 +0,0 @@
-gladedir = $(GNC_GLADE_DIR)
-glade_DATA = \
- hbci.glade \
- hbcipass.glade \
- hbciprefs.glade
-
-EXTRA_DIST = $(glade_DATA)
Deleted: gnucash/trunk/src/import-export/hbci/glade/hbci.glade
===================================================================
--- gnucash/trunk/src/import-export/hbci/glade/hbci.glade 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/glade/hbci.glade 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,1676 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
- <requires lib="gnome"/>
- <!-- interface-requires gnome 2112.4328 -->
- <!-- interface-requires gtk+ 2.10 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkWindow" id="HBCI Init Druid">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Initial Online Banking Setup</property>
- <property name="default_width">650</property>
- <property name="default_height">580</property>
- <child>
- <widget class="GnomeDruid" id="hbci_init_druid">
- <property name="visible">True</property>
- <property name="border_width">4</property>
- <signal name="cancel" handler="on_cancel"/>
- <child>
- <widget class="GnomeDruidPageEdge" id="druidpagestart1">
- <property name="visible">True</property>
- <property name="position">Edge Start</property>
- <property name="title" translatable="yes">Initial Online Banking Setup</property>
- <property name="text" translatable="yes">This assistant helps you setting up your Online Banking connection with your bank.
-
-You first need to apply for Online Banking access at your bank. If your bank decides to grant you electronic access, they will send you a letter containing
-
-* The bank code of your bank
-* The user ID that identifies you to your bank
-* The Internet address of your bank's Online Banking server
-* For HBCI Online Banking, information about the cryptographic public key of your bank ("Ini-Letter").
-
-This information will be needed in the following. Press "Forward" now.
-
-NOTE: NO WARRANTIES FOR ANYTHING. Some banks run a poorly implemented Online Banking server. You should not rely on time-critical transfers through Online Banking, because sometimes the bank does not give you correct feedback when a transfer is rejected.
-
-Press "Cancel" if you do not wish to setup any Online Banking connection now.</property>
- </widget>
- </child>
- <child>
- <widget class="GnomeDruidPageStandard" id="configfile_page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Start Online Banking Wizard</property>
- <property name="title_foreground_gdk">#ffffffffffff</property>
- <property name="background_gdk">#9999bfbf9999</property>
- <property name="logo_background_gdk">#ffffffffffff</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox132">
- <property name="visible">True</property>
- <property name="border_width">10</property>
- <property name="orientation">vertical</property>
- <property name="spacing">5</property>
- <child>
- <widget class="GtkFrame" id="frame56">
- <property name="visible">True</property>
- <property name="label_xalign">4.8428798749000634e-08</property>
- <child>
- <widget class="GtkVBox" id="vbox156">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="label8877441">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="xpad">10</property>
- <property name="label" translatable="yes">The Setup of your Online Banking connection is handled by the external program "AqBanking Setup Wizard". Please press the button below to start this program.</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox118">
- <property name="visible">True</property>
- <property name="border_width">9</property>
- <child>
- <widget class="GtkButton" id="aqhbci_button">
- <property name="label" translatable="yes">_Start AqBanking Wizard</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GtkLabel" id="label1">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Start AqBanking Setup Wizard</property>
- </widget>
- <packing>
- <property name="type">label_item</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GnomeDruidPageStandard" id="account_match_page">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Match Online Banking accounts with GnuCash accounts</property>
- <property name="title_foreground_gdk">#ffffffffffff</property>
- <property name="background_gdk">#9999bfbf9999</property>
- <property name="logo_background_gdk">#ffffffffffff</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="druid-vbox3">
- <property name="visible">True</property>
- <property name="border_width">10</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkVBox" id="vbox157">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow25">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTreeView" id="account_page_view">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="rules_hint">True</property>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label828">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Click on the line of an Online Banking account name if you want to match it to a GnuCash account. Click "Forward" when all desired accounts are matching.</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- <child>
- <widget class="GnomeDruidPageEdge" id="initial_finish_page">
- <property name="visible">True</property>
- <property name="position">GNOME_EDGE_FINISH</property>
- <property name="title" translatable="yes">Online Banking Setup Finished</property>
- <property name="text" translatable="yes">The setup for matching Online Banking accounts to GnuCash accounts is now finished. You can now invoke Online Banking actions on those accounts.
-
-If you want to add another bank, user, or account, you can start this assistant again anytime.
-
-Press "Apply" now.</property>
- <signal name="finish" handler="on_finish"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="HBCI_trans_dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Online Transaction</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox2">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkVBox" id="vbox151">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">1</property>
- <child>
- <widget class="GtkLabel" id="heading_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Enter an Online Transaction</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHSeparator" id="hseparator7">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkTable" id="table6">
- <property name="visible">True</property>
- <property name="n_rows">21</property>
- <property name="n_columns">3</property>
- <child>
- <widget class="GtkEntry" id="recp_account_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">12</property>
- </widget>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="recp_account_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recipient Account Number</property>
- </widget>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="recp_bankcode_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">8</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="recp_bankcode_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recipient Bank Code</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="recp_name_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">27</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="recp_name_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Recipient Name</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="recp_bankname_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">at Bank</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="recp_bankname_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">(filled in automatically)</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877434">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Amount</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkHSeparator" id="hseparator6">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">9</property>
- <property name="bottom_attach">10</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877433">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Payment Purpose (only for recipient)</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">10</property>
- <property name="bottom_attach">11</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877435">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Payment Purpose continued</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">12</property>
- <property name="bottom_attach">13</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_name_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Originator Name</property>
- </widget>
- <packing>
- <property name="top_attach">15</property>
- <property name="bottom_attach">16</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_name_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">something</property>
- </widget>
- <packing>
- <property name="top_attach">16</property>
- <property name="bottom_attach">17</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_bankname_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">at Bank</property>
- </widget>
- <packing>
- <property name="top_attach">17</property>
- <property name="bottom_attach">18</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_bankname_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">something</property>
- </widget>
- <packing>
- <property name="top_attach">18</property>
- <property name="bottom_attach">19</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_account_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Originator Account Number</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">15</property>
- <property name="bottom_attach">16</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_account_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">something</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">16</property>
- <property name="bottom_attach">17</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_bankcode_heading">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Bank Code</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">17</property>
- <property name="bottom_attach">18</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="orig_bankcode_label">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">something</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">18</property>
- <property name="bottom_attach">19</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkHSeparator" id="hseparator4">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">14</property>
- <property name="bottom_attach">15</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="amount_hbox">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="top_attach">8</property>
- <property name="bottom_attach">9</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox117">
- <property name="visible">True</property>
- <property name="border_width">2</property>
- <property name="spacing">4</property>
- <child>
- <widget class="GtkLabel" id="label8877442">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Use Transaction Template</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="template_scrolledwindow">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <child>
- <widget class="GtkViewport" id="viewport1">
- <property name="visible">True</property>
- <child>
- <widget class="GtkTreeView" id="template_list">
- <property name="rules_hint">True</property>
- <signal name="select_child" handler="on_template_list_select_child"/>
- <signal name="selection_changed" handler="on_template_list_selection_changed"/>
- <signal name="unselect_child" handler="on_template_list_unselect_child"/>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="pack_type">end</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkVButtonBox" id="vbutonbox158">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkButton" id="add_templ_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Add the current online transaction as a new transaction template</property>
- <property name="border_width">2</property>
- <signal name="clicked" handler="add_template_cb"/>
- <child>
- <widget class="GtkAlignment" id="alignment3">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox119">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image1">
- <property name="visible">True</property>
- <property name="stock">gtk-add</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877451">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Add current</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="moveup_templ_button">
- <property name="label">gtk-go-up</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Move the selected transaction template one row up</property>
- <property name="border_width">2</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="moveup_templ_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="movedown_templ_button">
- <property name="label">gtk-go-down</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Move the selected transaction template one row down</property>
- <property name="border_width">2</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="movedown_templ_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="sort_templ_button">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Sort the list of transaction templates alphabetically</property>
- <property name="border_width">2</property>
- <signal name="clicked" handler="sort_templ_cb"/>
- <child>
- <widget class="GtkAlignment" id="alignment4">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox120">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image2">
- <property name="visible">True</property>
- <property name="stock">gtk-sort-ascending</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877452">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Sort</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="del_templ_button">
- <property name="label">gtk-delete</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Delete the currently selected transaction template</property>
- <property name="border_width">2</property>
- <property name="use_stock">True</property>
- <signal name="clicked" handler="del_template_cb"/>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">4</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">20</property>
- <property name="bottom_attach">21</property>
- <property name="x_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHSeparator" id="hseparator8">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">19</property>
- <property name="bottom_attach">20</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_padding">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHSeparator" id="hseparator5">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="right_attach">3</property>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_padding">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="purpose_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">27</property>
- </widget>
- <packing>
- <property name="top_attach">11</property>
- <property name="bottom_attach">12</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="purpose_cont2_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">27</property>
- </widget>
- <packing>
- <property name="top_attach">13</property>
- <property name="bottom_attach">14</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="purpose_cont_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">27</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">11</property>
- <property name="bottom_attach">12</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="purpose_cont3_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">27</property>
- </widget>
- <packing>
- <property name="left_attach">2</property>
- <property name="right_attach">3</property>
- <property name="top_attach">13</property>
- <property name="bottom_attach">14</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area2">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="exec_later_button">
- <property name="label" translatable="yes">Execute later (unimpl.)</property>
- <property name="response_id">-9</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="cancel_button">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="exec_now_button">
- <property name="response_id">-8</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Execute this online transaction now</property>
- <child>
- <widget class="GtkAlignment" id="alignment6">
- <property name="visible">True</property>
- <property name="xscale">0</property>
- <property name="yscale">0</property>
- <child>
- <widget class="GtkHBox" id="hbox122">
- <property name="visible">True</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkImage" id="image4">
- <property name="visible">True</property>
- <property name="stock">gtk-execute</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877454">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Execute Now</property>
- <property name="use_underline">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="HBCI_connection_dialog">
- <property name="visible">True</property>
- <property name="border_width">6</property>
- <property name="title" translatable="yes">Online Banking Connection Window</property>
- <property name="default_width">350</property>
- <property name="default_height">420</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox3">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkVBox" id="vbox149">
- <property name="visible">True</property>
- <property name="border_width">8</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkLabel" id="label8877443">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Progress</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment2">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkTable" id="table5">
- <property name="visible">True</property>
- <property name="n_rows">3</property>
- <property name="n_columns">2</property>
- <property name="column_spacing">12</property>
- <child>
- <widget class="GtkLabel" id="label8877424">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Current Job</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877425">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Current Action</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877426">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Progress</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkProgressBar" id="action_progress">
- <property name="visible">True</property>
- <property name="pulse_step">0.10000000149</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="job_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="action_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877447">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877444">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Log Messages</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">3</property>
- </packing>
- </child>
- <child>
- <widget class="GtkAlignment" id="alignment1">
- <property name="visible">True</property>
- <property name="left_padding">12</property>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow30">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">never</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkTextView" id="log_text">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="editable">False</property>
- <property name="wrap_mode">word</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">4</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="close_checkbutton">
- <property name="label" translatable="yes">Close when finished</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">5</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area3">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="abort_button">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="close_button">
- <property name="label">gtk-close</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="HBCI_daterange_dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Get Transactions Online</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox4">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkVBox" id="vbox152">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="heading_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Date range of transactions to retrieve:</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877449">
- <property name="visible">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- <child>
- <widget class="GtkTable" id="table7">
- <property name="visible">True</property>
- <property name="n_rows">8</property>
- <property name="n_columns">2</property>
- <child>
- <widget class="GtkLabel" id="label8877445">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>From</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="enter_from_box">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877448">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- </widget>
- <packing>
- <property name="top_attach">4</property>
- <property name="bottom_attach">5</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label8877446">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>To</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="top_attach">5</property>
- <property name="bottom_attach">6</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="enter_to_box">
- <property name="visible">True</property>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options">GTK_FILL</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="last_retrieval_button">
- <property name="label" translatable="yes">_Last retrieval date</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="active">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="x_padding">12</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="enter_from_button">
- <property name="label" translatable="yes">E_nter date:</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">last_retrieval_button</property>
- </widget>
- <packing>
- <property name="top_attach">3</property>
- <property name="bottom_attach">4</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="x_padding">12</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="first_button">
- <property name="label" translatable="yes">_Earliest possible date</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">last_retrieval_button</property>
- </widget>
- <packing>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="x_padding">12</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="now_button">
- <property name="label" translatable="yes">_Now</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="top_attach">6</property>
- <property name="bottom_attach">7</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="x_padding">12</property>
- </packing>
- </child>
- <child>
- <widget class="GtkRadioButton" id="enter_to_button">
- <property name="label" translatable="yes">Ente_r date:</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- <property name="group">now_button</property>
- </widget>
- <packing>
- <property name="top_attach">7</property>
- <property name="bottom_attach">8</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="x_padding">12</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area4">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="cancel_button">
- <property name="label">gtk-cancel</property>
- <property name="response_id">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="ok_button">
- <property name="label">gtk-ok</property>
- <property name="response_id">1</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="HBCI_version_dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Online Banking Version</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox5">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkVBox" id="vbox155">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="label8877436">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Choose an Online Banking Version to use with the selected bank:</property>
- <property name="justify">center</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkScrolledWindow" id="scrolledwindow31">
- <property name="visible">True</property>
- <property name="can_focus">False</property>
- <property name="hscrollbar_policy">automatic</property>
- <property name="vscrollbar_policy">automatic</property>
- <property name="shadow_type">in</property>
- <child>
- <widget class="GtkCList" id="version_clist">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="n_columns">1</property>
- <property name="shadow_type">in</property>
- <property name="selection_mode">single</property>
- <child>
- <widget class="GtkLabel" id="label8877437">
- <property name="label" translatable="yes">Version</property>
- <property name="use_underline">False</property>
- <property name="use_markup">False</property>
- <property name="justify">GTK_JUSTIFY_LEFT</property>
- <property name="wrap">False</property>
- <property name="selectable">False</property>
- <property name="xalign">0</property>
- <property name="yalign">0.5</property>
- <property name="xpad">0</property>
- <property name="ypad">0</property>
- <property name="ellipsize">PANGO_ELLIPSIZE_NONE</property>
- <property name="width_chars">-1</property>
- <property name="single_line_mode">False</property>
- <property name="angle">0</property>
- </widget>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area5">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="button4">
- <property name="label">gtk-cancel</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="button2">
- <property name="label">gtk-ok</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="HBCI_template_name_dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Name for new template</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox6">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkVBox" id="vbox159">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <child>
- <widget class="GtkLabel" id="label8877450">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Enter name for new template:</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="template_name">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="max_length">250</property>
- <property name="activates_default">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">2</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area6">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="cancelbutton1">
- <property name="label">gtk-cancel</property>
- <property name="response_id">-6</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="okbutton1">
- <property name="label">gtk-ok</property>
- <property name="response_id">-5</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
Deleted: gnucash/trunk/src/import-export/hbci/glade/hbcipass.glade
===================================================================
--- gnucash/trunk/src/import-export/hbci/glade/hbcipass.glade 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/glade/hbcipass.glade 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,249 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
- <!-- interface-requires gtk+ 2.10 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkDialog" id="Password Dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Enter Password</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="dialog-vbox16">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkLabel" id="heading_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Enter your password</property>
- <property name="justify">center</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkHBox" id="hbox95">
- <property name="visible">True</property>
- <property name="border_width">10</property>
- <property name="spacing">2</property>
- <child>
- <widget class="GtkLabel" id="label847714">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Password:</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="password_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="visibility">False</property>
- <property name="activates_default">True</property>
- </widget>
- <packing>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="dialog-action_area16">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="cancelbutton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="okbutton">
- <property name="label">gtk-ok</property>
- <property name="response_id">1</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <widget class="GtkDialog" id="Initial Password Dialog">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Enter new Password</property>
- <property name="type_hint">dialog</property>
- <child internal-child="vbox">
- <widget class="GtkVBox" id="vbox106">
- <property name="visible">True</property>
- <property name="orientation">vertical</property>
- <property name="spacing">8</property>
- <child>
- <widget class="GtkLabel" id="heading_label">
- <property name="visible">True</property>
- <property name="label" translatable="yes">Enter and confirm your new password</property>
- <property name="justify">center</property>
- <property name="wrap">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">2</property>
- </packing>
- </child>
- <child>
- <widget class="GtkFrame" id="frame48">
- <property name="visible">True</property>
- <property name="label_xalign">0</property>
- <child>
- <widget class="GtkTable" id="table1">
- <property name="visible">True</property>
- <property name="border_width">10</property>
- <property name="n_rows">2</property>
- <property name="n_columns">2</property>
- <child>
- <widget class="GtkEntry" id="password_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="has_focus">True</property>
- <property name="visibility">False</property>
- <property name="activates_default">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847716">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Password:</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkEntry" id="confirm_entry">
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="visibility">False</property>
- <property name="activates_default">True</property>
- </widget>
- <packing>
- <property name="left_attach">1</property>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkLabel" id="label847717">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes">Confirm Password:</property>
- <property name="justify">center</property>
- </widget>
- <packing>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
- <packing>
- <property name="position">3</property>
- </packing>
- </child>
- <child internal-child="action_area">
- <widget class="GtkHButtonBox" id="hbuttonbox1">
- <property name="visible">True</property>
- <property name="layout_style">end</property>
- <child>
- <widget class="GtkButton" id="cancelbutton">
- <property name="label">gtk-cancel</property>
- <property name="response_id">2</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">0</property>
- </packing>
- </child>
- <child>
- <widget class="GtkButton" id="okbutton">
- <property name="label">gtk-ok</property>
- <property name="response_id">1</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="can_default">True</property>
- <property name="has_default">True</property>
- <property name="receives_default">False</property>
- <property name="use_stock">True</property>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="fill">False</property>
- <property name="position">1</property>
- </packing>
- </child>
- </widget>
- <packing>
- <property name="expand">False</property>
- <property name="pack_type">end</property>
- <property name="position">0</property>
- </packing>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
Deleted: gnucash/trunk/src/import-export/hbci/glade/hbciprefs.glade
===================================================================
--- gnucash/trunk/src/import-export/hbci/glade/hbciprefs.glade 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/glade/hbciprefs.glade 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,99 +0,0 @@
-<?xml version="1.0"?>
-<glade-interface>
- <!-- interface-requires gtk+ 2.10 -->
- <!-- interface-naming-policy toplevel-contextual -->
- <widget class="GtkWindow" id="Preferences">
- <property name="visible">True</property>
- <property name="title" translatable="yes">Preferences</property>
- <child>
- <widget class="GtkTable" id="hbci_prefs">
- <property name="visible">True</property>
- <property name="n_rows">4</property>
- <property name="n_columns">4</property>
- <child>
- <widget class="GtkLabel" id="label55">
- <property name="visible">True</property>
- <property name="xalign">0</property>
- <property name="label" translatable="yes"><b>Online Banking</b></property>
- <property name="use_markup">True</property>
- </widget>
- <packing>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="gconf/dialogs/import/hbci/remember_pin">
- <property name="label" translatable="yes">Remember _PIN</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Remember the Online Banking PIN in memory during a session.</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="right_attach">2</property>
- <property name="top_attach">1</property>
- <property name="bottom_attach">2</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="x_padding">12</property>
- </packing>
- </child>
- <child>
- <widget class="GtkCheckButton" id="gconf/dialogs/import/hbci/verbose_debug">
- <property name="label" translatable="yes">_Verbose debug messages</property>
- <property name="visible">True</property>
- <property name="can_focus">True</property>
- <property name="receives_default">False</property>
- <property name="tooltip" translatable="yes">Activate verbose debug messages for Online Banking.</property>
- <property name="use_underline">True</property>
- <property name="draw_indicator">True</property>
- </widget>
- <packing>
- <property name="right_attach">2</property>
- <property name="top_attach">2</property>
- <property name="bottom_attach">3</property>
- <property name="x_options">GTK_FILL</property>
- <property name="y_options"></property>
- <property name="x_padding">12</property>
- </packing>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- <child>
- <placeholder/>
- </child>
- </widget>
- </child>
- </widget>
-</glade-interface>
Deleted: gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,237 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-/** @addtogroup Import_Export
- @{ */
-/** @internal
- @file gnc-dtaus-import.c
- @brief DTAUS import module code
- @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>, Copyright (c) 2003 Jan-Pascal van Best <janpascal at vanbest.org>, Copyright (c) 2006 Florian Steinel, 2006 Christian Stimming.
- */
-#include "config.h"
-
-#include "gnc-file-aqb-import.h"
-
-#include <glib/gi18n.h>
-#include <glib/gstdio.h>
-#include <string.h>
-#include <sys/time.h>
-#include <fcntl.h>
-
-#include <aqbanking/version.h>
-#include <aqbanking/banking.h>
-#include <aqbanking/imexporter.h>
-
-#include "gnc-ui.h"
-#include "qof.h"
-#include "Transaction.h"
-#include "Account.h"
-
-#include "gnc-engine.h"
-#include "gnc-file.h"
-#include "gnc-ui-util.h"
-
-#include "gnc-hbci-utils.h"
-#include "gnc-hbci-gettrans.h"
-#include "hbci-interaction.h"
-
-
-static QofLogModule log_module = GNC_MOD_IMPORT;
-
-
-/* See aqbanking-1.6.0beta/src/tools/aqbanking-tool/import.c for hints
- on how to program aqbanking. */
-
-/********************************************************************\
- * gnc_file_dtaus_import
- * Entry point
-\********************************************************************/
-
-void gnc_file_aqbanking_import (const gchar *aqbanking_importername,
- const gchar *aqbanking_profilename,
- gboolean execute_transactions)
-{
- char *selected_filename;
- char *default_dir;
- int dtaus_fd;
-
- DEBUG("gnc_file_dtaus_import(): Begin...\n");
-
- default_dir = gnc_get_default_directory(GCONF_SECTION);
- selected_filename = gnc_file_dialog(_("Select a file to import"),
- NULL,
- default_dir,
- GNC_FILE_DIALOG_IMPORT);
- g_free(default_dir);
-
- if (selected_filename != NULL)
- {
- /* Remember the directory as the default. */
- default_dir = g_path_get_dirname(selected_filename);
- gnc_set_default_directory(GCONF_SECTION, default_dir);
- g_free(default_dir);
-
- /*strncpy(file,selected_filename, 255);*/
- DEBUG("Filename found: %s", selected_filename);
-
- DEBUG("Opening selected file");
- dtaus_fd = g_open(selected_filename, O_RDONLY, 0);
- if (dtaus_fd == -1)
- {
- DEBUG("Could not open file %s", selected_filename);
- return;
- }
- g_free(selected_filename);
-
- {
- int result;
- AB_BANKING *ab;
- AB_IMEXPORTER *importer;
- AB_IMEXPORTER_CONTEXT *ctx = 0;
- GWEN_BUFFEREDIO *buffio;
- GWEN_DB_NODE *dbProfiles;
- GWEN_DB_NODE *dbProfile;
- GNCInteractor *interactor = NULL;
- const char *importerName = aqbanking_importername;
- const char *profileName = aqbanking_profilename;
-
- /* Get API */
- ab = gnc_AB_BANKING_new_currentbook (NULL, &interactor);
- if (ab == NULL)
- {
- g_message("gnc_file_dtaus_import: Couldn't get HBCI API. Nothing will happen.\n");
- return;
- }
- g_assert (interactor);
-
- /* get import module */
- importer = AB_Banking_GetImExporter(ab, importerName);
- if (!importer)
- {
- DEBUG("Import module %s not found", importerName);
- gnc_error_dialog(NULL, "%s", ("Import module for DTAUS import not found."));
- return;
- }
- g_assert(importer);
-
- /* load the import profile */
- dbProfiles = AB_Banking_GetImExporterProfiles(ab, importerName);
-
- /* select profile */
- dbProfile = GWEN_DB_GetFirstGroup(dbProfiles);
- while (dbProfile)
- {
- const char *name;
-
- name = GWEN_DB_GetCharValue(dbProfile, "name", 0, 0);
- g_assert(name);
- if (strcasecmp(name, profileName) == 0)
- break;
- dbProfile = GWEN_DB_GetNextGroup(dbProfile);
- }
- if (!dbProfile)
- {
- g_warning("Profile \"%s\" for importer \"%s\" not found\n",
- profileName, importerName);
- /* For debugging: Print those available names that have been found. */
- dbProfile = GWEN_DB_GetFirstGroup(dbProfiles);
- while (dbProfile)
- {
- const char *name;
- name = GWEN_DB_GetCharValue(dbProfile, "name", 0, 0);
- g_assert(name);
- g_warning("Only found profile \"%s\"\n", name);
- dbProfile = GWEN_DB_GetNextGroup(dbProfile);
- }
- return;
- }
- g_assert(dbProfile);
-
- /* import new context */
- ctx = AB_ImExporterContext_new();
- g_assert(ctx);
-
- /* Wrap file in gwen_bufferedio */
- buffio = GWEN_BufferedIO_File_new(dtaus_fd);
- g_assert(buffio);
- GWEN_BufferedIO_SetReadBuffer(buffio, 0, 1024);
-
- result = AB_ImExporter_Import(importer,
- ctx,
- buffio,
- dbProfile);
-
- DEBUG("Parsing result: %d\n", result);
-
- GWEN_BufferedIO_Close(buffio);
- GWEN_BufferedIO_free(buffio);
- GWEN_DB_Group_free(dbProfiles);
-
- {
- /* Now get all accountinfos */
- GNCImportMainMatcher *importer_generic_gui;
- GtkWidget *parent = NULL;
- gboolean successful = FALSE;
- GList *ab_job_list;
-
- /* Create importer GUI */
- importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
-
- /* Import the transactions from the ctx into gnucash. */
- ab_job_list = gnc_hbci_import_ctx(ab, ctx, importer_generic_gui,
- execute_transactions);
- /* Finished importing. */
-
- /* We clean up here. */
- AB_ImExporterContext_free(ctx);
-
- if (execute_transactions)
- {
- /* Wait for the gnucash importer to be finished (it is being
- run anyway). */
- result = gnc_gen_trans_list_run (importer_generic_gui);
-
- if (result)
- /* Execute these jobs now. This function already delete()s the
- job. */
- /* no parent so far; otherwise add this: GNCInteractor_reparent (interactor, parent); */
- successful = gnc_hbci_multijob_execute (parent, ab, ab_job_list, interactor);
- /* else */
-
- /* Delete all jobs from queue in any case. */
- gnc_hbci_clearqueue (ab, ab_job_list);
- }
- else
- {
- successful = TRUE;
- }
-
- if (successful)
- {
- /* If execution was not successful, leave the log window
- still intact and open. */
- gnc_AB_BANKING_fini (ab);
- gnc_AB_BANKING_delete (ab);
- }
- }
- }
- }
-}
-
-
-/** @} */
Deleted: gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,56 +0,0 @@
-/********************************************************************\
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-/** @file
- @brief dtaus import module interface
- *
- gnc-dtaus-import.h
- @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>
-*/
-#ifndef DTAUS_IMPORT_H
-#define DTAUS_IMPORT_H
-
-#include <glib.h>
-
-/** This routine will pop up a standard file selection dialog asking
- * the user to pick a file to import. This file will be opened and
- * read. Its contents will be imported into the current book, using
- * the import matcher from import-main-matcher.h.
- *
- * @param aqbanking_importername The aqbanking importer module that
- * should be used. Possible values: "dtaus", "csv", "swift", or more.
- *
- * @param aqbanking_formatname In aqbanking, each importer has one or
- * more data formats available which define the actual data
- * fields that should be used. In aqbanking, such a different format
- * is called a "profile".
- * Possible values for swift: "swift-mt940" or "swift-mt942",
- * but for all others: "default", or more precisely: Look into
- * $datadir/aqbanking/imexporters and look into the "name" field of
- * the foo.conf files.
- *
- * @param exec_as_aqbanking_jobs If TRUE, additionally queue the
- * imported transactions as online jobs over aqbanking/HBCI. If FALSE,
- * just import the transactions and that's it.
- */
-void gnc_file_aqbanking_import (const gchar *aqbanking_importername,
- const gchar *aqbanking_formatname,
- gboolean exec_as_aqbanking_jobs);
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,29 +0,0 @@
-/********************************************************************\
- * gnc-hbci-actions.c -- hbci action functions *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "gnc-hbci-actions.h"
-
-#include <openhbci2/api.h>
-#include <openhbci2/outboxaccjobs.h>
-
-/* File intentionally left blank. */
-
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-actions.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,32 +0,0 @@
-/********************************************************************\
- * gnc-hbci-actions.h -- hbci action functions *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef GNC_HBCI_ACTIONS_H
-#define GNC_HBCI_ACTIONS_H
-
-/*#include <gnome.h>
- #include "Account.h"*/
-
-/* File intentionally left blank. */
-
-
-#endif /* GNC_HBCI_ACTIONS_H */
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,354 +0,0 @@
-/********************************************************************\
- * gnc-hbci-getbalance.c -- hbci getbalance functions *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#define AQBANKING_NOWARN_DEPRECATED
-#include <aqbanking/banking.h>
-
-#include "RecnWindow.h"
-#include "gnc-date.h"
-#include "gnc-hbci-getbalance.h"
-#include "gnc-hbci-utils.h"
-#include "gnc-numeric.h"
-#include "gnc-ui.h"
-#include "hbci-interaction.h"
-
-
-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 AB_VALUE *val,
- gboolean negative,
- const char *date_str,
- const char *time_str)
-{
- char *str = gnc_AB_VALUE_toReadableString (val);
- g_message("GetBalance: %s%s %s at date %s %s",
- (negative ? "-" : ""), str,
- name, date_str, time_str);
- free (str);
-}
-#endif
-
-
-void
-gnc_hbci_getbalance (GtkWidget *parent, Account *gnc_acc)
-{
- AB_BANKING *api = NULL;
- const AB_ACCOUNT *h_acc = NULL;
- GNCInteractor *interactor = NULL;
-
- g_assert(parent);
- if (gnc_acc == NULL)
- return;
-
- /* Get API */
- api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
- if (api == NULL)
- {
- g_message("gnc_hbci_getbalance: Couldn't get AB_BANKING API.\n");
- return;
- }
- g_assert (interactor);
-
- /* Get HBCI account */
- h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
- if (h_acc == NULL)
- {
- g_warning("gnc_hbci_getbalance: No HBCI account found.\n");
- /* FIXME: free unneeded data */
- return;
- }
- /* g_message("gnc_hbci_getbalance: HBCI account no. %s found.\n",
- AB_ACCOUNT_accountId (h_acc)); */
-
- {
- /* Execute a GetBalance job. */
- AB_JOB *job;
-
- job = AB_JobGetBalance_new((AB_ACCOUNT*)h_acc);
- if (AB_Job_CheckAvailability(job))
- {
- g_message("gnc_hbci_getbalance: JobGetBalance not available for this account.\n");
- /* FIXME: free unneeded data */
- return;
- }
-
- /* Add job to API queue */
- AB_Banking_EnqueueJob(api, job);
-
- /* Execute Outbox. */
- if (!gnc_AB_BANKING_execute (parent, api, job, interactor))
- {
-
- /* AB_BANKING_executeOutbox failed. */
- gnc_hbci_cleanup_job(api, job);
- /* FIXME: free unneeded data */
- return;
- }
-
- /* gnc_hbci_getbalance_debugprint(balance_job, h_acc); */
-
- /* Finish this job. */
- gnc_hbci_getbalance_finish (parent,
- gnc_acc,
- job);
-
- /* Clean up after ourselves. */
- gnc_hbci_cleanup_job(api, job);
- gnc_AB_BANKING_fini (api);
- GNCInteractor_hide (interactor);
- }
-}
-
-
-#if 0
-void gnc_hbci_getbalance_debugprint(AB_JOB *job,
- const AB_ACCOUNT *h_acc)
-{
- GWEN_DB_NODE *response, *acc_bal;
- GWEN_DB_NODE *noted_grp, *booked_grp;
- 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"));
-
- g_message("GetBalance: Balances for account %s :\n",
- AB_ACCOUNT_accountId (h_acc));
- bal_print_debug("Booked balance",
- 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",
- 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 AB_VALUE *val)
-{
- char *str = gnc_AB_VALUE_toReadableString (val);
- char *res = g_strdup_printf(format,
- str);
- free (str);
- return res;
-}
-
-
-
-gboolean
-gnc_hbci_getbalance_finish (GtkWidget *parent,
- Account *gnc_acc,
- const AB_JOB *job)
-{
- const AB_ACCOUNT_STATUS *response;
- const AB_BALANCE *noted_grp, *booked_grp;
- const AB_VALUE *booked_val, *noted_val;
- time_t booked_tt = 0;
- gboolean dialogres;
- double booked_value, noted_value;
- gnc_numeric value;
- GtkWidget *dialog;
-
- response = AB_JobGetBalance_GetAccountStatus((AB_JOB*)job);
- if (!response)
- {
- g_critical("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)
- {
- const GWEN_TIME *ti;
-
- ti = AB_Balance_GetTime(booked_grp);
- if (ti)
- booked_tt = GWEN_Time_toTime_t (ti);
- else
- /* No time found? Use today because the HBCI query asked for
- today's balance. */
- booked_tt = gnc_timet_get_day_start(time(NULL));
- booked_val = AB_Balance_GetValue(booked_grp);
- if (booked_val)
- booked_value = AB_Value_GetValue (booked_val);
- else
- {
- g_warning("gnc_hbci_getbalance_finish: Warning: booked_val == NULL. Assuming 0.\n");
- booked_value = 0.0;
- }
- }
- else
- {
- g_warning("gnc_hbci_getbalance_finish: Warning: booked_grp == NULL. Assuming 0.\n");
- booked_value = 0.0;
- booked_val = NULL;
- booked_tt = 0;
- }
-
- if (noted_grp)
- {
- noted_val = AB_Balance_GetValue(noted_grp);
- /* noted_tt = GWEN_Time_toTime_t (AB_Balance_GetTime(noted_grp)); */
- if (noted_val)
- noted_value = AB_Value_GetValue (noted_val);
- else
- {
- g_warning("gnc_hbci_getbalance_finish: Warning: noted_val == NULL. Assuming 0.\n");
- noted_value = 0.0;
- }
- }
- else
- {
- g_warning("gnc_hbci_getbalance_finish: Warning: noted_grp == NULL. Assuming 0.\n");
- noted_value = 0.0;
- noted_val = NULL;
- }
-
- value = double_to_gnc_numeric (booked_value,
- xaccAccountGetCommoditySCU(gnc_acc),
- GNC_HOW_RND_ROUND_HALF_UP);
- if ((noted_value == 0.0) && (booked_value == 0.0))
- {
- dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
- GTK_DIALOG_MODAL
- | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- "%s",
- /* Translators: Strings from this file are needed only in
- * countries that have one of aqbanking's Online Banking
- * techniques available. This is 'OFX DirectConnect'
- * (U.S. and others), 'HBCI' (in Germany), or 'YellowNet'
- * (Switzerland). If none of these techniques are available
- * in your country, you may safely ignore strings from the
- * import-export/hbci subdirectory. */
- _("The downloaded Online Banking Balance was zero.\n\n"
- "Either this is the correct balance, or your bank does not "
- "support Balance download in this Online Banking version. "
- "In the latter case you should choose a different "
- "Online Banking version number in the Online Banking "
- "(AqBanking or HBCI) Setup. After that, try again to "
- "download the Online Banking Balance."));
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(GTK_WIDGET(dialog));
- dialogres = FALSE;
- }
- else
- {
- gnc_numeric reconc_balance = xaccAccountGetReconciledBalance (gnc_acc);
-
- char *booked_str = gnc_AB_VALUE_toReadableString (booked_val);
- char *message1 = g_strdup_printf
- (
- _("Result of Online Banking job: \n"
- "Account booked balance is %s"),
- booked_str);
- char *message2 =
- ((noted_value == 0.0) ?
- g_strdup_printf("%s", "") :
- bal_print_balance
- (_("For your information: This account also "
- "has a noted balance of %s\n"),
- noted_val));
-
- if (gnc_numeric_equal(value, reconc_balance))
- {
- const char *message3 = _("The booked balance is identical to the current "
- "reconciled balance of the account.");
- dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
- GTK_DIALOG_MODAL
- | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- "%s\n%s\n%s",
- message1, message2, message3);
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(GTK_WIDGET(dialog));
- dialogres = FALSE;
-
- }
- else
- {
- const char *message3 = _("Reconcile account now?");
-
- dialogres = gnc_verify_dialog
- (parent,
- TRUE,
- "%s%s\n%s",
- message1, message2, message3);
- }
- g_free (message1);
- g_free (message2);
- free (booked_str);
- }
-
-
- if (dialogres)
- {
- recnWindowWithBalance (parent,
- gnc_acc,
- value,
- booked_tt);
- }
-
- return TRUE;
-}
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-getbalance.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,42 +0,0 @@
-/********************************************************************\
- * gnc-hbci-getbalance.h -- hbci getbalance function *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef GNC_HBCI_GETBALANCE_H
-#define GNC_HBCI_GETBALANCE_H
-
-#include <aqbanking/jobgetbalance.h>
-#include "Account.h"
-
-/** Starts a GetBalance job, adds the job to the AB_BANKING, and
- * (currently) calls executeOutbox. */
-void
-gnc_hbci_getbalance (GtkWidget *parent, Account *gnc_acc);
-
-/** Finalizes all the things that have to be done with a GetBalance
- * job. Returns true if everything has been finished succesfully. */
-gboolean
-gnc_hbci_getbalance_finish (GtkWidget *parent,
- Account *gnc_acc,
- const AB_JOB *job);
-
-
-#endif /* GNC_HBCI_GETBALANCE_H */
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,364 +0,0 @@
-/********************************************************************\
- * gnc-hbci-gettrans.c -- hbci get transactions functions *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#define AQBANKING_NOWARN_DEPRECATED
-#include "gnc-hbci-gettrans.h"
-
-#include "gnc-ui.h"
-#include "qof.h"
-#include "Transaction.h"
-
-#include "import-main-matcher.h"
-
-#include "hbci-interaction.h"
-#include "gnc-hbci-utils.h"
-#include "dialog-hbcitrans.h"
-#include "gnc-hbci-kvp.h"
-#include "dialog-daterange.h"
-#include "import-utilities.h"
-
-/* static short module = MOD_IMPORT; */
-
-
-gboolean
-gettrans_dates(GtkWidget *parent, Account *gnc_acc,
- GWEN_TIME **from_date, GWEN_TIME **to_date);
-
-
-
-
-void
-gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc)
-{
- AB_BANKING *api = NULL;
- const AB_ACCOUNT *h_acc = NULL;
- GNCInteractor *interactor = NULL;
-
- g_assert(parent);
- g_assert(gnc_acc);
-
- /* Get the api */
- api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
- if (api == NULL)
- {
- g_message("gnc_hbci_gettrans: Couldn't get HBCI API.\n");
- return;
- }
- g_assert (interactor);
-
- /* Get HBCI account */
- h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
- if (h_acc == NULL)
- {
- g_warning("gnc_hbci_getbalance: No HBCI account found.\n");
- /* FIXME: free unneeded data */
- return;
- }
-
- {
- /* Execute a GetTransactions job. */
- AB_JOB *job;
- Timespec until_timespec;
- 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, GWEN_Time_toTime_t(to_date));
-
- /* Create OutboxJob */
- job = AB_JobGetTransactions_new((AB_ACCOUNT*)h_acc);
- if (AB_Job_CheckAvailability(job))
- {
- g_warning("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 AB_BANKING queue. */
- AB_Banking_EnqueueJob(api, job);
-
- /* Execute Outbox. */
- if (!gnc_AB_BANKING_execute (parent, api, job, interactor) ||
- (AB_Job_GetStatus(job) == AB_Job_StatusError) ||
- GNCInteractor_hadErrors (interactor))
- {
- /* AB_BANKING_executeOutbox failed. */
- gnc_hbci_cleanup_job(api, job);
- return;
- }
-
- /* Store the date of this retrieval */
- gnc_hbci_set_account_trans_retrieval (gnc_acc, until_timespec);
-
- /* Now finish the job duties. */
- gnc_hbci_gettrans_final(parent, gnc_acc, job, FALSE);
-
- /* Clean up behind ourself. */
- gnc_hbci_cleanup_job(api, job);
- gnc_AB_BANKING_fini (api);
- GNCInteractor_hide (interactor);
- if (from_date)
- GWEN_Time_free (from_date);
- GWEN_Time_free (to_date);
- }
-}
-
-
-/** Create and set the from_date and to_date objects, and return TRUE
- if they have been set. If FALSE is returned, then from_date and
- to_date are not pointing to valid objects and may not be
- deleted. */
-gboolean
-gettrans_dates(GtkWidget *parent, Account *gnc_acc,
- GWEN_TIME **from_date, GWEN_TIME **to_date)
-{
- Timespec last_timespec, until_timespec;
- time_t now = time(NULL);
- gboolean use_last_date = TRUE,
- use_earliest_date = TRUE, use_until_now = TRUE;
-
- g_assert(from_date);
- g_assert(to_date);
- /* Get time of last retrieval */
- last_timespec = gnc_hbci_get_account_trans_retrieval (gnc_acc);
- if (last_timespec.tv_sec == 0)
- {
- use_last_date = FALSE;
- timespecFromTime_t (&last_timespec, now);
- }
- timespecFromTime_t (&until_timespec, now);
-
- /* Let the user choose the date range of retrieval */
- if (!gnc_hbci_enter_daterange (parent, NULL,
- &last_timespec,
- &use_last_date, &use_earliest_date,
- &until_timespec, &use_until_now))
- return FALSE;
-
- /*printf("Retrieving transactions from date %s to date %s. \n",
- ctime(&()))*/
-
- /* Now calculate from date */
- if (use_earliest_date)
- *from_date = NULL;
- /* for an old version this was: from_date = GWEN_Time_fromSeconds(0); */
- else
- {
- if (use_last_date)
- last_timespec = gnc_hbci_get_account_trans_retrieval (gnc_acc);
- *from_date = GWEN_Time_fromSeconds(timespecToTime_t(last_timespec));
- }
-
- /* Now calculate to date */
- if (use_until_now)
- timespecFromTime_t (&until_timespec, now);
- *to_date = GWEN_Time_fromSeconds(timespecToTime_t (until_timespec));
-
- return TRUE;
-}
-
-
-/** Finalizes all the things that have to be done with a GetTrans
- * job. Returns true if everything has been finished succesfully. */
-gboolean
-gnc_hbci_gettrans_final(GtkWidget *parent,
- Account *gnc_acc,
- const AB_JOB *trans_job,
- gboolean run_until_done)
-{
- GtkWidget *dialog;
-
- /* Now add the retrieved transactions to the gnucash account. */
- AB_TRANSACTION_LIST2 *trans_list;
-
- trans_list = AB_JobGetTransactions_GetTransactions(trans_job);
- if (trans_list && (AB_Transaction_List2_GetSize(trans_list) > 0))
- {
- /* Final importing part. */
- return gnc_hbci_import_final(parent, gnc_acc, trans_list, run_until_done);
- }
-
- dialog = gtk_message_dialog_new(GTK_WINDOW(parent),
- GTK_DIALOG_MODAL
- | GTK_DIALOG_DESTROY_WITH_PARENT,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- "%s",
- _("The Online Banking import returned no transactions "
- "for the selected time period."));
- gtk_dialog_run(GTK_DIALOG(dialog));
- gtk_widget_destroy(GTK_WIDGET(dialog));
- return TRUE;
-}
-
-
-gboolean
-gnc_hbci_import_final(GtkWidget *parent,
- Account *gnc_acc,
- AB_TRANSACTION_LIST2 *trans_list,
- gboolean run_until_done)
-{
- struct trans_list_data data;
- GNCImportMainMatcher *importer_generic_gui;
-
- if (!trans_list || (AB_Transaction_List2_GetSize(trans_list) == 0))
- return TRUE;
-
- importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
-
- data.importer_generic = importer_generic_gui;
- data.gnc_acc = gnc_acc;
-
- AB_Transaction_List2_ForEach (trans_list, gnc_hbci_trans_list_cb, &data);
-
- if (run_until_done)
- return gnc_gen_trans_list_run (importer_generic_gui);
- return TRUE;
-}
-
-
-/* list_AB_TRANSACTION_foreach callback. The Conversion from HBCI to
- GNC transaction is done here, once for each AB_TRANSACTION. */
-AB_TRANSACTION *gnc_hbci_trans_list_cb(AB_TRANSACTION *h_trans, void *user_data)
-{
- time_t current_time;
- /* time_t tt1, tt2; */
- /*struct tm tm1, tm2;*/
- Account *gnc_acc;
- QofBook *book;
- Transaction *gnc_trans;
- const GWEN_TIME *valutaDate, *normalDate;
- Split *split;
- struct trans_list_data *data = user_data;
- g_assert(data);
-
- if (!h_trans) return NULL;
-
- gnc_acc = data->gnc_acc;
- g_assert(gnc_acc);
- book = gnc_account_get_book(gnc_acc);
-
- /* Create new gnucash transaction for the given hbci one */
- gnc_trans = xaccMallocTransaction(book);
- xaccTransBeginEdit(gnc_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));*/
-
-
- /* Date / Time */
- if (valutaDate)
- xaccTransSetDatePostedSecs
- (gnc_trans, GWEN_Time_toTime_t (valutaDate));
- else
- g_warning("trans_list_cb: Oops, date 'valutaDate' was NULL.\n");
-
- current_time = time(NULL);
- xaccTransSetDateEnteredSecs(gnc_trans, mktime(localtime(¤t_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 = AB_Transaction_GetCustomerReference (h_trans);
- if (custref && (strlen (custref) > 0) &&
- (g_ascii_strncasecmp (custref, "NONREF", 6) != 0))
- xaccTransSetNum (gnc_trans, custref);
- }
-
- /* Description */
- {
- char *g_descr = gnc_hbci_descr_tognc (h_trans);
- xaccTransSetDescription (gnc_trans, g_descr);
- g_free (g_descr);
- }
-
- /* 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);
-
-
- {
- /* OFX unique transaction ID */
- const char *fitid = AB_Transaction_GetFiId(h_trans);
- if (fitid && (strlen (fitid) > 0))
- gnc_import_set_split_online_id(split, fitid);
- }
-
- {
- /* Amount into the split */
- const AB_VALUE *h_value = AB_Transaction_GetValue (h_trans);
- double d_value = h_value ? AB_Value_GetValue (h_value) : 0.0;
- AB_TRANSACTION_TYPE h_type = AB_Transaction_GetType (h_trans);
- gnc_numeric gnc_amount;
-
- /*printf("Transaction with value %f has type %d\n", d_value, h_type);*/
- /* If the value is positive, but the transaction type says the
- money is transferred away from our account (Transfer instead of
- DebitNote), we switch the value to negative. */
- if (d_value > 0.0 && h_type == AB_Transaction_TypeTransfer)
- d_value = -d_value;
-
- gnc_amount = double_to_gnc_numeric
- (d_value,
- xaccAccountGetCommoditySCU(gnc_acc),
- GNC_HOW_RND_ROUND_HALF_UP);
- if (!h_value)
- g_warning("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);
- xaccSplitSetMemo(split, g_memo);
- g_free (g_memo);
- }
-
- /* Instead of xaccTransCommitEdit(gnc_trans) */
- g_assert (data->importer_generic);
- gnc_gen_trans_list_add_trans (data->importer_generic, gnc_trans);
-
- return NULL;
-
-}
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-gettrans.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,64 +0,0 @@
-/********************************************************************\
- * gnc-hbci-gettrans.h -- hbci get transactions function *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef GNC_HBCI_GETTRANS_H
-#define GNC_HBCI_GETTRANS_H
-
-#include <aqbanking/jobgettransactions.h>
-
-#include "import-main-matcher.h"
-#include "Account.h"
-
-/** Start a GetTrans job. */
-void
-gnc_hbci_gettrans (GtkWidget *parent, Account *gnc_acc);
-
-/** Finalizes all the things that have to be done with a GetTrans
- * job. Returns true if everything has been finished succesfully. */
-gboolean
-gnc_hbci_gettrans_final(GtkWidget *parent,
- Account *gnc_acc,
- const AB_JOB *trans_job,
- gboolean run_until_done);
-
-/** Finalize the final importing part of a GetTrans job. Returns true
- * if everything has been finished succesfully. */
-gboolean
-gnc_hbci_import_final(GtkWidget *parent,
- Account *gnc_acc,
- AB_TRANSACTION_LIST2 *trans_list,
- gboolean run_until_done);
-
-/** user_data struct for the gnc_hbci_trans_list_cb() structure */
-struct trans_list_data
-{
- Account *gnc_acc;
- GNCImportMainMatcher *importer_generic;
-};
-
-/** AB_TRANSACTION_LIST2_foreach callback. The Conversion from HBCI to
- GNC transaction is done here, once for each AB_TRANSACTION. */
-AB_TRANSACTION *gnc_hbci_trans_list_cb(AB_TRANSACTION *imported_trans,
- void *user_data);
-
-
-#endif /* GNC_HBCI_GETTRANS_H */
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,200 +0,0 @@
-/********************************************************************\
- * gnc-hbci-kvp.c -- hbci kvp handling *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-#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"
-
-static void force_account_dirty(Account *acct)
-{
- gchar *name = g_strdup(xaccAccountGetName(acct));
-
- /* This is necessary because modifying the KvpFrames doesn't mark
- accounts dirty, which means the changes wont be propagated to the
- backend. */
- xaccAccountSetName(acct, name);
- g_free(name);
-}
-
-/* Account */
-char *gnc_hbci_get_account_accountid (Account *a)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
- kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNT_ID);
- return kvp_value_get_string (value);
-}
-char *gnc_hbci_get_account_bankcode (Account *a)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
- kvp_value *value = kvp_frame_get_slot (frame, HBCI_BANK_CODE);
- return kvp_value_get_string (value);
-}
-gint gnc_hbci_get_account_countrycode (Account *a)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
- kvp_value *value = kvp_frame_get_slot (frame, HBCI_COUNTRY_CODE);
- return kvp_value_get_gint64 (value);
-}
-void gnc_hbci_set_account_accountid (Account *a, const char *id)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
- kvp_value *value = kvp_value_new_string (id);
- xaccAccountBeginEdit(a);
- kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_ID, value);
- force_account_dirty (a);
- xaccAccountCommitEdit (a);
-}
-void gnc_hbci_set_account_bankcode (Account *a, const char *code)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
- kvp_value *value = kvp_value_new_string (code);
- xaccAccountBeginEdit (a);
- kvp_frame_set_slot_nc (frame, HBCI_BANK_CODE, value);
- force_account_dirty (a);
- xaccAccountCommitEdit (a);
-}
-void gnc_hbci_set_account_countrycode (Account *a, gint code)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, TRUE);
- kvp_value *value = kvp_value_new_gint64 (code);
- xaccAccountBeginEdit (a);
- kvp_frame_set_slot_nc (frame, HBCI_COUNTRY_CODE, value);
- force_account_dirty (a);
- xaccAccountCommitEdit (a);
-}
-gint gnc_hbci_get_account_uid (Account *a)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
- 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, TRUE);
- kvp_value *value = kvp_value_new_gint64 (uid);
- xaccAccountBeginEdit (a);
- kvp_frame_set_slot_nc (frame, HBCI_ACCOUNT_UID, value);
- force_account_dirty (a);
- xaccAccountCommitEdit (a);
-}
-Timespec gnc_hbci_get_account_trans_retrieval (Account *a)
-{
- kvp_frame *frame = gnc_hbci_get_account_kvp (a, FALSE);
- 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, TRUE);
- kvp_value *value = kvp_value_new_timespec (time);
- xaccAccountBeginEdit (a);
- kvp_frame_set_slot_nc (frame, HBCI_TRANS_RETRIEVAL, value);
- force_account_dirty (a);
- xaccAccountCommitEdit (a);
-}
-
-
-
-/* QofBook */
-#define HBCI_CONFIGFILE "config-filename"
-#define HBCI_TEMPLATES "template-list"
-
-char *gnc_hbci_get_book_configfile (QofBook *b)
-{
- kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
- kvp_value *value = kvp_frame_get_slot (frame, HBCI_CONFIGFILE);
- return kvp_value_get_string (value);
-}
-void gnc_hbci_set_book_configfile (QofBook *b, const char *filename)
-{
- kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
- kvp_value *value = kvp_value_new_string (filename);
- kvp_frame_set_slot_nc (frame, HBCI_CONFIGFILE, value);
- qof_book_kvp_changed (b);
-}
-GList *gnc_hbci_get_book_template_list (QofBook *b)
-{
- kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
- kvp_value *value = kvp_frame_get_slot (frame, HBCI_TEMPLATES);
- return kvp_value_get_glist (value);
-}
-void gnc_hbci_set_book_template_list (QofBook *b, GList *template_list)
-{
- kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
- kvp_value *value = kvp_value_new_glist_nc (template_list);
- kvp_frame_set_slot_nc (frame, HBCI_TEMPLATES, value);
- qof_book_kvp_changed (b);
-}
-
-#if 0
-GList *gnc_hbci_get_book_account_list (QofBook *b)
-{
- kvp_frame *frame = gnc_hbci_get_book_kvp (b, FALSE);
- kvp_value *value = kvp_frame_get_slot (frame, HBCI_ACCOUNTS);
- return kvp_value_get_glist (value);
-}
-void gnc_hbci_set_book_account_list (QofBook *b, GList *account_list)
-{
- kvp_frame *frame = gnc_hbci_get_book_kvp (b, TRUE);
- kvp_value *value = kvp_value_new_glist_nc (account_list);
- kvp_frame_set_slot_nc (frame, HBCI_ACCOUNTS, value);
- qof_book_kvp_changed (b);
-}
-#endif
-
-
-/* lowlevel */
-/* getters for kvp frame in book */
-kvp_frame *gnc_hbci_get_book_kvp (QofBook *b, gboolean create)
-{
- kvp_frame *toplevel = qof_book_get_slots (b);
- kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY);
- if (!result && create)
- {
- result = kvp_frame_new();
- kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
- }
- return result;
-}
-
-
-
-/* kvp frame in Account */
-kvp_frame *gnc_hbci_get_account_kvp (Account *a, gboolean create)
-{
- kvp_frame *toplevel = xaccAccountGetSlots (a);
- kvp_frame *result = kvp_frame_get_frame (toplevel, HBCI_KEY);
- if (!result && create)
- {
- result = kvp_frame_new();
- kvp_frame_add_frame_nc (toplevel, HBCI_KEY, result);
- }
- return result;
-}
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-kvp.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,105 +0,0 @@
-/********************************************************************\
- * gnc-hbci-kvp.h -- hbci kvp handling *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef GNC_HBCI_KVP_H
-#define GNC_HBCI_KVP_H
-
-#include <glib.h>
-#include "qof.h"
-#include "Account.h"
-
-/* Account */
-
-/** Returns a non-copied pointer to the accountid string in the
- * Account a. The char* is still owned by the kvp_frame, so don't free
- * it until you want to delete the whole kvp_frame. */
-char *gnc_hbci_get_account_accountid (Account *a);
-/** Set the accountid string in the Account a. A copy of the string
- * will be stored. The Account will be marked as "dirty". */
-void gnc_hbci_set_account_accountid (Account *a, const char *id);
-
-/** Returns a non-copied pointer to the bankcode string in the
- * Account a. The char* is still owned by the kvp_frame, so don't free
- * it until you want to delete the whole kvp_frame. */
-char *gnc_hbci_get_account_bankcode (Account *a);
-/** Set the bankcode string in the Account a. A copy of the string
- * will be stored. The Account will be marked as "dirty". */
-void gnc_hbci_set_account_bankcode (Account *a, const char *code);
-
-/** Returns the countrycode integer value from the Account a. */
-gint gnc_hbci_get_account_countrycode (Account *a);
-/** Set the countrycode integer value in the Account a. The Account
- * will be marked as "dirty". */
-void gnc_hbci_set_account_countrycode (Account *a, gint code);
-
-/** 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
- * will be marked as "dirty". */
-void gnc_hbci_set_account_trans_retrieval (Account *a, Timespec time);
-
-
-/* QofBook */
-
-/** Returns a non-copied pointer to the configfile string in the
- * QofBook b. The char* is still owned by the kvp_frame, so don't free
- * it until you want to delete the whole kvp_frame. */
-char *gnc_hbci_get_book_configfile (QofBook *b);
-/** Set the configfile string in the QofBook b. A copy of the string
- * will be stored. The Book will be marked as "dirty". */
-void gnc_hbci_set_book_configfile (QofBook *b, const char *filename);
-
-/** Returns a non-copied pointer to the GList of kvp_frames which
- * eventually are the template transactions, stored in the given
- * book. */
-GList *gnc_hbci_get_book_template_list (QofBook *b);
-void gnc_hbci_set_book_template_list (QofBook *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 (QofBook *b);
-void gnc_hbci_set_book_account_list (QofBook *b, GList *account_list);
-#endif
-
-/* lowlevel */
-
-/* internal getter for kvp frame in book. The create argument says
- * to create the frame if it doesn't already exist. */
-kvp_frame *gnc_hbci_get_book_kvp (QofBook *b, gboolean create);
-
-/* internal getter for kvp frame in Account. The create argument says
- * to create the frame if it doesn't already exist. */
-kvp_frame *gnc_hbci_get_account_kvp (Account *a, gboolean create);
-
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,286 +0,0 @@
-/********************************************************************\
- * gnc-hbci-trans-template.c -- Templates for HBCI transactions *
- * Copyright (C) 2003 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include "gnc-hbci-trans-templ.h"
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-struct _trans_data
-{
- /* Name of this Template */
- gchar *name;
- gchar *name_key; /* Collation key */
-
- /* Recipient */
- gchar *recp_name;
- gchar *recp_account;
- gchar *recp_bankcode;
-
- /* Amount */
- gnc_numeric amount;
-
- /* Purpose, description */
- gchar *purpose;
- gchar *purpose_cont;
-};
-
-
-GNCTransTempl *gnc_trans_templ_new()
-{
- GNCTransTempl *r = g_new0(GNCTransTempl, 1);
- r->amount = gnc_numeric_zero();
- return r;
-}
-GNCTransTempl *gnc_trans_templ_new_full(const char *name,
- const char *recp_name,
- const char *recp_account,
- const char *recp_bankcode,
- gnc_numeric amount,
- const char *purpose,
- const char *purpose_cont)
-{
- GNCTransTempl *r = g_new0(GNCTransTempl, 1);
- r->name = g_strdup(name);
- r->name_key = g_utf8_collate_key(name, -1);
- r->recp_name = g_strdup(recp_name);
- r->recp_account = g_strdup(recp_account);
- r->recp_bankcode = g_strdup(recp_bankcode);
- r->amount = amount;
- r->purpose = g_strdup(purpose);
- r->purpose_cont = g_strdup(purpose_cont);
- return r;
-}
-
-void gnc_trans_templ_delete(GNCTransTempl *t)
-{
- if (!t) return;
- if (t->name) g_free(t->name);
- if (t->name_key) g_free(t->name_key);
- if (t->recp_name) g_free(t->recp_name);
- if (t->recp_account) g_free(t->recp_account);
- if (t->recp_bankcode) g_free(t->recp_bankcode);
- if (t->purpose) g_free(t->purpose);
- if (t->purpose_cont) g_free(t->purpose_cont);
- g_free(t);
-}
-static void delete_glist_func(gpointer data, gpointer user_data)
-{
- GNCTransTempl *t = data;
- gnc_trans_templ_delete(t);
-}
-void gnc_trans_templ_delete_glist(GList *l)
-{
- g_list_foreach(l, delete_glist_func, NULL);
- g_list_free(l);
-}
-
-
-/* kvp_frame slot names */
-#define TT_NAME "name"
-#define TT_RNAME "rnam"
-#define TT_RACC "racc"
-#define TT_RBCODE "rbcd"
-#define TT_PURPOS "purp"
-#define TT_PURPOSCT "purc"
-#define TT_AMOUNT "amou"
-
-/** Constructor from a kvp_frame */
-GNCTransTempl *gnc_trans_templ_from_kvp(kvp_frame *k)
-{
- GNCTransTempl *res = gnc_trans_templ_new();
- g_assert(k);
-
- res->name = g_strdup(kvp_value_get_string
- (kvp_frame_get_slot(k, TT_NAME)));
- res->name_key = g_utf8_collate_key(res->name, -1);
- res->recp_name = g_strdup(kvp_value_get_string
- (kvp_frame_get_slot(k, TT_RNAME)));
- res->recp_account = g_strdup(kvp_value_get_string
- (kvp_frame_get_slot(k, TT_RACC)));
- res->recp_bankcode = g_strdup(kvp_value_get_string
- (kvp_frame_get_slot(k, TT_RBCODE)));
- res->purpose = g_strdup(kvp_value_get_string
- (kvp_frame_get_slot(k, TT_PURPOS)));
- res->purpose_cont = g_strdup(kvp_value_get_string
- (kvp_frame_get_slot(k, TT_PURPOSCT)));
- res->amount = kvp_value_get_numeric(kvp_frame_get_slot(k, TT_AMOUNT));
- return res;
-}
-
-/** Creates a kvp_frame from this TransTempl */
-kvp_frame *gnc_trans_templ_to_kvp(const GNCTransTempl *t)
-{
- kvp_frame *k = kvp_frame_new();
- g_assert(t);
-
- kvp_frame_set_slot(k, TT_NAME, kvp_value_new_string(t->name));
- kvp_frame_set_slot(k, TT_RNAME, kvp_value_new_string(t->recp_name));
- kvp_frame_set_slot(k, TT_RACC, kvp_value_new_string(t->recp_account));
- kvp_frame_set_slot(k, TT_RBCODE, kvp_value_new_string(t->recp_bankcode));
- kvp_frame_set_slot(k, TT_PURPOS, kvp_value_new_string(t->purpose));
- kvp_frame_set_slot(k, TT_PURPOSCT, kvp_value_new_string(t->purpose_cont));
- kvp_frame_set_slot(k, TT_AMOUNT, kvp_value_new_gnc_numeric(t->amount));
- return k;
-}
-
-/** Creates a GList of GNCTransTempl from a GList of kvp_values which
- in turn contain a kvp_frame. */
-static void glist_from_kvp_func(gpointer data, gpointer user_data)
-{
- GList **tmp = user_data;
- GList *res = *tmp;
- kvp_value *k = data;
- *tmp = g_list_append(res, gnc_trans_templ_from_kvp(kvp_value_get_frame(k)));
-}
-/** Creates a GList of GNCTransTempl from a GList of kvp_values which
- in turn contain a kvp_frame. */
-GList *gnc_trans_templ_glist_from_kvp_glist(GList *v)
-{
- GList *res = NULL;
- if (!v) return NULL;
-
- g_list_foreach (v, glist_from_kvp_func, &res);
- return res;
-}
-
-
-/** Creates a GList of kvp_value (which in turn contain a kvp_frame)
- from a GList of GNCTransTempl. */
-static void glist_to_kvp_func(gpointer data, gpointer user_data)
-{
- GList **tmp = user_data;
- GList *res = *tmp;
- GNCTransTempl *g = data;
- *tmp = g_list_append(res,
- kvp_value_new_frame_nc(gnc_trans_templ_to_kvp(g)));
-}
-/** Creates a GList of kvp_value (which in turn contain a kvp_frame)
- from a GList of GNCTransTempl. */
-GList *gnc_trans_templ_kvp_glist_from_glist(GList *k)
-{
- GList *res = NULL;
- if (!k) return NULL;
-
- g_list_foreach (k, glist_to_kvp_func, &res);
- return res;
-}
-
-
-
-/* Value accessors.
- *
- * Gee, how I *HATE* OO programming in C! This STINKS! barf barf barf */
-const char *gnc_trans_templ_get_name(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->name;
-}
-const char *gnc_trans_templ_get_name_key(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->name_key;
-}
-const char *gnc_trans_templ_get_recp_name(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->recp_name;
-}
-const char *gnc_trans_templ_get_recp_account(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->recp_account;
-}
-const char *gnc_trans_templ_get_recp_bankcode(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->recp_bankcode;
-}
-gnc_numeric gnc_trans_templ_get_amount(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->amount;
-}
-const char *gnc_trans_templ_get_purpose(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->purpose;
-}
-const char *gnc_trans_templ_get_purpose_cont(const GNCTransTempl *t)
-{
- g_assert(t);
- return t->purpose_cont;
-}
-/** value storing. This sucks even more. barf barf barf again */
-void gnc_trans_templ_set_amount(GNCTransTempl *t, gnc_numeric n)
-{
- g_assert(t);
- t->amount = n;
-}
-void gnc_trans_templ_set_name(GNCTransTempl *t, const char *c)
-{
- g_assert(t);
- if (t->name)
- g_free(t->name);
- if (t->name_key)
- g_free(t->name_key);
- t->name = g_strdup(c);
- t->name_key = g_utf8_collate_key(c, -1);
-}
-void gnc_trans_templ_set_recp_name(GNCTransTempl *t, const char *c)
-{
- g_assert(t);
- if (t->recp_name)
- g_free(t->recp_name);
- t->recp_name = g_strdup(c);
-}
-void gnc_trans_templ_set_recp_account(GNCTransTempl *t, const char *c)
-{
- g_assert(t);
- if (t->recp_account)
- g_free(t->recp_account);
- t->recp_account = g_strdup(c);
-}
-void gnc_trans_templ_set_recp_bankcode(GNCTransTempl *t, const char *c)
-{
- g_assert(t);
- if (t->recp_bankcode)
- g_free(t->recp_bankcode);
- t->recp_bankcode = g_strdup(c);
-}
-void gnc_trans_templ_set_purpose(GNCTransTempl *t, const char *c)
-{
- g_assert(t);
- if (t->purpose)
- g_free(t->purpose);
- t->purpose = g_strdup(c);
-}
-void gnc_trans_templ_set_purpose_cont(GNCTransTempl *t, const char *c)
-{
- g_assert(t);
- if (t->purpose_cont)
- g_free(t->purpose_cont);
- t->purpose_cont = g_strdup(c);
-}
-
-
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-trans-templ.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,90 +0,0 @@
-/********************************************************************\
- * gnc-hbci-trans-templ.h -- Templates for HBCI transactions *
- * Copyright (C) 2003 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-/** @file gnc-hbci-trans-templ.h Templates for HBCI transactions */
-
-#include "qof.h"
-
-/** A template for a HBCI transaction */
-typedef struct _trans_data GNCTransTempl;
-
-/** @name Constructor */
-/*@{*/
-GNCTransTempl *gnc_trans_templ_new(void);
-GNCTransTempl *gnc_trans_templ_new_full(const char *name,
- const char *recp_name,
- const char *recp_account,
- const char *recp_bankcode,
- gnc_numeric amount,
- const char *purpose,
- const char *purpose_cont);
-
-void gnc_trans_templ_delete(GNCTransTempl *t);
-void gnc_trans_templ_delete_glist(GList *l);
-/*@}*/
-
-/** @name Serialization -- to kvp_frame and back */
-/*@{*/
-/** Constructor from a kvp_frame (the kvp_frame is left unchanged) */
-GNCTransTempl *gnc_trans_templ_from_kvp(kvp_frame *k);
-/** Creates a kvp_frame from this TransTempl */
-kvp_frame *gnc_trans_templ_to_kvp(const GNCTransTempl *t);
-
-/** Creates a GList of GNCTransTempl from a GList of kvp_values which
- in turn contain a kvp_frame. */
-GList *gnc_trans_templ_glist_from_kvp_glist(GList *v);
-/** Creates a GList of kvp_value (which in turn contain a kvp_frame)
- from a GList of GNCTransTempl. */
-GList *gnc_trans_templ_kvp_glist_from_glist(GList *k);
-/*@}*/
-
-/** @name GNCTransTempl value access */
-/*@{*/
-const char *gnc_trans_templ_get_name(const GNCTransTempl *t);
-const char *gnc_trans_templ_get_name_key(const GNCTransTempl *t);
-const char *gnc_trans_templ_get_recp_name(const GNCTransTempl *t);
-const char *gnc_trans_templ_get_recp_account(const GNCTransTempl *t);
-const char *gnc_trans_templ_get_recp_bankcode(const GNCTransTempl *t);
-
-/** Amount */
-gnc_numeric gnc_trans_templ_get_amount(const GNCTransTempl *t);
-
-/** Purpose, description */
-const char *gnc_trans_templ_get_purpose(const GNCTransTempl *t);
-const char *gnc_trans_templ_get_purpose_cont(const GNCTransTempl *t);
-/*@}*/
-
-/** @name GNCTransTempl value storing */
-/*@{*/
-void gnc_trans_templ_set_name(GNCTransTempl *t, const char *);
-void gnc_trans_templ_set_recp_name(GNCTransTempl *t, const char *);
-void gnc_trans_templ_set_recp_account(GNCTransTempl *t, const char *);
-void gnc_trans_templ_set_recp_bankcode(GNCTransTempl *t, const char *);
-
-/** Amount */
-void gnc_trans_templ_set_amount(GNCTransTempl *t, gnc_numeric );
-
-/** Purpose, description */
-void gnc_trans_templ_set_purpose(GNCTransTempl *t, const char *);
-void gnc_trans_templ_set_purpose_cont(GNCTransTempl *t, const char *);
-/*@}*/
-
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,309 +0,0 @@
-/********************************************************************\
- * gnc-hbci-transfer.c -- hbci transfer functions *
- * Copyright (C) 2002 Christian Stimming *
- * Copyright (C) 2004 Bernd Wagner (minor changes for *
- * online transaction templates) *
- * Copyright (c) 2006 David Hampton <hampton at employees.org> *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <aqbanking/banking.h>
-
-#include "gnc-hbci-transfer.h"
-#include "gnc-ui.h"
-#include "gnc-numeric.h"
-#include "dialog-transfer.h"
-#include "gnc-date.h"
-#include "Transaction.h"
-
-#include "hbci-interaction.h"
-#include "gnc-hbci-utils.h"
-#include "gnc-hbci-trans-templ.h"
-#include "gnc-hbci-kvp.h"
-
-
-void maketrans_save_templates(GtkWidget *parent, Account *gnc_acc,
- GList *template_list, gboolean dont_ask);
-
-
-void
-gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc,
- GNC_HBCI_Transtype trans_type)
-{
- AB_BANKING *api = NULL;
- const AB_ACCOUNT *h_acc = NULL;
- GNCInteractor *interactor = NULL;
-
- g_assert(parent);
- g_assert(gnc_acc);
-
- /* Get API */
- api = gnc_AB_BANKING_new_currentbook (parent, &interactor);
- if (api == NULL)
- {
- g_message("gnc_hbci_maketrans: Couldn't get HBCI API. Nothing will happen.\n");
- return;
- }
- g_assert (interactor);
-
- /* Get HBCI account */
- h_acc = gnc_hbci_get_hbci_acc (api, gnc_acc);
- if (h_acc == NULL)
- {
- g_warning("gnc_hbci_maketrans: No HBCI account found. Nothing will happen.\n");
- return;
- }
- /*printf("gnc_hbci_maketrans: HBCI account no. %s found.\n",
- AB_ACCOUNT_accountId (h_acc));*/
-
- {
- GList *template_list =
- gnc_trans_templ_glist_from_kvp_glist
- ( gnc_hbci_get_book_template_list
- ( gnc_account_get_book(gnc_acc)));
- int result;
- gboolean successful = FALSE;
- HBCITransDialog *td;
-
- /* Now open the HBCI_trans_dialog, which also calls
- AB_BANKING_executeQueue. */
-
- /* Create new HBCIDialogTrans */
- td = gnc_hbci_dialog_new(parent, h_acc, gnc_acc,
- trans_type, template_list);
-
- /* Delete the list. The data is still pointed to by the
- * GtkListStore in the dialog. */
- g_list_free(template_list);
- template_list = NULL;
-
- /* Repeat until HBCI action was successful or user pressed cancel */
- do
- {
-
- /* Let the user enter the values. If cancel is pressed, -1 is returned. */
- result = gnc_hbci_dialog_run_until_ok(td, h_acc);
-
- if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER))
- {
- /* If cancel has been pressed, the dialog doesn't exist
- anymore and we cannot query for the template
- list. Therefore break immediately. */
- break;
- }
-
- /* Set the template list in case it got modified. */
- if (template_list)
- g_list_free(template_list);
- template_list = gnc_hbci_dialog_get_templ(td);
-
- /* templates changed? If yes, store them */
- if (gnc_hbci_dialog_get_templ_changed(td) )
- maketrans_save_templates(parent, gnc_acc, template_list,
- (result == GNC_RESPONSE_NOW));
-
- /* Make really sure the dialog is hidden now. */
- gnc_hbci_dialog_hide(td);
-
- {
- AB_JOB *job =
- gnc_hbci_trans_dialog_enqueue(gnc_hbci_dialog_get_htrans(td), api,
- (AB_ACCOUNT *)h_acc, trans_type);
-
- /* Check whether we really got a job */
- if (!job)
- {
- /* Oops, no job, probably not supported by bank. */
- if (gnc_verify_dialog
- (parent,
- FALSE,
- "%s",
- _("The backend found an error during the preparation "
- "of the job. It is not possible to execute this job. \n"
- "\n"
- "Most probable the bank does not support your chosen "
- "job or your Online Banking account does not have the permission "
- "to execute this job. More error messages might be "
- "visible on your console log.\n"
- "\n"
- "Do you want to enter the job again?")))
- continue;
- else
- /* job is NULL anyway, so it doesn't have to be cleaned up */
- break;
- }
-
- /* 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)
- {
- AB_Banking_DequeueJob (api, job);
- AB_Job_free (job);
- continue;
- }
-
- /* Result of run_until_ok:
- * GNC_RESPONSE_NOW == execute now
- * GNC_RESPONSE_LATER == scheduled for later execution (currently unimplemented)
- * GTK_RESPONSE_CANCEL == cancel
- * GTK_RESPONSE_DELETE_EVENT == window destroyed */
- if (result == GNC_RESPONSE_NOW)
- {
-
- /* 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);
-
- if (!successful)
- {
- /* HBCI job failed -- then remove gnc txn from the books. */
- Transaction *gtrans = gnc_hbci_dialog_get_gtrans(td);
- xaccTransBeginEdit(gtrans);
- xaccTransDestroy(gtrans);
- xaccTransCommitEdit(gtrans);
- }
-
- gnc_hbci_cleanup_job(api, job);
- } /* result == GNC_RESPONSE_NOW */
- else
- {
- /* Simply ignore any other case. */
- break;
- } /* result == GNC_RESPONSE_NOW */
-
- } /* Create a do-transaction (transfer) job */
-
- }
- while (!successful);
-
- /* If we wanted to do something here with the gnc txn, we could. */
- /*if (result >= 0) {
- Transaction *gtrans = gnc_hbci_dialog_get_gtrans(td);
- g_message("gnc-hbci-transfer: Got gnc txn w/ description: %s\n",
- xaccTransGetDescription(gtrans));
- }*/
-
- /* Just to be on the safe side, clear queue once again. */
- gnc_AB_BANKING_fini (api);
- gnc_hbci_dialog_delete(td);
- gnc_trans_templ_delete_glist (template_list);
-
- /* GNCInteractor_hide (interactor); */
- }
-}
-
-
-/** Store the template_list in the given Account gnc_acc. If dont_ask
- is FALSE, first ask whether they really should be saved. */
-void maketrans_save_templates(GtkWidget *parent, Account *gnc_acc,
- GList *template_list, gboolean dont_ask)
-{
- if (dont_ask || gnc_verify_dialog
- (parent,
- FALSE,
- "%s",
- _("You have changed the list of online transfer templates, "
- "but you cancelled the transfer dialog. "
- "Do you nevertheless want to store the changes?")))
- {
- GList *kvp_list = gnc_trans_templ_kvp_glist_from_glist (template_list);
- /*printf ("Now having %d templates. List: '%s'\n",
- g_list_length(template_list),
- kvp_value_glist_to_string(kvp_list));*/
- gnc_hbci_set_book_template_list
- (gnc_account_get_book(gnc_acc), kvp_list);
- }
-}
-
-gboolean
-gnc_hbci_maketrans_final(HBCITransDialog *td, Account *gnc_acc,
- GNC_HBCI_Transtype trans_type)
-{
- gnc_numeric amount;
- XferDialog *transdialog;
- const AB_TRANSACTION *h_trans;
- gboolean run_until_done = TRUE;
- g_assert(td);
-
- h_trans = gnc_hbci_dialog_get_htrans(td);
-
- /* HBCI Transaction has finished, so now open the gnucash
- transaction dialog and fill in all values. */
-
- transdialog = gnc_xfer_dialog (gnc_hbci_dialog_get_parent(td), gnc_acc);
-
- switch (trans_type)
- {
- case SINGLE_DEBITNOTE:
- gnc_xfer_dialog_set_title (transdialog, _("Online Banking Direct Debit Note"));
- case SINGLE_INTERNAL_TRANSFER:
- gnc_xfer_dialog_set_title (transdialog, _("Online Banking Bank-Internal Transfer"));
- case SINGLE_TRANSFER:
- default:
- gnc_xfer_dialog_set_title (transdialog, _("Online Banking Transaction"));
- }
-
- /* Amount */
- amount = double_to_gnc_numeric
- (AB_Value_GetValue (AB_Transaction_GetValue (h_trans)),
- xaccAccountGetCommoditySCU(gnc_acc),
- GNC_HOW_RND_ROUND_HALF_UP);
- /*switch (trans_type) {
- case SINGLE_DEBITNOTE:
- gnc_xfer_dialog_set_amount (transdialog, gnc_numeric_neg (amount));
- case SINGLE_TRANSFER:
- default:*/
- gnc_xfer_dialog_set_amount (transdialog, amount);
- /*}*/
- /* gnc_xfer_dialog_toggle_currency_frame (transdialog, FALSE); */
-
- {
- /* Description */
- char *g_descr = gnc_hbci_descr_tognc (h_trans);
- gnc_xfer_dialog_set_description (transdialog, g_descr);
- g_free (g_descr);
- }
-
- {
- /* Memo. */
- char *g_memo = gnc_hbci_memo_tognc (h_trans);
- gnc_xfer_dialog_set_memo (transdialog, g_memo);
- g_free (g_memo);
- }
- /*gnc_xfer_dialog_set_date(XferDialog *xferData, time_t set_time)*/
-
- /* Set the callback for the Gnucash Transaction */
- gnc_xfer_dialog_set_txn_cb(transdialog, gnc_hbci_dialog_xfer_cb, td);
-
- /* Run the dialog until the user has either successfully completed the
- * transaction (just clicking OK doesn't always count) or clicked Cancel.
- * Return TRUE if the transaction was a success, FALSE otherwise.
- */
- return run_until_done
- ? gnc_xfer_dialog_run_until_done( transdialog )
- : TRUE;
-}
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-transfer.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,43 +0,0 @@
-/********************************************************************\
- * gnc-hbci-transfer.h -- hbci transfer functions *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef GNC_HBCI_TRANSFER_H
-#define GNC_HBCI_TRANSFER_H
-
-#include <aqbanking/jobsingletransfer.h>
-#include "Account.h"
-#include "dialog-hbcitrans.h"
-
-void
-gnc_hbci_maketrans (GtkWidget *parent, Account *gnc_acc,
- GNC_HBCI_Transtype trans_type);
-
-/** Open a gnucash transfer dialog for gnucash Account gnc_acc and
- * 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
-gnc_hbci_maketrans_final(HBCITransDialog *td, Account *gnc_acc,
- GNC_HBCI_Transtype trans_type);
-
-
-#endif /* GNC_HBCI_TRANSFER_H */
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,1016 +0,0 @@
-/********************************************************************\
- * gnc-hbci-utils.c -- hbci utility functions *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <errno.h>
-#include <iconv.h>
-#include <gwenhywfar/directory.h>
-#include <gwenhywfar/logger.h>
-
-#include "gnc-ui.h"
-#include "gnc-hbci-kvp.h"
-#include "gnc-gconf-utils.h"
-#include "gnc-ui-util.h"
-#include "qof.h"
-#include "gnc-glib-utils.h"
-
-#include "import-main-matcher.h"
-#include "import-account-matcher.h"
-
-#define AQBANKING_NOWARN_DEPRECATED
-#include "gnc-hbci-utils.h"
-
-#include "hbci-interaction.h"
-#include "gnc-hbci-gettrans.h"
-#include "dialog-hbcitrans.h"
-#include <aqbanking/version.h>
-#include <aqbanking/jobsingledebitnote.h>
-
-
-/* static short module = MOD_IMPORT; */
-
-/* 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;
-
-
-/* If aqbanking is older than 1.9.7, use our own copies of these
- foreach functions */
-#if ((AQBANKING_VERSION_MAJOR == 1) && \
- ((AQBANKING_VERSION_MINOR < 9) || \
- ((AQBANKING_VERSION_MINOR == 9) && \
- ((AQBANKING_VERSION_PATCHLEVEL < 7)))))
-static AB_IMEXPORTER_ACCOUNTINFO *
-AB_ImExporterContext_AccountInfoForEach(AB_IMEXPORTER_CONTEXT *iec,
- AB_IMEXPORTER_ACCOUNTINFO *
- (* func)(AB_IMEXPORTER_ACCOUNTINFO *element,
- void *user_data),
- void* user_data)
-{
- AB_IMEXPORTER_ACCOUNTINFO *it;
- AB_IMEXPORTER_ACCOUNTINFO *retval;
- g_assert(iec);
-
- it = AB_ImExporterContext_GetFirstAccountInfo (iec);
- while (it)
- {
- retval = func(it, user_data);
- if (retval)
- {
- return retval;
- }
- it = AB_ImExporterContext_GetNextAccountInfo (iec);
- }
- return 0;
-
-}
-static const AB_TRANSACTION *
-AB_ImExporterAccountInfo_TransactionsForEach(AB_IMEXPORTER_ACCOUNTINFO *iea,
- const AB_TRANSACTION *
- (* func)(const AB_TRANSACTION *element,
- void *user_data),
- void* user_data)
-{
- const AB_TRANSACTION *it;
- const AB_TRANSACTION *retval;
- g_assert(iea);
-
- it = AB_ImExporterAccountInfo_GetFirstTransaction (iea);
- while (it)
- {
- retval = func(it, user_data);
- if (retval)
- {
- return retval;
- }
- it = AB_ImExporterAccountInfo_GetNextTransaction (iea);
- }
- return 0;
-}
-#endif /* aqbanking < 1.9.7 */
-
-
-
-AB_BANKING * gnc_AB_BANKING_new_currentbook (GtkWidget *parent,
- GNCInteractor **inter)
-{
- if (gnc_AB_BANKING == NULL)
- {
- /* No API cached -- create new one. */
- AB_BANKING *api = NULL;
-
- api = AB_Banking_new ("gnucash", 0);
- g_assert(api);
- {
- int r = AB_Banking_Init(api);
- if (r != 0)
- g_critical("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
- {
- /* 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_AB_BANKING_delete (AB_BANKING *api)
-{
- 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);
- }
-}
-
-
-int gnc_AB_BANKING_fini (AB_BANKING *api)
-{
- 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;
-}
-
-
-
-
-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;
-
- bankcode = gnc_hbci_get_account_bankcode (gnc_acc);
- 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);*/
- hbci_acc = AB_Banking_GetAccount(api, account_uid);
-
- if (!hbci_acc && bankcode && (strlen(bankcode) > 0) &&
- accountid && (strlen(accountid) > 0))
- {
- g_message("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);
- }
- /* g_message("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)
-{
- g_warning("%d, ", value);
- return NULL;
-}
-static void
-print_list_int (const list_int *list)
-{
- g_assert(list);
- list_int_foreach (list, &print_list_int_cb, NULL);
- g_warning ("\n");
-}
-static void *
-get_resultcode_error_cb (int value, void *user_data)
-{
- int *tmp_result = user_data;
- if (value > *tmp_result)
- *tmp_result = value;
- if (value >= 9000)
- return (void*) value;
- else
- return NULL;
-}
-static int
-get_resultcode_error (const list_int *list)
-{
- int tmp_result = 0, cause = 0;
- g_assert (list);
- cause = (int) list_int_foreach (list, &get_resultcode_error_cb, &tmp_result);
- return MAX(tmp_result, cause);
-}
-#endif
-
-/** 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. */
-static int
-gnc_hbci_debug_outboxjob (GNCInteractor *inter, AB_JOB *job, gboolean verbose)
-{
- int cause = 0;
- AB_JOB_STATUS jobstatus;
-
- g_assert (job);
-
- if (verbose)
- {
- g_warning("gnc_hbci_debug_outboxjob: Job status: %s", AB_Job_Status2Char(AB_Job_GetStatus(job)));
-
- g_warning(", result: %s", AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
- g_warning("\n");
- }
-
- jobstatus = AB_Job_GetStatus (job);
- if (jobstatus == AB_Job_StatusError)
- {
- if (AB_Job_GetResultText (job))
- {
- /* Add the "result text" to the log window */
- char *logstring = g_strdup_printf("Job %s had an error: %s\n",
- AB_Job_Type2Char(AB_Job_GetType(job)),
- AB_Job_GetResultText(job));
- GNCInteractor_add_log_text (inter, logstring);
- g_free (logstring);
- }
-
- if (!verbose)
- g_warning("gnc_hbci_debug_outboxjob: Job %s had an error: %s\n",
- AB_Job_Type2Char(AB_Job_GetType(job)),
- AB_Job_GetResultText(job) ? AB_Job_GetResultText(job) : "(none)");
- cause = 9000;
- }
- else
- {
- cause = 0;
- }
-
-#if 0
- /* hbci debugging code; might be adapted to aqbanking at a later
- point in time */
- list = AB_JOB_resultCodes (job);
- if (list_int_size (list) > 0)
- {
-
- cause = get_resultcode_error (list);
-
- if (verbose)
- {
- g_warning("OutboxJob resultcodes: ");
- print_list_int (list);
-
- switch (cause)
- {
- case 9310:
- msg = "Schluessel noch nicht hinterlegt";
- break;
- case 9320:
- msg = "Schluessel noch nicht freigeschaltet";
- break;
- case 9330:
- msg = "Schluessel gesperrt";
- break;
- case 9340:
- msg = "Schluessel falsch";
- break;
- default:
- msg = "Unknown";
- }
- g_warning("Probable cause of error was: code %d, msg: %s\n", cause, msg);
- }
- }
- else
- {
- if (verbose)
- g_warning("OutboxJob's resultCodes list has zero length.\n");
- }
- list_int_delete (list);
-#endif
-
- return cause;
-}
-
-void
-gnc_hbci_cleanup_job(AB_BANKING *api, AB_JOB *job)
-{
- if (AB_Job_GetStatus(job) == AB_Job_StatusFinished)
- {
- AB_Banking_DelFinishedJob(api, job);
- }
- else if (AB_Job_GetStatus(job) == AB_Job_StatusPending)
- {
- AB_Banking_DelPendingJob(api, job);
- }
- /* Martin assured me that there will be no job in the queue after
- ExecuteQueue, so we don't need to remove it from the queue. */
-}
-
-
-gboolean
-gnc_hbci_Error_retry (GtkWidget *parent, int error,
- GNCInteractor *inter)
-{
- int code = error;
-
- switch (code)
- {
-#if 0
- /* these error codes existed in openhbci, but no longer in
- aqbanking. Maybe they might get reintroduced later, but maybe
- not. */
- case AB_ERROR_PIN_WRONG:
- GNCInteractor_erasePIN (inter);
- return gnc_verify_dialog (parent,
- TRUE,
- _("The PIN you entered was wrong.\n"
- "Do you want to try again?"));
- case AB_ERROR_PIN_WRONG_0:
- GNCInteractor_erasePIN (inter);
- return gnc_verify_dialog (parent,
- TRUE,
- _("The PIN you entered was wrong.\n"
- "ATTENTION: You have zero further wrong retries left!\n"
- "Do you want to try again?"));
- case AB_ERROR_CARD_DESTROYED:
- GNCInteractor_hide (inter);
- gnc_error_dialog
- (parent,
- _("Unfortunately you entered a wrong PIN for too many times. "
- "Your chip card is therefore destroyed. Aborting."));
- return FALSE;
- case AB_ERROR_FILE_NOT_FOUND:
- /* g_warning("gnc_hbci_Error_feedback: File not found error.\n"); */
- return FALSE;
- case AB_ERROR_NO_CARD:
- return gnc_verify_dialog (parent,
- TRUE,
- _("No chip card has been found in the chip card reader. "
- "Do you want to try again?"));
- case AB_ERROR_JOB_NOT_SUPPORTED:
- GNCInteractor_hide (inter);
- gnc_error_dialog
- (parent,
- _("Unfortunately this Online Banking job is not supported "
- "by your bank or for your account. Aborting."));
- return FALSE;
-#endif
- case AB_ERROR_NETWORK:
- if (inter) GNCInteractor_hide (inter);
- gnc_error_dialog
- (parent,
- _("The server of your bank refused the Online Banking connection. "
- "Please try again later. Aborting."));
- return FALSE;
-
- default:
- return FALSE;
- }
-
-}
-
-#if 0
-/* hbci debugging code; might be adapted to aqbanking at a later
- point in time */
-
-/* Prints all results that can be found in the outbox into the interactor */
-static void gnc_hbci_printresult(HBCI_Outbox *outbox, GNCInteractor *inter)
-{
- /* 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_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
- AB_JOB *job, GNCInteractor *inter)
-{
- int err;
- int resultcode = 3000; /* This code means: Warnings, but not errors */
- int be_verbose = FALSE;
- g_assert (api);
-
- if (inter)
- GNCInteractor_show (inter);
-
- if (gnc_gconf_get_bool(GCONF_SECTION, KEY_VERBOSE_DEBUG, NULL))
- {
- GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevelNotice);
- GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevelInfo);
- GWEN_Logger_SetLevel("aqhbci", GWEN_LoggerLevelInfo);
- be_verbose = TRUE;
- }
- else
- {
- GWEN_Logger_SetLevel(GWEN_LOGDOMAIN, GWEN_LoggerLevelError);
- GWEN_Logger_SetLevel(AQBANKING_LOGDOMAIN, GWEN_LoggerLevelError);
- GWEN_Logger_SetLevel("aqhbci", GWEN_LoggerLevelError);
- }
-
- do
- {
- if (inter)
- {
- GNCInteractor_show_nodelete (inter);
- AB_Banking_SetPinCacheEnabled (api, GNCInteractor_get_cache_valid(inter));
- }
-
- err = AB_Banking_ExecuteQueue (api);
-
- /* Print result codes to interactor */
- /* gnc_hbci_printresult(queue, inter); */
-
- }
- while (gnc_hbci_Error_retry (parent, err, inter));
-
- if (job)
- resultcode = gnc_hbci_debug_outboxjob (inter, job, be_verbose);
- if (!hbci_Error_isOk(err))
- {
- if (job) gnc_hbci_debug_outboxjob (inter, job, TRUE);
- if (inter) GNCInteractor_show_nodelete (inter);
- return FALSE;
- }
-
- GNCInteractor_set_cache_valid (inter, TRUE);
- if (resultcode <= 20 && (! GNCInteractor_errorsLogged (inter)) )
- {
- return TRUE;
- }
- else
- {
- g_message("gnc_AB_BANKING_execute: Some error at executeQueue (see gwen/aqbanking messages above); this does not necessarily mean that the results are unusable.");
- GNCInteractor_show_nodelete (inter);
- return TRUE; /* <- This used to be a FALSE but this was probably
- * as wrong as it could get. @%$! */
- }
-}
-
-static void multijob_cb (gpointer element, gpointer user_data);
-
-gboolean
-gnc_hbci_multijob_execute(GtkWidget *parent, AB_BANKING *api,
- GList *job_list, GNCInteractor *interactor)
-{
- gboolean successful;
- g_assert(api);
-
- successful = gnc_AB_BANKING_execute (parent, api, NULL, interactor);
-
- /*printf("dialog-hbcitrans: Ok, result of api_execute was %d.\n",
- successful);*/
-
- if (!successful)
- {
- /* AB_BANKING_executeOutbox failed. */
- gnc_error_dialog (GNCInteractor_dialog (interactor),
- "%s",
- _("Executing the Online Banking outbox failed. Please check the log window."));
- GNCInteractor_show_nodelete(interactor);
-
- g_list_foreach (job_list, multijob_cb, GNCInteractor_dialog (interactor));
- }
- /* Watch out! The job *has* to be removed from the queue
- here because otherwise it might be executed again. */
- /* AB_Banking_DequeueJob(api, job); is done in the calling function. */
- return successful;
-}
-
-
-void multijob_cb (gpointer element, gpointer user_data)
-{
- AB_JOB *job = element;
- GtkWidget *parent = user_data;
-
- if ((AB_Job_GetStatus (job) == AB_Job_StatusPending) ||
- (AB_Job_GetStatus (job) == AB_Job_StatusError))
- {
- /* There was some error in this job. */
- if (AB_Job_GetType (job) == AB_Job_TypeDebitNote)
- {
- const AB_TRANSACTION *h_trans =
- AB_JobSingleDebitNote_GetTransaction (job);
- gchar *descr_name = gnc_hbci_descr_tognc (h_trans);
- gchar *value =
- gnc_AB_VALUE_toReadableString (AB_Transaction_GetValue (h_trans));
- gchar *errortext;
- errortext =
- g_strdup_printf(_("A debit note has been refused by the bank. The refused debit note has the following data:\n"
- "Remote bank code: \"%s\"\n"
- "Remote account number: \"%s\"\n"
- "Description and remote name: \"%s\"\n"
- "Value: \"%s\"\n"),
- AB_Transaction_GetRemoteBankCode (h_trans),
- AB_Transaction_GetRemoteAccountNumber (h_trans),
- descr_name,
- value);
- g_warning ("%s", errortext);
- gnc_error_dialog (parent, "%s", errortext);
- g_free (errortext);
- g_free (descr_name);
- }
- else
- {
- gnc_error_dialog
- (parent, "%s",
- _("One of the jobs was sent to the bank successfully, but the "
- "bank is refusing to execute the job. Please check "
- "the log window for the exact error message of the "
- "bank. The line with the error message contains a "
- "code number that is greater than 9000.\n"
- "\n"
- "The job has been removed from the queue."));
- /* FIXME: Might make more useful user feedback here. */
- }
- }
-}
-
-
-/* ------------------------------------------------------- */
-
-/* Callback declarations */
-static const AB_TRANSACTION *
-translist_cb (const AB_TRANSACTION *element, void *user_data);
-static AB_IMEXPORTER_ACCOUNTINFO *
-accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *element, void *user_data);
-
-struct import_data
-{
- Account *gnc_acc;
- GNCImportMainMatcher *importer_generic;
- AB_BANKING *ab;
- AB_ACCOUNT *hbci_account;
- GList *job_list;
- gboolean execute_transactions;
-};
-
-
-GList *
-gnc_hbci_import_ctx(AB_BANKING *ab, AB_IMEXPORTER_CONTEXT *ctx,
- GNCImportMainMatcher *importer_generic_gui,
- gboolean exec_as_aqbanking_jobs)
-{
- struct import_data data;
- data.importer_generic = importer_generic_gui;
- data.ab = ab;
- data.job_list = NULL;
- data.execute_transactions = exec_as_aqbanking_jobs;
-
- /* Iterate through all accounts */
- AB_ImExporterContext_AccountInfoForEach(ctx, accountinfolist_cb, &data);
- /* All accounts finished. Finished importing. */
- return data.job_list;
-}
-
-
-static AB_IMEXPORTER_ACCOUNTINFO *
-accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *accinfo, void *user_data)
-{
- Account *gnc_acc;
- struct import_data *data = user_data;
- const char *bank_code =
- AB_ImExporterAccountInfo_GetBankCode(accinfo);
- const char *account_number =
- AB_ImExporterAccountInfo_GetAccountNumber(accinfo);
- const char *account_name =
- AB_ImExporterAccountInfo_GetAccountName(accinfo);
- gchar *online_id = g_strconcat (bank_code, account_number, NULL);
-
- gnc_acc = gnc_import_select_account(NULL,
- online_id, 1, account_name, NULL,
- ACCT_TYPE_NONE, NULL, NULL);
- g_free(online_id);
- if (gnc_acc)
- {
- /* Store chosen gnucash account in callback data */
- data->gnc_acc = gnc_acc;
-
- if (data->execute_transactions)
- {
- /* Retrieve the aqbanking account that belongs to this gnucash
- account */
- data->hbci_account = gnc_hbci_get_hbci_acc (data->ab, gnc_acc);
- if (data->hbci_account == NULL)
- {
- gnc_error_dialog (NULL, _("No Online Banking account found for this gnucash account. These transactions will not be executed by Online Banking."));
- }
- }
- else
- {
- data->hbci_account = NULL;
- }
-
- /* Iterate through all transactions. */
- AB_ImExporterAccountInfo_TransactionsForEach (accinfo, translist_cb, data);
- /* all transactions finished. */
- }
- return NULL;
-}
-
-static const AB_TRANSACTION *
-translist_cb (const AB_TRANSACTION *element, void *user_data)
-{
- AB_JOB *job;
- AB_TRANSACTION *trans = (AB_TRANSACTION*)element;
- GtkWidget *parent = NULL;
- struct import_data *data = user_data;
- struct trans_list_data hbci_userdata;
-
- /* This callback in the hbci module will add the imported
- transaction to gnucash's importer. */
- hbci_userdata.gnc_acc = data->gnc_acc;
- hbci_userdata.importer_generic = data->importer_generic;
- /* The call will use "trans" only as const* */
- gnc_hbci_trans_list_cb((AB_TRANSACTION*) trans, &hbci_userdata);
-
- if (data->hbci_account)
- {
- /* NEW: The imported transaction has been imported into
- gnucash. Now also add it as a job to aqbanking. */
- AB_Transaction_SetLocalBankCode (trans,
- AB_Account_GetBankCode (data->hbci_account));
- AB_Transaction_SetLocalAccountNumber (trans, AB_Account_GetAccountNumber (data->hbci_account));
- AB_Transaction_SetLocalCountry (trans, "DE");
-
- job =
- gnc_hbci_trans_dialog_enqueue(trans, data->ab,
- data->hbci_account, SINGLE_DEBITNOTE);
-
- /* Check whether we really got a job */
- if (!job)
- {
- /* Oops, no job, probably not supported by bank. */
- if (gnc_verify_dialog
- (parent,
- FALSE,
- "%s",
- _("The backend found an error during the preparation "
- "of the job. It is not possible to execute this job. \n"
- "\n"
- "Most probable the bank does not support your chosen "
- "job or your Online Banking account does not have the permission "
- "to execute this job. More error messages might be "
- "visible on your console log.\n"
- "\n"
- "Do you want to enter the job again?")))
- {
- gnc_error_dialog (parent, "Sorry, not implemented yet.");
- }
- /* else
- break; */
- }
- data->job_list = g_list_append(data->job_list, job);
- }
-
- return NULL;
-}
-
-
-/* ------------------------------------------------------- */
-
-static void delpending_cb (gpointer element, gpointer user_data);
-
-void
-gnc_hbci_clearqueue(AB_BANKING *ab, GList *ab_job_list)
-{
- g_list_foreach (ab_job_list, delpending_cb, ab);
-}
-
-void delpending_cb (gpointer element, gpointer user_data)
-{
- AB_JOB *job = element;
- AB_BANKING *ab = user_data;
-
- if (AB_Job_GetStatus (job) == AB_Job_StatusPending)
- AB_Banking_DelPendingJob(ab, job);
-}
-
-/* ------------------------------------------------------- */
-
-struct cb_struct
-{
- gchar **result;
- GIConv gnc_iconv_handler;
-};
-
-/* Needed for the gnc_hbci_descr_tognc and gnc_hbci_memo_tognc. */
-static void *gnc_list_string_cb (const char *string, void *user_data)
-{
- struct cb_struct *u = user_data;
- gchar **res = u->result;
- gchar *tmp1, *tmp2;
-
- if (!string) return NULL;
- tmp1 = gnc_call_iconv(u->gnc_iconv_handler, string);
-
- g_strstrip (tmp1);
- if (strlen (tmp1) > 0)
- {
- /* Ensure string is in utf8 */
- gnc_utf8_strip_invalid (tmp1);
-
- if (*res != NULL)
- {
- /* The " " is the separating string in between each two strings. */
- tmp2 = g_strjoin (" ", *res, tmp1, NULL);
- g_free (tmp1);
-
- g_free (*res);
- *res = tmp2;
- }
- else
- {
- *res = tmp1;
- }
- }
-
- return NULL;
-}
-
-
-char *gnc_hbci_descr_tognc (const AB_TRANSACTION *h_trans)
-{
- /* Description */
- char *h_descr = gnc_hbci_getpurpose (h_trans);
- char *othername = gnc_hbci_getremotename (h_trans);
- char *g_descr;
-
- /* Get othername */
- /*DEBUG("HBCI Description '%s'", h_descr);*/
-
- if (othername && strlen (othername) > 0)
- g_descr =
- ((strlen (h_descr) > 0) ?
- g_strdup_printf ("%s; %s",
- h_descr,
- othername) :
- g_strdup (othername));
- else
- g_descr =
- ((strlen (h_descr) > 0) ?
- g_strdup (h_descr) :
- g_strdup (_("Unspecified")));
-
- g_free (h_descr);
- if (othername) g_free (othername);
- return g_descr;
-}
-
-char *gnc_hbci_getremotename (const AB_TRANSACTION *h_trans)
-{
- /* Description */
- char *othername = NULL;
- char *result;
- const GWEN_STRINGLIST *h_remotename = AB_Transaction_GetRemoteName (h_trans);
- struct cb_struct cb_object;
-
- cb_object.gnc_iconv_handler =
- g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
- g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));
-
- /* Get othername */
- cb_object.result = &othername;
- if (h_remotename)
- GWEN_StringList_ForEach (h_remotename,
- &gnc_list_string_cb,
- &cb_object);
- /*DEBUG("HBCI Description '%s'", h_descr);*/
-
- if (othername && (strlen (othername) > 0))
- result = g_strdup (othername);
- else
- result = NULL;
-
- g_iconv_close(cb_object.gnc_iconv_handler);
- g_free (othername);
- return result;
-}
-
-char *gnc_hbci_getpurpose (const AB_TRANSACTION *h_trans)
-{
- /* Description */
- char *h_descr = NULL;
- char *g_descr;
- const GWEN_STRINGLIST *h_purpose = AB_Transaction_GetPurpose (h_trans);
- struct cb_struct cb_object;
-
- cb_object.gnc_iconv_handler =
- g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
- g_assert(cb_object.gnc_iconv_handler != (GIConv)(-1));
-
- cb_object.result = &h_descr;
- if (h_purpose)
- GWEN_StringList_ForEach (h_purpose,
- &gnc_list_string_cb,
- &cb_object);
-
- g_descr = g_strdup (h_descr ? h_descr : "");
-
- g_iconv_close(cb_object.gnc_iconv_handler);
- g_free (h_descr);
- return g_descr;
-}
-
-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 (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 (h_remoteAccountNumber ? h_remoteAccountNumber : _("unknown"));
- char *h_otherBankCode =
- g_strdup (h_remoteBankCode ? h_remoteBankCode : _("unknown"));
- char *g_memo;
-
- /* g_strstrip (h_transactionText); */
- g_strstrip (h_otherAccountId);
- g_strstrip (h_otherBankCode);
- /* Ensure string is in utf8 */
- gnc_utf8_strip_invalid (h_otherAccountId);
- gnc_utf8_strip_invalid (h_otherBankCode);
-
- g_memo =
- (h_otherAccountId && (strlen (h_otherAccountId) > 0) ?
- g_strdup_printf ("%s %s %s %s",
- _("Account"), h_otherAccountId,
- _("Bank"), h_otherBankCode) :
- g_strdup (""));
- gnc_utf8_strip_invalid (g_memo);
-
- g_free (h_otherAccountId);
- g_free (h_otherBankCode);
- return g_memo;
-}
-
-char *gnc_AB_VALUE_toReadableString(const AB_VALUE *v)
-{
- char tmp[100];
- if (v)
- sprintf(tmp, "%.2f %s", AB_Value_GetValue(v), AB_Value_GetCurrency(v));
- else
- sprintf(tmp, "%.2f", 0.0);
- return g_strdup(tmp);
-}
-
-/* Note: In the gnome2-branch we don't need the iconv(3) conversion
- and gnc_call_iconv() anymore since the gnc_book has an UTF-8
- encoding and the AqBanking library also expects all strings in
- UTF-8. Nevertheless we keep all these functions for now, just in
- case they might be needed later.
-*/
-
-/* Returns a newly allocated gchar, converted according to the given
- handler */
-gchar *gnc_call_iconv(GIConv handler, const gchar* input)
-{
- gchar *inbuffer = (gchar*)input;
- gchar *outbuffer, *outbufferstart;
- gsize inbytes, outbytes;
-
- inbytes = strlen(inbuffer);
- outbytes = inbytes + 2;
- outbufferstart = g_strndup(inbuffer, outbytes);
- outbuffer = outbufferstart;
- g_iconv(handler, &inbuffer, &inbytes, &outbuffer, &outbytes);
- if (outbytes > 0)
- *outbuffer = '\0';
- return outbufferstart;
-}
-
-const char *gnc_hbci_book_encoding()
-{
- return "UTF-8";
-}
-
-const char *gnc_hbci_AQBANKING_encoding()
-{
- return "UTF-8";
-}
Deleted: gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-hbci-utils.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,227 +0,0 @@
-/********************************************************************\
- * gnc-hbci-utils.h -- hbci utility functions *
- * Copyright (C) 2002 Christian Stimming *
- * *
- * This program is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU General Public License as *
- * published by the Free Software Foundation; either version 2 of *
- * the License, or (at your option) any later version. *
- * *
- * This program is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
- * GNU General Public License for more details. *
- * *
- * You should have received a copy of the GNU General Public License*
- * along with this program; if not, contact: *
- * *
- * Free Software Foundation Voice: +1-617-542-5942 *
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652 *
- * Boston, MA 02110-1301, USA gnu at gnu.org *
-\********************************************************************/
-
-#ifndef GNC_HBCI_UTILS_H
-#define GNC_HBCI_UTILS_H
-
-#include <iconv.h>
-#include <aqbanking/banking.h>
-#include <aqbanking/transaction.h>
-#include <aqbanking/account.h>
-#include <aqbanking/imexporter.h>
-#include <aqbanking/version.h>
-#if AQBANKING_VERSION_MAJOR > 2
-# define AB_Value_GetValue AB_Value_GetValueAsDouble
-# define GWEN_TYPE_UINT32 uint32_t
-# define GWEN_LoggerLevelError GWEN_LoggerLevel_Error
-# define GWEN_LoggerLevelWarning GWEN_LoggerLevel_Warning
-# define GWEN_LoggerLevelNotice GWEN_LoggerLevel_Notice
-# define GWEN_LoggerLevelInfo GWEN_LoggerLevel_Info
-# define GWEN_LoggerLevelDebug GWEN_LoggerLevel_Debug
-# define AB_Banking_LogLevelVerbous GWEN_LoggerLevel_Verbous
-# define AB_Banking_LogLevelNotice GWEN_LoggerLevel_Notice
-# define AB_BANKING_LOGLEVEL GWEN_LOGGER_LEVEL
-# define AB_Banking_new(arg1, arg2) AB_Banking_new(arg1, arg2, 0)
-# define AB_ERROR_FOUND GWEN_ERROR_FOUND
-#endif
-
-#include "gnc-ui.h"
-#include "Account.h"
-#include "Transaction.h"
-#include "import-main-matcher.h"
-
-#include "hbci-interaction.h"
-
-
-/** 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.
- */
-AB_BANKING * gnc_AB_BANKING_new_currentbook (GtkWidget *parent,
- GNCInteractor **inter);
-
-/** 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);
-
-
-/* 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 AB_ACCOUNT was found.
- *
- * @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);
-
-/** Clean up the queue after executing, i.e. delete the job as good as
- possible. */
-void
-gnc_hbci_cleanup_job(AB_BANKING *api, AB_JOB *job);
-
-/* 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, int error,
- GNCInteractor *inter);
-
-/* 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. parent may be NULL, job may be NULL (although in this
- * case no HBCI result codes can be checked!), inter may be NULL; api
- * must not be NULL. */
-gboolean
-gnc_AB_BANKING_execute (GtkWidget *parent, AB_BANKING *api,
- AB_JOB *job, GNCInteractor *inter);
-
-/* Calls AB_Banking_executeQueue() with some supplementary stuff
- * around it: set the debugLevel, show the GNCInteractor, and do some
- * error checking afterwards by checking each AB_JOB in
- * job_list. Returns TRUE upon success or FALSE if the calling dialog
- * should abort. parent may be NULL, job_list (a GList of AB_JOBs) may
- * be NULL (although in this case no HBCI result codes can be
- * checked!), inter may be NULL; api must not be NULL. */
-gboolean
-gnc_hbci_multijob_execute(GtkWidget *parent, AB_BANKING *api,
- GList *job_list, GNCInteractor *inter);
-
-/**
- * Imports the account/transaction/balance data of an aqbanking
- * "imexporter-context" into the matching gnucash accounts, using the
- * given importer_generic_gui.
- *
- * If exec_as_jobs is TRUE, additionally queue each transaction as a
- * new aqbanking online banking job.
- *
- * @param ab The AB_BANKING api object.
- *
- * @param ctx The "context" object that holds the actual transactions.
- *
- * @param importer_generic_gui The dialog which should display the
- * to-be-imported transactions.
- *
- * @param exec_as_aqbanking_jobs If TRUE, additionally queue the
- * imported transactions as online jobs over aqbanking/HBCI. If FALSE,
- * just import the transactions and that's it.
- *
- * @return If exec_as_aqbanking_jobs was FALSE, this always returns
- * NULL. Otherwise it returns a GList of the AB_JOBs that have been
- * queued into aqbanking.
- */
-GList *
-gnc_hbci_import_ctx(AB_BANKING *ab, AB_IMEXPORTER_CONTEXT *ctx,
- GNCImportMainMatcher *importer_generic_gui,
- gboolean exec_as_aqbanking_jobs);
-
-/** Clear all the AB_JOBs of the ab_job_list from aqbanking's
- * queue. */
-void
-gnc_hbci_clearqueue(AB_BANKING *ab, GList *ab_job_list);
-
-/* Create the appropriate description field for a Gnucash Transaction
- * 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 AB_TRANSACTION *h_trans);
-
-/* Create the appropriate memo field for a Gnucash Split by the
- * 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 AB_TRANSACTION *h_trans);
-
-/* Retrieve the merged purpose fields from the transaction. The
- * returned string must be g_free'd by the caller. If there was no
- * purpose, an empty (but allocated) string is returned. */
-char *gnc_hbci_getpurpose (const AB_TRANSACTION *h_trans);
-
-/* Retrieve the merged "remote name" fields from the transaction. The
- * returned string must be g_free'd by the caller. If there was no
- * "remote name" field, NULL (!) is returned. */
-char *gnc_hbci_getremotename (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 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); */
-
-/** Chooses one bank out of the given list.
- *
- * If the list has more than one bank, this displays a multichoice
- * 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); */
-
-/** Chooses one customer out of the given list.
- *
- * If the list has more than one customer, this displays a multichoice
- * 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); */
-
-/** Chooses one user out of the given list.
- *
- * If the list has more than one user, this displays a multichoice
- * 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); */
-
-/** Return a newly allocated string. */
-char *gnc_AB_VALUE_toReadableString(const AB_VALUE *v);
-
-/** Returns a newly allocated gchar, converted according to the given
- handler */
-gchar *gnc_call_iconv(GIConv handler, const gchar* input);
-
-/** Returns the encoding of the current book in the format as required
- by iconv_open(3). */
-const char *gnc_hbci_book_encoding(void);
-
-/** Returns the encoding that is required by AqBanking in the format
- as required by iconv_open(3). */
-const char *gnc_hbci_AQBANKING_encoding(void);
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci-ui.xml
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci-ui.xml 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci-ui.xml 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,34 +0,0 @@
-<ui>
- <menubar>
- <menu name="File" action="FileAction">
- <menu name="FileImport" action="FileImportAction">
- <placeholder name="FileImportPlaceholder">
- <menuitem name="FileMt940Import" action="Mt940ImportAction"/>
- <menuitem name="FileMt942Import" action="Mt942ImportAction"/>
- <menuitem name="FileDtausImport" action="DtausImportAction"/>
- <menuitem name="FileDtausImportsend" action="DtausImportSendAction"/>
- <!-- When CsvImport works:
- <menuitem name="FileCsvImport" action="CsvImportAction"/>
- <menuitem name="FileCsvImportsend" action="CsvImportSendAction"/>
- -->
- </placeholder>
- </menu>
- </menu>
- <menu name="Actions" action="ActionsAction">
- <placeholder name="ActionsPlaceholder">
- <menu name="OnlineActions" action="OnlineActionsAction">
- <menuitem name="HbciGetBalance" action="HbciGetBalanceAction"/>
- <menuitem name="HbciGetTrans" action="HbciGetTransAction"/>
- <menuitem name="HbciIssueTrans" action="HbciIssueTransAction"/>
- <!-- activate this with aqbanking>=1.6.1: menuitem name="HbciIssueIntTrans" action="HbciIssueIntTransAction"/ -->
- <menuitem name="HbciIssueDirectDebit" action="HbciIssueDirectDebitAction"/>
- </menu>
- </placeholder>
- </menu>
- <menu name="Tools" action="ToolsAction">
- <placeholder name="ToolsPlaceholder">
- <menuitem name="HbciSetup" action="HbciSetupAction"/>
- </placeholder>
- </menu>
- </menubar>
-</ui>
Deleted: gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,663 +0,0 @@
-/*
- * gnc-plugin-hbci.c --
- * Copyright (C) 2003 David Hampton <hampton at employees.org>
- * Copyright (C) 2002 Christian Stimming *
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation Voice: +1-617-542-5942
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
- * Boston, MA 02110-1301, USA gnu at gnu.org
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "gnc-engine.h"
-#include "druid-hbci-initial.h"
-#include "gnc-plugin-manager.h"
-#include "gnc-gnome-utils.h"
-#include "gnc-hbci-getbalance.h"
-#include "gnc-hbci-gettrans.h"
-#include "gnc-hbci-transfer.h"
-#include "gnc-file-aqb-import.h"
-#include "gnc-plugin-hbci.h"
-#include "gnc-plugin-manager.h"
-#include "gnc-plugin-page-account-tree.h"
-#include "gnc-plugin-page-register.h"
-
-/* for gnc_gconf_ */
-#include "gnc-gconf-utils.h"
-#include "hbci-interaction.h"
-
-/* This static indicates the debugging module that this .o belongs to. */
-static QofLogModule log_module = "gnucash-hbci";
-
-static void gnc_plugin_hbci_class_init (GncPluginHbciClass *klass);
-static void gnc_plugin_hbci_init (GncPluginHbci *plugin);
-static void gnc_plugin_hbci_finalize (GObject *object);
-
-static void gnc_plugin_hbci_add_to_window (GncPlugin *plugin,
- GncMainWindow *window,
- GQuark type);
-static void gnc_plugin_hbci_remove_from_window (GncPlugin *plugin,
- GncMainWindow *window,
- GQuark type);
-
-/* Callbacks on other objects */
-static void gnc_plugin_hbci_main_window_page_added (GncMainWindow *window,
- GncPluginPage *page);
-static void gnc_plugin_hbci_main_window_page_changed (GncMainWindow *window,
- GncPluginPage *page);
-static void gnc_plugin_hbci_account_selected (GncPluginPage *plugin_page,
- Account *account,
- gpointer user_data);
-
-/* Command callbacks */
-static void gnc_plugin_hbci_cmd_setup (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_get_balance (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_get_transactions (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_issue_transaction (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_issue_inttransaction (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_issue_direct_debit (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_mt940_import (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_mt942_import (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_dtaus_import (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_csv_import (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_dtaus_importsend (GtkAction *action, GncMainWindowActionData *data);
-static void gnc_plugin_hbci_cmd_csv_importsend (GtkAction *action, GncMainWindowActionData *data);
-
-
-#define PLUGIN_ACTIONS_NAME "gnc-plugin-hbci-actions"
-#define PLUGIN_UI_FILENAME "gnc-plugin-hbci-ui.xml"
-
-static GtkActionEntry gnc_plugin_actions [] =
-{
- /* Menus */
- { "OnlineActionsAction", NULL, N_("_Online Actions"), NULL, NULL, NULL },
-
- /* Menu Items */
- {
- "HbciSetupAction", NULL, N_("_Online Banking Setup..."), NULL,
- N_("Initial setup of Online Banking access (HBCI, or OFX DirectConnect, using AqBanking)"),
- G_CALLBACK (gnc_plugin_hbci_cmd_setup)
- },
- {
- "HbciGetBalanceAction", NULL, N_("Get _Balance"), NULL,
- N_("Get the account balance online through Online Banking"),
- G_CALLBACK (gnc_plugin_hbci_cmd_get_balance)
- },
- {
- "HbciGetTransAction", NULL, N_("Get _Transactions..."), NULL,
- N_("Get the transactions online through Online Banking"),
- G_CALLBACK (gnc_plugin_hbci_cmd_get_transactions)
- },
- {
- "HbciIssueTransAction", NULL, N_("_Issue Transaction..."), NULL,
- N_("Issue a new transaction online through Online Banking"),
- G_CALLBACK (gnc_plugin_hbci_cmd_issue_transaction)
- },
- {
- "HbciIssueIntTransAction", NULL, N_("I_nternal Transaction..."), NULL,
- N_("Issue a new bank-internal transaction online through Online Banking"),
- G_CALLBACK (gnc_plugin_hbci_cmd_issue_inttransaction)
- },
- {
- "HbciIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
- N_("Issue a new direct debit note online through Online Banking"),
- G_CALLBACK (gnc_plugin_hbci_cmd_issue_direct_debit)
- },
-
- /* File -> Import menu item */
- {
- "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import _MT940"), NULL,
- N_("Import a MT940 file into GnuCash"),
- G_CALLBACK (gnc_plugin_hbci_cmd_mt940_import)
- },
- {
- "Mt942ImportAction", GTK_STOCK_CONVERT, N_("Import MT94_2"), NULL,
- N_("Import a MT942 file into GnuCash"),
- G_CALLBACK (gnc_plugin_hbci_cmd_mt942_import)
- },
- {
- "DtausImportAction", GTK_STOCK_CONVERT, N_("Import _DTAUS"), NULL,
- N_("Import a DTAUS file into GnuCash"),
- G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_import)
- },
-#ifdef CSV_IMPORT_FUNCTIONAL
- {
- "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL,
- N_("Import a CSV file into GnuCash"),
- G_CALLBACK (gnc_plugin_hbci_cmd_csv_import)
- },
- {
- "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL,
- N_("Import a CSV file into GnuCash and send the transfers online through Online Banking"),
- G_CALLBACK (gnc_plugin_hbci_cmd_csv_importsend)
- },
-#endif
- {
- "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
- N_("Import a DTAUS file into GnuCash and send the transfers online through Online Banking"),
- G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_importsend)
- },
-
-};
-static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
-
-static const gchar *account_tree_actions[] =
-{
- "HbciSetupAction",
- "HbciGetBalanceAction",
- "HbciGetTransAction",
- "HbciIssueTransAction",
- "HbciIssueIntTransAction",
- "HbciIssueDirectDebitAction",
- NULL
-};
-
-static const gchar *register_actions[] =
-{
- "HbciSetupAction",
- "HbciGetBalanceAction",
- "HbciGetTransAction",
- "HbciIssueTransAction",
- "HbciIssueIntTransAction",
- "HbciIssueDirectDebitAction",
- NULL
-};
-
-static const gchar *need_account_actions[] =
-{
- "HbciGetBalanceAction",
- "HbciGetTransAction",
- "HbciIssueTransAction",
- "HbciIssueIntTransAction",
- "HbciIssueDirectDebitAction",
- NULL
-};
-
-typedef struct GncPluginHbciPrivate
-{
- gpointer dummy;
-} GncPluginHbciPrivate;
-
-#define GNC_PLUGIN_HBCI_GET_PRIVATE(o) \
- (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_HBCI, GncPluginHbciPrivate))
-
-static GObjectClass *parent_class = NULL;
-
-/************************************************************
- * Object Implementation *
- ************************************************************/
-
-GType
-gnc_plugin_hbci_get_type (void)
-{
- static GType gnc_plugin_hbci_type = 0;
-
- if (gnc_plugin_hbci_type == 0)
- {
- static const GTypeInfo our_info =
- {
- sizeof (GncPluginHbciClass),
- NULL, /* base_init */
- NULL, /* base_finalize */
- (GClassInitFunc) gnc_plugin_hbci_class_init,
- NULL, /* class_finalize */
- NULL, /* class_data */
- sizeof (GncPluginHbci),
- 0, /* n_preallocs */
- (GInstanceInitFunc) gnc_plugin_hbci_init,
- };
-
- gnc_plugin_hbci_type = g_type_register_static (GNC_TYPE_PLUGIN,
- "GncPluginHbci",
- &our_info, 0);
- }
-
- return gnc_plugin_hbci_type;
-}
-
-GncPlugin *
-gnc_plugin_hbci_new (void)
-{
- return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_HBCI, NULL));
-}
-
-static void
-gnc_plugin_hbci_class_init (GncPluginHbciClass *klass)
-{
- GObjectClass *object_class = G_OBJECT_CLASS (klass);
- GncPluginClass *plugin_class = GNC_PLUGIN_CLASS (klass);
-
- parent_class = g_type_class_peek_parent (klass);
-
- object_class->finalize = gnc_plugin_hbci_finalize;
-
- /* plugin info */
- plugin_class->plugin_name = GNC_PLUGIN_HBCI_NAME;
-
- /* widget addition/removal */
- plugin_class->actions_name = PLUGIN_ACTIONS_NAME;
- plugin_class->actions = gnc_plugin_actions;
- plugin_class->n_actions = gnc_plugin_n_actions;
- plugin_class->ui_filename = PLUGIN_UI_FILENAME;
- plugin_class->add_to_window = gnc_plugin_hbci_add_to_window;
- plugin_class->remove_from_window = gnc_plugin_hbci_remove_from_window;
-
- g_type_class_add_private(klass, sizeof(GncPluginHbciPrivate));
-}
-
-static void
-gnc_plugin_hbci_init (GncPluginHbci *plugin)
-{
-}
-
-static void
-gnc_plugin_hbci_finalize (GObject *object)
-{
- GncPluginHbci *plugin;
- GncPluginHbciPrivate *priv;
-
- g_return_if_fail (GNC_IS_PLUGIN_HBCI (object));
-
- plugin = GNC_PLUGIN_HBCI (object);
- priv = GNC_PLUGIN_HBCI_GET_PRIVATE(plugin);
-
- G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-/*
- * The gnc_plugin_add_to_window() function has already added our
- * actions to the main window. HBCI include this function so that it
- * can attach callbacks to the window and track page changes within
- * each window. Sneaky, huh?
- */
-static void
-gnc_plugin_hbci_add_to_window (GncPlugin *plugin,
- GncMainWindow *window,
- GQuark type)
-{
- g_signal_connect (G_OBJECT(window), "page_added",
- G_CALLBACK (gnc_plugin_hbci_main_window_page_added),
- plugin);
- g_signal_connect (G_OBJECT(window), "page_changed",
- G_CALLBACK (gnc_plugin_hbci_main_window_page_changed),
- plugin);
-}
-
-static void
-gnc_plugin_hbci_remove_from_window (GncPlugin *plugin,
- GncMainWindow *window,
- GQuark type)
-{
- g_signal_handlers_disconnect_by_func(G_OBJECT(window),
- G_CALLBACK (gnc_plugin_hbci_main_window_page_changed),
- plugin);
- g_signal_handlers_disconnect_by_func(G_OBJECT(window),
- G_CALLBACK (gnc_plugin_hbci_main_window_page_added),
- plugin);
-}
-
-/************************************************************
- * Auxiliary Functions *
- ************************************************************/
-
-/** Given a pointer to a main window, try and extract an Account from
- * it. If the current page is an "account tree" page, get the
- * account corresponding to the selected account. (What if multiple
- * accounts are selected?) If the current page is a "register" page,
- * get the head account for the register. (Returns NULL for a general
- * ledger or search register.)
- *
- * @param window A pointer to a GncMainWindow object.
- *
- * @return A pointer to an account, if one can be determined from the
- * current page. NULL otherwise. */
-static Account *
-main_window_to_account (GncMainWindow *window)
-{
- GncPluginPage *page;
- const gchar *page_name;
- Account *account = NULL;
- const gchar *account_name;
-
- ENTER("main window %p", window);
- if (!GNC_IS_MAIN_WINDOW(window))
- {
- LEAVE("no main_window");
- return NULL;
- }
-
- /* Ensure we are called from a register page. */
- page = gnc_main_window_get_current_page(window);
- if (!GNC_IS_PLUGIN_PAGE(page))
- {
- LEAVE("no plugin_page");
- return NULL;
- }
- page_name = gnc_plugin_page_get_plugin_name(page);
- if (!page_name)
- {
- LEAVE("no page_name of plugin_page");
- return NULL;
- }
-
- if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0)
- {
- DEBUG("register page");
- account =
- gnc_plugin_page_register_get_account (GNC_PLUGIN_PAGE_REGISTER(page));
- }
- else if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
- {
- DEBUG("account tree page");
- account =
- gnc_plugin_page_account_tree_get_current_account (GNC_PLUGIN_PAGE_ACCOUNT_TREE(page));
- }
- else
- {
- account = NULL;
- }
- account_name = account ? xaccAccountGetName(account) : NULL;
- LEAVE("account %s(%p)", account_name ? account_name : "(null)", account);
- return account;
-}
-
-/************************************************************
- * Object Callbacks *
- ************************************************************/
-
-/** An account had been (de)selected in an "account tree" page.
- * Update the hbci mennus appropriately. */
-static void
-gnc_plugin_hbci_account_selected (GncPluginPage *plugin_page,
- Account *account,
- gpointer user_data)
-{
- GtkActionGroup *action_group;
- GncMainWindow *window;
-
- g_return_if_fail (GNC_IS_PLUGIN_PAGE (plugin_page));
- window = GNC_MAIN_WINDOW(plugin_page->window);
- g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
- action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
- g_return_if_fail (GTK_IS_ACTION_GROUP (action_group));
- gnc_plugin_update_actions(action_group, need_account_actions,
- "sensitive", account != NULL);
-}
-
-/** A new page has been added to a main window. Connect a signal to
- * it so that hbci can track when accounts are selected. */
-static void
-gnc_plugin_hbci_main_window_page_added (GncMainWindow *window,
- GncPluginPage *page)
-{
- const gchar *page_name;
-
- ENTER("main window %p, page %p", window, page);
- if (!GNC_IS_PLUGIN_PAGE(page))
- {
- LEAVE("no plugin_page");
- return;
- }
-
- page_name = gnc_plugin_page_get_plugin_name(page);
- if (!page_name)
- {
- LEAVE("no page_name of plugin_page");
- return;
- }
-
- if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
- {
- DEBUG("account tree page, adding signal");
- g_signal_connect (G_OBJECT(page),
- "account_selected",
- G_CALLBACK (gnc_plugin_hbci_account_selected),
- NULL);
-
- }
- LEAVE(" ");
-}
-
-/** Whenever the current page has changed, update the hbci menus based
- * upon the page that is currently selected. */
-static void
-gnc_plugin_hbci_main_window_page_changed (GncMainWindow *window,
- GncPluginPage *page)
-{
- GtkActionGroup *action_group;
- const gchar *page_name;
- Account *account;
-
- ENTER("main window %p, page %p", window, page);
- if (!GNC_IS_MAIN_WINDOW (window))
- {
- LEAVE("no main_window");
- return;
- }
-
- action_group = gnc_main_window_get_action_group(window, PLUGIN_ACTIONS_NAME);
- if (!GTK_IS_ACTION_GROUP (action_group))
- {
- LEAVE("no action_group");
- return;
- }
-
- /* Reset everything to known state */
- gnc_plugin_update_actions(action_group, need_account_actions,
- "sensitive", FALSE);
- gnc_plugin_update_actions(action_group, account_tree_actions,
- "visible", FALSE);
- gnc_plugin_update_actions(action_group, register_actions,
- "visible", FALSE);
-
- /* Any page selected? */
- if (page == NULL)
- {
- LEAVE("no page");
- return;
- }
-
- /* Selectively make items visible */
- page_name = gnc_plugin_page_get_plugin_name(page);
- g_return_if_fail (page_name);
- if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_ACCOUNT_TREE_NAME) == 0)
- {
- DEBUG("account tree page");
- gnc_plugin_update_actions(action_group, account_tree_actions,
- "visible", TRUE);
- }
- else if (safe_strcmp(page_name, GNC_PLUGIN_PAGE_REGISTER_NAME) == 0)
- {
- DEBUG("register page");
- gnc_plugin_update_actions(action_group, register_actions,
- "visible", TRUE);
- }
-
- /* Only make items sensitive if an account can be determined */
- account = main_window_to_account (window);
- if (account)
- {
- gnc_plugin_update_actions(action_group, need_account_actions,
- "sensitive", TRUE);
- }
- LEAVE(" ");
-}
-/************************************************************
- * Command Callbacks *
- ************************************************************/
-
-static void
-gnc_plugin_hbci_cmd_setup (GtkAction *action,
- GncMainWindowActionData *data)
-{
- ENTER("action %p, main window data %p", action, data);
- gnc_hbci_initial_druid ();
- LEAVE(" ");
-}
-
-static void
-gnc_plugin_hbci_cmd_get_balance (GtkAction *action,
- GncMainWindowActionData *data)
-{
- Account *account;
-
- ENTER("action %p, main window data %p", action, data);
- account = main_window_to_account(data->window);
- if (account == NULL)
- {
- LEAVE("no account");
- return;
- }
-
- gnc_hbci_getbalance(GTK_WIDGET(data->window), account);
- LEAVE(" ");
-}
-
-static void
-gnc_plugin_hbci_cmd_get_transactions (GtkAction *action,
- GncMainWindowActionData *data)
-{
- Account *account;
-
- ENTER("action %p, main window data %p", action, data);
- account = main_window_to_account(data->window);
- if (account == NULL)
- {
- LEAVE("no account");
- return;
- }
-
- gnc_hbci_gettrans(GTK_WIDGET(data->window), account);
- LEAVE(" ");
-}
-
-static void
-gnc_plugin_hbci_cmd_issue_transaction (GtkAction *action,
- GncMainWindowActionData *data)
-{
- Account *account;
-
- ENTER("action %p, main window data %p", action, data);
- account = main_window_to_account(data->window);
- if (account == NULL)
- {
- LEAVE("no account");
- return;
- }
-
- gnc_hbci_maketrans(GTK_WIDGET(data->window), account, SINGLE_TRANSFER);
- LEAVE(" ");
-}
-
-static void
-gnc_plugin_hbci_cmd_issue_inttransaction (GtkAction *action,
- GncMainWindowActionData *data)
-{
- Account *account;
-
- ENTER("action %p, main window data %p", action, data);
- account = main_window_to_account(data->window);
- if (account == NULL)
- {
- LEAVE("no account");
- return;
- }
-
- gnc_hbci_maketrans(GTK_WIDGET(data->window), account, SINGLE_INTERNAL_TRANSFER);
- LEAVE(" ");
-}
-
-static void
-gnc_plugin_hbci_cmd_issue_direct_debit (GtkAction *action,
- GncMainWindowActionData *data)
-{
- Account *account;
-
- ENTER("action %p, main window data %p", action, data);
- account = main_window_to_account(data->window);
- if (account == NULL)
- {
- LEAVE("no account");
- return;
- }
- gnc_hbci_maketrans (GTK_WIDGET(data->window), account, SINGLE_DEBITNOTE);
- LEAVE(" ");
-}
-
-static void
-gnc_plugin_hbci_cmd_dtaus_importsend (GtkAction *action,
- GncMainWindowActionData *data)
-{
- char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_DTAUS, NULL);
- gnc_file_aqbanking_import ("dtaus", format ? format : "default", TRUE);
- g_free (format);
-}
-static void
-gnc_plugin_hbci_cmd_csv_importsend (GtkAction *action,
- GncMainWindowActionData *data)
-{
- char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_CSV, NULL);
- gnc_file_aqbanking_import ("csv", format ? format : "default", TRUE);
- g_free (format);
-}
-
-static void
-gnc_plugin_hbci_cmd_mt940_import (GtkAction *action,
- GncMainWindowActionData *data)
-{
- char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_SWIFT940, NULL);
- gnc_file_aqbanking_import ("swift", format ? format : "swift-mt940", FALSE);
- g_free (format);
-}
-static void
-gnc_plugin_hbci_cmd_mt942_import (GtkAction *action,
- GncMainWindowActionData *data)
-{
- char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_SWIFT942, NULL);
- gnc_file_aqbanking_import ("swift", format ? format : "swift-mt942", FALSE);
- g_free (format);
-}
-static void
-gnc_plugin_hbci_cmd_dtaus_import (GtkAction *action,
- GncMainWindowActionData *data)
-{
- char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_DTAUS, NULL);
- gnc_file_aqbanking_import ("dtaus", format ? format : "default", FALSE);
- g_free (format);
-}
-static void
-gnc_plugin_hbci_cmd_csv_import (GtkAction *action,
- GncMainWindowActionData *data)
-{
- char *format = gnc_gconf_get_string(GCONF_SECTION, KEY_FORMAT_CSV, NULL);
- gnc_file_aqbanking_import ("csv", format ? format : "default", FALSE);
- g_free (format);
-}
-/************************************************************
- * Plugin Bootstrapping *
- ************************************************************/
-
-void
-gnc_plugin_hbci_create_plugin (void)
-{
- GncPlugin *plugin = gnc_plugin_hbci_new ();
-
- gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
-}
Deleted: gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gnc-plugin-hbci.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,62 +0,0 @@
-/*
- * gnc-plugin-hbci.h --
- * Copyright (C) 2003 David Hampton <hampton at employees.org>
- *
- * This program is free software; you can redistribute it and/or
- * modify it under the terms of the GNU General Public License as
- * published by the Free Software Foundation; either version 2 of
- * the License, or (at your option) any later version.
- *
- * This program is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with this program; if not, contact:
- *
- * Free Software Foundation Voice: +1-617-542-5942
- * 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
- * Boston, MA 02110-1301, USA gnu at gnu.org
- */
-
-#ifndef __GNC_PLUGIN_HBCI_H
-#define __GNC_PLUGIN_HBCI_H
-
-#include <gtk/gtkwindow.h>
-
-#include "gnc-plugin.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_HBCI (gnc_plugin_hbci_get_type ())
-#define GNC_PLUGIN_HBCI(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_HBCI, GncPluginHbci))
-#define GNC_PLUGIN_HBCI_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_HBCI, GncPluginHbciClass))
-#define GNC_IS_PLUGIN_HBCI(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_HBCI))
-#define GNC_IS_PLUGIN_HBCI_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_HBCI))
-#define GNC_PLUGIN_HBCI_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_HBCI, GncPluginHbciClass))
-
-#define GNC_PLUGIN_HBCI_NAME "gnc-plugin-hbci"
-
-/* typedefs & structures */
-typedef struct
-{
- GncPlugin gnc_plugin;
-} GncPluginHbci;
-
-typedef struct
-{
- GncPluginClass gnc_plugin;
-} GncPluginHbciClass;
-
-/* function prototypes */
-GType gnc_plugin_hbci_get_type (void);
-
-GncPlugin *gnc_plugin_hbci_new (void);
-
-void gnc_plugin_hbci_create_plugin (void);
-
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_HBCI_H */
Deleted: gnucash/trunk/src/import-export/hbci/gncmod-hbci.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/gncmod-hbci.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/gncmod-hbci.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,91 +0,0 @@
-/*********************************************************************
- * gncmod-hbci.c
- * module definition/initialization for HBCI support
- *
- * Copyright (c) 2002 Christian <stimming at tuhh.de>
- *********************************************************************/
-
-#include "config.h"
-
-#include <gmodule.h>
-#include <libguile.h>
-#include <glib/gi18n.h>
-
-#include "gnc-module.h"
-#include "gnc-module-api.h"
-#include "gnc-plugin-hbci.h"
-#include "druid-hbci-initial.h"
-#include "gnc-hbci-utils.h"
-#include <gwenhywfar/gwenhywfar.h>
-#include "dialog-preferences.h"
-
-GNC_MODULE_API_DECL(libgncmod_hbci)
-
-/* version of the gnc module system interface we require */
-int libgncmod_hbci_gnc_module_system_interface = 0;
-
-/* module versioning uses libtool semantics. */
-int libgncmod_hbci_gnc_module_current = 0;
-int libgncmod_hbci_gnc_module_revision = 0;
-int libgncmod_hbci_gnc_module_age = 0;
-
-
-char *
-libgncmod_hbci_gnc_module_path(void)
-{
- return g_strdup("gnucash/import-export/hbci");
-}
-
-char *
-libgncmod_hbci_gnc_module_description(void)
-{
- return g_strdup("Support for Online Banking protocols");
-}
-
-
-int
-libgncmod_hbci_gnc_module_init(int refcount)
-{
- /* load the engine (we depend on it) */
- if (!gnc_module_load("gnucash/engine", 0))
- {
- return FALSE;
- }
-
- /* load the app-utils (we depend on it) */
- if (!gnc_module_load("gnucash/app-utils", 0))
- {
- return FALSE;
- }
- if (!gnc_module_load("gnucash/gnome-utils", 0))
- {
- return FALSE;
- }
-
- if (!gnc_module_load("gnucash/import-export", 0))
- {
- return FALSE;
- }
-
- /* Add menu items with C callbacks */
- gnc_plugin_hbci_create_plugin();
-
- gnc_preferences_add_to_page("hbciprefs.glade", "hbci_prefs",
- _("Online Banking"));
-
- /* Initialize gwen library */
- GWEN_Init();
-
- return TRUE;
-}
-
-int
-libgncmod_hbci_gnc_module_end(int refcount)
-{
- gnc_AB_BANKING_delete(0);
-
- /* Finalize gwen library */
- GWEN_Fini();
-
- return TRUE;
-}
Deleted: gnucash/trunk/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interaction.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/hbci-interaction.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,963 +0,0 @@
-/* hbci-interaction.c
- Copyright 2002 by Christian Stimming <stimming at tuhh.de> */
-
-/***************************************************************************
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this library; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- * *
- ***************************************************************************/
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-#include <stdio.h>
-#include <string.h>
-#include <locale.h>
-#include <iconv.h>
-#include <aqbanking/banking.h>
-#include <gwenhywfar/bio_buffer.h>
-#include <gwenhywfar/xml.h>
-
-#include "hbci-interaction.h"
-#include "hbci-interactionP.h"
-
-#include "dialog-utils.h"
-#include "druid-utils.h"
-#include "gnc-ui-util.h"
-#include "gnc-ui.h"
-#include "gnc-gconf-utils.h"
-#include "gnc-component-manager.h"
-#include "gnc-session.h"
-
-#include "dialog-pass.h"
-#include "gnc-hbci-utils.h"
-
-#include <aqbanking/version.h>
-#if AQBANKING_VERSION_MAJOR > 2
-# include <gwenhywfar/gui.h>
-# define AB_Banking_SetMessageBoxFn GWEN_Gui_SetMessageBoxFn
-# define AB_Banking_SetInputBoxFn GWEN_Gui_SetInputBoxFn
-# define AB_Banking_SetShowBoxFn GWEN_Gui_SetShowBoxFn
-# define AB_Banking_SetHideBoxFn GWEN_Gui_SetHideBoxFn
-# define AB_Banking_SetProgressStartFn GWEN_Gui_SetProgressStartFn
-# define AB_Banking_SetProgressAdvanceFn GWEN_Gui_SetProgressAdvanceFn
-# define AB_Banking_SetProgressLogFn GWEN_Gui_SetProgressLogFn
-# define AB_Banking_SetProgressEndFn GWEN_Gui_SetProgressEndFn
-# define AB_Banking_SetGetTanFn GWEN_Gui_SetGetTanFn
-# define AB_BANKING_MSG_FLAGS_TYPE_ERROR GWEN_GUI_MSG_FLAGS_TYPE_ERROR
-# define AB_BANKING_INPUT_FLAGS_CONFIRM GWEN_GUI_INPUT_FLAGS_CONFIRM
-# define AB_BANKING_INPUT_FLAGS_SHOW GWEN_GUI_INPUT_FLAGS_SHOW
-# define AB_BANKING_PROGRESS_NONE GWEN_GUI_PROGRESS_NONE
-# define AB_Banking_GetUserData(arg) GWEN_INHERIT_GETDATA(GWEN_GUI, GNCInteractor, arg)
-# define AB_Banking_SetUserData(arg1, arg2)
-/* Note about other changes: Replace callback object AB_BANKING by
- GWEN_GUI, to be created by GWEN_GUI_new; replace GetTan
- callback by watching for INPUT_FLAGS_TAN in InputBox(). */
-#endif
-
-GWEN_INHERIT(AB_BANKING, GNCInteractor)
-
-#define GCONF_SECTION_CONNECTION GCONF_SECTION "/connection_dialog"
-#define DIALOG_HBCILOG_CM_CLASS "dialog-hbcilog"
-
-gchar *gnc__extractText(const char *text);
-static void cm_close_handler(gpointer user_data);
-
-/** Adds the interactor and progressmonitor classes to the api. */
-GNCInteractor *gnc_AB_BANKING_interactors (AB_BANKING *api, GtkWidget *parent)
-{
- GNCInteractor *data;
- gint component_id;
-
- data = g_new0 (GNCInteractor, 1);
- data->parent = parent;
- /* FIXME: The internal target encoding is hard-coded so far. This
- needs to be fixed for the gnome2 version; the target encoding is
- then probably utf-8 as well. iconv is also used in
- gnc_hbci_descr_tognc() in gnc-hbci-utils.c. */
- data->gnc_iconv_handler =
- g_iconv_open(gnc_hbci_book_encoding(), gnc_hbci_AQBANKING_encoding());
- g_assert(data->gnc_iconv_handler != (GIConv)(-1));
- data->keepAlive = TRUE;
- data->cache_pin =
- gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
- data->showbox_id = 1;
- data->showbox_hash = g_hash_table_new(NULL, NULL);
- data->min_loglevel = AB_Banking_LogLevelVerbous;
-
- component_id = gnc_register_gui_component(DIALOG_HBCILOG_CM_CLASS,
- NULL, cm_close_handler,
- data);
- gnc_gui_component_set_session(component_id, gnc_get_current_session());
-
- /* set HBCI_Interactor */
- gnc_hbci_add_callbacks(api, data);
- return data;
-}
-
-void GNCInteractor_delete(GNCInteractor *data)
-{
- if (data == NULL)
- return;
- if (data->dialog != NULL)
- {
- gnc_gconf_set_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH,
- gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (data->close_checkbutton)),
- NULL);
- gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (data->dialog));
- g_object_unref (G_OBJECT (data->dialog));
- gtk_widget_destroy (data->dialog);
- }
-
- gnc_unregister_gui_component_by_data(DIALOG_HBCILOG_CM_CLASS, data);
-
- data->dialog = NULL;
-
- g_hash_table_destroy(data->showbox_hash);
- g_iconv_close(data->gnc_iconv_handler);
-
- g_free (data);
-}
-
-
-
-/* ************************************************************
- */
-
-
-GtkWidget *GNCInteractor_parent(const GNCInteractor *i)
-{
- g_assert(i);
- return i->parent;
-}
-
-GtkWidget *GNCInteractor_dialog(const GNCInteractor *i)
-{
- g_assert(i);
- return i->dialog;
-}
-
-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);
- data->keepAlive = TRUE;
-}
-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);
- return !(i->keepAlive);
-}
-
-void GNCInteractor_show_nodelete(GNCInteractor *i)
-{
- gboolean cache_pin =
- gnc_gconf_get_bool(GCONF_SECTION, KEY_REMEMBER_PIN, NULL);
- g_assert(i);
- /* Show widgets */
- gtk_widget_show_all (i->dialog);
-
- /* Make sure the cache_pin option is up to date. */
- if (cache_pin != i->cache_pin)
- {
- /* AB_Banking_SetEnablePinCaching (ab, cache_pin); */
- i->cache_pin = cache_pin;
- if (cache_pin == FALSE)
- GNCInteractor_erasePIN (i);
- }
-}
-void GNCInteractor_show(GNCInteractor *i)
-{
- g_assert(i);
- GNCInteractor_show_nodelete(i);
- /* Clear log window. */
- gtk_text_buffer_set_text
- (gtk_text_view_get_buffer (GTK_TEXT_VIEW (i->log_text) ),
- "", 0);
-}
-
-
-void GNCInteractor_hide(GNCInteractor *i)
-{
- g_assert(i);
- if (gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (i->close_checkbutton)))
- gtk_widget_hide_all (i->dialog);
- gnc_gconf_set_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH,
- gtk_toggle_button_get_active
- (GTK_TOGGLE_BUTTON (i->close_checkbutton)),
- NULL);
- gnc_save_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (i->dialog));
-}
-
-gboolean GNCInteractor_get_cache_valid(const GNCInteractor *i)
-{
- g_assert(i);
- return i->cache_pin;
-}
-void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value)
-{
- g_assert(i);
- /* Nothing to be done right now. */
-}
-
-void GNCInteractor_erasePIN(GNCInteractor *i)
-{
- g_assert(i);
- /* Nothing to be done right now. */
-}
-void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent)
-{
- g_assert (i);
- if (new_parent != i->parent)
- {
- i->parent = new_parent;
- /*if (GTK_WIDGET (i->dialog) -> parent != NULL)
- gtk_widget_reparent (GTK_WIDGET (i->dialog), new_parent);
- else
- gtk_widget_set_parent (GTK_WIDGET (i->dialog), new_parent);*/
- gtk_window_set_transient_for (GTK_WINDOW (i->dialog),
- GTK_WINDOW (new_parent));
- }
-}
-
-gboolean GNCInteractor_hadErrors (const GNCInteractor *i)
-{
- g_assert (i);
- return (i->msgBoxError != 0);
-}
-
-gboolean GNCInteractor_errorsLogged (const GNCInteractor *i)
-{
- g_assert (i);
- /* Note: Unfortunately this does not mean at all that there actually
- has been any error. Old aqbanking versions had some debugging
- messages set at "error" level, and there can also be errors when
- closing connection that don't affect the job result at all. */
- return (i->min_loglevel < AB_Banking_LogLevelNotice);
-}
-
-/* ************************************************************
- */
-
-/* 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)
-{
- char *utf8extracted, *latin1;
-
- 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); */
-
- latin1 = gnc_call_iconv(data->gnc_iconv_handler, utf8extracted);
-
- /* printf("Converted \"%s\" into \"%s\"\n", utf8extracted, latin1); */
- g_free(utf8extracted);
- return latin1;
-}
-
-/********************************************************
- * Now all the callback functions
- */
-
-static int inputBoxCB(AB_BANKING *ab,
- GWEN_TYPE_UINT32 flags,
- const char *utf8title,
- const char *utf8text,
- char *resultbuffer,
- int minsize,
- int maxLen)
-{
- 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);
- data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
-
- 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)
- {
-
- if (newPin)
- {
- if (!hideInput)
- g_warning("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,
- title,
- text,
- &passwd);
- }
- else
- {
- retval = gnc_hbci_get_password (data->parent,
- title,
- text,
- NULL,
- &passwd,
- hideInput);
- } /* newPin */
-
- if (!retval)
- break;
-
- g_assert(passwd);
- if (strlen(passwd) < (unsigned int)minsize)
- {
- gboolean retval;
- char *msg =
- g_strdup_printf ( _("The PIN needs to be at least %d characters "
- "long. Do you want to try again?"),
- minsize);
- retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
- TRUE,
- "%s", msg);
- g_free (msg);
- if (!retval)
- break;
- }
- else if (strlen(passwd) > (unsigned int)maxLen)
- {
- gboolean retval;
- char *msg =
- g_strdup_printf ( _("You entered %ld characters, but the PIN must "
- "be no longer than %d characters. "
- "Do you want to try again?"),
- (long)strlen(passwd), maxLen);
- retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
- TRUE,
- "%s", msg);
- g_free (msg);
- if (!retval)
- break;
- }
- else
- {
- g_assert (maxLen > strlen(passwd)); /* assertion was queried above */
- strcpy(resultbuffer, passwd);
- g_free (memset (passwd, 0, strlen (passwd)));
- g_free(title);
- g_free(text);
- return 0;
- }
- }
-
- /* User wanted to abort. */
- g_free(title);
- g_free(text);
- return 1;
-}
-
-/* ****************************************
- */
-
-
-static int getTanCB(AB_BANKING *ab,
- const char *token,
- const char *utf8title,
- const char *utf8text,
- char *resultbuffer,
- int minsize,
- int maxLen)
-{
- GNCInteractor *data;
- char *passwd = NULL;
- int retval = 0;
- gchar *title, *text;
-
- g_assert(ab);
- data = AB_Banking_GetUserData(ab);
- g_assert(data);
- g_assert(maxLen > minsize);
- data->msgBoxError = 0;
-
- text = gnc_hbci_utf8ToLatin1(data, utf8text);
- title = gnc_hbci_utf8ToLatin1(data, utf8title);
-
- while (TRUE)
- {
-
- retval = gnc_hbci_get_password (data->parent,
- title,
- text,
- NULL,
- &passwd,
- FALSE);
-
- if (!retval)
- break;
-
- if (strlen(passwd) < (unsigned int)minsize)
- {
- gboolean retval;
- char *msg =
- g_strdup_printf ( _("This TAN needs to be at least %d characters "
- "long. Do you want to try again?"),
- minsize);
- retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
- TRUE,
- "%s", msg);
- g_free (msg);
- if (!retval)
- break;
- }
- else if (strlen(passwd) > (unsigned int)maxLen)
- {
- gboolean retval;
- char *msg =
- g_strdup_printf ( _("You entered %ld characters, but the TAN must "
- "be no longer than %d characters. "
- "Do you want to try again?"),
- (long)strlen(passwd), maxLen);
- retval = gnc_verify_dialog (GTK_WIDGET (data->parent),
- TRUE,
- "%s", msg);
- g_free (msg);
- if (!retval)
- break;
- }
- else
- {
- g_assert (maxLen > strlen(passwd)); /* assertion was queried above */
- strcpy(resultbuffer, passwd);
-
- g_free (memset (passwd, 0, strlen (passwd)));
- g_free(title);
- g_free(text);
- return 0;
- }
- }
-
- /* User wanted to abort. */
- g_free(title);
- g_free(text);
- return 1;
-}
-
-
-/* ************************************************************
- */
-
-static int keepAlive(void *user_data)
-{
- GNCInteractor *data = user_data;
- GMainContext *context;
-
- g_assert(data);
- /*fprintf(stdout, "my-keepAlive: returning 1\n");*/
-
- /* Let the widgets be redrawn */
- context = g_main_context_default();
- while (g_main_context_iteration(context, FALSE));
-
- return data->keepAlive;
-}
-
-
-#ifndef GWENHYWFAR_CB
-/* Has been introduced in gwenhywfar>=2.4.1 for callback function
- decoration on win32, but is empty everywhere else. */
-# define GWENHYWFAR_CB
-#endif
-static void GWENHYWFAR_CB destr(void *bp, void *user_data)
-{
- GNCInteractor *data = user_data;
- if (data == NULL)
- return;
-
- GNCInteractor_delete (data);
-}
-
-
-/* ************************************************************
- */
-
-static void
-hideBoxCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
-{
- 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, GUINT_TO_POINTER(id));
- }
- else
- {
- dialog = data->showbox_last;
- }
- if (dialog)
- {
- gtk_widget_hide (dialog);
- gtk_widget_destroy (dialog);
- g_hash_table_remove(data->showbox_hash, GUINT_TO_POINTER(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);
- data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
-
- text = gnc_hbci_utf8ToLatin1(data, utf8text);
- title = gnc_hbci_utf8ToLatin1(data, utf8title);
-
- /* Create new dialog */
- dialog = gtk_message_dialog_new(GTK_WINDOW(data->parent),
- 0,
- GTK_MESSAGE_INFO,
- GTK_BUTTONS_OK,
- "%s", text);
-
- if (title && (strlen(title) > 0))
- gtk_window_set_title (GTK_WINDOW (dialog), title);
-
- g_signal_connect(G_OBJECT(dialog), "response",
- (GCallback)gtk_widget_hide, NULL);
- gtk_widget_show_all (dialog);
-
- result = data->showbox_id;
- g_hash_table_insert(data->showbox_hash, GUINT_TO_POINTER(result), dialog);
- data->showbox_id++;
- data->showbox_last = dialog;
-
- g_free(title);
- g_free(text);
- return result;
-}
-
-/* ************************************************************
- */
-
-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;
- GtkWidget *dialog, *label;
- int result;
- gchar *text, *title, *b1text, *b2text, *b3text;
-
- g_assert(ab);
- data = AB_Banking_GetUserData(ab);
- g_assert(data);
- data->msgBoxError = flags & AB_BANKING_MSG_FLAGS_TYPE_ERROR;
-
- text = gnc_hbci_utf8ToLatin1(data, utf8text);
- title = gnc_hbci_utf8ToLatin1(data, utf8title);
- b1text = gnc_hbci_utf8ToLatin1(data, b1);
- b2text = gnc_hbci_utf8ToLatin1(data, b2);
- b3text = gnc_hbci_utf8ToLatin1(data, b3);
-
- dialog = gtk_dialog_new_with_buttons (title,
- GTK_WINDOW (data->parent),
- GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT,
- b1 ? b1text : NULL,
- 1,
- b2 ? b2text : NULL,
- 2,
- b3 ? b3text : NULL,
- 3,
- NULL);
- /* Add the label, and show everything we've added to the dialog. */
- label = gtk_label_new (text);
- gtk_label_set_justify (GTK_LABEL (label), GTK_JUSTIFY_LEFT);
- gtk_container_add (GTK_CONTAINER (GTK_DIALOG(dialog)->vbox),
- label);
- gtk_widget_show_all (dialog);
-
- result = gtk_dialog_run (GTK_DIALOG (dialog));
- gtk_widget_destroy (dialog);
- if (result < 1 || result > 3)
- {
- g_warning("messageBoxCB: Bad result %d", result);
- result = 0;
- }
- g_free(title);
- g_free(text);
- g_free(b1text);
- g_free(b2text);
- g_free(b3text);
- return result;
-}
-
-
-/* ************************************************************
- */
-
-#define progress_id 4711
-
-static GWEN_TYPE_UINT32 progressStartCB(AB_BANKING *ab, const char *utf8title,
- const char *utf8text, GWEN_TYPE_UINT32 total)
-{
- GNCInteractor *data;
- gchar *title, *text;
-
- g_assert(ab);
- data = AB_Banking_GetUserData(ab);
- g_assert(data);
-
- text = gnc_hbci_utf8ToLatin1(data, utf8text);
- title = gnc_hbci_utf8ToLatin1(data, utf8title);
-
- /* 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_widget_set_sensitive (data->action_progress, TRUE);
- gtk_progress_bar_set_fraction (GTK_PROGRESS_BAR(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);
-
- /* Initialize loglevel caching */
- data->min_loglevel = AB_Banking_LogLevelVerbous;
-
- g_free(title);
- g_free(text);
- return progress_id;
-}
-
-static int progressAdvanceCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id,
- GWEN_TYPE_UINT32 progress)
-{
- GNCInteractor *data;
-
- 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_bar_set_fraction (GTK_PROGRESS_BAR (data->action_progress),
- progress / data->action_max);
- }
-
- return !keepAlive(data);
-}
-
-
-static int progressLogCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id,
- AB_BANKING_LOGLEVEL level, const char *utf8text)
-{
- GNCInteractor *data;
- gchar *text;
-
- g_assert(ab);
- data = AB_Banking_GetUserData(ab);
- g_assert(data);
-
- 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);
-
- /* Cache loglevel */
- if (level < data->min_loglevel)
- data->min_loglevel = level;
-
- g_free(text);
- return !keepAlive(data);
-}
-
-static int progressEndCB(AB_BANKING *ab, GWEN_TYPE_UINT32 id)
-{
- GNCInteractor *data;
- 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); */
- }
-
- GNCInteractor_setFinished(data);
-
- keepAlive(data);
- return 0;
-}
-
-
-
-/* ************************************************************
- */
-
-int debug_pmonitor = FALSE;
-void GNCInteractor_add_log_text (GNCInteractor *data, const char *msg)
-{
- GtkTextBuffer *tb;
- GtkTextView *tv;
- g_assert(data);
-
- tv = GTK_TEXT_VIEW (data->log_text);
- tb = gtk_text_view_get_buffer (tv);
- gtk_text_buffer_insert_at_cursor (tb, msg, -1);
- gtk_text_buffer_insert_at_cursor (tb, "\n", -1);
- /* and scroll to the end of the buffer */
- gtk_text_view_scroll_to_mark (tv, gtk_text_buffer_get_insert (tb),
- 0.0, FALSE, 0.0, 0.0);
-}
-
-static void
-on_button_clicked (GtkButton *button,
- gpointer user_data)
-{
- GNCInteractor *data = user_data;
- GMainContext *context;
- const 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
- {
- g_critical("on_button_clicked: Oops, unknown button: %s\n",
- name);
- }
- /* Let the widgets be redrawn */
- context = g_main_context_default();
- while (g_main_context_iteration(context, FALSE));
-}
-
-static void
-cm_close_handler(gpointer user_data)
-{
- GNCInteractor *data = user_data;
-
- GNCInteractor_setAborted(data);
- /* Notes about correctly handling this ComponentManager close event:
- We can't actually close the dialog here because AqBanking might
- still be running and expecting the GNCInteractor object to exist
- (and it doesn't offer any handlers for aborting from here). This
- is not per se a problem with gnucash objects because as soon as
- AqBanking received the SetAborted signal, it will abort and not
- deliver any actual results, which means the gnc-hbci module will
- not continue any operation.
-
- However, the dialog and the AB_BANKING object will still be
- around. It is unclear whether this is 1. correct or 2. wrong:
- 1. It might be correct because a user might still want to see the
- log messages in the window until he manually closes the
- GNCInteractor. 2. It might be wrong because once we've received
- the close event, nobody wants to see the GNCInteractor log
- messages anyway. To implement the behaviour #2, we should add a
- new flag in GNCInteractor that is being queried in
- gnc_AB_BANKING_execute() right after AB_Banking_ExecuteQueue()
- has finished, and if it is activated from the cm_close_handler,
- gnc_AB_BANKING_execute should immediately delete the AB_BANKING
- object (which will also delete the GNCInteractor object) and
- abort.
- */
-}
-
-
-/********************************************************
- * Constructor
- */
-void
-gnc_hbci_add_callbacks(AB_BANKING *ab, GNCInteractor *data)
-{
- 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")) != NULL);
- data->dialog = dialog;
- g_assert ((data->job_entry = glade_xml_get_widget (xml, "job_entry")) != NULL);
- g_assert ((data->action_entry = glade_xml_get_widget (xml, "action_entry")) != NULL);
- g_assert ((data->action_progress =
- glade_xml_get_widget (xml, "action_progress")) != NULL);
- g_assert ((data->log_text = glade_xml_get_widget (xml, "log_text")) != NULL);
- g_assert ((data->abort_button = glade_xml_get_widget (xml, "abort_button")) != NULL);
- gtk_widget_set_sensitive (GTK_WIDGET (data->abort_button), FALSE);
- g_assert ((data->close_button = glade_xml_get_widget (xml, "close_button")) != NULL);
- g_assert ((data->close_checkbutton =
- glade_xml_get_widget (xml, "close_checkbutton")) != NULL);
-
- /* 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_gconf_get_bool(GCONF_SECTION, KEY_CLOSE_ON_FINISH, NULL));
-
- g_signal_connect (data->abort_button, "clicked",
- G_CALLBACK (on_button_clicked), data);
- g_signal_connect (data->close_button, "clicked",
- G_CALLBACK (on_button_clicked), data);
-
- if (data->parent)
- gtk_window_set_transient_for (GTK_WINDOW (dialog), GTK_WINDOW (data->parent));
- gnc_restore_window_size(GCONF_SECTION_CONNECTION, GTK_WINDOW (dialog));
-
- g_object_ref (G_OBJECT (dialog));
- gtk_widget_hide_all (dialog);
-
- GWEN_INHERIT_SETDATA(AB_BANKING, GNCInteractor,
- ab, data,
- &destr);
-
- AB_Banking_SetMessageBoxFn(ab, messageBoxCB);
- AB_Banking_SetInputBoxFn(ab, inputBoxCB);
- AB_Banking_SetShowBoxFn(ab, showBoxCB);
- AB_Banking_SetHideBoxFn(ab, hideBoxCB);
- AB_Banking_SetProgressStartFn(ab, progressStartCB);
- AB_Banking_SetProgressAdvanceFn(ab, progressAdvanceCB);
- AB_Banking_SetProgressLogFn(ab, progressLogCB);
- AB_Banking_SetProgressEndFn(ab, progressEndCB);
-
- /* AB_Banking_SetGetPinFn(ab,); */
- AB_Banking_SetGetTanFn(ab, getTanCB);
-
- AB_Banking_SetUserData(ab, data);
-
-}
Deleted: gnucash/trunk/src/import-export/hbci/hbci-interaction.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interaction.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/hbci-interaction.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,65 +0,0 @@
-/* hbci-interactor.h
- Copyright 2002 by Christian Stimming <stimming at tuhh.de> */
-
-/***************************************************************************
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this library; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- * *
- ***************************************************************************/
-
-#ifndef HBCI_INTERACTION_H
-#define HBCI_INTERACTION_H
-
-#include <aqbanking/banking.h>
-
-#define GCONF_SECTION "dialogs/import/hbci"
-#define KEY_CLOSE_ON_FINISH "close_on_finish"
-#define KEY_REMEMBER_PIN "remember_pin"
-#define KEY_VERBOSE_DEBUG "verbose_debug"
-#define KEY_FORMAT_DTAUS "format_dtaus"
-#define KEY_FORMAT_CSV "format_csv"
-#define KEY_FORMAT_SWIFT940 "format_swift_mt940"
-#define KEY_FORMAT_SWIFT942 "format_swift_mt942"
-
-typedef struct _inter_data GNCInteractor;
-
-/** Adds the interactor and progressmonitor classes to the api. */
-GNCInteractor *gnc_AB_BANKING_interactors (AB_BANKING *api, GtkWidget *parent);
-
-gboolean GNCInteractor_aborted(const GNCInteractor *i);
-void GNCInteractor_show(GNCInteractor *i);
-void GNCInteractor_show_nodelete(GNCInteractor *i);
-void GNCInteractor_hide(GNCInteractor *i);
-void GNCInteractor_delete(GNCInteractor *i);
-void GNCInteractor_erasePIN(GNCInteractor *i);
-void GNCInteractor_reparent (GNCInteractor *i, GtkWidget *new_parent);
-gboolean GNCInteractor_get_cache_valid(const GNCInteractor *i);
-void GNCInteractor_set_cache_valid(GNCInteractor *i, gboolean value);
-GtkWidget *GNCInteractor_parent(const GNCInteractor *i);
-GtkWidget *GNCInteractor_dialog(const GNCInteractor *i);
-void GNCInteractor_add_log_text (GNCInteractor *i, const char *msg);
-/** Returns true if aqbanking requested to show a msgBox of type
- error. (Note: This happens very seldomly.) */
-gboolean GNCInteractor_hadErrors (const GNCInteractor *i);
-/** Returns true if any error messages have been logged. Note:
- Unfortunately this does not mean at all that there actually has
- been any error. Old aqbanking versions had some debugging messages
- set at "error" level, and there can also be errors when closing
- connection that don't affect the job result at all. */
-gboolean GNCInteractor_errorsLogged (const GNCInteractor *i);
-
-
-#endif
Deleted: gnucash/trunk/src/import-export/hbci/hbci-interactionP.h
===================================================================
--- gnucash/trunk/src/import-export/hbci/hbci-interactionP.h 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/hbci-interactionP.h 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,97 +0,0 @@
-/* hbci-interactorP.h -- private header for the functionality offerd by the
- method in hbci-interaction.h.
- Copyright 2002 by Christian Stimming <stimming at tuhh.de> */
-
-/***************************************************************************
- * *
- * This library is free software; you can redistribute it and/or *
- * modify it under the terms of the GNU Lesser General Public *
- * License as published by the Free Software Foundation; either *
- * version 2.1 of the License, or (at your option) any later version. *
- * *
- * This library is distributed in the hope that it will be useful, *
- * but WITHOUT ANY WARRANTY; without even the implied warranty of *
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
- * Lesser General Public License for more details. *
- * *
- * You should have received a copy of the GNU Lesser General Public *
- * License along with this library; if not, write to the Free Software *
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, *
- * MA 02110-1301 USA *
- * *
- ***************************************************************************/
-
-#ifndef HBCI_INTERACTIONP_H
-#define HBCI_INTERACTIONP_H
-
-#include <aqbanking/banking.h>
-#include <iconv.h>
-#include "gnc-hbci-utils.h"
-
-
-typedef enum
-{
- INIT,
- RUNNING,
- FINISHED,
- ABORTED,
- CLOSING
-} PMon_state;
-
-struct _inter_data
-{
- GtkWidget *parent;
- GtkWidget *dialog;
-
- /* Progress bars */
- GtkWidget *job_entry;
- GtkWidget *action_entry;
- GtkWidget *action_progress;
- /* Counters for progress bar */
- double action_max;
-
- /* Log window */
- GtkWidget *log_text;
-
- /* Buttons */
- GtkWidget *abort_button;
- GtkWidget *close_button;
- GtkWidget *close_checkbutton;
-
- const char *format_pin_user_bank;
- const char *format_pin_min_char;
-
- /* The iconv handler for utf8 -> latin1 conversion */
- GIConv gnc_iconv_handler;
-
- /* Flags to keep track on whether an HBCI action is running or
- not. */
- gboolean keepAlive;
- PMon_state state;
-
- /* Flag on Whether the PIN should be cached. */
- gboolean cache_pin;
-
- /* Dialogs */
- int showbox_id;
- GHashTable *showbox_hash;
- GtkWidget *showbox_last;
-
- /* Flag whether the last dialog showed any error */
- gboolean msgBoxError;
- /* Cache the lowest loglevel, corresponding to the most serious
- warning. */
- AB_BANKING_LOGLEVEL min_loglevel;
-};
-
-void delete_GNCInteractor (GNCInteractor *data);
-
-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
Deleted: gnucash/trunk/src/import-export/hbci/schemas/Makefile.am
===================================================================
--- gnucash/trunk/src/import-export/hbci/schemas/Makefile.am 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/schemas/Makefile.am 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,21 +0,0 @@
-schemadir = @GCONF_SCHEMA_FILE_DIR@
-schemas_in_files = \
- apps_gnucash_dialog_hbci.schemas.in
-schema_DATA = $(schemas_in_files:.schemas.in=.schemas)
-
- at INTLTOOL_SCHEMAS_RULE@
-
-EXTRA_DIST = $(schemas_in_files)
-
-CLEANFILES = $(schema_DATA)
-
-install-data-local:
-if GCONF_SCHEMAS_INSTALL
- -mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schema_DATA)
-endif
-
-uninstall-local:
-if GCONF_SCHEMAS_INSTALL
- GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
-endif
Deleted: gnucash/trunk/src/import-export/hbci/schemas/apps_gnucash_dialog_hbci.schemas.in
===================================================================
--- gnucash/trunk/src/import-export/hbci/schemas/apps_gnucash_dialog_hbci.schemas.in 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/schemas/apps_gnucash_dialog_hbci.schemas.in 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,143 +0,0 @@
-<?xml version="1.0"?>
-<gconfschemafile>
- <schemalist>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/position</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/connection_dialog/window_position</applyto>
- <owner>gnucash</owner>
- <type>list</type>
- <list_type>int</list_type>
- <locale name="C">
- <short>Window position</short>
- <long>
- The X,Y coordinates of the top left corner of the window
- when it was last closed.
- </long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/geometry</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/connection_dialog/window_geometry</applyto>
- <owner>gnucash</owner>
- <type>list</type>
- <list_type>int</list_type>
- <locale name="C">
- <short>Window geometry</short>
- <long>
- The width and size of the window when it was last closed.
- </long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/close_on_finish</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/close_on_finish</applyto>
- <owner>gnucash</owner>
- <type>bool</type>
- <default>True</default>
- <locale name="C">
- <short>Close window when finished</short>
- <long>
- If active, the window will be closed automatically when you
- finish the HBCI/AqBanking import process. Otherwise it will
- stay open.
- </long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/remember_pin</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/remember_pin</applyto>
- <owner>gnucash</owner>
- <type>bool</type>
- <default>False</default>
- <locale name="C">
- <short>Remember the PIN in memory</short>
- <long>If active, the PIN for HBCI/AqBanking actions will be
- remembered in memory during a session. Otherwise it will have
- to be entered again each time during a session when it is
- needed.</long>
- </locale>
- </schema>
-
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/verbose_debug</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/verbose_debug</applyto>
- <owner>gnucash</owner>
- <type>bool</type>
- <default>False</default>
- <locale name="C">
- <short>Verbose HBCI debug messages</short>
- <long>Enables verbose debug messages for HBCI/AqBanking Online Banking.</long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/format_dtaus</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/format_dtaus</applyto>
- <owner>gnucash</owner>
- <type>string</type>
- <default>default</default>
- <locale name="C">
- <short>DTAUS import data format</short>
- <long>
- This setting specifies the data format when importing DTAUS
- files. The AqBanking library offers various import formats
- (called "profiles") of which you can choose one here.
- </long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/format_csv</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/format_csv</applyto>
- <owner>gnucash</owner>
- <type>string</type>
- <default>default</default>
- <locale name="C">
- <short>CSV import data format</short>
- <long>
- This setting specifies the data format when importing CSV
- files. The AqBanking library offers various import formats
- (called "profiles") of which you can choose one here.
- </long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/format_swift_mt940</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/format_swift_mt940</applyto>
- <owner>gnucash</owner>
- <type>string</type>
- <default>swift-mt940</default>
- <locale name="C">
- <short>SWIFT MT940 import data format</short>
- <long>
- This setting specifies the data format when importing SWIFT
- MT940 files. The AqBanking library offers various import
- formats (called "profiles") of which you can choose one here.
- </long>
- </locale>
- </schema>
-
- <schema>
- <key>/schemas/apps/gnucash/dialogs/import/hbci/format_swift_mt942</key>
- <applyto>/apps/gnucash/dialogs/import/hbci/format_swift_mt942</applyto>
- <owner>gnucash</owner>
- <type>string</type>
- <default>swift-mt942</default>
- <locale name="C">
- <short>SWIFT MT942 import data format</short>
- <long>
- This setting specifies the data format when importing SWIFT
- MT942 files. The AqBanking library offers various import
- formats (called "profiles") of which you can choose one here.
- </long>
- </locale>
- </schema>
-
- </schemalist>
-</gconfschemafile>
Deleted: gnucash/trunk/src/import-export/hbci/test/Makefile.am
===================================================================
--- gnucash/trunk/src/import-export/hbci/test/Makefile.am 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/test/Makefile.am 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,7 +0,0 @@
-TESTS=test-link-module
-
-check_PROGRAMS=test-link-module
-
-test_link_module_SOURCES=test-link-module.c
-test_link_module_LDADD=../libgncmod-hbci.la
-
Deleted: gnucash/trunk/src/import-export/hbci/test/test-link-module.c
===================================================================
--- gnucash/trunk/src/import-export/hbci/test/test-link-module.c 2011-01-15 09:52:41 UTC (rev 20105)
+++ gnucash/trunk/src/import-export/hbci/test/test-link-module.c 2011-01-15 09:52:53 UTC (rev 20106)
@@ -1,6 +0,0 @@
-int
-main(int argc, char ** argv)
-{
- return 0;
-}
-
More information about the gnucash-changes
mailing list