2002-07-27 Christian Stimming <stimming@tuhh.de>

* configure.in: Add --enable-hbci configure option.

	* src/import-export/hbci/*: More HBCI GUI work. Some druid should
	be visible by now. The code doesn't really do anything so far,
	though.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7127 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming
2002-07-27 17:13:49 +00:00
parent 28d55fa582
commit 21ba05c0de
9 changed files with 449 additions and 977 deletions

View File

@@ -1,3 +1,11 @@
2002-07-27 Christian Stimming <stimming@tuhh.de>
* configure.in: Add --enable-hbci configure option.
* src/import-export/hbci/*: More HBCI GUI work. Some druid should
be visible by now. The code doesn't really do anything so far,
though.
2002-07-24 Joshua Sled <jsled@asynchronous.org>
* src/register/ledger-core/gnc-ledger-display.c

View File

@@ -423,6 +423,13 @@ AC_ARG_ENABLE( ofx,
AC_SUBST(OFX_DIR)
### --------------------------------------------------------------------------
### HBCI
AC_ARG_ENABLE( hbci,
[ --enable-hbci compile with HBCI support],
HBCI_DIR=hbci)
AC_SUBST(HBCI_DIR)
### --------------------------------------------------------------------------
### i18n
AC_ARG_WITH( locale-dir,
@@ -941,6 +948,7 @@ AC_OUTPUT( m4/Makefile intl/Makefile
src/import-export/ofx/Makefile
src/import-export/ofx/test/Makefile
src/import-export/hbci/Makefile
src/import-export/hbci/glade/Makefile
src/import-export/hbci/test/Makefile
src/network-utils/Makefile
src/network-utils/test/Makefile

View File

@@ -1,18 +1,50 @@
gladedir = $(GNC_GLADE_DIR)
glade_DATA = \
account.glade \
commodities.glade \
fincalc.glade \
help.glade \
newuser.glade \
price.glade \
print.glade \
progress.glade \
register.glade \
stocks.glade \
tax.glade \
transfer.glade \
userpass.glade \
sched-xact.glade
SUBDIRS = . glade test
EXTRA_DIST = $(glade_DATA)
pkglib_LTLIBRARIES = libgncmod-hbci.la
libgncmod_hbci_la_SOURCES = \
gncmod-hbci.c \
druid-hbci-initial.c
noinst_HEADERS =
libgncmod_hbci_la_LDFLAGS = -module
libgncmod_hbci_la_LIBADD = \
${top_builddir}/src/gnc-module/libgncmodule.la \
${top_builddir}/src/engine/libgncmod-engine.la \
${top_builddir}/src/import-export/libgncmod-generic-import.la \
${GLIB_LIBS} \
${GNOMEUI_LIBS}
# -L/home/chs/lib/unstable/lib -lopenhbci
gncscmdir = ${GNC_SCM_INSTALL_DIR}/hbci
gncscm_DATA = \
hbci.scm
#gladedir = ${GNC_GLADE_DIR}
#glade_DATA =
AM_CFLAGS = \
-I${top_srcdir}/src \
-I${top_srcdir}/src/engine \
-I${top_srcdir}/src/gnc-module \
-I${top_srcdir}/src/app-utils \
-I${top_srcdir}/src/app-file \
-I${top_srcdir}/src/gnome \
-I${top_srcdir}/src/gnome-utils \
-I${top_srcdir}/src/import-export \
${GNOME_INCLUDEDIR} \
${GLADE_CFLAGS} \
${GLIB_CFLAGS}
# -I/home/chs/lib/unstable/include
#gladedir = $(GNC_GLADE_DIR)
#glade_DATA =
EXTRA_DIST =
CLEANFILES = hbci import-export gnucash g-wrapped .scm-links

View File

@@ -0,0 +1,198 @@
/********************************************************************\
* druid-hbci-initial.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 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
\********************************************************************/
#include "config.h"
#include <gnome.h>
#include <sys/stat.h>
#include <sys/types.h>
#include <unistd.h>
#include "druid-hbci-initial.h"
/* #include "Group.h" */
#include "dialog-utils.h"
#include "druid-utils.h"
/* #include "glade/glade-xml.h" */
/* #include "gnc-amount-edit.h" */
/* #include "gnc-commodity-edit.h" */
/* #include "gnc-general-select.h" */
/* #include "gnc-component-manager.h" */
/* #include "../gnome-utils/gnc-dir.h" */
/* #include "gnc-gui-query.h" */
/* #include "gnc-ui-util.h" */
/* #include "io-example-account.h" */
/* #include "top-level.h" */
typedef struct
{
GtkWidget *window;
GtkWidget *druid;
/* bank info page */
GtkWidget *bankcode;
GtkWidget *countrycode;
GtkWidget *ipaddr;
GtkWidget *port;
/* user info page */
GtkWidget *userid;
/* medium page */
GtkWidget *mediumrdh;
GtkWidget *mediumpath;
GtkWidget *mediumddv;
/* iniletter server */
GtkWidget *server_text;
/* iniletter user */
GtkWidget *user_text;
} HBCIInitialInfo;
//static AccountGroup *our_final_group = NULL;
static gboolean
on_userid_next (GnomeDruidPage *gnomedruidpage,
gpointer arg1,
gpointer user_data)
{
HBCIInitialInfo *info = user_data;
const char *bankcode;
int countrycode;
const char *ipaddr, *port;
const char *userid;
bankcode = gtk_entry_get_text (GTK_ENTRY (info->bankcode));
countrycode = atoi (gtk_entry_get_text (GTK_ENTRY (info->countrycode)));
ipaddr = gtk_entry_get_text (GTK_ENTRY (info->ipaddr));
port = gtk_entry_get_text (GTK_ENTRY (info->port));
userid = gtk_entry_get_text (GTK_ENTRY (info->userid));
return FALSE;
}
static gboolean
on_medium_next (GnomeDruidPage *gnomedruidpage,
gpointer arg1,
gpointer user_data)
{
HBCIInitialInfo *info = user_data;
gboolean is_rdh;
const char *mediumpath;
is_rdh = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (info->mediumrdh));
mediumpath = gtk_entry_get_text (GTK_ENTRY (info->mediumpath));
return FALSE;
}
static gboolean
on_iniletter_server_next (GnomeDruidPage *gnomedruidpage,
gpointer arg1,
gpointer user_data)
{
HBCIInitialInfo *info = user_data;
GtkEditable *text = GTK_EDITABLE (info->server_text);
const char *mytext = "abcdefg";
gint *pos;
pos = g_new0(gint,1);
*pos = 0;
gtk_editable_insert_text (text, mytext, strlen(mytext), pos);
g_free(pos);
return FALSE;
}
static gboolean
on_iniletter_user_next (GnomeDruidPage *gnomedruidpage,
gpointer arg1,
gpointer user_data)
{
HBCIInitialInfo *info = user_data;
return FALSE;
}
void gnc_hbci_initial_druid (void)
{
HBCIInitialInfo *info;
GladeXML *xml;
GtkWidget *page;
info = g_new0 (HBCIInitialInfo, 1);
xml = gnc_glade_xml_new ("hbci.glade", "HBCI Init Druid");
info->window = glade_xml_get_widget (xml, "HBCI Init Druid");
info->druid = glade_xml_get_widget (xml, "hbci_init_druid");
gnc_druid_set_colors (GNOME_DRUID (info->druid));
{
info->bankcode = glade_xml_get_widget(xml, "bank_code_entry");
info->countrycode = glade_xml_get_widget(xml, "country_code_entry");
info->ipaddr = glade_xml_get_widget(xml, "ip_address_entry");
info->port = glade_xml_get_widget(xml, "port_nr_entry");
}
{
info->userid = glade_xml_get_widget(xml, "user_id_entry");
page = glade_xml_get_widget(xml, "user_page");
gtk_signal_connect (GTK_OBJECT (page), "next",
GTK_SIGNAL_FUNC (on_userid_next), info);
}
{
info->mediumrdh = glade_xml_get_widget(xml, "rdh_radiobutton");
info->mediumpath = glade_xml_get_widget(xml, "path_entry");
info->mediumddv = glade_xml_get_widget(xml, "ddv_radiobutton");
page = glade_xml_get_widget(xml, "medium_page");
gtk_signal_connect (GTK_OBJECT (page), "next",
GTK_SIGNAL_FUNC (on_medium_next), info);
}
{
info->server_text = glade_xml_get_widget(xml, "iniletter_server_text");
page = glade_xml_get_widget(xml, "iniletter_server_page");
gtk_signal_connect (GTK_OBJECT (page), "next",
GTK_SIGNAL_FUNC (on_iniletter_server_next), info);
}
{
info->user_text = glade_xml_get_widget(xml, "iniletter_user_text");
page = glade_xml_get_widget(xml, "iniletter_user_page");
gtk_signal_connect (GTK_OBJECT (page), "next",
GTK_SIGNAL_FUNC (on_iniletter_user_next), info);
}
//gtk_signal_connect (GTK_OBJECT(dialog), "destroy",
// GTK_SIGNAL_FUNC(gnc_hierarchy_destroy_cb), NULL);
gtk_widget_show_all (info->window);
}
SCM scm_hbci_initial_druid (void)
{
gnc_hbci_initial_druid();
return SCM_EOL;
}

View File

@@ -0,0 +1,31 @@
/********************************************************************\
* 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 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
\********************************************************************/
#ifndef DRUID_HBCI_INITIAL_H
#define DRUID_HBCI_INITIAL_H
#include <guile/gh.h>
void gnc_hbci_initial_druid (void);
SCM scm_hbci_initial_druid (void);
#endif

View File

@@ -0,0 +1,5 @@
gladedir = $(GNC_GLADE_DIR)
glade_DATA = \
hbci.glade
EXTRA_DIST = $(glade_DATA)

File diff suppressed because it is too large Load Diff

View File

@@ -12,34 +12,37 @@
#include "gnc-module.h"
#include "gnc-module-api.h"
#include "druid-hbci-initial.h"
/* version of the gnc module system interface we require */
int libgncmod_hbci_LTX_gnc_module_system_interface = 0;
int gnc_module_system_interface = 0;
/* module versioning uses libtool semantics. */
int libgncmod_hbci_LTX_gnc_module_current = 0;
int libgncmod_hbci_LTX_gnc_module_revision = 0;
int libgncmod_hbci_LTX_gnc_module_age = 0;
int gnc_module_current = 0;
int gnc_module_revision = 0;
int gnc_module_age = 0;
/* forward references */
char *libgncmod_hbci_LTX_gnc_module_path(void);
char *libgncmod_hbci_LTX_gnc_module_description(void);
int libgncmod_hbci_LTX_gnc_module_init(int refcount);
int libgncmod_hbci_LTX_gnc_module_end(int refcount);
char *gnc_module_path(void);
char *gnc_module_description(void);
int gnc_module_init(int refcount);
int gnc_module_end(int refcount);
char *
libgncmod_hbci_LTX_gnc_module_path(void) {
gnc_module_path(void) {
return g_strdup("gnucash/import-export/hbci");
}
char *
libgncmod_hbci_LTX_gnc_module_description(void) {
gnc_module_description(void) {
return g_strdup("Support for HBCI protocol");
}
int
libgncmod_hbci_LTX_gnc_module_init(int refcount) {
gnc_module_init(int refcount) {
printf("Started gncmod-hbci.c.\n");
/* load the engine (we depend on it) */
if(!gnc_module_load("gnucash/engine", 0)) {
return FALSE;
@@ -53,16 +56,24 @@ libgncmod_hbci_LTX_gnc_module_init(int refcount) {
return FALSE;
}
/* load the HBCI Scheme code */
if(gh_eval_str("(use-modules (gnucash import-export hbci))") ==
SCM_BOOL_F) {
if(!gnc_module_load("gnucash/import-export", 0)) {
return FALSE;
}
/* load the HBCI Scheme code */
if(gh_eval_str("(load-from-path \"hbci/hbci.scm\")") ==
SCM_BOOL_F) {
return FALSE;
}
gh_new_procedure("gnc:hbci-initial-setup",
scm_hbci_initial_druid, 0, 0, 0);
printf("Been in gncmod-hbci.c.\n");
return TRUE;
}
int
libgncmod_hbci_LTX_gnc_module_end(int refcount) {
gnc_module_end(int refcount) {
return TRUE;
}

View File

@@ -7,7 +7,25 @@
(define-module (gnucash import-export hbci))
;;(export gnc:txf-get-payer-name-source)
;;(export txf-expense-categories)
(use-modules (gnucash main))
(define (add-hbci-menu-items)
(gnc:add-extension
(gnc:make-menu "HBCI" (list "_Tools" )))
(gnc:add-extension
(gnc:make-menu-item (N_ "Initial HBCI Setup")
(N_ "Initial HBCI Setup")
(list "_Tools" "HBCI" "")
(lambda ()
(gnc:hbci-initial-setup))))
;;(gnc:add-extension
;; (gnc:make-menu-item (N_ "Finish HBCI Setup")
;; (N_ "Finish HBCI Setup")
;; (list "_Tools" "HBCI" "")
;; (lambda ()
;; (gnc:hbci-finish-setup)))))
(gnc:hook-add-dangler gnc:*ui-startup-hook* add-hbci-menu-items)