how to hook OpenHBCI menu items in the register window

Christian Stimming stimming@tuhh.de
Fri, 23 Aug 2002 00:37:21 +0200


-----BEGIN PGP SIGNED MESSAGE-----

Hi,

I'm about to create new actions that can be performed on a Gnucash account 
online by means of HBCI. Those online actions include balance retrieval, 
transaction retrieval, and others. I'd like to add menu items for the user to 
invoke those, preferably under a submenu Actions->Online->... or similar. 
These menu items should appear both in the Register's action menu as well as 
the account tree's action menu.

Of course, those menu items should only be there for those who compile gnucash 
with --enable-hbci. I wonder what would be the best way to have menu items 
appear in the mentioned menus, conditioned on --enable-hbci. For the account 
tree window, this would be the menu initialization code in 
src/gnome/window-acct-tree.c. For the register view, I would probably have to 
add menu items manually in src/gnome/window-register.c, as the existing menu 
items are all defined directly in the glade file.

I was thinking of defining HBCI_CFLAGS to contain "-DHAS_OPENHBCI" if 
- --enable-hbci was given, and to add that to src/gnome/Makefile.am's 
AM_CFLAGS. Then, all menu code that gets added for HBCI online actions 
support would be surrounded by #ifdef HAS_OPENHBCI / #endif. 

I know that this is not the most elegant solution possible. However,  does 
anybody have a better proposal? Are there plans to enable adding menu items 
from outside the src/gnome/window-*.c code, i.e., so that I can write the 
menu item adding code into src/import-export/hbci/*.c? Otherwise the 
mentioned solution is pretty much the only thing I can think of.

Christian
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iQCVAwUBPWVnomXAi+BfhivFAQFtOwQAuUhxgyvDPwSqEggZOINNxPbM/ZOvx190
Ki8A7gZb+QUks9cqO0KNFGMzODXCZSTa2oSlqQWKOjYFHGssywOnfKpIEzYGCLy3
FmrkUTdSNgMZZmqOWpnH66ySkbaBdtRiEQVbLOHKUwk8RnnhjrzTAnnbnWUkjCAu
WSsOfndZrXg=
=Zpeo
-----END PGP SIGNATURE-----