Install menus using the new plugin system. Cleanup some gnome2

errors.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/branches/gnucash-gnome2-dev@9586 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
David Hampton
2003-10-20 03:02:09 +00:00
parent 331371d4ab
commit d945661d67
10 changed files with 114 additions and 329 deletions

View File

@@ -10,11 +10,11 @@ libgncmod_hbci_la_SOURCES = \
dialog-daterange.c \
gnc-hbci-kvp.c \
gnc-hbci-utils.c \
gnc-hbci-cb.c \
gnc-hbci-transfer.c \
gnc-hbci-trans-templ.c \
gnc-hbci-getbalance.c \
gnc-hbci-gettrans.c \
gnc-plugin-hbci.c \
hbci-interaction.c \
hbci-progressmon.c \
druid-hbci-initial.c
@@ -30,13 +30,13 @@ noinst_HEADERS = \
druid-hbci-initial.h \
druid-hbci-utils.h \
gnc-hbci-actions.h \
gnc-hbci-cb.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
@@ -48,6 +48,7 @@ libgncmod_hbci_la_LIBADD = \
${top_builddir}/src/engine/libgncmod-engine.la \
${top_builddir}/src/import-export/libgncmod-generic-import.la \
${top_builddir}/src/gnome/libgncgnome.la \
${top_builddir}/lib/egg/libegg.la \
${GLADE_LIBS} \
${GLIB_LIBS} \
${GNOME_LIBS} \
@@ -62,6 +63,7 @@ gncscm_DATA = \
#glade_DATA =
AM_CFLAGS = \
-I${top_srcdir}/lib/egg \
-I${top_srcdir}/src \
-I${top_srcdir}/src/engine \
-I${top_srcdir}/src/gnc-module \
@@ -85,6 +87,10 @@ AM_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}
CLEANFILES = hbci import-export gnucash g-wrapped .scm-links

View File

@@ -1771,11 +1771,4 @@ void gnc_hbci_initial_druid (void)
/* 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

@@ -26,7 +26,6 @@
#include <libguile.h>
void gnc_hbci_initial_druid (void);
SCM scm_hbci_initial_druid (void);
typedef struct _hbciinitialinfo HBCIInitialInfo;

View File

@@ -49,8 +49,8 @@ Press 'Cancel' if you do not wish to setup any
HBCI connection now.</property>
<property name="title_color">#ffffffffffff</property>
<property name="text_color">#000000000000</property>
<property name="background_color">#9999bfbf9999</property>
<property name="logo_background_color">#ffffffffffff</property>
<property name="background_color">#666666669999</property>
<property name="logo_background_color">#666666669999</property>
<property name="textbox_color">#ffffffffffff</property>
</widget>
</child>
@@ -59,9 +59,9 @@ HBCI connection now.</property>
<widget class="GnomeDruidPageStandard" id="configfile_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Enter OpenHBCI Configuration File</property>
<property name="title_foreground">#bad8082bd2e8</property>
<property name="background">#ce70082be9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox132">
@@ -211,9 +211,9 @@ Setup finishes.</property>
<widget class="GnomeDruidPageStandard" id="bank_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Enter Bank Information</property>
<property name="title_foreground">#1540082ed2e8</property>
<property name="background">#0950082ee9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox130">
@@ -461,9 +461,9 @@ Setup finishes.</property>
<widget class="GnomeDruidPageStandard" id="user_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Enter User Information</property>
<property name="title_foreground">#66b0082ed2e8</property>
<property name="background">#5d58082ee9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="vbox141">
@@ -1125,9 +1125,9 @@ use the tool 'hbcicard' from the libchipcard package to read these numbers from
<widget class="GnomeDruidPageStandard" id="account_info_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Account list will be updated</property>
<property name="title_foreground">#8660082fd2e8</property>
<property name="background">#9bb8082fe9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="druid-vbox10">
@@ -1170,9 +1170,9 @@ progress of the HBCI connection in the HBCI connection window.</property>
<widget class="GnomeDruidPageStandard" id="account_match_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Match HBCI accounts with GnuCash accounts</property>
<property name="title_foreground">#a990082fd2e8</property>
<property name="background">#ba80082fe9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="druid-vbox3">
@@ -1202,13 +1202,58 @@ progress of the HBCI connection in the HBCI connection window.</property>
<property name="window_placement">GTK_CORNER_TOP_LEFT</property>
<child>
<widget class="GtkTreeView" id="account_page_list">
<widget class="GtkCList" id="account_page_list">
<property name="visible">True</property>
<property name="can_focus">True</property>
<property name="headers_visible">True</property>
<property name="rules_hint">False</property>
<property name="reorderable">False</property>
<property name="enable_search">True</property>
<property name="n_columns">3</property>
<property name="column_widths">281,242,53</property>
<property name="selection_mode">GTK_SELECTION_SINGLE</property>
<property name="show_titles">True</property>
<property name="shadow_type">GTK_SHADOW_IN</property>
<child>
<widget class="GtkLabel" id="label834">
<property name="label" translatable="yes">HBCI account name</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label835">
<property name="label" translatable="yes">GnuCash account name</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
<child>
<widget class="GtkLabel" id="label836">
<property name="label" translatable="yes">New?</property>
<property name="use_underline">False</property>
<property name="use_markup">False</property>
<property name="justify">GTK_JUSTIFY_CENTER</property>
<property name="wrap">False</property>
<property name="selectable">False</property>
<property name="xalign">0.5</property>
<property name="yalign">0.5</property>
<property name="xpad">0</property>
<property name="ypad">0</property>
</widget>
</child>
</widget>
</child>
</widget>
@@ -1368,8 +1413,8 @@ start this druid again anytime.
Press 'Finish' now.</property>
<property name="title_color">#ffffffffffff</property>
<property name="text_color">#000000000000</property>
<property name="background_color">#9999bfbf9999</property>
<property name="logo_background_color">#ffffffffffff</property>
<property name="background_color">#666666669999</property>
<property name="logo_background_color">#666666669999</property>
<property name="textbox_color">#ffffffffffff</property>
<signal name="finish" handler="on_finish"/>
</widget>
@@ -1379,9 +1424,9 @@ Press 'Finish' now.</property>
<widget class="GnomeDruidPageStandard" id="iniletter_info_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Public Keys will be retrieved</property>
<property name="title_foreground">#39000830d2e8</property>
<property name="background">#57f80830e9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="druid-vbox10">
@@ -1430,9 +1475,9 @@ before this whole druid has finished.</property>
<widget class="GnomeDruidPageStandard" id="iniletter_server_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Verify Ini-Letter from Server</property>
<property name="title_foreground">#5b180830d2e8</property>
<property name="background">#80d00830e9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="druid-vbox8">
@@ -1591,9 +1636,9 @@ before this whole druid has finished.</property>
<widget class="GnomeDruidPageStandard" id="iniletter_userinfo_page">
<property name="visible">True</property>
<property name="title" translatable="yes">User Keys will be sent</property>
<property name="title_foreground">#b8500830d2e8</property>
<property name="background">#c8300830e9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="druid-vbox10">
@@ -1644,9 +1689,9 @@ connection in the HBCI connection window.</property>
<widget class="GnomeDruidPageStandard" id="iniletter_user_page">
<property name="visible">True</property>
<property name="title" translatable="yes">Print Ini-Letter of User</property>
<property name="title_foreground">#c9a00830d2e8</property>
<property name="background">#e1900830e9eb</property>
<property name="logo_background">#1e40081d0001</property>
<property name="title_foreground">#ffffffffffff</property>
<property name="background">#666666669999</property>
<property name="logo_background">#666666669999</property>
<child internal-child="vbox">
<widget class="GtkVBox" id="iniletter_user_vbox">
@@ -1763,8 +1808,8 @@ to use the HBCI functionality in your accounts.
Press 'Finish' now.</property>
<property name="title_color">#ffffffffffff</property>
<property name="text_color">#000000000000</property>
<property name="background_color">#9999bfbf9999</property>
<property name="logo_background_color">#ffffffffffff</property>
<property name="background_color">#666666669999</property>
<property name="logo_background_color">#666666669999</property>
<property name="textbox_color">#ffffffffffff</property>
<signal name="finish" handler="on_finish"/>
</widget>

View File

@@ -1,148 +0,0 @@
/********************************************************************\
* gnc-hbci-cb.c -- hbci callback 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 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
\********************************************************************/
#include "config.h"
#include "gnc-hbci-cb.h"
#include "Account.h"
#include "gnc-ui.h"
#include "window-acct-tree.h"
#include "window-register.h"
#include "gnc-hbci-getbalance.h"
#include "gnc-hbci-gettrans.h"
#include "gnc-hbci-transfer.h"
void
gnc_hbci_acct_tree_menu_getbalance_cb (GtkWidget * widget,
GnomeMDIChild * child)
{
GNCMDIChildInfo * mc = NULL;
GNCAcctTreeWin * win = NULL;
Account * account = NULL;
g_assert (child);
mc = gtk_object_get_user_data (GTK_OBJECT (child));
g_assert (mc);
win = mc->user_data;
g_assert (win);
account = gnc_acct_tree_window_get_current_account (win);
g_assert (account);
gnc_hbci_getbalance (gnc_acct_tree_window_get_widget (win),
account);
}
void
gnc_hbci_acct_tree_menu_gettrans_cb (GtkWidget * widget,
GnomeMDIChild * child)
{
GNCMDIChildInfo * mc = NULL;
GNCAcctTreeWin * win = NULL;
Account * account = NULL;
g_assert (child);
mc = gtk_object_get_user_data (GTK_OBJECT (child));
g_assert (mc);
win = mc->user_data;
g_assert (win);
account = gnc_acct_tree_window_get_current_account (win);
g_assert (account);
gnc_hbci_gettrans (gnc_acct_tree_window_get_widget (win),
account);
}
void
gnc_hbci_register_menu_getbalance_cb (GtkWidget * widget,
gpointer data)
{
RegWindow *regData = data;
GNCLedgerDisplay *ledger = NULL;
Account *account = NULL;
g_assert (regData);
ledger = gnc_RegWindow_ledger (regData);
g_assert (ledger);
account = gnc_ledger_display_leader (ledger);
if (!account)
return;
gnc_hbci_getbalance (gnc_RegWindow_window (regData), account);
}
void
gnc_hbci_register_menu_gettrans_cb (GtkWidget * widget,
gpointer data)
{
RegWindow *regData = data;
GNCLedgerDisplay *ledger = NULL;
Account *account = NULL;
g_assert (regData);
ledger = gnc_RegWindow_ledger (regData);
g_assert (ledger);
account = gnc_ledger_display_leader (ledger);
if (!account)
return;
gnc_hbci_gettrans (gnc_RegWindow_window (regData), account);
}
void
gnc_hbci_register_menu_maketrans_cb (GtkWidget * widget,
gpointer data)
{
RegWindow *regData = data;
GNCLedgerDisplay *ledger = NULL;
Account *account = NULL;
g_assert (regData);
ledger = gnc_RegWindow_ledger (regData);
g_assert (ledger);
account = gnc_ledger_display_leader (ledger);
if (!account)
return;
gnc_hbci_maketrans (gnc_RegWindow_window (regData), account,
SINGLE_TRANSFER);
}
void
gnc_hbci_register_menu_makedebnote_cb (GtkWidget * widget,
gpointer data)
{
RegWindow *regData = data;
GNCLedgerDisplay *ledger = NULL;
Account *account = NULL;
g_assert (regData);
ledger = gnc_RegWindow_ledger (regData);
g_assert (ledger);
account = gnc_ledger_display_leader (ledger);
if (!account)
return;
gnc_hbci_maketrans (gnc_RegWindow_window (regData), account,
SINGLE_DEBITNOTE);
}

View File

@@ -1,59 +0,0 @@
/********************************************************************\
* gnc-hbci-cb.h -- hbci callback 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 *
* 59 Temple Place - Suite 330 Fax: +1-617-542-2652 *
* Boston, MA 02111-1307, USA gnu@gnu.org *
\********************************************************************/
#ifndef GNC_HBCI_CB_H
#define GNC_HBCI_CB_H
#include <gnome.h>
/* Callback from account tree window to invoke Get Balance. */
void
gnc_hbci_acct_tree_menu_getbalance_cb (GtkWidget * widget,
GnomeMDIChild * child);
/* Callback from account tree window to invoke Get Transactions (not
* yet implemented). */
void
gnc_hbci_acct_tree_menu_gettrans_cb (GtkWidget * widget,
GnomeMDIChild * child);
/* Callback from register window to invoke Get Balance. */
void
gnc_hbci_register_menu_getbalance_cb (GtkWidget * widget,
gpointer data);
/* Callback from register window to invoke Get Transactions. */
void
gnc_hbci_register_menu_gettrans_cb (GtkWidget * widget,
gpointer data);
/* Callback from register window to invoke Transaction invocation. */
void
gnc_hbci_register_menu_maketrans_cb (GtkWidget * widget,
gpointer data);
/* Callback from register window to invoke Debit Note invocation. */
void
gnc_hbci_register_menu_makedebnote_cb (GtkWidget * widget,
gpointer data);
#endif /* GNC_HBCI_CB_H */

View File

@@ -12,10 +12,7 @@
#include "gnc-module.h"
#include "gnc-module-api.h"
#include "gnc-menu-extensions.h"
#include "gnc-hbci-cb.h"
#include "druid-hbci-initial.h"
#include "gnc-plugin-hbci.h"
/* version of the gnc module system interface we require */
int libgncmod_hbci_LTX_gnc_module_system_interface = 0;
@@ -31,8 +28,6 @@ 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);
static void gnc_hbci_addmenus(void);
char *
libgncmod_hbci_LTX_gnc_module_path(void) {
return g_strdup("gnucash/import-export/hbci");
@@ -67,13 +62,8 @@ libgncmod_hbci_LTX_gnc_module_init(int refcount)
/* load the HBCI Scheme code */
scm_c_eval_string("(load-from-path \"hbci/hbci.scm\")");
scm_c_define_gsubr("gnc:hbci-initial-setup",
0, 0, 0, scm_hbci_initial_druid);
/* Add menu items with C callbacks */
gnc_hbci_addmenus();
gnc_ui_hbci_create_plugin();
return TRUE;
}
@@ -82,38 +72,3 @@ int
libgncmod_hbci_LTX_gnc_module_end(int refcount) {
return TRUE;
}
static void
gnc_hbci_addmenus(void)
{
static GnomeUIInfo reg_online_submenu[] =
{
GNOMEUIINFO_ITEM ( N_("HBCI Get Balance"),
N_("Get the account balance online through HBCI"),
gnc_hbci_register_menu_getbalance_cb,
GNOME_APP_PIXMAP_NONE),
GNOMEUIINFO_ITEM ( N_("HBCI Get Transactions"),
N_("Get the transactions online through HBCI"),
gnc_hbci_register_menu_gettrans_cb,
GNOME_APP_PIXMAP_NONE),
GNOMEUIINFO_ITEM ( N_("HBCI Issue Transaction"),
N_("Issue a new transaction online through HBCI"),
gnc_hbci_register_menu_maketrans_cb,
GNOME_APP_PIXMAP_NONE),
GNOMEUIINFO_ITEM ( N_("HBCI Issue Direct Debit"),
N_("Issue a new direct debit note online through HBCI"),
gnc_hbci_register_menu_makedebnote_cb,
GNOME_APP_PIXMAP_NONE),
GNOMEUIINFO_END
};
static GnomeUIInfo reg_online_menu[] =
{
GNOMEUIINFO_SUBTREE( N_("Online Actions"),
reg_online_submenu ),
GNOMEUIINFO_END
};
gnc_add_c_extension (reg_online_menu, WINDOW_NAME_REGISTER "/_Actions/");
}

View File

@@ -5,31 +5,6 @@
;; Copyright (c) 2002 Christian <Stimming@tuhh.de>
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (add-hbci-menu-items)
; (gnc:add-extension
; (gnc:make-menu (N_ "HBCI") (list gnc:window-name-main "_Tools" "")))
(gnc:add-extension
(gnc:make-menu-item (N_ "HBCI Setup")
(N_ "HBCI Setup")
(list gnc:window-name-main "_Tools" "")
(lambda ()
(gnc:hbci-initial-setup))))
; (gnc:add-extension
; (gnc:make-menu "Online" (list gnc:window-name-register "Actions" "")))
; (gnc:add-extension
; (gnc:make-menu-item (N_ "Get Balance")
; (N_ "Get Balance")
; (list gnc:window-name-register "Actions" "Online" "")
; (lambda ()
; (gnc:hbci-initial-setup))))
)
(gnc:hook-add-dangler gnc:*ui-startup-hook* add-hbci-menu-items)
;; Register Preferences
(gnc:register-configuration-option
(gnc:make-simple-boolean-option