r15313 - gnucash/branches/register-rewrite - Merge -r 14539:15058 from trunk.

Chris Shoemaker chris at cvs.gnucash.org
Fri Jan 5 12:26:13 EST 2007


Author: chris
Date: 2007-01-05 12:25:28 -0500 (Fri, 05 Jan 2007)
New Revision: 15313
Trac: http://svn.gnucash.org/trac/changeset/15313

Added:
   gnucash/branches/register-rewrite/art/
   gnucash/branches/register-rewrite/macros/ac_pkg_swig.m4
   gnucash/branches/register-rewrite/macros/binreloc.m4
   gnucash/branches/register-rewrite/packaging/win32/
   gnucash/branches/register-rewrite/src/app-utils/app-utils.i
   gnucash/branches/register-rewrite/src/base-typemaps.i
   gnucash/branches/register-rewrite/src/business/business-core/business-core.i
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.i
   gnucash/branches/register-rewrite/src/core-utils/core-utils.i
   gnucash/branches/register-rewrite/src/core-utils/core-utils.scm
   gnucash/branches/register-rewrite/src/core-utils/gnc-gtk-utils.c
   gnucash/branches/register-rewrite/src/core-utils/gnc-gtk-utils.h
   gnucash/branches/register-rewrite/src/engine/binreloc.c
   gnucash/branches/register-rewrite/src/engine/binreloc.h
   gnucash/branches/register-rewrite/src/engine/engine.i
   gnucash/branches/register-rewrite/src/engine/gnc-path.c
   gnucash/branches/register-rewrite/src/engine/gnc-path.h
   gnucash/branches/register-rewrite/src/gnc-module/gnc-module.i
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/bar.i
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/baz.i
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/foo.i
   gnucash/branches/register-rewrite/src/gnome-search/search-core-utils.c
   gnucash/branches/register-rewrite/src/gnome-search/search-core-utils.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnome-utils.i
   gnucash/branches/register-rewrite/src/gnome/gnome.i
   gnucash/branches/register-rewrite/src/gnome/gnucash.desktop.in.in
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-file-aqb-import.c
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-file-aqb-import.h
   gnucash/branches/register-rewrite/src/report/report-gnome/report-gnome.i
   gnucash/branches/register-rewrite/src/report/report-system/report-system.i
Removed:
   gnucash/branches/register-rewrite/macros/g-wrap.m4
   gnucash/branches/register-rewrite/src/app-utils/gw-app-utils-spec.scm
   gnucash/branches/register-rewrite/src/app-utils/kvp-option-registry.scm
   gnucash/branches/register-rewrite/src/app-utils/test/test-component-manager
   gnucash/branches/register-rewrite/src/bin/i18n.h.in
   gnucash/branches/register-rewrite/src/business/business-core/gw-business-core-spec.scm
   gnucash/branches/register-rewrite/src/business/business-gnome/gw-business-gnome-spec.scm
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm
   gnucash/branches/register-rewrite/src/core-utils/gw-core-utils-spec.scm
   gnucash/branches/register-rewrite/src/engine/gw-engine-spec.scm
   gnucash/branches/register-rewrite/src/engine/gw-kvp-spec.scm
   gnucash/branches/register-rewrite/src/gnc-module/gw-gnc-module-spec.scm
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/bar-gwrap.scm
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/baz-gwrap.scm
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/foo-gwrap.scm
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-dir.h.in
   gnucash/branches/register-rewrite/src/gnome-utils/gw-gnome-utils-spec.scm
   gnucash/branches/register-rewrite/src/gnome/gnucash.desktop.in
   gnucash/branches/register-rewrite/src/gnome/gw-gnc-spec.scm
   gnucash/branches/register-rewrite/src/import-export/mt940/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.c
   gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.h
   gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940-ui.xml
   gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.c
   gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.h
   gnucash/branches/register-rewrite/src/import-export/mt940/gncmod-mt940-import.c
   gnucash/branches/register-rewrite/src/optional/swig/
   gnucash/branches/register-rewrite/src/register/register-core/gw-register-core-spec.scm
   gnucash/branches/register-rewrite/src/report/report-gnome/gw-report-gnome-spec.scm
   gnucash/branches/register-rewrite/src/report/report-system/gw-report-system-spec.scm
Modified:
   gnucash/branches/register-rewrite/
   gnucash/branches/register-rewrite/ChangeLog
   gnucash/branches/register-rewrite/Makefile.am
   gnucash/branches/register-rewrite/accounts/de_DE/acctchrt_skr03.gnucash-xea
   gnucash/branches/register-rewrite/configure.in
   gnucash/branches/register-rewrite/doc/tip_of_the_day.list.in
   gnucash/branches/register-rewrite/lib/goffice-0.0.4/goffice/Makefile.am
   gnucash/branches/register-rewrite/lib/guile-www/Makefile.am
   gnucash/branches/register-rewrite/lib/libqof/backend/file/Makefile.am
   gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-backend.c
   gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-xml-map.c
   gnucash/branches/register-rewrite/lib/libqof/qof/Makefile.am
   gnucash/branches/register-rewrite/lib/libqof/qof/qof.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend-p.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofbookmerge.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofclass.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofid-p.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofid.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofid.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofobject-p.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore-p.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.h
   gnucash/branches/register-rewrite/lib/libqof/qof/qofsession.c
   gnucash/branches/register-rewrite/lib/libqof/qof/qofutil.h
   gnucash/branches/register-rewrite/macros/legacy_macros.m4
   gnucash/branches/register-rewrite/packaging/gnucash.spec.in
   gnucash/branches/register-rewrite/po/POTFILES.skip
   gnucash/branches/register-rewrite/src/
   gnucash/branches/register-rewrite/src/Makefile.am
   gnucash/branches/register-rewrite/src/app-utils/
   gnucash/branches/register-rewrite/src/app-utils/Makefile.am
   gnucash/branches/register-rewrite/src/app-utils/app-utils.scm
   gnucash/branches/register-rewrite/src/app-utils/c-interface.scm
   gnucash/branches/register-rewrite/src/app-utils/date-utilities.scm
   gnucash/branches/register-rewrite/src/app-utils/gfec.c
   gnucash/branches/register-rewrite/src/app-utils/gfec.h
   gnucash/branches/register-rewrite/src/app-utils/gnc-account-merge.c
   gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.c
   gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.h
   gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.c
   gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.h
   gnucash/branches/register-rewrite/src/app-utils/gnc-ui-util.c
   gnucash/branches/register-rewrite/src/app-utils/gncmod-app-utils.c
   gnucash/branches/register-rewrite/src/app-utils/guile-util.c
   gnucash/branches/register-rewrite/src/app-utils/hooks.scm
   gnucash/branches/register-rewrite/src/app-utils/option-util.c
   gnucash/branches/register-rewrite/src/app-utils/option-util.h
   gnucash/branches/register-rewrite/src/app-utils/options.scm
   gnucash/branches/register-rewrite/src/app-utils/prefs.scm
   gnucash/branches/register-rewrite/src/app-utils/test/Makefile.am
   gnucash/branches/register-rewrite/src/app-utils/test/test-load-module
   gnucash/branches/register-rewrite/src/app-utils/test/test-print-parse-amount.c
   gnucash/branches/register-rewrite/src/app-utils/test/test-print-queries.c
   gnucash/branches/register-rewrite/src/app-utils/test/test-scm-query-string.c
   gnucash/branches/register-rewrite/src/backend/file/gnc-account-xml-v2.c
   gnucash/branches/register-rewrite/src/backend/file/gnc-backend-file.c
   gnucash/branches/register-rewrite/src/backend/file/gnc-book-xml-v2.c
   gnucash/branches/register-rewrite/src/backend/file/gnc-commodity-xml-v2.c
   gnucash/branches/register-rewrite/src/backend/file/io-gncbin-r.c
   gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c
   gnucash/branches/register-rewrite/src/backend/file/test/Makefile.am
   gnucash/branches/register-rewrite/src/backend/file/test/test-file-stuff.c
   gnucash/branches/register-rewrite/src/backend/file/test/test-load-backend.c
   gnucash/branches/register-rewrite/src/backend/file/test/test-load-example-account.c
   gnucash/branches/register-rewrite/src/backend/file/test/test-load-xml2.c
   gnucash/branches/register-rewrite/src/backend/file/test/test-save-in-lang.c
   gnucash/branches/register-rewrite/src/backend/file/test/test-xml-account.c
   gnucash/branches/register-rewrite/src/backend/file/test/test-xml-commodity.c
   gnucash/branches/register-rewrite/src/backend/file/test/test-xml2-is-file.c
   gnucash/branches/register-rewrite/src/backend/postgres/putil.c
   gnucash/branches/register-rewrite/src/backend/postgres/putil.h
   gnucash/branches/register-rewrite/src/backend/postgres/test/Makefile.am
   gnucash/branches/register-rewrite/src/backend/postgres/test/run-tests.sh
   gnucash/branches/register-rewrite/src/backend/postgres/test/test-db.c
   gnucash/branches/register-rewrite/src/backend/postgres/test/test-load-backend.c
   gnucash/branches/register-rewrite/src/backend/postgres/test/test-period.c
   gnucash/branches/register-rewrite/src/bin/Makefile.am
   gnucash/branches/register-rewrite/src/bin/gnucash-bin.c
   gnucash/branches/register-rewrite/src/bin/gnucash-valgrind.in
   gnucash/branches/register-rewrite/src/bin/gnucash.in
   gnucash/branches/register-rewrite/src/bin/overrides/Makefile.am
   gnucash/branches/register-rewrite/src/bin/overrides/gnucash-build-env.in
   gnucash/branches/register-rewrite/src/bin/overrides/gnucash-env.in
   gnucash/branches/register-rewrite/src/bin/test/Makefile.am
   gnucash/branches/register-rewrite/src/business/business-core/
   gnucash/branches/register-rewrite/src/business/business-core/Makefile.am
   gnucash/branches/register-rewrite/src/business/business-core/business-core.scm
   gnucash/branches/register-rewrite/src/business/business-core/businessmod-core.c
   gnucash/branches/register-rewrite/src/business/business-core/file/gncmod-business-backend-file.c
   gnucash/branches/register-rewrite/src/business/business-core/gncBillTerm.h
   gnucash/branches/register-rewrite/src/business/business-core/gncBusGuile.c
   gnucash/branches/register-rewrite/src/business/business-core/gncCustomer.h
   gnucash/branches/register-rewrite/src/business/business-core/gncEntry.c
   gnucash/branches/register-rewrite/src/business/business-core/gncEntry.h
   gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.c
   gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.h
   gnucash/branches/register-rewrite/src/business/business-core/gncJob.h
   gnucash/branches/register-rewrite/src/business/business-core/gncOrder.h
   gnucash/branches/register-rewrite/src/business/business-core/gncOwner.h
   gnucash/branches/register-rewrite/src/business/business-core/test/Makefile.am
   gnucash/branches/register-rewrite/src/business/business-core/test/test-address.c
   gnucash/branches/register-rewrite/src/business/business-core/test/test-business.c
   gnucash/branches/register-rewrite/src/business/business-core/test/test-customer.c
   gnucash/branches/register-rewrite/src/business/business-core/test/test-employee.c
   gnucash/branches/register-rewrite/src/business/business-core/test/test-job.c
   gnucash/branches/register-rewrite/src/business/business-core/test/test-vendor.c
   gnucash/branches/register-rewrite/src/business/business-gnome/
   gnucash/branches/register-rewrite/src/business/business-gnome/Makefile.am
   gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome-utils.c
   gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome.scm
   gnucash/branches/register-rewrite/src/business/business-gnome/business-options-gnome.c
   gnucash/branches/register-rewrite/src/business/business-gnome/businessmod-gnome.c
   gnucash/branches/register-rewrite/src/business/business-gnome/dialog-billterms.c
   gnucash/branches/register-rewrite/src/business/business-gnome/dialog-employee.c
   gnucash/branches/register-rewrite/src/business/business-gnome/dialog-invoice.c
   gnucash/branches/register-rewrite/src/business/business-gnome/dialog-payment.c
   gnucash/branches/register-rewrite/src/business/business-gnome/glade/billterms.glade
   gnucash/branches/register-rewrite/src/business/business-gnome/glade/payment.glade
   gnucash/branches/register-rewrite/src/business/business-gnome/gnc-plugin-business.c
   gnucash/branches/register-rewrite/src/business/business-gnome/schemas/Makefile.am
   gnucash/branches/register-rewrite/src/business/business-gnome/search-owner.c
   gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedger.c
   gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedgerLoad.c
   gnucash/branches/register-rewrite/src/business/business-reports/Makefile.am
   gnucash/branches/register-rewrite/src/business/business-reports/aging.scm
   gnucash/branches/register-rewrite/src/business/business-reports/business-reports.scm
   gnucash/branches/register-rewrite/src/business/business-reports/easy-invoice.scm
   gnucash/branches/register-rewrite/src/business/business-reports/fancy-invoice.scm
   gnucash/branches/register-rewrite/src/business/business-reports/invoice.scm
   gnucash/branches/register-rewrite/src/business/business-reports/owner-report.scm
   gnucash/branches/register-rewrite/src/business/business-reports/payables.scm
   gnucash/branches/register-rewrite/src/business/business-reports/receivables.scm
   gnucash/branches/register-rewrite/src/business/business-utils/Makefile.am
   gnucash/branches/register-rewrite/src/business/business-utils/business-options.c
   gnucash/branches/register-rewrite/src/business/business-utils/business-options.scm
   gnucash/branches/register-rewrite/src/business/business-utils/business-prefs.scm
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/Makefile.am
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.c
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.scm
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/gncmod-dialog-tax-table.c
   gnucash/branches/register-rewrite/src/business/dialog-tax-table/tax-tables.glade
   gnucash/branches/register-rewrite/src/calculation/expression_parser.c
   gnucash/branches/register-rewrite/src/core-utils/
   gnucash/branches/register-rewrite/src/core-utils/Makefile.am
   gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.c
   gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.h
   gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.c
   gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.h
   gnucash/branches/register-rewrite/src/core-utils/gnc-main.c
   gnucash/branches/register-rewrite/src/core-utils/gnc-main.h
   gnucash/branches/register-rewrite/src/engine/
   gnucash/branches/register-rewrite/src/engine/Account.c
   gnucash/branches/register-rewrite/src/engine/Account.h
   gnucash/branches/register-rewrite/src/engine/AccountP.h
   gnucash/branches/register-rewrite/src/engine/Group.c
   gnucash/branches/register-rewrite/src/engine/Group.h
   gnucash/branches/register-rewrite/src/engine/Makefile.am
   gnucash/branches/register-rewrite/src/engine/Period.c
   gnucash/branches/register-rewrite/src/engine/Period.h
   gnucash/branches/register-rewrite/src/engine/Query.c
   gnucash/branches/register-rewrite/src/engine/Query.h
   gnucash/branches/register-rewrite/src/engine/SX-book.c
   gnucash/branches/register-rewrite/src/engine/SX-book.h
   gnucash/branches/register-rewrite/src/engine/SchedXaction.c
   gnucash/branches/register-rewrite/src/engine/Scrub.c
   gnucash/branches/register-rewrite/src/engine/Transaction.c
   gnucash/branches/register-rewrite/src/engine/Transaction.h
   gnucash/branches/register-rewrite/src/engine/cap-gains.c
   gnucash/branches/register-rewrite/src/engine/cashobjects.c
   gnucash/branches/register-rewrite/src/engine/engine-helpers.c
   gnucash/branches/register-rewrite/src/engine/engine-helpers.h
   gnucash/branches/register-rewrite/src/engine/engine-interface.scm
   gnucash/branches/register-rewrite/src/engine/engine-utilities.scm
   gnucash/branches/register-rewrite/src/engine/engine.scm
   gnucash/branches/register-rewrite/src/engine/glib-helpers.c
   gnucash/branches/register-rewrite/src/engine/glib-helpers.h
   gnucash/branches/register-rewrite/src/engine/gnc-associate-account.c
   gnucash/branches/register-rewrite/src/engine/gnc-budget.c
   gnucash/branches/register-rewrite/src/engine/gnc-budget.h
   gnucash/branches/register-rewrite/src/engine/gnc-commodity.c
   gnucash/branches/register-rewrite/src/engine/gnc-commodity.h
   gnucash/branches/register-rewrite/src/engine/gnc-engine.c
   gnucash/branches/register-rewrite/src/engine/gnc-filepath-utils.c
   gnucash/branches/register-rewrite/src/engine/gnc-hooks.c
   gnucash/branches/register-rewrite/src/engine/gnc-lot.c
   gnucash/branches/register-rewrite/src/engine/gnc-numeric.scm
   gnucash/branches/register-rewrite/src/engine/gnc-pricedb.c
   gnucash/branches/register-rewrite/src/engine/gnc-pricedb.h
   gnucash/branches/register-rewrite/src/engine/gncla-dir.h.in
   gnucash/branches/register-rewrite/src/engine/gncmod-engine.c
   gnucash/branches/register-rewrite/src/engine/kvp-scm.c
   gnucash/branches/register-rewrite/src/engine/test-core/Makefile.am
   gnucash/branches/register-rewrite/src/engine/test-core/test-engine-stuff.c
   gnucash/branches/register-rewrite/src/engine/test/Makefile.am
   gnucash/branches/register-rewrite/src/engine/test/test-commodities.c
   gnucash/branches/register-rewrite/src/engine/test/test-create-account.scm
   gnucash/branches/register-rewrite/src/engine/test/test-date.c
   gnucash/branches/register-rewrite/src/engine/test/test-group-vs-book.c
   gnucash/branches/register-rewrite/src/engine/test/test-guid.c
   gnucash/branches/register-rewrite/src/engine/test/test-load-engine.c
   gnucash/branches/register-rewrite/src/engine/test/test-lots.c
   gnucash/branches/register-rewrite/src/engine/test/test-numeric.c
   gnucash/branches/register-rewrite/src/engine/test/test-object.c
   gnucash/branches/register-rewrite/src/engine/test/test-period.c
   gnucash/branches/register-rewrite/src/engine/test/test-query.c
   gnucash/branches/register-rewrite/src/engine/test/test-querynew.c
   gnucash/branches/register-rewrite/src/engine/test/test-resolve-file-path.c
   gnucash/branches/register-rewrite/src/engine/test/test-scm-query-import.scm
   gnucash/branches/register-rewrite/src/engine/test/test-scm-query.c
   gnucash/branches/register-rewrite/src/engine/test/test-split-vs-account.c
   gnucash/branches/register-rewrite/src/engine/test/test-transaction-reversal.c
   gnucash/branches/register-rewrite/src/engine/test/test-transaction-voiding.c
   gnucash/branches/register-rewrite/src/gnc-module/
   gnucash/branches/register-rewrite/src/gnc-module/Makefile.am
   gnucash/branches/register-rewrite/src/gnc-module/gnc-module.c
   gnucash/branches/register-rewrite/src/gnc-module/gnc-module.scm
   gnucash/branches/register-rewrite/src/gnc-module/test/Makefile.am
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/Makefile.am
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/gnc-mod-bar.c
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/Makefile.am
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/gnc-mod-baz.c
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/Makefile.am
   gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/gnc-mod-foo.c
   gnucash/branches/register-rewrite/src/gnc-module/test/test-dynload.c
   gnucash/branches/register-rewrite/src/gnc-module/test/test-gwrapped-c
   gnucash/branches/register-rewrite/src/gnc-module/test/test-load-deps
   gnucash/branches/register-rewrite/src/gnc-module/test/test-scm-multi
   gnucash/branches/register-rewrite/src/gnc-test-env
   gnucash/branches/register-rewrite/src/gnome-search/
   gnucash/branches/register-rewrite/src/gnome-search/Makefile.am
   gnucash/branches/register-rewrite/src/gnome-search/dialog-search.c
   gnucash/branches/register-rewrite/src/gnome-search/search-account.c
   gnucash/branches/register-rewrite/src/gnome-search/search-boolean.c
   gnucash/branches/register-rewrite/src/gnome-search/search-date.c
   gnucash/branches/register-rewrite/src/gnome-search/search-double.c
   gnucash/branches/register-rewrite/src/gnome-search/search-int64.c
   gnucash/branches/register-rewrite/src/gnome-search/search-numeric.c
   gnucash/branches/register-rewrite/src/gnome-search/search-reconciled.c
   gnucash/branches/register-rewrite/src/gnome-search/search-string.c
   gnucash/branches/register-rewrite/src/gnome-search/search.glade
   gnucash/branches/register-rewrite/src/gnome-utils/
   gnucash/branches/register-rewrite/src/gnome-utils/Makefile.am
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-account.c
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.c
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.h
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.c
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.h
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-preferences.c
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-reset-warnings.c
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-transfer.c
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.c
   gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.h
   gnucash/branches/register-rewrite/src/gnome-utils/druid-gconf-setup.c
   gnucash/branches/register-rewrite/src/gnome-utils/druid-gnc-xml-import.c
   gnucash/branches/register-rewrite/src/gnome-utils/glade/commodity.glade
   gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-gnc-xml-import.glade
   gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-provider-multifile.glade
   gnucash/branches/register-rewrite/src/gnome-utils/glade/preferences.glade
   gnucash/branches/register-rewrite/src/gnome-utils/glade/transfer.glade
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-currency-edit.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-format.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-dialog.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-file-gnome.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-embedded-window.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-gnome-utils.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-html.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin-menu-additions.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-query-list.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.h
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-commodity.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-price.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-account.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-transaction.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnc-window.c
   gnucash/branches/register-rewrite/src/gnome-utils/gncmod-gnome-utils.c
   gnucash/branches/register-rewrite/src/gnome-utils/gnome-utils.scm
   gnucash/branches/register-rewrite/src/gnome-utils/schemas/Makefile.am
   gnucash/branches/register-rewrite/src/gnome-utils/search-param.c
   gnucash/branches/register-rewrite/src/gnome-utils/search-param.h
   gnucash/branches/register-rewrite/src/gnome-utils/test/Makefile.am
   gnucash/branches/register-rewrite/src/gnome-utils/test/test-gnc-recurrence.c
   gnucash/branches/register-rewrite/src/gnome-utils/window-main-summarybar.c
   gnucash/branches/register-rewrite/src/gnome/
   gnucash/branches/register-rewrite/src/gnome/Makefile.am
   gnucash/branches/register-rewrite/src/gnome/dialog-chart-export.c
   gnucash/branches/register-rewrite/src/gnome/dialog-fincalc.c
   gnucash/branches/register-rewrite/src/gnome/dialog-price-edit-db.c
   gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c
   gnucash/branches/register-rewrite/src/gnome/dialog-scheduledxaction.h
   gnucash/branches/register-rewrite/src/gnome/dialog-sx-from-trans.c
   gnucash/branches/register-rewrite/src/gnome/dialog-tax-info.c
   gnucash/branches/register-rewrite/src/gnome/druid-acct-period.c
   gnucash/branches/register-rewrite/src/gnome/druid-hierarchy.c
   gnucash/branches/register-rewrite/src/gnome/druid-loan.c
   gnucash/branches/register-rewrite/src/gnome/druid-stock-split.c
   gnucash/branches/register-rewrite/src/gnome/glade/account.glade
   gnucash/branches/register-rewrite/src/gnome/glade/commodities.glade
   gnucash/branches/register-rewrite/src/gnome/glade/fincalc.glade
   gnucash/branches/register-rewrite/src/gnome/glade/lots.glade
   gnucash/branches/register-rewrite/src/gnome/glade/price.glade
   gnucash/branches/register-rewrite/src/gnome/glade/sched-xact.glade
   gnucash/branches/register-rewrite/src/gnome/glade/stocks.glade
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-basic-commands.c
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-budget.c
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-account-tree.c
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-budget.c
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c
   gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.h
   gnucash/branches/register-rewrite/src/gnome/lot-viewer.c
   gnucash/branches/register-rewrite/src/gnome/schemas/
   gnucash/branches/register-rewrite/src/gnome/schemas/Makefile.am
   gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_dialog_scheduled_transctions.schemas.in
   gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_general.schemas.in
   gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_warnings.schemas.in
   gnucash/branches/register-rewrite/src/gnome/top-level.c
   gnucash/branches/register-rewrite/src/gnome/window-reconcile.c
   gnucash/branches/register-rewrite/src/import-export/
   gnucash/branches/register-rewrite/src/import-export/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/binary-import/
   gnucash/branches/register-rewrite/src/import-export/binary-import/druid-commodity.c
   gnucash/branches/register-rewrite/src/import-export/generic-import.glade
   gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.c
   gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.h
   gnucash/branches/register-rewrite/src/import-export/hbci/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.c
   gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.h
   gnucash/branches/register-rewrite/src/import-export/hbci/druid-hbci-initial.c
   gnucash/branches/register-rewrite/src/import-export/hbci/glade/hbci.glade
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-kvp.c
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-transfer.c
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.c
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.h
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci-ui.xml
   gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci.c
   gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.c
   gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.h
   gnucash/branches/register-rewrite/src/import-export/hbci/schemas/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/import-account-matcher.c
   gnucash/branches/register-rewrite/src/import-export/import-account-matcher.h
   gnucash/branches/register-rewrite/src/import-export/import-backend.c
   gnucash/branches/register-rewrite/src/import-export/import-backend.h
   gnucash/branches/register-rewrite/src/import-export/import-main-matcher.c
   gnucash/branches/register-rewrite/src/import-export/import-match-map.c
   gnucash/branches/register-rewrite/src/import-export/import-match-picker.c
   gnucash/branches/register-rewrite/src/import-export/import-provider-format.glade
   gnucash/branches/register-rewrite/src/import-export/log-replay/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/ofx/gnc-ofx-import.c
   gnucash/branches/register-rewrite/src/import-export/qif-import/
   gnucash/branches/register-rewrite/src/import-export/qif-import/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/qif-import/dialog-account-picker.c
   gnucash/branches/register-rewrite/src/import-export/qif-import/druid-qif-import.c
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-dialog-utils.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-file.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-guess-map.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-import.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-merge-groups.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-objects.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-parse.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif-to-gnc.scm
   gnucash/branches/register-rewrite/src/import-export/qif-import/qif.glade
   gnucash/branches/register-rewrite/src/import-export/qif-import/test/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-acct-table.scm
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-bank-xtn-import.scm
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-format-check.scm
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-invst-xtn-import.scm
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-parse.scm
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-import-phase-1.scm
   gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-parser.scm
   gnucash/branches/register-rewrite/src/import-export/qif/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/qif/qif-parse.c
   gnucash/branches/register-rewrite/src/import-export/qif/test/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/schemas/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/test/Makefile.am
   gnucash/branches/register-rewrite/src/import-export/test/test-import-parse.c
   gnucash/branches/register-rewrite/src/network-utils/test/Makefile.am
   gnucash/branches/register-rewrite/src/optional/Makefile.am
   gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.c
   gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.h
   gnucash/branches/register-rewrite/src/register/ledger-core/split-register-control.c
   gnucash/branches/register-rewrite/src/register/ledger-core/split-register-load.c
   gnucash/branches/register-rewrite/src/register/ledger-core/split-register-model.c
   gnucash/branches/register-rewrite/src/register/ledger-core/split-register.c
   gnucash/branches/register-rewrite/src/register/register-core/
   gnucash/branches/register-rewrite/src/register/register-core/Makefile.am
   gnucash/branches/register-rewrite/src/register/register-core/gncmod-register-core.c
   gnucash/branches/register-rewrite/src/register/register-core/table-allgui.h
   gnucash/branches/register-rewrite/src/register/register-core/test/Makefile.am
   gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-color.c
   gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-item-list.c
   gnucash/branches/register-rewrite/src/register/register-gnome/table-gnome.c
   gnucash/branches/register-rewrite/src/register/register-gnome/test/Makefile.am
   gnucash/branches/register-rewrite/src/report/locale-specific/us/Makefile.am
   gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf-de_DE.scm
   gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf.scm
   gnucash/branches/register-rewrite/src/report/locale-specific/us/test/Makefile.am
   gnucash/branches/register-rewrite/src/report/report-gnome/
   gnucash/branches/register-rewrite/src/report/report-gnome/Makefile.am
   gnucash/branches/register-rewrite/src/report/report-gnome/dialog-column-view.c
   gnucash/branches/register-rewrite/src/report/report-gnome/dialog-style-sheet.c
   gnucash/branches/register-rewrite/src/report/report-gnome/gnc-plugin-page-report.c
   gnucash/branches/register-rewrite/src/report/report-gnome/gncmod-report-gnome.c
   gnucash/branches/register-rewrite/src/report/report-gnome/report-gnome.scm
   gnucash/branches/register-rewrite/src/report/report-gnome/report.glade
   gnucash/branches/register-rewrite/src/report/report-gnome/test/Makefile.am
   gnucash/branches/register-rewrite/src/report/report-gnome/window-report.c
   gnucash/branches/register-rewrite/src/report/report-system/
   gnucash/branches/register-rewrite/src/report/report-system/Makefile.am
   gnucash/branches/register-rewrite/src/report/report-system/commodity-utilities.scm
   gnucash/branches/register-rewrite/src/report/report-system/gnc-report.c
   gnucash/branches/register-rewrite/src/report/report-system/gnc-report.h
   gnucash/branches/register-rewrite/src/report/report-system/gncmod-report-system.c
   gnucash/branches/register-rewrite/src/report/report-system/html-acct-table.scm
   gnucash/branches/register-rewrite/src/report/report-system/html-barchart.scm
   gnucash/branches/register-rewrite/src/report/report-system/html-piechart.scm
   gnucash/branches/register-rewrite/src/report/report-system/html-scatter.scm
   gnucash/branches/register-rewrite/src/report/report-system/html-style-info.scm
   gnucash/branches/register-rewrite/src/report/report-system/html-style-sheet.scm
   gnucash/branches/register-rewrite/src/report/report-system/html-utilities.scm
   gnucash/branches/register-rewrite/src/report/report-system/options-utilities.scm
   gnucash/branches/register-rewrite/src/report/report-system/report-system.scm
   gnucash/branches/register-rewrite/src/report/report-system/report-utilities.scm
   gnucash/branches/register-rewrite/src/report/report-system/report.scm
   gnucash/branches/register-rewrite/src/report/report-system/test/Makefile.am
   gnucash/branches/register-rewrite/src/report/standard-reports/Makefile.am
   gnucash/branches/register-rewrite/src/report/standard-reports/account-piecharts.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/account-summary.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/advanced-portfolio.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/average-balance.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/balance-sheet.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/budget.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/cash-flow.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/category-barchart.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/daily-reports.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/equity-statement.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/general-journal.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/income-statement.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/net-barchart.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/portfolio.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/price-scatter.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/register.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/standard-reports.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/test/Makefile.am
   gnucash/branches/register-rewrite/src/report/standard-reports/transaction.scm
   gnucash/branches/register-rewrite/src/report/standard-reports/trial-balance.scm
   gnucash/branches/register-rewrite/src/report/stylesheets/Makefile.am
   gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-easy.scm
   gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-fancy.scm
   gnucash/branches/register-rewrite/src/report/stylesheets/test/Makefile.am
   gnucash/branches/register-rewrite/src/report/utility-reports/Makefile.am
   gnucash/branches/register-rewrite/src/report/utility-reports/hello-world.scm
   gnucash/branches/register-rewrite/src/report/utility-reports/test-graphing.scm
   gnucash/branches/register-rewrite/src/report/utility-reports/test/Makefile.am
   gnucash/branches/register-rewrite/src/report/utility-reports/utility-reports.scm
   gnucash/branches/register-rewrite/src/report/utility-reports/view-column.scm
   gnucash/branches/register-rewrite/src/report/utility-reports/welcome-to-gnucash.scm
   gnucash/branches/register-rewrite/src/scm/Makefile.am
   gnucash/branches/register-rewrite/src/scm/command-line.scm
   gnucash/branches/register-rewrite/src/scm/main-window.scm
   gnucash/branches/register-rewrite/src/scm/main.scm
   gnucash/branches/register-rewrite/src/scm/price-quotes.scm
   gnucash/branches/register-rewrite/src/scm/printing/print-check.scm
   gnucash/branches/register-rewrite/src/tax/us/Makefile.am
   gnucash/branches/register-rewrite/src/tax/us/test/Makefile.am
   gnucash/branches/register-rewrite/src/tax/us/txf-de_DE.scm
   gnucash/branches/register-rewrite/src/test-core/test-stuff.c
Log:
Merge -r 14539:15058 from trunk.



Property changes on: gnucash/branches/register-rewrite
___________________________________________________________________
Name: svk:merge
   - d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:12883
   + 3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/branches/swig-redo:802
3889ce50-311e-0410-a464-f059747ec5d1:/local/gnucash/trunk:859
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk:13528
d2ab10a8-8a95-4986-baff-8d511d9f15b2:/local/gnucash/trunk2:13366

Modified: gnucash/branches/register-rewrite/ChangeLog
===================================================================
--- gnucash/branches/register-rewrite/ChangeLog	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/ChangeLog	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,3 +1,290 @@
+2006-10-09  Josh Sled <jsled at asynchronous.org>
+
+	* art/: Add, with 2.0 {banner,icon,logo,splash} art.
+	
+2006-09-26  Derek Atkins  <derek at ihtfp.com>
+
+	* lib/libqof/qof/qofquery.[ch]:
+	  Implement SubQuery functionality in QOF:  qof_query_run_subquery()
+	  Now you can run one query off of the results of another query.
+
+	Add the ability to override the default sort (#150799).
+	Override the Transaction Number to sort numerically.
+	* lib/libqof/qof/qofclass.h:
+	* lib/libqof/qof/qofquery.c:
+	* lib/libqof/qof/qofquerycore-p.h:
+	* lib/libqof/qof/qofquerycore.[ch]:
+	  - Publish the QofCompareFunc prototype.
+	  - Add a new QofParam param_compfcn parameter
+	  - Change QofQuery to use the param_compfcn over the
+	    default type compare function.
+	  - create (and publish) a qof API to compare strings
+	    as numbers:  qof_string_number_compare_func()
+	* src/engine/Transaction.c:
+	  Assign TRANS_NUM to use qof_string_numer_compare_func()
+
+2006-09-23  Derek Atkins  <derek at ihtfp.com>
+
+	* src/ledger-core/split-register*.c:
+	  suspend events around the Commit(). Fixes #347089 when combined
+	  with r14495.
+
+	* src/gnome/druid-acct-period.c:
+	* src/gnome/gnc-plugin-page-account-tree.c:
+	* src/gnome/window-reconcile.c:
+	  disable lot scrubbing during Check & Repair (#357370).
+	  Lots are supposed to be disabled in the 2.0 release until we
+	  get the cap-gains code working.  IMHO the cap-gains code should
+	  deal with extra txn splits instead of creating additional txns.
+
+2006-09-19  Christian Stimming  <stimming at tuhh.de>
+
+	* configure.in: Remove mt940 module completely from the build and
+	SVN because all of its functionality has been moved into the hbci
+	(aqbanking) module.
+
+2006-09-19  Andreas Köhler  <andi5.py at gmx.net>
+
+	* $some.glade: Use some more automatic scrollbars.
+
+	* src/backend/file/gnc-backend-file.c:
+	* src/gnome-utils/gnc-file.c: Do not complain about non-existent
+	  files if we save to a new file. In pass one we ignore the error
+	  returned by stat and call qof_session_begin with
+	  create_if_nonexistent=TRUE for a second run.
+
+2006-09-18  Christian Stimming  <stimming at tuhh.de>
+
+	* src/engine/binreloc.[hc], src/engine/gnc-path.c,
+	src/bin/gnucash-bin.c, configure.in: Implement automatic
+	relocation of previously compiled-in paths. With the exception of
+	the env variables in src/bin/gnucash, we're fully relocatable now.
+
+2006-09-13  Christian Stimming <stimming at tuhh.de>
+
+	* src/import-export/hbci/gnc-plugin-hbci.c: Move the MT940
+	importer action from the mt940 into the hbci plugin because in the
+	hbci plugin everything is already there. From now on, MT940
+	importing is available as soon as --enable-hbci is switched
+	on. The mt940 plugin can be removed from SVN now.
+
+2006-09-07  Christian Stimming  <stimming at tuhh.de>
+
+	* src/engine/gnc-path.h, gnc-path.c: Add new file with utility
+	functions to retrieve the needed directory paths. All compile-time
+	vs. runtime path lookups will be implemented exactly in this file.
+
+2006-09-07  David Hampton  <hampton at employees.org>
+
+	* src/backend/postgres: Include config.h a couple of places.
+
+	* src/engine/gnc-budget.c: Use the glib-compat.h file for backward
+	compatible function names.
+
+2006-09-03  Christian Stimming  <stimming at tuhh.de>
+
+	* lib/libqof/qof/qofbackend.h, src/gnome-utils/gnc-file.c,
+	src/backend/file/gnc-backend-file.c: If the file type wasn't
+	recognized, check whether this failed because of no read
+	permission and give appropriate user feedback.
+
+	* src/backend/file/gnc-backend-file.c: Fix error checking for
+	non-existing filenames. Will now always give a "file not found"
+	message on nonexisting paths or filenames. #351351.
+
+2006-08-20  David Hampton  <hampton at employees.org>
+
+	* src/backend/file/gnc-account-xml-v2.c:
+	* src/backend/file/gnc-commodity-xml-v2.c:
+	* src/gnome/top-level.c: Remove some conditional code that is no
+	longer compiled, or shouldn't be compiled in 2.2.
+
+	* src/gnome/gnc-plugin-page-account-tree.c: Maintain the account
+	hierarchy when reparenting the descendants of a deleted account.
+
+2006-08-20  Christian Stimming  <stimming at tuhh.de>
+
+	* src/import-export/hbci/gnc-dtaus-import.[ch], gnc-plugin-hbci.c:
+	Add new HBCI action to File->Import that imports a DTAUS file and
+	sends all transfers as HBCI online transfers to the bank.
+
+2006-08-19  David Hampton  <hampton at employees.org>
+
+	* src/gnome/gnucash-desktop*: Update so that bug-buddy 2.16 will
+	still allow you to file bugs against gnucash.
+
+	* src/engine/Account.c: Add missing call to xaccAccountBeginEdit.
+
+2006-08-18  David Hampton  <hampton at employees.org>
+
+	* various: Add some 'const' declarations.
+
+2006-08-17  Christian Stimming <stimming at tuhh.de>
+
+	* lib/libqof/qof/qof.h, qofsession.c: Move #include "qofla-dir.h"
+	into qofsession.c because this is the only place where it is
+	used. Removes an often regenerated dependency from qof.h.
+
+2006-08-15  Christian Stimming <stimming at tuhh.de>
+
+	* src/import-export/hbci/dialog-hbcitrans.c, druid-hbci-initial.c:
+	Double-check really every string from aqbanking for valid utf-8
+	characters.
+
+	* src/core-utils/gnc-glib-utils.[hc]: Add
+	gnc_utf8_strip_invalid_strdup() that returns a stripped copy
+	instead of working in-place.
+
+	* src/import-export/hbci/dialog-hbcitrans.c (blz_changed_cb):
+	Ensure the encoding of the ktoblzcheck library is used
+	correctly. Their encoding is still always ISO-8859-1, but in
+	future versions they might change it to something else. We're
+	prepared now.
+
+2006-08-15  David Hampton  <hampton at employees.org>
+
+	* src/core-utils/gnc-gconf-utils.[ch]:
+	* src/gnome-utils/dialog-preferences.c:
+	* src/gnome-utils/gnc-plugin.[ch]:
+	* src/gnome-utils/gnc-main-window.c:
+	* src/gnome-utils/dialog-reset-warnings.c:
+	* src/gnome-utils/gnc-tree-view.c: Remove overloading of an
+	argument passed to the gnc_gconf_add/remove_notification
+	functions..  This will solve a crash on Solaris caused by
+	g_vasprintf being passed a "%s" format string and a NULL as
+	argument.
+
+2006-08-14  David Hampton  <hampton at employees.org>
+
+	* doc/tip_of_the_day.list.in: Add a tip for raising the accounts
+	menu in a register page.
+
+2006-08-10  David Hampton  <hampton at employees.org>
+
+	* src/import-export/qif-import/druid-qif-import.c: Fix account
+	currency problems when importing QIF files (introduced by the
+	widget cleanup.)
+
+2006-08-08  Christian Stimming <stimming at tuhh.de>
+
+	* configure.in, src/gnome-utils/schemas/Makefile.am: Find absolute
+	path of gconftool-2 during configure. Make gconftool rules to fail
+	if gconftool-2 could not be found. bug#349851.
+
+	* src/gnome-utils/druid-gnc-xml-import.c: Improve wording for XML
+	data file import druid. bug#342727.
+
+2006-08-06  David Hampton  <hampton at employees.org>
+
+	* various: Regularize the account type names into the form
+	ACCT_TYPE_xxx.
+
+2006-08-05  David Hampton  <hampton at employees.org>
+
+	* import-backend.c: gnc_import_process_trans_item() should return
+	TRUE in those cases where the transaction has been processed.
+
+	* src/core-utils/gnc-gtk-utils.[ch]:
+	* src/core-utils/gnc-gtk-utils.h:
+	* src/import-export/import-main-matcher.c:
+	* src/report/report-gnome/dialog-style-sheet.c:
+	* src/gnome-utils/gnc-main-window.c: Fix compilation errors on
+	FC3.
+
+2006-08-05  Andreas Köhler  <andi5.py at gmx.net>
+
+	* various: Unref all new stores.
+
+	* src/core-utils/gnc-gtk-utils.c: Unref entry completion, inline
+	  completion only for gtk>=2.6.
+
+	* src/gnome-utils/dialog-account.c: I18n "Type", unref store.
+
+2006-08-03  Andreas Köhler  <andi5.py at gmx.net>
+
+	* src/gnome-utils/dialog-reset-warnings.c:
+	* src/gnome/schemas/apps_gnucash_warnings.schemas.in: Add tooltips
+	  to the checkboxes in the Reset Warnings dialog showing the long
+	  descriptions. Remove all linebreaks in these strings to make
+	  them look better.
+
+2006-08-02  David Hampton  <hampton at employees.org>
+
+	* various: Remove the majority of the remaining deprecated widgets
+	by collapsing the "deprecated-cleanup" branch (r13935:14581) back
+	into trunk.  This patch also creates a new file for the code that
+	requires a GtkEntry text to match one of its completions.
+
+2006-07-31  Derek Atkins  <derek at ihtfp.com>
+
+	* src/bin/gnucash-bin.c:
+	  Adjust the "development version" message for the 2.0.1 release.
+
+2006-07-30  Andreas Köhler  <andi5.py at gmx.net>
+
+	* src/gnome/window-reconcile.c: Replace the hbox separating debits
+	  from credits in the reconciliation window by a homogeneous
+	  table. This avoids nasty redraws when one of them changes in
+	  size. Fixes #342512.
+
+	* src/gnome/schemas/apps_gnucash_warnings.schemas.in:
+	* src/gnome-utils/gnc-main-window.c: Add warning close_last_window
+	  and show it when user tries to close the last GnuCash window.
+	  Fixes #338865.
+
+	* src/gnome-utils/gnc-gnome-utils.c:
+	* src/gnome-utils/glade/preferences.glade:
+	* src/gnome/schemas/apps_gnucash_general.schemas.in: Add new
+	  setting general/show_splash_screen to
+	  preferences_dialog->General and only show the splash screen if
+	  it is TRUE. Fixes 339876.
+
+	* src/gnome/gnc-plugin-page-account-tree.c:
+	* src/gnome/gnc-plugin-page-register.c:
+	* src/gnome/gnc-plugin-basic-commands.c:
+	* src/gnome-utils/glade/preferences.glade: Fixed some duplicate
+	  accelerators.
+
+	* src/gnome-utils/gnc-main-window.c:
+	* src/gnome/schemas/apps_gnucash_general.schemas.in:
+	* src/gnome-utils/glade/preferences.glade: Add preference
+	  general/tab_position to choose the edge of the notebook the tabs
+	  will be showed (top, bottom, left or right). Add it to
+	  preferences_dialog->Windows. Move "Show close button on notebook
+	  tabs" from General to Windows. Fixes #340299.
+
+2006-07-24  Derek Atkins  <derek at ihtfp.com>
+
+	* [lots of Makefile.am files]:
+	  Allow proper compile/install from tarball using separate builddir.
+	  - Don't distribute (most) generated files.
+	  - Be (more) consistent about when generated files are cleaned.
+
+	* po/POTFILES.skip:
+	  - Now that we distribute the SX schema properly, don't skip it
+	    in the POTFILES.skip file.
+
+2006-07-23  Andreas Köhler  <andi5.py at gmx.net>
+
+	* src/gnome-utils/gnc-tree-view.c: Correctly set column sort
+	  orders from gconf. Fixes #348248.
+
+2006-07-22  Derek Atkins  <derek at ihtfp.com>
+
+	* configure.in: check for SLIB.  (#347922)
+
+2006-07-21  Andreas Köhler  <andi5.py at gmx.net>
+
+	* configure.in:
+	* src/gnome-utils/gnc-main-window.c: Make tabs within one notebook
+	  reorderable by dnd for gtk>=2.10. Fixes #343454.
+
+2006-07-18   Christian Stimming <stimming at tuhh.de>
+
+	* src/gnc-module/gnc-module.c: On windows, deactivate gnucash's
+	extra de-quoting of path names that is done on the GNC_MODULE_PATH
+	env variable.
+
 2006-07-16  Derek Atkins  <derek at ihtfp.com>
 
 	* configure.in:

Modified: gnucash/branches/register-rewrite/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -46,8 +46,9 @@
   make-gnucash-potfiles.in \
   macros/aqbanking.m4 \
   macros/as-scrub-include.m4 \
+  macros/binreloc.m4 \
   macros/compiler-flags.m4 \
-  macros/g-wrap.m4 \
+  macros/ac_pkg_swig.m4 \
   macros/gnome-guile-checks.m4 \
   macros/legacy_macros.m4 \
   po/gnucash.pot \

Modified: gnucash/branches/register-rewrite/accounts/de_DE/acctchrt_skr03.gnucash-xea
===================================================================
--- gnucash/branches/register-rewrite/accounts/de_DE/acctchrt_skr03.gnucash-xea	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/accounts/de_DE/acctchrt_skr03.gnucash-xea	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,18 +1,18 @@
-<?xml version="1.0"?>
+<?xml version="1.0" encoding="ISO-8859-15"?>
 <gnc-account-example>
     <gnc-act:title>
       Kontenrahmen SKR03
     </gnc-act:title>
     <gnc-act:short-description>
-      Standardkontenrahmen SKR03 alpha allg.
+      Standardkontenrahmen SKR03
     </gnc-act:short-description>
     <gnc-act:long-description>
-      Alpha-Version eines nicht vollständigen SKR03 mit relativ vielen Konten
+      Beta Version des Kontenrahmes SKR03 zum Erweitern und Umstrukturieren. Der Kontenrahmen sollte den eigenen Bedürfnissen angepasst werden was Struktur und Kontenbezeichnungen angeht. WICHTIG!: Die Privatkonten fließen nicht in die Berechnung des Berichtes Bilanz, sind jedoch im Bericht Bilanz aufgeführt. Die im Bericht Bilanz aufgeführte Passiva "Gewinnrücklagen" gibt den Saldo der GuV aus. Die Anlage dieses Kontenrahmens wurde von der Firma LiHAS - Linuxhaus Stuttgart - unterstützt.
     </gnc-act:long-description>
 <gnc-act:exclude-from-select-all>1</gnc-act:exclude-from-select-all>
 <gnc:account version="2.0.0">
   <act:name>Aktiva</act:name>
-  <act:id type="guid">c3e9d2cb51af856b5cd8fcde6d05b704</act:id>
+  <act:id type="guid">fc3b1f110a6686f3d40bb0c41c0f8de0</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -22,8 +22,8 @@
   <act:description>Aktiva</act:description>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Anlage u. Kapitalkonten 0</act:name>
-  <act:id type="guid">e2e9b85bb92351303776f0693fddc205</act:id>
+  <act:name>Anlage- u. Kapitalkonten 0</act:name>
+  <act:id type="guid">27356188a1963c1dbf943022441d095f</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -40,11 +40,11 @@
       <slot:value type="integer">1</slot:value>
     </slot>
   </act:slots>
-  <act:parent type="guid">c3e9d2cb51af856b5cd8fcde6d05b704</act:parent>
+  <act:parent type="guid">fc3b1f110a6686f3d40bb0c41c0f8de0</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>0027 EDV-Software</act:name>
-  <act:id type="guid">0d8d6d3f7328afa35b70a35afeb23cd8</act:id>
+  <act:id type="guid">8275e7a0b489940a2ba993f9019a898f</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -58,99 +58,71 @@
       <slot:value type="integer">1</slot:value>
     </slot>
   </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:parent type="guid">27356188a1963c1dbf943022441d095f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0090 Gesch&#228;ftsbauten</act:name>
-  <act:id type="guid">03a2a2f5e2f9ce02b3370ce5b1da6777</act:id>
+  <act:name>0410 Geschäftsausstattung</act:name>
+  <act:id type="guid">a588283077bd935dede66d13b2ee478f</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0090</act:code>
+  <act:code>0410</act:code>
   <act:slots>
     <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:key>tax-related</slot:key>
+      <slot:value type="integer">1</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:parent type="guid">27356188a1963c1dbf943022441d095f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0200 Tech. Anlagen und Maschinen</act:name>
-  <act:id type="guid">c696e41f7e625f0d1aaa571aaa63ff27</act:id>
+  <act:name>0420 Büroeinrichtung</act:name>
+  <act:id type="guid">573063d23b81fe3f9917d80fe6cc41e7</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0200</act:code>
+  <act:code>0420</act:code>
   <act:slots>
     <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:key>tax-related</slot:key>
+      <slot:value type="integer">1</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:parent type="guid">27356188a1963c1dbf943022441d095f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0210 Maschinen</act:name>
-  <act:id type="guid">e78eb3ebc1d52993a3cbf296629a77b2</act:id>
+  <act:name>0565 Dahrlehn</act:name>
+  <act:id type="guid">bd74fcb2d15fc7540ecc5ba8f27cbf48</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0210</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:code>0565</act:code>
+  <act:parent type="guid">27356188a1963c1dbf943022441d095f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0380 Sonst. Transportmittel</act:name>
-  <act:id type="guid">de3856b6163806012bc7a6e6bf05da6b</act:id>
+  <act:name>0210 Maschinen</act:name>
+  <act:id type="guid">904b262e6f84659046267cad87ac5e90</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0380</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:code>0210</act:code>
+  <act:parent type="guid">27356188a1963c1dbf943022441d095f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>0400 Betriebsausstattung</act:name>
-  <act:id type="guid">20ec7779960057114120047ecfc416bf</act:id>
+  <act:id type="guid">910d6c057660045a9958fb5a57ffc899</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -158,179 +130,88 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>0400</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:parent type="guid">27356188a1963c1dbf943022441d095f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0410 Gesch&#228;ftsausstattung</act:name>
-  <act:id type="guid">0e04b507455f116dc5b5f6d9bf87a70b</act:id>
+  <act:name>0430 Ladeneinrichtung</act:name>
+  <act:id type="guid">2876b41c069107076e7a18ec39bf4f9c</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0410</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-    <slot>
-      <slot:key>tax-related</slot:key>
-      <slot:value type="integer">1</slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>0420 B&#252;roeinrichtung</act:name>
-  <act:id type="guid">dfd2898915e4d2d63b56fb7bf3b655ab</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0420</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-    <slot>
-      <slot:key>tax-related</slot:key>
-      <slot:value type="integer">1</slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>0430 Ladeneinrchtung</act:name>
-  <act:id type="guid">6d12c0f0756c215427e5908c31831531</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
   <act:code>0430</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:parent type="guid">27356188a1963c1dbf943022441d095f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0440 Werkzeuge</act:name>
-  <act:id type="guid">60e5fb52538964e339d2ad0a21631c6a</act:id>
+  <act:name>Finanzkonten 1</act:name>
+  <act:id type="guid">1b13a7614b5e84b0778963995e20d897</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0440</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:parent type="guid">fc3b1f110a6686f3d40bb0c41c0f8de0</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0480 Geringwertige Wirtschaftsg. bis 410 Euro</act:name>
-  <act:id type="guid">cb1fc584da899369ff73d8cd025d35b4</act:id>
+  <act:name>1100 Postbank</act:name>
+  <act:id type="guid">9fe8d61dac9cf62b3f12e6c71a4385b2</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0480</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:code>1100</act:code>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0565 Dahrlehn</act:name>
-  <act:id type="guid">765400be7b46f5b08919117895c47cc7</act:id>
+  <act:name>1200 Bankkonto</act:name>
+  <act:id type="guid">875ec51cd332f3b75c15a2a9ca309ebd</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0565</act:code>
-  <act:parent type="guid">e2e9b85bb92351303776f0693fddc205</act:parent>
+  <act:code>1200</act:code>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Finanz u. Privatkonten 1</act:name>
-  <act:id type="guid">4b5b80fd8c0649d3982b3bba12e7258d</act:id>
+  <act:name>1590 Durchlaufende Posten</act:name>
+  <act:id type="guid">f048cb49a135a298d5df958a4c63ba22</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">true</slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">c3e9d2cb51af856b5cd8fcde6d05b704</act:parent>
+  <act:code>1590</act:code>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Abziehbare Vorsteuer</act:name>
-  <act:id type="guid">05806d56cf670d96a2eefbc50789ffe9</act:id>
+  <act:name>1371 Gewinnermittlung §4/3 nicht Ergebniswirksam</act:name>
+  <act:id type="guid">58c8b84a785d7feac255d381943076df</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:parent type="guid">4b5b80fd8c0649d3982b3bba12e7258d</act:parent>
+  <act:code>1371</act:code>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>1571 Abziehbare VSt. 7%</act:name>
-  <act:id type="guid">635b599a130b53d9cddc5528ce469029</act:id>
+  <act:id type="guid">7edc3c319713c53035b3e439ccec5e2b</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -338,11 +219,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1571</act:code>
-  <act:parent type="guid">05806d56cf670d96a2eefbc50789ffe9</act:parent>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>1575 Abziehbare VSt. 16%</act:name>
-  <act:id type="guid">ff9ce96b018e817bc502fd19be3a16da</act:id>
+  <act:id type="guid">507b25d5d47d57ba115929b70a32fa5e</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -350,11 +231,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1575</act:code>
-  <act:parent type="guid">05806d56cf670d96a2eefbc50789ffe9</act:parent>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1576 Abziehbare VStr. nach &#194;&#167;13b UStG 16%</act:name>
-  <act:id type="guid">397ca4b625da67d9077a8a77b25babce</act:id>
+  <act:name>1576 Abziehbare VStr. nach §13b UStG 16%</act:name>
+  <act:id type="guid">ac0fb64d0cfc2b88444527ce8c8682fe</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -362,32 +243,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1576</act:code>
-  <act:parent type="guid">05806d56cf670d96a2eefbc50789ffe9</act:parent>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Forderungen</act:name>
-  <act:id type="guid">fe6b59110039fe1f4fcdd7fc8bacf4e3</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">true</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">4b5b80fd8c0649d3982b3bba12e7258d</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>1400 Ford. a. Lieferungen und Leistungen</act:name>
-  <act:id type="guid">c1a294af9626250949b5bbd8989156ad</act:id>
+  <act:id type="guid">2fe36b4ddde053387e42aa893a94b91b</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -395,178 +255,40 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1400</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe6b59110039fe1f4fcdd7fc8bacf4e3</act:parent>
+  <act:parent type="guid">1b13a7614b5e84b0778963995e20d897</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1000 Kasse</act:name>
-  <act:id type="guid">7cee43f003b86dfdcce038096f6b51d2</act:id>
+  <act:name>Wareneingangs- u. Bestandskonten 3</act:name>
+  <act:id type="guid">a26df9927a82bcb58a1facb4cde6f221</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1000</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">4b5b80fd8c0649d3982b3bba12e7258d</act:parent>
+  <act:parent type="guid">fc3b1f110a6686f3d40bb0c41c0f8de0</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1100 Postbank</act:name>
-  <act:id type="guid">d40e98b74f39ab3072675867772cf370</act:id>
+  <act:name>3120 Leistungen §13b UStG 16% Vorsteuer, 16% Umsatzsteuer</act:name>
+  <act:id type="guid">39c180a4e3647d347ebc3e16e984372b</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1100</act:code>
-  <act:parent type="guid">4b5b80fd8c0649d3982b3bba12e7258d</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>1200 Bank</act:name>
-  <act:id type="guid">64a6b88a61535980d27369fb4dcaef73</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1200</act:code>
-  <act:parent type="guid">4b5b80fd8c0649d3982b3bba12e7258d</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>1590 Durchlaufende Posten</act:name>
-  <act:id type="guid">7e533a4fb3b79d86062c92b3490c3fe5</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1590</act:code>
-  <act:parent type="guid">4b5b80fd8c0649d3982b3bba12e7258d</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>Wareneingangs- und Bestandskonten 3</act:name>
-  <act:id type="guid">e33030ae758db9b6a3ce4defb8c458d5</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:parent type="guid">c3e9d2cb51af856b5cd8fcde6d05b704</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>3000 Roh-, Hilfs- u. Betriebsstoffe</act:name>
-  <act:id type="guid">7ba19127ad9b590caff84e09bb7fb48d</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>3000</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e33030ae758db9b6a3ce4defb8c458d5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>3090 Energiestoffe (Fert.)</act:name>
-  <act:id type="guid">8d9b3f35354427cf5fe68fee4efea188</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>3090</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e33030ae758db9b6a3ce4defb8c458d5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>3120 Leistungen &#167;13b UStG 16% Vorsteuer, 16% Umsatzsteuer</act:name>
-  <act:id type="guid">00f8eb9b6add747daae7934d424c1b6c</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
   <act:code>3120</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e33030ae758db9b6a3ce4defb8c458d5</act:parent>
+  <act:parent type="guid">a26df9927a82bcb58a1facb4cde6f221</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>3300 Wareneingang VSt. 7%</act:name>
-  <act:id type="guid">baed753f62f88e4a6e0a172aa1f9b1a2</act:id>
-  <act:type>ASSET</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>3300</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e33030ae758db9b6a3ce4defb8c458d5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>3400 Wareneingang VSt. 16%</act:name>
-  <act:id type="guid">2ea5196d25c707841fa7180f7fb02da6</act:id>
+  <act:id type="guid">01e4b246665a54d40466ba88f5d1d34e</act:id>
   <act:type>ASSET</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -580,11 +302,11 @@
       <slot:value type="integer">1</slot:value>
     </slot>
   </act:slots>
-  <act:parent type="guid">e33030ae758db9b6a3ce4defb8c458d5</act:parent>
+  <act:parent type="guid">a26df9927a82bcb58a1facb4cde6f221</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>Passiva</act:name>
-  <act:id type="guid">caeccc24b9818a798efe49173b4b871e</act:id>
+  <act:id type="guid">845b29bc14787bded30488e8d51eec0b</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -592,10 +314,16 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:description>Passiva</act:description>
+  <act:slots>
+    <slot>
+      <slot:key>placeholder</slot:key>
+      <slot:value type="string">true</slot:value>
+    </slot>
+  </act:slots>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>Umsatzsteuer</act:name>
-  <act:id type="guid">a3d059e9afb301a695400885b554c1e3</act:id>
+  <act:id type="guid">dea7f32e6a447d2d1cd7048932c98265</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -608,11 +336,11 @@
       <slot:value type="string">true</slot:value>
     </slot>
   </act:slots>
-  <act:parent type="guid">caeccc24b9818a798efe49173b4b871e</act:parent>
+  <act:parent type="guid">845b29bc14787bded30488e8d51eec0b</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>1771 Umsatzsteuer 7%</act:name>
-  <act:id type="guid">3401389dfb1956be5cca00030eb38891</act:id>
+  <act:id type="guid">d699c440f7817339d2fe60dd875520b6</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -620,21 +348,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1771</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">a3d059e9afb301a695400885b554c1e3</act:parent>
+  <act:parent type="guid">dea7f32e6a447d2d1cd7048932c98265</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>1775 Umsatzsteuer 16%</act:name>
-  <act:id type="guid">9f465d75df0f377cbc997540a970c1ad</act:id>
+  <act:id type="guid">55a2876edef147ed7631486de4af558c</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -642,11 +360,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1775</act:code>
-  <act:parent type="guid">a3d059e9afb301a695400885b554c1e3</act:parent>
+  <act:parent type="guid">dea7f32e6a447d2d1cd7048932c98265</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>1780 Umsatzsteuer-Vorauszahlung</act:name>
-  <act:id type="guid">235bc197d68e05f385f902bacee75d1d</act:id>
+  <act:id type="guid">4b5e1c2b17024a7721d0955c9f140dd6</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -654,11 +372,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1780</act:code>
-  <act:parent type="guid">a3d059e9afb301a695400885b554c1e3</act:parent>
+  <act:parent type="guid">dea7f32e6a447d2d1cd7048932c98265</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>1781 Umsatzsteuer-Vorauszahlung 1/11</act:name>
-  <act:id type="guid">5709612e10db36f4dc5666ba156d1ede</act:id>
+  <act:id type="guid">08793cd11dfca23d7b435a7338db02da</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -666,11 +384,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1781</act:code>
-  <act:parent type="guid">a3d059e9afb301a695400885b554c1e3</act:parent>
+  <act:parent type="guid">dea7f32e6a447d2d1cd7048932c98265</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1786 Umsatzsteuer &#167; 13b UStG 16%</act:name>
-  <act:id type="guid">665fe8fd2a2c2e42e3813dfbb3b301a6</act:id>
+  <act:name>1786 Umsatzsteuer § 13b UStG 16%</act:name>
+  <act:id type="guid">8e1583dfe60365b756f5365741250001</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -678,21 +396,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1786</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">a3d059e9afb301a695400885b554c1e3</act:parent>
+  <act:parent type="guid">dea7f32e6a447d2d1cd7048932c98265</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>1790 Umsatzsteuer Vorjahr</act:name>
-  <act:id type="guid">e8de87fddd36d0916ad25851ef2a84d9</act:id>
+  <act:id type="guid">635fe36261db8b9beda522420f564028</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -700,11 +408,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1790</act:code>
-  <act:parent type="guid">a3d059e9afb301a695400885b554c1e3</act:parent>
+  <act:parent type="guid">dea7f32e6a447d2d1cd7048932c98265</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1791 Umsatzsteuer fr&#252;here Jahre</act:name>
-  <act:id type="guid">4279dff926793bb4538e67b7ccbff49f</act:id>
+  <act:name>1791 Umsatzsteuer frühere Jahre</act:name>
+  <act:id type="guid">b2d79b416fee27d4d6a38643f6ad0d45</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -712,21 +420,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>1791</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">a3d059e9afb301a695400885b554c1e3</act:parent>
+  <act:parent type="guid">dea7f32e6a447d2d1cd7048932c98265</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>Verbindlichkeiten</act:name>
-  <act:id type="guid">c67a54c03377194e8c6f3cd972d625e8</act:id>
+  <act:id type="guid">a31fca8b7c5eb2cb0111f1f97696ac93</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -738,301 +436,128 @@
       <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">caeccc24b9818a798efe49173b4b871e</act:parent>
+  <act:parent type="guid">845b29bc14787bded30488e8d51eec0b</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>0631 Verbindl. geg. Kreditinst. - Restlaufzeit bis 1 Jahr</act:name>
-  <act:id type="guid">4c2a6c8bc25fe1eebf1ab0f6bc87ce59</act:id>
+  <act:name>1600 Verblk. aus Lieferungen u. Leistungen</act:name>
+  <act:id type="guid">1bf9f2675a36b278adcf6da68a7e4cbe</act:id>
   <act:type>LIABILITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0631</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">c67a54c03377194e8c6f3cd972d625e8</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>0640 Verbindl. geg. Kreditinst. - Restlaufzeit 1 bis 5 Jahre</act:name>
-  <act:id type="guid">680113bdfca1b11c7b60c29da340839c</act:id>
-  <act:type>LIABILITY</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0640</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">c67a54c03377194e8c6f3cd972d625e8</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>0650 Verbindl. geg. Kreditinst. - Restlaufzeit gr&#246;&#223;er als 5 Jahre</act:name>
-  <act:id type="guid">0fd7bfeba29ef6257849614e2e9b87fb</act:id>
-  <act:type>LIABILITY</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>0650</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">c67a54c03377194e8c6f3cd972d625e8</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>1600 Verbindli. Lief. u. Leistungen</act:name>
-  <act:id type="guid">5e785d84355c8c7d5b14ff6f26fe5133</act:id>
-  <act:type>LIABILITY</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
   <act:code>1600</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">c67a54c03377194e8c6f3cd972d625e8</act:parent>
+  <act:parent type="guid">a31fca8b7c5eb2cb0111f1f97696ac93</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1605 Verbindl. a. LuL z. allg. Umsatzsteuersatz (E&#220;R)</act:name>
-  <act:id type="guid">2a3bab7d7db764c435fb9b2f2459f295</act:id>
-  <act:type>LIABILITY</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1605</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">c67a54c03377194e8c6f3cd972d625e8</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>1606 Verbindl. a. LuL z. erm. Umsatzsteuersatz</act:name>
-  <act:id type="guid">48d70d0bcec45049ceed70077f474e50</act:id>
-  <act:type>LIABILITY</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1606</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">c67a54c03377194e8c6f3cd972d625e8</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>Erl&#246;skonten 26/8</act:name>
-  <act:id type="guid">633c73003e9120caebb3e1eebc7e2c60</act:id>
+  <act:name>Erlöse u. Erträge 2/8</act:name>
+  <act:id type="guid">3f31fc649f19b5201f22f7648c3f7107</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:description>Erfolgskonto Ertr&#228;ge</act:description>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2600 Ertr&#228;ge aus Beteiligunen</act:name>
-  <act:id type="guid">8e0c69216a78e845a97b732496b962ce</act:id>
+  <act:name>Erlöskonten 8</act:name>
+  <act:id type="guid">fd04e181ab83b37b80a4609b0806e954</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2600</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
+  <act:parent type="guid">3f31fc649f19b5201f22f7648c3f7107</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2650 sonstige Zinsen und &#228;hnliche Ertr&#228;ge</act:name>
-  <act:id type="guid">b6ff9b9ab07cde4dc9942387267cb941</act:id>
+  <act:name>8400 Erlöse USt. 16%</act:name>
+  <act:id type="guid">d75d796e879b0ad9b2732d698ae9e838</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2650</act:code>
+  <act:code>8400</act:code>
   <act:slots>
     <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:key>tax-related</slot:key>
+      <slot:value type="integer">1</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
+  <act:parent type="guid">fd04e181ab83b37b80a4609b0806e954</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2657 Zinsertr&#228;ge-betriebl. Steuern</act:name>
-  <act:id type="guid">a93010d68960a28b972763a6904292a1</act:id>
+  <act:name>8300 Erlöse USt. 7%</act:name>
+  <act:id type="guid">0c82316c2aecaa02ce1b4ecb223f6f5d</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2657</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
+  <act:code>8300</act:code>
+  <act:parent type="guid">fd04e181ab83b37b80a4609b0806e954</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2660 Ertr&#228;ge aus Kursdifferenzen</act:name>
-  <act:id type="guid">fe0eb06f6f2d3dd028ea20efd8c316a0</act:id>
+  <act:name>Ertragskonten 2</act:name>
+  <act:id type="guid">4f552b822559c82eaa816d0049f70064</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2660</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
+  <act:parent type="guid">3f31fc649f19b5201f22f7648c3f7107</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2670 Diskontertr&#228;ge</act:name>
-  <act:id type="guid">0fa37d8e8489f32489640e3df6111f44</act:id>
+  <act:name>2650 sonstige Zinsen und ähnliche Erträge</act:name>
+  <act:id type="guid">cc08ab7c747853f5f7ea6b384fdd8b4d</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2670</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
+  <act:code>2650</act:code>
+  <act:parent type="guid">4f552b822559c82eaa816d0049f70064</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2680 Zins&#228;hnliche Ertr&#228;ge</act:name>
-  <act:id type="guid">0bdd1473af64d651f8af46a00a0b4918</act:id>
+  <act:name>2500 Außerordentliche Erträge</act:name>
+  <act:id type="guid">5634359999c43ba58697553d1d905c4c</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2680</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
+  <act:code>2500</act:code>
+  <act:parent type="guid">4f552b822559c82eaa816d0049f70064</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2700 Sonstige Ertr&#228;ge</act:name>
-  <act:id type="guid">d6ee5e0b77a3bfa07b696876443fa0dc</act:id>
+  <act:name>2700 Sonstige Erträge</act:name>
+  <act:id type="guid">067716095fef7e694a2e0c40f1eaaefd</act:id>
   <act:type>INCOME</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1040,178 +565,27 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>2700</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
+  <act:parent type="guid">4f552b822559c82eaa816d0049f70064</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2750 Grundst&#252;cksertr&#228;ge</act:name>
-  <act:id type="guid">07a8ec00558eb91eae7d5dbab55f1a6d</act:id>
-  <act:type>INCOME</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2750</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>8200 Erl&#246;se</act:name>
-  <act:id type="guid">e77e26756c652bdfb573385f84bbb975</act:id>
-  <act:type>INCOME</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>8200</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>8300 Erl&#246;se 7% USt.</act:name>
-  <act:id type="guid">d3d5aa0c27a4a8eb35de841423d70458</act:id>
-  <act:type>INCOME</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>8300</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>8400 Erl&#246;se USt. 16%</act:name>
-  <act:id type="guid">65633b6058c5aa2da2748427a6edbcdc</act:id>
-  <act:type>INCOME</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>8400</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-    <slot>
-      <slot:key>tax-related</slot:key>
-      <slot:value type="integer">1</slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>8600 Sonstige Erl&#246;se betreibl. u. regalm&#228;&#223;ig</act:name>
-  <act:id type="guid">d3ad31f7930e4c95c21ae72b7e5d3c49</act:id>
-  <act:type>INCOME</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>8600</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>8800 Erl&#246;se aus Anlagenverk&#228;ufen</act:name>
-  <act:id type="guid">18d64cc360632bdb85aa1719e70a5d20</act:id>
-  <act:type>INCOME</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>8800</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">633c73003e9120caebb3e1eebc7e2c60</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>betriebliche Aufwendungen 2/4</act:name>
-  <act:id type="guid">e9490706606134bbd40d9d010a276746</act:id>
+  <act:name>Aufwendungen 2/4</act:name>
+  <act:id type="guid">be324e400d3b67510f89afd18de776e3</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:description>Erfolgskonto Aufwendungen</act:description>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>20 Au&#223;erordentliche Aufwendungen</act:name>
-  <act:id type="guid">931bdec43029b8dc311e0060f4caa1e2</act:id>
+  <act:name>Abschreibungen</act:name>
+  <act:id type="guid">ad3f063a8200c1faa0331e2d9eb3ae04</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1223,235 +597,113 @@
       <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2000 au&#223;erordentliche Aufwendungen</act:name>
-  <act:id type="guid">9643b081bfd27af8a9b5a4bc9ff24178</act:id>
+  <act:name>4855 Sofortabschreibung GWG</act:name>
+  <act:id type="guid">cf214c888424ce036704bd526650a4c1</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2000</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">931bdec43029b8dc311e0060f4caa1e2</act:parent>
+  <act:code>4855</act:code>
+  <act:parent type="guid">ad3f063a8200c1faa0331e2d9eb3ae04</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2010 Betriebsfremde Aufwendungen (soweit . au&#223;erord.)</act:name>
-  <act:id type="guid">e1cd5c9443183fccb26860ae15fb6655</act:id>
+  <act:name>Kfz-Kosten</act:name>
+  <act:id type="guid">8488954a5834d5484ed57439a0d43305</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2010</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">931bdec43029b8dc311e0060f4caa1e2</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>2020 Periodenfremde Aufwend. (soweit n. au&#223;erordentl.)</act:name>
-  <act:id type="guid">63dd8bcf63e2643078047aef87b7c94e</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2020</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">931bdec43029b8dc311e0060f4caa1e2</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>21 Zinsen</act:name>
-  <act:id type="guid">d47d8bf1db8229e2533aa9d82751dc7e</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2100 Zinsen und &#228;hnl. Aufwendungen</act:name>
-  <act:id type="guid">fb9792373cfb520942700505ac79860e</act:id>
+  <act:name>4510 Kfz-Steuer</act:name>
+  <act:id type="guid">4355e4bceaa024b71efb3223ac6576c0</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2100</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">d47d8bf1db8229e2533aa9d82751dc7e</act:parent>
+  <act:code>4510</act:code>
+  <act:parent type="guid">8488954a5834d5484ed57439a0d43305</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2107 Zinsaufwendung-betriebl. Steuern &#167;223aAO</act:name>
-  <act:id type="guid">1c739c342d14384c73d8bc478a24249c</act:id>
+  <act:name>4520 Kfz-Versicherungen</act:name>
+  <act:id type="guid">4395e7b49fc7d34db620e6249836d747</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2107</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">d47d8bf1db8229e2533aa9d82751dc7e</act:parent>
+  <act:code>4520</act:code>
+  <act:parent type="guid">8488954a5834d5484ed57439a0d43305</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2110 Zinsaufwendungen f&#252;r kurzfr. Verbindlichkeiten</act:name>
-  <act:id type="guid">96c06fb2953315457bcd4ab72aa01f7d</act:id>
+  <act:name>4530 laufende Kfz-Betriebskosten</act:name>
+  <act:id type="guid">9bcbd663916f135d81b8eff6dc8b8819</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2110</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">d47d8bf1db8229e2533aa9d82751dc7e</act:parent>
+  <act:code>4530</act:code>
+  <act:parent type="guid">8488954a5834d5484ed57439a0d43305</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2120 Zinsaufwendungen f. langf. Verbindl.</act:name>
-  <act:id type="guid">8e945eb01951079ce978598f72d5687a</act:id>
+  <act:name>4540 Kfz-Reparaturen</act:name>
+  <act:id type="guid">5359164e661dd33c4bdb98b5149b07d1</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2120</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">d47d8bf1db8229e2533aa9d82751dc7e</act:parent>
+  <act:code>4540</act:code>
+  <act:parent type="guid">8488954a5834d5484ed57439a0d43305</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2121 Zinsaufwendungen f&#252;r Finanzierung</act:name>
-  <act:id type="guid">0b1810b482012f63db8ae1a99c6d1cde</act:id>
+  <act:name>4570 Fremdfahrzeuge</act:name>
+  <act:id type="guid">3b92417001893aa765edaa7109b2d48a</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2121</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">d47d8bf1db8229e2533aa9d82751dc7e</act:parent>
+  <act:code>4570</act:code>
+  <act:parent type="guid">8488954a5834d5484ed57439a0d43305</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>2125 Zinsaufwenden f. Geb&#228;ude, die z. Betriebsverm. geh&#246;ren</act:name>
-  <act:id type="guid">20d25b99f835812b0792fb687ce1be13</act:id>
+  <act:name>4580 sonstige Kfz-Kosten</act:name>
+  <act:id type="guid">e4c3ff3a921558869191a648aeb9b0e3</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>2125</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">d47d8bf1db8229e2533aa9d82751dc7e</act:parent>
+  <act:code>4580</act:code>
+  <act:parent type="guid">8488954a5834d5484ed57439a0d43305</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>41 Personalkosten</act:name>
-  <act:id type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:id>
+  <act:name>Personalkosten</act:name>
+  <act:id type="guid">43953979cf408743814cb6887d5ec022</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1463,126 +715,24 @@
       <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4110 L&#246;hne</act:name>
-  <act:id type="guid">4c873ca5041aa34af0969e185decbb5c</act:id>
+  <act:name>4120 Gehälter</act:name>
+  <act:id type="guid">8f21199517fcfd70ad2ad6aaa3e714b6</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4110</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4120 Geh&#228;lter</act:name>
-  <act:id type="guid">174391313c40c56ef0ead182ceeb8f36</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
   <act:code>4120</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
+  <act:parent type="guid">43953979cf408743814cb6887d5ec022</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4125 Ehegattengehalt</act:name>
-  <act:id type="guid">67811422f39330a7c78525c127b4a548</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4125</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4126 Tantiemen</act:name>
-  <act:id type="guid">15aba38f05735a26e6db6c6e68ab1201</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4126</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4127 Gesch&#228;ftsf&#252;hrergeh&#228;lter</act:name>
-  <act:id type="guid">182ca5671422c16f52deff3c86d9cd85</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4127</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>4130 gesetzliche soziale Aufwendungen</act:name>
-  <act:id type="guid">e7b8073e4a1f06476b8725c6b9137c66</act:id>
+  <act:id type="guid">46ba645d075b6a1f3a38824d812f8818</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1590,11 +740,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4130</act:code>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
+  <act:parent type="guid">43953979cf408743814cb6887d5ec022</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4165 Aufwendungen f&#252;r Altersvorsorge</act:name>
-  <act:id type="guid">39d7cf1dda72c892c9f66dea9d554447</act:id>
+  <act:name>4165 Aufwendungen für Altersvorsorge</act:name>
+  <act:id type="guid">e89eafba1acc736a7ba74882a7f8c836</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1602,21 +752,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4165</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
+  <act:parent type="guid">43953979cf408743814cb6887d5ec022</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4170 Verm&#246;genswirksame Leistungen</act:name>
-  <act:id type="guid">9ffd7d56af5adf2f9e4aac3f7c3f04af</act:id>
+  <act:name>4170 Vermögenswirksame Leistungen</act:name>
+  <act:id type="guid">88bc69e1ff8977cd70c52567dde8107d</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1624,21 +764,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4170</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
+  <act:parent type="guid">43953979cf408743814cb6887d5ec022</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4190 Aushilfsl&#246;hne</act:name>
-  <act:id type="guid">e69fb020c1e9b89ac85aae42c357c05d</act:id>
+  <act:name>4190 Aushilfslöhne</act:name>
+  <act:id type="guid">d74350b9ad5583b533fd906ec837d9fe</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1646,86 +776,28 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4190</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
+  <act:parent type="guid">43953979cf408743814cb6887d5ec022</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4199 Lohnsteuer f&#252;r Aushilfen</act:name>
-  <act:id type="guid">ce2b5b5ce664ffeb57dea687f0dbaaa0</act:id>
+  <act:name>Raumkosten</act:name>
+  <act:id type="guid">9adef6f318a931fbb8519a823e2c20e8</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4199</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">9390cb3c25b3d0e1d419291b9a0c06a2</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>42 Raumkosten</act:name>
-  <act:id type="guid">cfc8034a196524419255c1ab9636f43d</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4200 Raumkosten</act:name>
-  <act:id type="guid">8c266f1f9f5946e9724e86f9d08ae155</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4200</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>4210 Miete und Nebenkosten</act:name>
-  <act:id type="guid">9cb27fcec125db10f8768257f57cde09</act:id>
+  <act:id type="guid">b6e84a2fcf1754f1f6f1f71913f03a1d</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1733,55 +805,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4210</act:code>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
+  <act:parent type="guid">9adef6f318a931fbb8519a823e2c20e8</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4220 Pacht</act:name>
-  <act:id type="guid">b32a00325c0058a3d7f82f2d3b451335</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4220</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4230 Heizung</act:name>
-  <act:id type="guid">b860bc5ddee580c464d06dae5766ef18</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4230</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>4240 Gas, Wasser, Strom (Verwaltung, Vertrieb)</act:name>
-  <act:id type="guid">aba35089b8810db823aa270492b31d98</act:id>
+  <act:id type="guid">d41823e7c279286dd74c6ec757dcb305</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1789,11 +817,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4240</act:code>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
+  <act:parent type="guid">9adef6f318a931fbb8519a823e2c20e8</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>4250 Reinigung</act:name>
-  <act:id type="guid">a743360e77143cca0bcf326ad9433e0e</act:id>
+  <act:id type="guid">db313359a146b610ce80a36dde18bf01</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1801,55 +829,40 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4250</act:code>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
+  <act:parent type="guid">9adef6f318a931fbb8519a823e2c20e8</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4260 Instandhaltung betriebl. R&#228;ume</act:name>
-  <act:id type="guid">75648dcc2b4e0c0bcd111d3409d4c2d8</act:id>
+  <act:name>Reparatur/Instandhaltung</act:name>
+  <act:id type="guid">accaec28a4afcf3c82570da4c9343c2d</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4260</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4280 Sonstige Raumkosten</act:name>
-  <act:id type="guid">0c323b882bfd5936a3fc39d11bd630b9</act:id>
+  <act:name>4805 Reparatur u. Instandh. von Anlagen/Maschinen u. Betriebs- u. Geschäftsausst.</act:name>
+  <act:id type="guid">b5d6461bb3028d13faa8bee2981925a1</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4280</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">cfc8034a196524419255c1ab9636f43d</act:parent>
+  <act:code>4805</act:code>
+  <act:parent type="guid">accaec28a4afcf3c82570da4c9343c2d</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>43 Versicherungen/Beitr&#228;ge/Steuern/Sonstige Ausgaben</act:name>
-  <act:id type="guid">3538f04e96238eb452b5891249f272af</act:id>
+  <act:name>Versicherungsbeiträge</act:name>
+  <act:id type="guid">709bf14d69164a6c2a48e6c0e13ece37</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1861,16 +874,12 @@
       <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>4360 Versicherungen</act:name>
-  <act:id type="guid">134b276f65693dd1c468b0edc3a7b8d7</act:id>
+  <act:id type="guid">7484251f3d5fc7ec71419b2fba733a78</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1878,11 +887,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4360</act:code>
-  <act:parent type="guid">3538f04e96238eb452b5891249f272af</act:parent>
+  <act:parent type="guid">709bf14d69164a6c2a48e6c0e13ece37</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4380 Beitr&#228;ge</act:name>
-  <act:id type="guid">89a2b2eade7d98d333a98c31d0f9dd7e</act:id>
+  <act:name>4380 Beiträge</act:name>
+  <act:id type="guid">f2b1ad75fd3b7fc4473972a9c2675cbf</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1890,21 +899,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4380</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">3538f04e96238eb452b5891249f272af</act:parent>
+  <act:parent type="guid">709bf14d69164a6c2a48e6c0e13ece37</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>4390 sonstige Ausgaben</act:name>
-  <act:id type="guid">d42da1bdc3e58034647ac294aad509f3</act:id>
+  <act:id type="guid">a2d552e480b95123e90be434b3ac9653</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1912,11 +911,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4390</act:code>
-  <act:parent type="guid">3538f04e96238eb452b5891249f272af</act:parent>
+  <act:parent type="guid">709bf14d69164a6c2a48e6c0e13ece37</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4396 steuerlich abzugsf&#228;hige Versp&#228;tungszuschl&#228;ge und Zwandsgelder</act:name>
-  <act:id type="guid">0d644e40814115dcd0678662e67536be</act:id>
+  <act:name>4396 steuerlich abzugsfähige Verspätungszuschläge und Zwandsgelder</act:name>
+  <act:id type="guid">0c73c5dc5e72bb4962b83ddc85991101</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1924,21 +923,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4396</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">3538f04e96238eb452b5891249f272af</act:parent>
+  <act:parent type="guid">709bf14d69164a6c2a48e6c0e13ece37</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>45 Kfz-Kosten</act:name>
-  <act:id type="guid">b00e7c59c9febf82aaa846991b89ec78</act:id>
+  <act:name>Werbe-/Reisekosten</act:name>
+  <act:id type="guid">a657ade965a1429d44d830d3832bf9aa</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -1950,175 +939,12 @@
       <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4500 Fahrzeugkosten</act:name>
-  <act:id type="guid">ef3be8ea5244b1b7df25375888b75441</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4500</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4510 Kfz-Steuer</act:name>
-  <act:id type="guid">c56712faf2570357c65db9c76e95eb99</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4510</act:code>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4520 Kfz-Versicherungen</act:name>
-  <act:id type="guid">bb95498eccf54627c35d2f5512b83786</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4520</act:code>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4530 laufende Kfz-Betriebskosten</act:name>
-  <act:id type="guid">cdb3e39478c71e2d8ab8dce5c7b4ad50</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4530</act:code>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4540 Kfz-Reparaturen</act:name>
-  <act:id type="guid">52d0181de7dab5222f13441f0b6d8afe</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4540</act:code>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4550 Garagenmiete</act:name>
-  <act:id type="guid">e627bd140c8e88b424ca092977321600</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4550</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4570 Frendfahrzeuge</act:name>
-  <act:id type="guid">058a0613f6db81e289dfcdedfc5c7cd3</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4570</act:code>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4580 sonstige Kfz-Kosten</act:name>
-  <act:id type="guid">f92944d503e8eb51d1cebe339cf3de91</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4580</act:code>
-  <act:parent type="guid">b00e7c59c9febf82aaa846991b89ec78</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>46 Werbe-/Reisekosten</act:name>
-  <act:id type="guid">fe902486a9d04119d724a7e21d018b9c</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">true</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4600 Werbe- u. Reisekosten</act:name>
-  <act:id type="guid">b6d0b77c7b1a016990c562ff8625b8e3</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4600</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>4610 Werbekosten</act:name>
-  <act:id type="guid">b65e5e6a1894233f576f9148b337dc5a</act:id>
+  <act:id type="guid">2d90f835fcb74d7a77b4a2a2b40c777a</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2126,99 +952,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4610</act:code>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
+  <act:parent type="guid">a657ade965a1429d44d830d3832bf9aa</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4630 Geschenke bis 35 Euro abzugsf&#228;hig</act:name>
-  <act:id type="guid">f0dd2c6203b1b42db1c8fae8ad416fd9</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4630</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4635 Geschenke &#252;ber 35 Euro nicht abzugsf.</act:name>
-  <act:id type="guid">3fe2c81aa6b09df860a0fe7586a49820</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4635</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4640 Repr&#228;sentationskosten</act:name>
-  <act:id type="guid">a115fc8b9a4e9f894987bc697048a945</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4640</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4650 Bewirtungskosten</act:name>
-  <act:id type="guid">40d2f673ead25815fdba786f7d3b4b37</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4650</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>4653 Aufmerksamkeiten</act:name>
-  <act:id type="guid">21a06c0b16c9fb364776ead4592275de</act:id>
+  <act:id type="guid">790770c5f93cff7d585bca1627446716</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2226,77 +964,23 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4653</act:code>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
+  <act:parent type="guid">a657ade965a1429d44d830d3832bf9aa</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4654 nicht abzugsf. Bewirtungskosten</act:name>
-  <act:id type="guid">d38c448d3925850e22e02ccd809f0c0a</act:id>
+  <act:name>4665 nicht abzugsfähige Betriebsausg. aus Werbe-, Repräs.- u. Reisekosten</act:name>
+  <act:id type="guid">235a6225c2c7d2ffa865345e78cae283</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4654</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4660 Reisekosten Arbeitnehmer</act:name>
-  <act:id type="guid">1c1d11f6b35e9e9ccfd5e23a50a47d1b</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4660</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4665 nicht abzugsf&#228;hige Betriebsausg. aus Werbe-, Repr&#228;s.- u. Riesekosten</act:name>
-  <act:id type="guid">65c19851a3d6a2e44364bc068dd4f45b</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
   <act:code>4665</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
+  <act:parent type="guid">a657ade965a1429d44d830d3832bf9aa</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>4670 Reisekosten Unernehmer</act:name>
-  <act:id type="guid">e4e6b10271cc52a5a7b56e12e537ef31</act:id>
+  <act:id type="guid">dda3ae53573975cd05fab1d3cdf40806</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2304,393 +988,28 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4670</act:code>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
+  <act:parent type="guid">a657ade965a1429d44d830d3832bf9aa</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4676 Reisekosten Untern. &#220;bernachtungsaufw.</act:name>
-  <act:id type="guid">0134f2b9e3c5f2ef748ee00f292b0d26</act:id>
+  <act:name>verschiedene Kosten</act:name>
+  <act:id type="guid">d0c00095e4b00f9f25253307be05e885</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4676</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4678 Kilometergelderstatt. (Wohn.-Arbeitsst.abziehb.Teil)</act:name>
-  <act:id type="guid">3f11e669a2f604c060bed83fc449b278</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4678</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4679 Fahrten zw. Wohn- u. Arbeitsst&#228;tte (nicht abziehb.Teil)</act:name>
-  <act:id type="guid">1562e90f0bb40af762251c12ef744d98</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4679</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">fe902486a9d04119d724a7e21d018b9c</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>47 Kosten Warenabgabe</act:name>
-  <act:id type="guid">19df2cdbfe931cbf239926edd338abf5</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
       <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4700 Kosten der Warenabgabe</act:name>
-  <act:id type="guid">22366b48ec4d671ce84850b5791ba2c5</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4700</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">19df2cdbfe931cbf239926edd338abf5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4710 Verpackungsmaterial</act:name>
-  <act:id type="guid">137ce08e9d4443361942809b5d968dd0</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4710</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">19df2cdbfe931cbf239926edd338abf5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4730 Ausgangsfracht</act:name>
-  <act:id type="guid">dfc21ba82f3248eb702b4b18ce75532b</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4730</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">19df2cdbfe931cbf239926edd338abf5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4750 Transportversicherung</act:name>
-  <act:id type="guid">49b51ddf0e666aba43c2771065650eef</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4750</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">19df2cdbfe931cbf239926edd338abf5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4790 Aufwand f&#252;r Gew&#228;hrleistung</act:name>
-  <act:id type="guid">395f2ca1dbb3afd3244e37c02afcae74</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4790</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">19df2cdbfe931cbf239926edd338abf5</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>48 Abschreibungen</act:name>
-  <act:id type="guid">2ce95687c834a53309dd8bb4b83896bd</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">true</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4855 Sofortabschreibung GWG</act:name>
-  <act:id type="guid">70d40d23a2578ec7edfe18d39e58b0c3</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4855</act:code>
-  <act:parent type="guid">2ce95687c834a53309dd8bb4b83896bd</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4860 Abschreibungen auf aktivierte GWG</act:name>
-  <act:id type="guid">39bf3606782053117009dc552dae1467</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4860</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">2ce95687c834a53309dd8bb4b83896bd</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4870 Abschreibungen auf Finanzanlagen</act:name>
-  <act:id type="guid">ae81be20a419bc9f8eecf2decd621ec4</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4870</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">2ce95687c834a53309dd8bb4b83896bd</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>48 Reparatur/Instandhaltung</act:name>
-  <act:id type="guid">a0c8478748ac62d9ab83f0d2dd3e3447</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">true</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4805 Reparatur u. Instandh. von Anlagen/Maschinen u. Betriebs- u. Gesch&#228;ftsausst.</act:name>
-  <act:id type="guid">807baaf9d3feaf3fc9c6156373b18f61</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4805</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">a0c8478748ac62d9ab83f0d2dd3e3447</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>49 verschiedene Kosten</act:name>
-  <act:id type="guid">ea43a932bb71ff1b4e61530363e20a11</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">true</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">e9490706606134bbd40d9d010a276746</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4905 Sonst. Aufw. betriebl. und regelm&#228;&#223;ig</act:name>
-  <act:id type="guid">e74ac88619e4f8f458fc4815492d5cb2</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4905</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>4909 Fremdleistungen</act:name>
-  <act:id type="guid">2062c2b58d7cae79fa76e9fb4736fd43</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4909</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
   <act:name>4910 Porto</act:name>
-  <act:id type="guid">5416949778f2f8e6f1f291b4fcb74152</act:id>
+  <act:id type="guid">b84666b6b2d17f4be4a2cc15e595b30d</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2698,11 +1017,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4910</act:code>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>4920 Telekom</act:name>
-  <act:id type="guid">ff173d035f04b7b31530385cfd10c113</act:id>
+  <act:id type="guid">892bb0974aa6c422f63b5df5354e8f7f</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2710,11 +1029,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4920</act:code>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>4921 Mobilfunk D2</act:name>
-  <act:id type="guid">43b58170435cabd592b83a0fe7fdd756</act:id>
+  <act:id type="guid">20a13b07d90c5b385e78190525439aa2</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2722,11 +1041,11 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4921</act:code>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
   <act:name>4922 Internet</act:name>
-  <act:id type="guid">641c002a3040e5aadeb759ba48467d51</act:id>
+  <act:id type="guid">4d57d9103ab150ad4f01bc7a918fd0cc</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2734,255 +1053,153 @@
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
   <act:code>4922</act:code>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4925 Telefax</act:name>
-  <act:id type="guid">5e746bc740988ab2fbe4ef7ed728e7e7</act:id>
+  <act:name>4930 Bürobedarf</act:name>
+  <act:id type="guid">ac4d7c452835096c373f1a94dc3104f4</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4925</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>4930</act:code>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4930 B&#252;robedarf</act:name>
-  <act:id type="guid">35613de8b2b2fdbd2671f916e523cdff</act:id>
+  <act:name>4940 Zeitschriften, Bücher</act:name>
+  <act:id type="guid">1bac306450e7bc0619e42c11ab791204</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4930</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>4940</act:code>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4940 Zeitschriften, B&#252;cher</act:name>
-  <act:id type="guid">2f8f83038e41d0f6ab785d2e644023ee</act:id>
+  <act:name>4945 Fortbildungskosten</act:name>
+  <act:id type="guid">6be35acc206b144ee23c07086bc7a856</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4940</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>4945</act:code>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4945 Fortbildungskosten</act:name>
-  <act:id type="guid">97deccc16af068166391ac76c08e6fae</act:id>
+  <act:name>4955 Buchführungskosten</act:name>
+  <act:id type="guid">25afa584627e0c0e8681bd8a82a77d14</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4945</act:code>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>4955</act:code>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4950 Rechts- u. Beratungskosten</act:name>
-  <act:id type="guid">4d2d4b34edf056daabb53e99b97c74a8</act:id>
+  <act:name>4957 Abschluß- u. Prüfungskosten</act:name>
+  <act:id type="guid">bf093094a55c036a193357ebcafcab67</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4950</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>4957</act:code>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4955 Buchf&#252;hrungskosten</act:name>
-  <act:id type="guid">d0ea7caf66a4ac31d5e9e5e424a85928</act:id>
+  <act:name>4970 Nebenkosten des Geldverkehrs</act:name>
+  <act:id type="guid">4f476c9b65684d56630db45690b9d4fc</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4955</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>4970</act:code>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4957 Abschlu&#223;- u. Pr&#252;fungskosten</act:name>
-  <act:id type="guid">23279a8dc7af902ad4da791cb3d3ad82</act:id>
+  <act:name>4985 Werkzeuge und Kleingeräte</act:name>
+  <act:id type="guid">a5b36148c3fc06080973a5d25f28225b</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4957</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>4985</act:code>
+  <act:parent type="guid">d0c00095e4b00f9f25253307be05e885</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4960 Mieten f&#252;r Einrichtungen</act:name>
-  <act:id type="guid">f163fb4bd61c4f0504ea335b7f4eaff3</act:id>
+  <act:name>Zinsaufwendungen</act:name>
+  <act:id type="guid">8d2641f8bbc41aa863274bb496002f3e</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4960</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:parent type="guid">be324e400d3b67510f89afd18de776e3</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4970 Nebenkosten des Geldverkehrs</act:name>
-  <act:id type="guid">42005e431d0773b0e398c6753f10f8a4</act:id>
+  <act:name>2110 Zinsaufwendungen für kurzfristige Verbindlichkeiten</act:name>
+  <act:id type="guid">2d20e36f8abb4e366c8e3e2783bdafab</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4970</act:code>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>2110</act:code>
+  <act:parent type="guid">8d2641f8bbc41aa863274bb496002f3e</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4980 Betriebsbedarf</act:name>
-  <act:id type="guid">ad84142e46c3aef4bf82eff774261b9a</act:id>
+  <act:name>2121 Zinsaufwendungen für KFZ Finanzierung</act:name>
+  <act:id type="guid">17651501792b93b06832634462ddddae</act:id>
   <act:type>EXPENSE</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4980</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
+  <act:code>2121</act:code>
+  <act:parent type="guid">8d2641f8bbc41aa863274bb496002f3e</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4985 Werkzeuge und Kleinger&#228;te</act:name>
-  <act:id type="guid">44d886bd8e1c058810673c768f89b5d9</act:id>
-  <act:type>EXPENSE</act:type>
+  <act:name>Anfangsbestand 9</act:name>
+  <act:id type="guid">2d4eb2e0ef3bab0ac50b87c84babcf5d</act:id>
+  <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4985</act:code>
+  <act:description>Saldenvortragskonten</act:description>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>4990 Kalkulatorischer Unternehmerlohn</act:name>
-  <act:id type="guid">f8f2c5dc02029f7f5e5cd15bc810eda6</act:id>
-  <act:type>EXPENSE</act:type>
-  <act:commodity>
-    <cmdty:space>ISO4217</cmdty:space>
-    <cmdty:id>EUR</cmdty:id>
-  </act:commodity>
-  <act:commodity-scu>100</act:commodity-scu>
-  <act:code>4990</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">ea43a932bb71ff1b4e61530363e20a11</act:parent>
-</gnc:account>
-<gnc:account version="2.0.0">
-  <act:name>Privatkonten</act:name>
-  <act:id type="guid">997a2671d83b4b252f7542f6dc5cd847</act:id>
+  <act:name>Saldenvortragskonten</act:name>
+  <act:id type="guid">26c3f10c1c7621661c1b813d6141280d</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
@@ -2995,216 +1212,148 @@
       <slot:value type="string">true</slot:value>
     </slot>
   </act:slots>
+  <act:parent type="guid">2d4eb2e0ef3bab0ac50b87c84babcf5d</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1800 Privatentnahme allgemein</act:name>
-  <act:id type="guid">55281d17fb566b575b727ee6e8f1ec7e</act:id>
+  <act:name>9000 Saldenvortrag Sachkonten</act:name>
+  <act:id type="guid">fa346eee1add66248bff420aafeebebb</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1800</act:code>
-  <act:parent type="guid">997a2671d83b4b252f7542f6dc5cd847</act:parent>
+  <act:code>9000</act:code>
+  <act:parent type="guid">26c3f10c1c7621661c1b813d6141280d</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1810 Privatsteuern</act:name>
-  <act:id type="guid">afa1e85d38cf2445b0f1daecd086f6ef</act:id>
+  <act:name>9008 Saldenvorträge Debitoren</act:name>
+  <act:id type="guid">1f36ecbf065faa2b25a0749ceee72efa</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1810</act:code>
-  <act:parent type="guid">997a2671d83b4b252f7542f6dc5cd847</act:parent>
+  <act:code>9008</act:code>
+  <act:parent type="guid">26c3f10c1c7621661c1b813d6141280d</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1820 Sonderausgaben beschr&#228;nkt abzugsf&#228;hig</act:name>
-  <act:id type="guid">ce4de668631a2db9f0d6368c7972ffa8</act:id>
+  <act:name>9009 Saldenvorträge Kreditoren</act:name>
+  <act:id type="guid">a6c754f12d0b9129790d9f52c5361778</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1820</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">997a2671d83b4b252f7542f6dc5cd847</act:parent>
+  <act:code>9009</act:code>
+  <act:parent type="guid">26c3f10c1c7621661c1b813d6141280d</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1830 Sonderausgaben ungeschr&#228;nkt abzugsf&#228;hig</act:name>
-  <act:id type="guid">ba5a5fb54e925708f5c711ae9e4d4407</act:id>
+  <act:name>Privatkonten 1</act:name>
+  <act:id type="guid">1888a7d2fbbdede8446090a31651565f</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1830</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">997a2671d83b4b252f7542f6dc5cd847</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1850 Au&#223;ergew&#246;hnliche Belastungen</act:name>
-  <act:id type="guid">ac4972c2dad0db60c6ec8931c1f0c231</act:id>
+  <act:name>Privatentnahmen/-einlagen</act:name>
+  <act:id type="guid">b9ae1b059749ea81c757a9adad39db1b</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1850</act:code>
   <act:slots>
     <slot>
       <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
+      <slot:value type="string">true</slot:value>
     </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
   </act:slots>
-  <act:parent type="guid">997a2671d83b4b252f7542f6dc5cd847</act:parent>
+  <act:parent type="guid">1888a7d2fbbdede8446090a31651565f</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>1890 Privateinlagen</act:name>
-  <act:id type="guid">587523463509dc4cfa095efa8fba2e9f</act:id>
+  <act:name>1800 Privatentnahme allgemein</act:name>
+  <act:id type="guid">0e6b8f9c973149c8d1c00e40919e9e21</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>1890</act:code>
-  <act:parent type="guid">997a2671d83b4b252f7542f6dc5cd847</act:parent>
+  <act:code>1800</act:code>
+  <act:parent type="guid">b9ae1b059749ea81c757a9adad39db1b</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>Vortragskonten 9</act:name>
-  <act:id type="guid">bef9d3186a962ce240064a85eb2e18fd</act:id>
+  <act:name>1810 Privatsteuern</act:name>
+  <act:id type="guid">fff2b92b43dc9d9690a7e5c365d2baf6</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">true</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
+  <act:code>1810</act:code>
+  <act:parent type="guid">b9ae1b059749ea81c757a9adad39db1b</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>9000 Saldenvortrag Sachkonten</act:name>
-  <act:id type="guid">0a6ab6b6ff7c8169f7464b2ddd753c24</act:id>
+  <act:name>1820 Sonderausgaben beschränkt abzugsfähig</act:name>
+  <act:id type="guid">5c008564ba99d0dfe6f20166adde5e6c</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>9000</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">bef9d3186a962ce240064a85eb2e18fd</act:parent>
+  <act:code>1820</act:code>
+  <act:parent type="guid">b9ae1b059749ea81c757a9adad39db1b</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>9008 Saldenvortr&#228;ge Debitoren</act:name>
-  <act:id type="guid">2562d3d7fb038d6bb1eb25d61f183af6</act:id>
+  <act:name>1830 Sonderausgaben unbeschränkt abzugsfähig</act:name>
+  <act:id type="guid">d89a53718b4753ac5407b38ab43f1339</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>9008</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">bef9d3186a962ce240064a85eb2e18fd</act:parent>
+  <act:code>1830</act:code>
+  <act:parent type="guid">b9ae1b059749ea81c757a9adad39db1b</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>9009 Saldenvortr&#228;ge Kreditoren</act:name>
-  <act:id type="guid">48ed6e9c05d6397cbe7742074dd644de</act:id>
+  <act:name>1850 Außergewöhnliche Belastungen</act:name>
+  <act:id type="guid">ab2c3c1b68e9c21ca3bce32c729c5cdc</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>9009</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">bef9d3186a962ce240064a85eb2e18fd</act:parent>
+  <act:code>1850</act:code>
+  <act:parent type="guid">b9ae1b059749ea81c757a9adad39db1b</act:parent>
 </gnc:account>
 <gnc:account version="2.0.0">
-  <act:name>9090 Summenvortragskonto</act:name>
-  <act:id type="guid">2bf135942ec9bfd85b42450654e8bb63</act:id>
+  <act:name>1890 Privateinlagen</act:name>
+  <act:id type="guid">4057a69542c170211849f7705354aadb</act:id>
   <act:type>EQUITY</act:type>
   <act:commodity>
     <cmdty:space>ISO4217</cmdty:space>
     <cmdty:id>EUR</cmdty:id>
   </act:commodity>
   <act:commodity-scu>100</act:commodity-scu>
-  <act:code>9090</act:code>
-  <act:slots>
-    <slot>
-      <slot:key>placeholder</slot:key>
-      <slot:value type="string">false</slot:value>
-    </slot>
-    <slot>
-      <slot:key>notes</slot:key>
-      <slot:value type="string"></slot:value>
-    </slot>
-  </act:slots>
-  <act:parent type="guid">bef9d3186a962ce240064a85eb2e18fd</act:parent>
+  <act:code>1890</act:code>
+  <act:parent type="guid">b9ae1b059749ea81c757a9adad39db1b</act:parent>
 </gnc:account>
 </gnc-account-example>
 

Copied: gnucash/branches/register-rewrite/art (from rev 15058, gnucash/trunk/art)

Modified: gnucash/branches/register-rewrite/configure.in
===================================================================
--- gnucash/branches/register-rewrite/configure.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/configure.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,10 @@
 AC_CONFIG_HEADERS(config.h)
 AC_CONFIG_SRCDIR(src/engine/Transaction.h)
 
+AC_CONFIG_HEADERS(gsf-config.h)
+AC_CONFIG_HEADERS(goffice-config.h)
+AC_CONFIG_HEADERS(goffice-features.h)
+
 # Initialize automake -- make sure we have at least version 1.9
 AM_INIT_AUTOMAKE(1.9)
 
@@ -101,13 +105,44 @@
   ])
 ])
 
+##################################################
+# Check for win32 platform
+##################################################
+AC_MSG_CHECKING([for native Win32])
+case $host in
+  *-*-mingw*)
+    native_win32=yes
+    ;;
+  *)
+    native_win32=no
+    ;;
+esac
+AC_MSG_RESULT([$native_win32])
+AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")
+
+AC_MSG_CHECKING([for Win32 platform in general])
+case $host in
+  *-*-mingw*|*-*-cygwin*)
+    platform_win32=yes
+    ;;
+  *)
+    platform_win32=no
+    ;;
+esac
+AC_MSG_RESULT($platform_win32)
+AM_CONDITIONAL(PLATFORM_WIN32, test "x$platform_win32" = "xyes")
+##################################################
+  
 STRUCT_TM_GMTOFF_CHECK
 SCANF_LLD_CHECK
 if test x$am_cv_scanf_lld = "xno"; then
   SCANF_QD_CHECK
 
-  if test x$am_cv_scanf_qs = "xno"; then
-    AC_MSG_ERROR([cannot continue, no long long conversion support in scanf])
+  if test x$am_cv_scanf_qd = "xno"; then
+    SCANF_I64D_CHECK
+    if test x$am_cv_scanf_i64d = "xno"; then
+      AC_MSG_ERROR([Cannot continue, no long long conversion support in scanf.])
+    fi
   fi
 fi
 
@@ -116,11 +151,27 @@
   AC_MSG_ERROR([Cannot find ltdl.h -- libtool-devel (or libtool-ltdl-devel) not installed?])
 fi
 
+# test whether we are building directly from SVN/SVK
+${srcdir}/util/gnc-svnversion ${srcdir} >/dev/null 2>&1
+if test $? = 0 ; then
+  BUILDING_FROM_SVN=yes
+
+  # We need at least version 1.3.28 of SWIG because
+  # that's when SWIG added %delobject
+  AC_PROG_SWIG(1.3.28)
+else
+  BUILDING_FROM_SVN=no
+fi
+AM_CONDITIONAL(BUILDING_FROM_SVN, test "x$BUILDING_FROM_SVN" = "xyes")
+
 # These are unavailable on windows/mingw32
 AC_CHECK_HEADERS(X11/Xlib.h glob.h)
 AC_CHECK_FUNCS(chown gethostname getppid getuid gettimeofday gmtime_r)
 AC_CHECK_FUNCS(gethostid link)
 
+# Init binreloc
+AM_BINRELOC
+
 ### --------------------------------------------------------------------------
 ### See if we have pkg-config
 
@@ -234,20 +285,29 @@
 
 
 ### --------------------------------------------------------------------------
-### Guile and g-wrap version checks (should this be something other than
-### the Gnome check?)
+### Guile version checks (should this be something other than the Gnome check?)
 
+# If the user has given these values, cache them to override the
+# detected values.
+if test "x$GUILE_LIBS" != x; then
+  saved_GUILE_LIBS="$GUILE_LIBS"
+fi
+if test "x$GUILE_INCS" != x; then
+  saved_GUILE_INCS="$GUILE_INCS"
+fi
 GUILE_LIBS=""
 GNOME_CHECK_GUILE
+
+if test "x$saved_GUILE_LIBS" != x; then
+  GUILE_LIBS="$saved_GUILE_LIBS"
+fi
+if test "x$saved_GUILE_INCS" != x; then
+  GUILE_INCS="$saved_GUILE_INCS"
+fi
+
 AS_SCRUB_INCLUDE(GUILE_INCS)
 AC_SUBST(GUILE_LIBS)
 
-### --------------------------------------------------------------------------
-### G-wrap (libraries and executable)
-
-G_WRAP_COMPILE_ARGS=""
-G_WRAP_LINK_ARGS=""
-
 AM_GUILE_VERSION_CHECK(1.6.0, , , [AC_MSG_ERROR([
 
   guile does not appear to be installed correctly, or is not in the
@@ -267,109 +327,21 @@
   AC_DEFINE(HAVE_GUILE18,1,[System has guile 1.8 or better])
 ], )
 
-AM_PATH_GWRAP(1.3.3, , [AC_MSG_ERROR([
-
-  g-wrap does not appear to be installed correctly, or is not new
-  enough.  GnuCash requires at least version 1.3.3 to build,
-  and 1.9.6 to build cleanly with GCC4.  If you need to install g-wrap,
-  you can find it at http://www.nongnu.org/g-wrap/ .
-])])
-
-# Find out what the g-wrap compile and link flags are.
-AC_MSG_CHECKING(for g-wrap compile args)
-G_WRAP_COMPILE_ARGS=`${G_WRAP_CONFIG} --c-compile-args guile`
-AC_MSG_RESULT($G_WRAP_COMPILE_ARGS)
-
-AC_MSG_CHECKING(for g-wrap link args)
-G_WRAP_LINK_ARGS=`${G_WRAP_CONFIG} --c-link-args guile`
-# Dear g-wrap: adding -L/usr/lib is very silly.  Do not do this.
-G_WRAP_LINK_ARGS=`echo ${G_WRAP_LINK_ARGS} | sed -e 's|-L/usr/lib ||'`
-AC_MSG_RESULT($G_WRAP_LINK_ARGS)
-
-AC_MSG_CHECKING(for g-wrap module directory)
-G_WRAP_MODULE_DIR=`${G_WRAP_CONFIG} --guile-module-directory`
-G_WRAP_LIB_DIR=`echo $G_WRAP_MODULE_DIR | sed -e 's|share/guile.*$|lib|'`
-AC_MSG_RESULT($G_WRAP_MODULE_DIR)
-
-AC_GWRAP_CHECK_GUILE($G_WRAP_MODULE_DIR)
-
-save_CPPFLAGS=$CPPFLAGS
-CPPFLAGS="$CPPFLAGS $GUILE_INCS $G_WRAP_COMPILE_ARGS"
-AC_CHECK_HEADER(g-wrap-wct.h,,
-	[AC_MSG_ERROR([
-
-   cannot find g-wrap-wct.h where g-wrap claims it should be.
-   are you on Debian or Ubuntu and still using g-wrap 1.9.6-2?
-   See:  http://bugzilla.gnome.org/show_bug.cgi?id=330539
-
-])])
-CPPFLAGS=$save_CPPFLAGS
-
-AC_SUBST(G_WRAP_CONFIG)
-AC_SUBST(G_WRAP_COMPILE_ARGS)
-AC_SUBST(G_WRAP_LINK_ARGS)
-AC_SUBST(G_WRAP_MODULE_DIR)
-AC_SUBST(G_WRAP_LIB_DIR)
-
 AS_SCRUB_INCLUDE(CFLAGS)
 
-AC_MSG_CHECKING([for (g-wrap) guile module])
-if LD_LIBRARY_PATH=$G_WRAP_LIB_DIR:$LD_LIBRARY_PATH \
-  GUILE_LOAD_PATH=$G_WRAP_MODULE_DIR \
-        ${GUILE} -c "(use-modules (g-wrap))" > /dev/null 2>&1
+AC_MSG_CHECKING([for SLIB support])
+if ${GUILE} -c "(use-modules (ice-9 slib)) (require 'printf)" > /dev/null 2>&1
 then
   AC_MSG_RESULT(yes)
 else
   AC_MSG_ERROR([
 
-   Cannot find the (g-wrap) guile module.
-   Are you sure you have g-wrap compile-time environment installed?
-   See http://bugzilla.gnome.org/show_bug.cgi?id=347680
+   Cannot find SLIB.  Are you sure you have it installed?
+   See http://bugzilla.gnome.org/show_bug.cgi?id=347922
 
 ])
 fi
 
-AC_MSG_CHECKING([for (g-wrap gw-glib-spec) guile module])
-if LD_LIBRARY_PATH=$G_WRAP_LIB_DIR:$LD_LIBRARY_PATH \
-  GUILE_LOAD_PATH=$G_WRAP_MODULE_DIR \
-        ${GUILE} -c "(use-modules (g-wrap gw-glib-spec))" > /dev/null 2>&1
-then
-  AC_MSG_RESULT(yes)
-else
-  AC_MSG_ERROR([
-
-   Cannot find the (g-wrap gw-glib-spec) guile module.
-   Are you sure you have g-wrap installed with glib support?
-   See http://bugzilla.gnome.org/show_bug.cgi?id=347404
-
-])
-fi
-
-AC_MSG_CHECKING([for (g-wrap gw-standard) guile module])
-if LD_LIBRARY_PATH=$G_WRAP_LIB_DIR:$LD_LIBRARY_PATH \
-  GUILE_LOAD_PATH=$G_WRAP_MODULE_DIR \
-        ${GUILE} -c "(use-modules (g-wrap gw-standard))" > /dev/null 2>&1
-then
-  AC_MSG_RESULT(yes)
-else
-  AC_MSG_RESULT(no)
-  AC_MSG_CHECKING([for (g-wrap gw standard) guile module])
-  if LD_LIBRARY_PATH=$G_WRAP_LIB_DIR:$LD_LIBRARY_PATH \
-    GUILE_LOAD_PATH=$G_WRAP_MODULE_DIR \
-        ${GUILE} -c "(use-modules (g-wrap gw standard))" > /dev/null 2>&1
-  then
-    AC_MSG_RESULT(yes)
-  else
-    AC_MSG_RESULT(no)
-    AC_MSG_WARN([
-
-    Unable to find the g-wrap standard module, a.k.a. guile-g-wrap. 
-    You won't be able to run GnuCash without it!
-
-    ])
-  fi
-fi
-
 ### Check size of long_long - some guile's are broken.
 AC_MSG_CHECKING(if guile long_long is at least as big as gint64)
 GNC_OLDCFLAGS="$CFLAGS"
@@ -387,6 +359,11 @@
 	       sizeof(gint64)))
 ],[
   AC_MSG_RESULT(no)
+],[
+  AC_MSG_RESULT(assuming yes)
+  AC_CHECK_LIB(guile, scm_long_long2num,
+               AC_DEFINE(GUILE_LONG_LONG_OK,1,is sizeof(long_long) >=
+	       sizeof(gint64)))
 ])
 CFLAGS="$GNC_OLDCFLAGS"
 
@@ -406,6 +383,8 @@
 ],[
   AC_MSG_RESULT(no)
   AC_MSG_ERROR(cannot continue, size of unsigned long too small.)
+],[
+  AC_MSG_RESULT(assuming yes)
 ])
 CFLAGS="$GNC_OLDCFLAGS"
 
@@ -454,6 +433,9 @@
 ### look for gconf
 
 PKG_CHECK_MODULES(GCONF, gconf-2.0 >= "2.0")
+# Look up gconftool-2
+AC_PATH_PROG(GCONFTOOL, gconftool-2)
+AC_SUBST(GCONFTOOL)
 AC_SUBST(GCONF_CFLAGS)
 AC_SUBST(GCONF_LIBS)
 
@@ -568,7 +550,6 @@
 GNC_ACCOUNTS_DIR='${GNC_SHAREDIR}/accounts'
 GNC_GLADE_DIR='${GNC_SHAREDIR}/glade'
 GNC_UI_DIR='${GNC_SHAREDIR}/ui'
-GNC_GWRAP_LIBDIR='${GNC_SHAREDIR}/guile-modules/g-wrapped'
 GNC_MODULE_DIR='${pkglibdir}'
 GNC_PIXMAP_DIR='${GNC_SHAREDIR}/pixmaps'
 
@@ -577,7 +558,6 @@
 AC_SUBST(GNC_DOC_INSTALL_DIR)
 AC_SUBST(GNC_GLADE_DIR)
 AC_SUBST(GNC_UI_DIR)
-AC_SUBST(GNC_GWRAP_LIBDIR)
 AC_SUBST(GNC_INCLUDE_DIR)
 AC_SUBST(GNC_LIBDIR)
 AC_SUBST(GNC_MODULE_DIR)
@@ -815,33 +795,11 @@
 ### --------------------------------------------------------------------------
 ### MT940
 AC_ARG_ENABLE( mt940,
-  [  --enable-mt940               compile with MT940 support (needs --enable-hbci)],
+  [  --enable-mt940               Obsolete, included in --enable-hbci],
   if test "x$enableval" != "xno" ; then
-    MT940_DIR=mt940 ;
-    HBCI_DIR=hbci ;
+    AC_MSG_ERROR([--enable-mt940 is obsolete -- all functionality is already included in --enable-hbci])
   fi)
-if test x${MT940_DIR} = xmt940 ;
-then
-    AC_MSG_WARN([MT940 importing support is enabled but is totally experimental!])
-    PKG_CHECK_MODULES(HBCI, aqbanking >= "1.3.0", [], [
-      # aqbanking-1.3.0 was released on 2005-08-11
-      AC_AQBANKING(1,3,0)
-      if test x${have_aqbanking} != xyes; 
-      then
-      	AC_MSG_ERROR([Could not find aqbanking. If you use --enable-mt940, you *have* to enable aqbanking.])
-      fi
-      HBCI_LIBS="${aqbanking_libs}"
-      HBCI_CFLAGS="${aqbanking_includes}"
-    ])
-    # Note: HBCI_LIBS is changed again below in the --enable-hbci
-    # section. So check for mt940 first and *not* the other way round!
 
-    AS_SCRUB_INCLUDE(HBCI_CFLAGS)
-    AC_SUBST(HBCI_LIBS)
-    AC_SUBST(HBCI_CFLAGS)
-fi
-AC_SUBST(MT940_DIR)
-
 ### --------------------------------------------------------------------------
 ### HBCI
 AC_ARG_ENABLE( hbci,
@@ -852,8 +810,9 @@
 if test x${HBCI_DIR} = xhbci ;
 then
     # Check for Aqbanking library
-    PKG_CHECK_MODULES(HBCI, aqbanking >= "1.0.0", [], [
-      AC_AQBANKING(1,0,0)
+    # aqbanking-1.6.0 was released on 2005-09-22
+    PKG_CHECK_MODULES(HBCI, aqbanking >= "1.6.0", [], [
+      AC_AQBANKING(1,6,0)
       if test x${have_aqbanking} != xyes; 
       then
       	AC_MSG_ERROR([Could not find aqbanking. If you use --enable-hbci, you *have* to enable aqbanking.])
@@ -1176,6 +1135,18 @@
   AM_CONDITIONAL(HAVE_GTK26, test "x$HAVE_GTK26" = "xyes" )
   
   
+  AC_MSG_CHECKING(for GTK - version >= 2.10.0)
+  if $PKG_CONFIG 'gtk+-2.0 >= 2.10.0'
+  then
+    AC_MSG_RESULT(yes)
+    AC_DEFINE(HAVE_GTK_2_10,1,[System has gtk 2.10.0 or better])
+    HAVE_GTK_2_10=yes
+  else
+    AC_MSG_RESULT(no)
+  fi
+  AM_CONDITIONAL(HAVE_GTK_2_10, test "x$HAVE_GTK_2_10" = "xyes" )
+  
+  
   AC_MSG_CHECKING(for pango version >= 1.8.0)
   if $PKG_CONFIG 'pango >= 1.8.0'
   then
@@ -1212,21 +1183,39 @@
   AC_SUBST(GSF_LIBS)
   
   dnl $4=true => don't die if failure.
-  PKG_CHECK_MODULES(GOFFICE, libgoffice-1 >= 0.0.4,,true)
-  if $PKG_CONFIG --silence-errors 'libgoffice-1 >= 0.0.4'
+  PKG_CHECK_MODULES(GOFFICE, libgoffice-0.3 >= 0.3.0,,true)
+  if $PKG_CONFIG --silence-errors 'libgoffice-0.3 >= 0.3.0'
   then
     AC_DEFINE(HAVE_GOFFICE,1,[System has goffice-0.0.4 or better])
     HAVE_GOFFICE=yes
   else
-    AC_MSG_RESULT(using internally-packaged goffice)
-    GOFFICE_CFLAGS='-I${top_srcdir}/lib/goffice-0.0.4'
-    GOFFICE_LIBS='${top_builddir}/lib/goffice-0.0.4/goffice/libgoffice-1.la'
-    HAVE_GOFFICE=no
+    AC_MSG_RESULT(no)
+    PKG_CHECK_MODULES(GOFFICE, libgoffice-1 >= 0.0.4,,true)
+    if $PKG_CONFIG --silence-errors 'libgoffice-1 >= 0.0.4'
+    then
+      AC_DEFINE(HAVE_GOFFICE,1,[System has goffice-0.0.4 or better])
+      HAVE_GOFFICE=yes
+    else
+      AC_MSG_RESULT(using internally-packaged goffice)
+      GOFFICE_CFLAGS='-I${top_srcdir}/lib/goffice-0.0.4'
+      GOFFICE_LIBS='${top_builddir}/lib/goffice-0.0.4/goffice/libgoffice-1.la'
+      HAVE_GOFFICE=no
+    fi
   fi
   AM_CONDITIONAL(HAVE_GOFFICE, test "x$HAVE_GOFFICE" = "xyes")
   AC_SUBST(GOFFICE_CFLAGS)
   AC_SUBST(GOFFICE_LIBS)
   
+  ##################################################
+  # regex needs its own linker flag on win32 platform
+  ##################################################
+  if test "$platform_win32" = yes; then
+    REGEX_LIBS="-lregex"
+  else
+    REGEX_LIBS=""
+  fi
+  AC_SUBST(REGEX_LIBS)
+  
   ### ------------------------------------------------------------------------
   ### Checks when building internal LIBGSF
   ### +libgsf-1.12.3
@@ -1252,11 +1241,6 @@
 :libgsf_version_micro:libgsf_version_minor)
   dnl NOTE: Above line needs no leading whitespace!  --warlord
   
-  dnl 2005-11-19,jsled, this doesn't seem to work... :(
-  dnl ifelse(x$HAVE_LIBGSF, xyes,,
-    AC_CONFIG_HEADERS(gsf-config.h)
-  dnl)
-  
   AC_FUNC_FSEEKO
   AC_SYS_LARGEFILE
   
@@ -1362,30 +1346,6 @@
   	 macro_s_isreg=no])
   AC_MSG_RESULT($macro_s_isreg)
   
-  AC_MSG_CHECKING([for native Win32])
-  case $host in
-    *-*-mingw*)
-      native_win32=yes
-      ;;
-    *)
-      native_win32=no
-      ;;
-  esac
-  AC_MSG_RESULT([$native_win32])
-  AM_CONDITIONAL(OS_WIN32, test "$native_win32" = yes)
-  
-  AC_MSG_CHECKING([for Win32 platform in general])
-  case $host in
-    *-*-mingw*|*-*-cygwin*)
-      platform_win32=yes
-      ;;
-    *)
-      platform_win32=no
-      ;;
-  esac
-  AC_MSG_RESULT($platform_win32)
-  AM_CONDITIONAL(PLATFORM_WIN32, test "$platform_win32" = yes)
-  
   ##################################################
   # Checks for gtk-doc and docbook-tools
   ##################################################
@@ -1512,8 +1472,6 @@
   
   else
   
-  AM_CONDITIONAL(OS_WIN32, false)
-  AM_CONDITIONAL(PLATFORM_WIN32, false)
   # dnl AM_CONDITIONAL(GTK_DOC_INSTALLED, false)
   # dnl  AM_CONDITIONAL(ENABLE_GTK_DOC, false)
   # dnl  AM_CONDITIONAL(GTK_DOC_USE_LIBTOOL, false)
@@ -1546,13 +1504,6 @@
   m4_eval(goffice_version_epoch + goffice_version_major)[]dnl
 :goffice_version_minor:goffice_version_major)
   dnl NOTE: Above line needs no leading whitespace!  --warlord
-  
-  dnl This one is created by autoheader, ...
-  AC_CONFIG_HEADERS(goffice-config.h)
-  
-  dnl ... and this one is a small subset, maintained manually,
-  dnl which will be installed.
-  AC_CONFIG_HEADERS(goffice-features.h)
   dnl
   dnl Make sure these two won't clash.  Put the following to goffice-config.h:
   AH_BOTTOM([/* Don't include goffice-features.h, it's a subset of goffice-config.h. */
@@ -1887,11 +1838,10 @@
 else
   ### A bunch of am conditionals that need to be set
   AM_CONDITIONAL(HAVE_GTK26, false )
+  AM_CONDITIONAL(HAVE_GTK_2_10, false)
   AM_CONDITIONAL(HAVE_PANGO18, false )
   AM_CONDITIONAL(HAVE_LIBGSF, false)
   AM_CONDITIONAL(HAVE_GOFFICE, false)
-  AM_CONDITIONAL(OS_WIN32, false)
-  AM_CONDITIONAL(PLATFORM_WIN32, false)
   AM_CONDITIONAL(WITH_LIBGSF_GNOME, false)
   AM_CONDITIONAL(WITH_PYTHON, false)
 
@@ -2000,10 +1950,10 @@
 ### GnuCash flags and libs configuration
 
 GNUCASH_ENGINE_BASE_LIBS="${GLIB_LIBS}"
-GNUCASH_ENGINE_LIBS="-L${GNC_MODULE_DIR} -L${GNC_GWRAP_LIBDIR} ${GNUCASH_ENGINE_BASE_LIBS} ${GUILE_LIBS} -lgncmod-engine -lgw-engine -lgw-kvp -lgncmodule"
+GNUCASH_ENGINE_LIBS="-L${GNC_MODULE_DIR} ${GNUCASH_ENGINE_BASE_LIBS} ${GUILE_LIBS} -lgncmod-engine -lgncmodule"
 
-GNUCASH_ENGINE_BASE_CFLAGS="-DGNUCASH ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS}"
-GNUCASH_ENGINE_CFLAGS="${GNUCASH_ENGINE_BASE_CFLAGS} ${GUILE_INCS}"
+GNUCASH_ENGINE_BASE_CFLAGS="-DGNUCASH ${GLIB_CFLAGS} ${GUILE_INCS}"
+GNUCASH_ENGINE_CFLAGS="${GNUCASH_ENGINE_BASE_CFLAGS}"
 
 AC_SUBST(GNUCASH_ENGINE_BASE_LIBS)
 AC_SUBST(GNUCASH_ENGINE_LIBS)
@@ -2046,9 +1996,7 @@
 if test ${GCC}x = yesx
 then
   warnFLAGS=
-  # These two are because of g-wrap -- it can't avoid unused and uninitialized.
-  #warnFLAGS="${warnFLAGS} -Wno-uninitialized"
-  #warnFLAGS="${warnFLAGS} -Wno-unused"
+  CFLAGS="${CFLAGS} -Wno-unused"
   # other flags...
   # These next two are included in the GNOME_COMPILE_WARNINGS
   #warnFLAGS="${warnFLAGS} -Wmissing-prototypes"
@@ -2056,8 +2004,7 @@
   #warnFLAGS="${warnFLAGS} -Werror-implicit-function-declaration" # In -Wall
 
   # error-on-warning should not be active in (stable) release tarballs
-  ${srcdir}/util/gnc-svnversion ${srcdir} >/dev/null 2>&1
-  if test $? = 0
+  if test "x$BUILDING_FROM_SVN" = "xyes"
   then
     # This code is from SVN/SVK, so enable error-on-warning
     error_on_warning_as_default="yes"
@@ -2097,42 +2044,20 @@
 	warnFLAGS="${warnFLAGS} -Wdeclaration-after-statement -Wno-pointer-sign"
 	# rpmbuild on FC4 forces this flag. Can't hurt to always compile with it.
 	warnFLAGS="${warnFLAGS} -D_FORTIFY_SOURCE=2"
-	if test x$gwrap_major_version = x1 -a "$gwrap_minor_version" -lt 9 ; then
-	    # This is g-wrap 1.3 + gcc4.  Test error-on-warning
-            case "$gnc_error_on_warning" in
-	    auto)
-	      AC_MSG_ERROR([
-
-  Sorry, your current configuration will not compile.  You are
-  running g-wrap 1.3.x, GCC4, and --enable-error-on-warning, which
-  do not work together.  You have three options:  You can update
-  g-wrap to 1.9.6, you can downgrade gcc to GCC3, or you can
-  --disable-error-on-warning on the configure line.  We recommend
-  you update g-wrap to 1.9.6 so gnucash can compile cleanly on GCC4
-  You can find it at http://www.nongnu.org/g-wrap/ .
-
-])
-	      ;;
-	    yes)
-	      AC_MSG_WARN([
-
-  g-wrap 1.3.x and GCC4 may cause build problems.  You have been warned!
-
-])
-	      ;;
-	    esac
-	  fi
 	fi
      fi
   fi
 
-  CFLAGS="${CFLAGS} ${warnFLAGS}"
+  CFLAGS="${warnFLAGS} ${CFLAGS}"
 
 else
   warnFLAGS=none
 fi
 AC_MSG_RESULT($warnFLAGS)
 
+# Extend LDFLAGS because libtool on Windows requires this argument
+LDFLAGS="${LDFLAGS} -no-undefined"
+
 ### --------------------------------------------------------------------------
 ### Adjustments -- especially executables that aren't generated via
 ### makefiles, so that we don't have an opportunity to adjust them
@@ -2219,6 +2144,7 @@
           lib/libqof/backend/Makefile
           lib/libqof/backend/file/Makefile
           packaging/Makefile
+	  packaging/win32/gnucash.iss
           src/Makefile
           src/app-utils/Makefile
           src/app-utils/test/Makefile
@@ -2248,6 +2174,7 @@
           src/gnc-module/test/mod-baz/Makefile
           src/gnc-module/test/misc-mods/Makefile
           src/gnome/Makefile
+          src/gnome/gnucash.desktop.in
 	  src/gnome/glade/Makefile
 	  src/gnome/schemas/Makefile
 	  src/gnome/ui/Makefile
@@ -2268,7 +2195,6 @@
           src/import-export/schemas/Makefile
           src/import-export/ofx/Makefile
           src/import-export/ofx/test/Makefile
-          src/import-export/mt940/Makefile
           src/import-export/log-replay/Makefile
           src/import-export/hbci/Makefile
           src/import-export/hbci/glade/Makefile
@@ -2277,8 +2203,6 @@
           src/network-utils/Makefile
           src/network-utils/test/Makefile
           src/optional/Makefile
-          src/optional/swig/Makefile
-          src/optional/swig/examples/Makefile
           src/optional/xsl/Makefile
           src/pixmaps/Makefile
           src/quotes/Makefile
@@ -2348,9 +2272,6 @@
 if test x${HBCI_DIR} != x; then
 components="$components hbci"
 fi
-if test x${MT940_DIR} != x; then
-components="$components mt940"
-fi
 
 AC_MSG_RESULT([
   Options detected/selected

Modified: gnucash/branches/register-rewrite/doc/tip_of_the_day.list.in
===================================================================
--- gnucash/branches/register-rewrite/doc/tip_of_the_day.list.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/doc/tip_of_the_day.list.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,6 @@
- N_( "Warning!! This is a DEVELOPMENT version of GnuCash. \ 
-It probably has lots of bugs and unstable features! \ 
-If you are looking for a stable personal finance application, \ 
+ N_( "Warning!! This is a DEVELOPMENT version of GnuCash. \
+It probably has lots of bugs and unstable features! \
+If you are looking for a stable personal finance application, \
 you should use the latest release of GnuCash 2.0.")
 
  N_( "The GnuCash online manual has lots of helpful information. \
@@ -57,6 +57,9 @@
 decrement the selected date. You can use '+' and '-' to increment and \
 decrement check numbers as well.")
 
+ N_( "To switch between multiple tabs in the main window, press \
+Control+Alt+Page Up/Down.")
+
  N_( "In the reconcile window, you can press the spacebar to mark \
 transactions as reconciled.  You can also press Tab and Shift-Tab to \
 move between deposits and withdrawals.")
@@ -75,6 +78,9 @@
 a style sheet for your report as a report option, and use \
 the Edit -> Style Sheets menu to customize style sheets.")
 
+ N_( "To raise the accounts menu in the transfer field of a register \
+page, press the Menu key or the Ctrl-Down key combination.")
+
  N_( "The GnuCash developers are easy to contact.  As well \
 as several mailing lists, you can chat to them live on IRC! \
 Join them on #gnucash at irc.gnome.org")

Modified: gnucash/branches/register-rewrite/lib/goffice-0.0.4/goffice/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/lib/goffice-0.0.4/goffice/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/goffice-0.0.4/goffice/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,7 +24,6 @@
 CLEANFILES = $(BUILT_SOURCES)
 
 libgoffice_1_la_SOURCES = 	\
-	$(BUILT_SOURCES)	\
 	goffice.c		\
 	goffice-priv.h
 if !HAVE_GLIB26

Modified: gnucash/branches/register-rewrite/lib/guile-www/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/lib/guile-www/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/guile-www/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,16 +15,20 @@
 endif
 
 .scm-links: 
-	rm -f www
-	$(LN_S) -f . www
+	$(RM) -rf www
+	mkdir -p www
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd www; for A in $(gncscm_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-CLEANFILES = www .scm-links
+clean-local:
+	$(RM) -rf www
+
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}
 
 endif # GNC_HAVE_GUILE_WWW (else clause)

Modified: gnucash/branches/register-rewrite/lib/libqof/backend/file/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/backend/file/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/backend/file/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -7,7 +7,8 @@
   -DLOCALE_DIR=\""$(datadir)/locale"\" \
   ${QOF_CFLAGS} \
   ${LIBXML2_CFLAGS} \
-  ${GLIB_CFLAGS}
+  ${GLIB_CFLAGS} \
+  -I$(top_srcdir)/lib/libc
 
 libgncqof_backend_qsf_la_SOURCES = \
   qsf-backend.c \
@@ -18,7 +19,9 @@
 libgncqof_backend_qsf_la_LIBADD = \
  ${QOF_LIBS} \
  ${GLIB_LIBS} \
- ${LIBXML2_LIBS}
+ ${REGEX_LIBS} \
+ ${LIBXML2_LIBS} \
+ $(top_builddir)/lib/libc/libc-missing.la
 
 qsfschemadir = $(QOF_XML_DIR)
 qsfschema_DATA = \
@@ -36,10 +39,8 @@
 qsf-dir.h: qsf-dir.h.in Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	        -e 's:@-QSF_SCHEMA_DIR-@:${QOF_XML_DIR}:g'
+	        -e 's#@-QSF_SCHEMA_DIR-@#${QOF_XML_DIR}#g'
 	mv $@.tmp $@
 
 BUILT_SOURCES = qsf-dir.h
-
-CONFIG_CLEAN_FILES = qsf-dir.h
-
+CLEANFILES = qsf-dir.h

Modified: gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-backend.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-backend.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-backend.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -35,6 +35,10 @@
 #include <errno.h>
 #include <sys/stat.h>
 
+#ifndef HAVE_STRPTIME
+#include "strptime.h"
+#endif
+
 #define QSF_TYPE_BINARY "binary"
 #define QSF_TYPE_GLIST  "glist"
 #define QSF_TYPE_FRAME  "frame"

Modified: gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-xml-map.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-xml-map.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/backend/file/qsf-xml-map.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -33,6 +33,10 @@
 #include "qsf-xml.h"
 #include "qsf-dir.h"
 
+#ifndef HAVE_STRPTIME
+#include "strptime.h"
+#endif
+
 static QofLogModule log_module = QOF_MOD_QSF;
 
 static void

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,7 @@
 libgncqof_la_LDFLAGS= -version-info $(LIBQOF_LIBRARY_VERSION)
 libgncqof_la_LIBADD= \
   $(GLIB_LIBS) \
+  $(REGEX_LIBS) \
   $(top_builddir)/lib/libc/libc-missing.la
 
 AM_CFLAGS = \
@@ -90,8 +91,8 @@
 qofla-dir.h: $(srcdir)/qofla-dir.h.in Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-                -e 's:@-libdir-@:${QOFLIBdir}:g'
+                -e 's#@-libdir-@#${QOFLIBdir}#g'
 	 mv $@.tmp $@
 
 BUILT_SOURCES = qofla-dir.h
-DISTCLEANFILES = qofla-dir.h
+CLEANFILES = $(BUILT_SOURCES)

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qof.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qof.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qof.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -100,7 +100,6 @@
 #include "qofchoice.h"
 #include "qofbookmerge.h"
 #include "qofreference.h"
-#include "qofla-dir.h"
 #include "deprecated.h"
 
 /** allow easy logging of QSF debug messages */

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend-p.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend-p.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend-p.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -382,7 +382,7 @@
 
 @return 'y' if book is open, otherwise 'n'.
 */
-gchar qof_book_get_open_marker(QofBook *book);
+gchar qof_book_get_open_marker(const QofBook *book);
 
 /** get the book version
 
@@ -391,13 +391,13 @@
 @return -1 if no book exists, 0 if the book is
 new, otherwise the book version number.
 */
-gint32 qof_book_get_version (QofBook *book);
+gint32 qof_book_get_version (const QofBook *book);
 
 /** get the book tag number
 
 used for kvp management in sql backends.
 */
-guint32 qof_book_get_idata (QofBook *book);
+guint32 qof_book_get_idata (const QofBook *book);
 
 void qof_book_set_version (QofBook *book, gint32 version);
 

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofbackend.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -117,6 +117,7 @@
   ERR_FILEIO_WRITE_ERROR,    /**< couldn't write to the file */
   ERR_FILEIO_READ_ERROR,     /**< Could not open the file for reading. */
   ERR_FILEIO_NO_ENCODING,    /**< file does not specify encoding */
+  ERR_FILEIO_FILE_EACCES,    /**< No read access permission for the given file */
 
   /* network errors */
   ERR_NETIO_SHORT_READ = 2000,  /**< not enough bytes received */
@@ -273,7 +274,7 @@
 qof_load_backend_library(const gchar *directory, const gchar* module_name);
 
 /** \brief Retrieve the backend used by this book */
-QofBackend* qof_book_get_backend (QofBook *book);
+QofBackend* qof_book_get_backend (const QofBook *book);
 
 void qof_book_set_backend (QofBook *book, QofBackend *);
 

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -135,7 +135,7 @@
 /* XXX this should probably be calling is_equal callbacks on gncObject */
 
 gboolean
-qof_book_equal (QofBook *book_1, QofBook *book_2)
+qof_book_equal (const QofBook *book_1, const QofBook *book_2)
 {
   if (book_1 == book_2) return TRUE;
   if (!book_1 || !book_2) return FALSE;
@@ -145,7 +145,7 @@
 /* ====================================================================== */
 
 gboolean
-qof_book_not_saved (QofBook *book)
+qof_book_not_saved (const QofBook *book)
 {
   if (!book) return FALSE;
 
@@ -185,15 +185,16 @@
 }
 
 void
-qof_book_print_dirty (QofBook *book)
+qof_book_print_dirty (const QofBook *book)
 {
   if (book->inst.dirty)
     printf("book is dirty.\n");
-  qof_book_foreach_collection(book, qof_collection_print_dirty, NULL);
+  qof_book_foreach_collection
+    (book, (QofCollectionForeachCB)qof_collection_print_dirty, NULL);
 }
 
 time_t
-qof_book_get_dirty_time (QofBook *book)
+qof_book_get_dirty_time (const QofBook *book)
 {
   return book->dirty_time;
 }
@@ -209,14 +210,14 @@
 /* getters */
 
 QofBackend * 
-qof_book_get_backend (QofBook *book)
+qof_book_get_backend (const QofBook *book)
 {
    if (!book) return NULL;
    return book->backend;
 }
 
 gboolean
-qof_book_shutting_down (QofBook *book)
+qof_book_shutting_down (const QofBook *book)
 {
   if (!book) return FALSE;
   return book->shutting_down;
@@ -262,7 +263,7 @@
 }
 
 gpointer 
-qof_book_get_data (QofBook *book, const char *key)
+qof_book_get_data (const QofBook *book, const char *key)
 {
   if (!book || !key) return NULL;
   return g_hash_table_lookup (book->data_tables, (gpointer)key);
@@ -271,7 +272,7 @@
 /* ====================================================================== */
 
 QofCollection *
-qof_book_get_collection (QofBook *book, QofIdType entity_type)
+qof_book_get_collection (const QofBook *book, QofIdType entity_type)
 {
   QofCollection *col;
 
@@ -302,7 +303,7 @@
 }
 
 void 
-qof_book_foreach_collection (QofBook *book, 
+qof_book_foreach_collection (const QofBook *book, 
                              QofCollectionForeachCB cb, gpointer user_data)
 {
   struct _iterate iter;
@@ -324,19 +325,19 @@
 	book->book_open = 'n';
 }
 
-gchar qof_book_get_open_marker(QofBook *book)
+gchar qof_book_get_open_marker(const QofBook *book)
 {
 	if(!book) { return 'n'; }
 	return book->book_open;
 }
 
-gint32 qof_book_get_version (QofBook *book)
+gint32 qof_book_get_version (const QofBook *book)
 {
 	if(!book) { return -1; }
 	return book->version;
 }
 
-guint32 qof_book_get_idata (QofBook *book)
+guint32 qof_book_get_idata (const QofBook *book)
 {
 	if(!book) { return 0; }
 	return book->idata;

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofbook.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -99,11 +99,11 @@
  *  a non-NULL value.  (Unless the system malloc failed (out of
  *  memory) in which case what happens??).
  */
-QofCollection  * qof_book_get_collection (QofBook *, QofIdType);
+QofCollection  * qof_book_get_collection (const QofBook *, QofIdType);
 
 /** Invoke the indicated callback on each collection in the book. */
 typedef void (*QofCollectionForeachCB) (QofCollection *, gpointer user_data);
-void qof_book_foreach_collection (QofBook *, QofCollectionForeachCB, gpointer);
+void qof_book_foreach_collection (const QofBook *, QofCollectionForeachCB, gpointer);
 
 /** Return The kvp data for the book.
  *  Note that the book KVP data is persistent, and is stored/retrieved
@@ -134,10 +134,10 @@
                             QofBookFinalCB);
 
 /** Retrieves arbitrary pointers to structs stored by qof_book_set_data. */
-gpointer qof_book_get_data (QofBook *book, const gchar *key);
+gpointer qof_book_get_data (const QofBook *book, const gchar *key);
 
 /** Is the book shutting down? */
-gboolean qof_book_shutting_down (QofBook *book);
+gboolean qof_book_shutting_down (const QofBook *book);
 
 /** qof_book_not_saved() will return TRUE if any
  *    data in the book hasn't been saved to long-term storage.
@@ -147,7 +147,7 @@
  *    'dirty' flag.  Its up to the backend to periodically reset this
  *    flag, when it actually does save the data.)
  */
-gboolean qof_book_not_saved (QofBook *book);
+gboolean qof_book_not_saved (const QofBook *book);
 
 /** The qof_book_mark_saved() routine marks the book as having been
  *    saved (to a file, to a database). Used by backends to mark the
@@ -166,10 +166,10 @@
  *    and all subsidiary structures, printing out which structures
  *    have been marked dirty.
  */
-void qof_book_print_dirty (QofBook *book);
+void qof_book_print_dirty (const QofBook *book);
 
 /** Retrieve the earliest modification time on the book. */
-time_t qof_book_get_dirty_time(QofBook *book);
+time_t qof_book_get_dirty_time(const QofBook *book);
 
 /** Set the function to call when a book transitions from clean to
  *    dirty, or vice versa.
@@ -183,7 +183,7 @@
 /** The qof_book_equal() method returns TRUE if books are equal.
  * XXX this routine is broken, and does not currently compare data.
  */
-gboolean qof_book_equal (QofBook *book_1, QofBook *book_2);
+gboolean qof_book_equal (const QofBook *book_1, const QofBook *book_2);
 
 /** This will 'get and increment' the named counter for this book.
  * The return value is -1 on error or the incremented counter.

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofbookmerge.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofbookmerge.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofbookmerge.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,6 +21,7 @@
  *                                                                   *
  ********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include "qof.h"
 
@@ -413,7 +414,7 @@
 	QofBookMergeData *mergeData;
 
 	g_return_if_fail(user_data != NULL);
-	mergeData = (qof_book_mergeData*)user_data;
+	mergeData = (QofBookMergeData*)user_data;
 	g_return_if_fail(targetEnt != NULL);
 	mergeData->targetList = g_slist_prepend(mergeData->targetList,targetEnt);
 }

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -41,7 +41,7 @@
 	return TRUE;
 }
 
-gboolean qof_object_is_choice(QofIdType type)
+gboolean qof_object_is_choice(QofIdTypeConst type)
 {
 	gpointer value, check;
 
@@ -67,7 +67,9 @@
 	return TRUE;
 }
 
-gboolean qof_choice_add_class(char* select, char* option, char* param_name)
+gboolean qof_choice_add_class(const char* select,
+			      char* option,
+			      char* param_name)
 {
 	GHashTable *param_table;
 	GList *option_list;
@@ -97,7 +99,9 @@
 	return choices;
 }
 
-gboolean qof_choice_check(char* choice_obj, char *param_name, char* choice )
+gboolean qof_choice_check(const char* choice_obj,
+			  const char *param_name,
+			  const char* choice )
 {
 	GList *choices, *result;
 	GHashTable *param_table;

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofchoice.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -113,7 +113,7 @@
 @return TRUE if one or more choice parameters has been
 registered using the object definition, otherwise FALSE.
 */
-gboolean qof_object_is_choice(QofIdType type);
+gboolean qof_object_is_choice(QofIdTypeConst type);
 
 /** \brief Set an object as using QOF_TYPE_CHOICE. */
 gboolean  qof_choice_create(char* type);
@@ -127,7 +127,7 @@
 @return FALSE if object is not a choice object or on error
 	otherwise TRUE.
 */
-gboolean qof_choice_add_class(char* choice, char* add, char* param_name);
+gboolean qof_choice_add_class(const char* choice, char* add, char* param_name);
 
 /** \brief Return the list of all object types usable with this parameter.
 
@@ -150,7 +150,9 @@
 @return TRUE if choice is found in the list of allowed choices for
 this parameter of this object. Otherwise, FALSE
 */
-gboolean qof_choice_check(char* choice_obj, char *param_name, char* choice);
+gboolean qof_choice_check(const char* choice_obj,
+			  const char *param_name,
+			  const char* choice);
 /** @} */
 
 /** @} */

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofclass.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofclass.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofclass.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -151,6 +151,14 @@
  */
 typedef void (*QofSetterFunc) (gpointer, gpointer);
 
+/* A callback for how to compare two (same-type) objects based on a
+ * common getter (parameter member), using the provided comparison
+ * options (which are the type-specific options).
+ */
+typedef gint (*QofCompareFunc) (gpointer a, gpointer b,
+                                gint compare_options,
+                                QofParam *getter);
+
 /** This structure is for each queriable parameter in an object
  *
  * -- param_name is the name of the parameter.
@@ -174,6 +182,7 @@
   QofType            param_type;
   QofAccessFunc      param_getfcn;
   QofSetterFunc      param_setfcn;
+  QofCompareFunc     param_compfcn;
   gpointer           param_userdata;
 };
 

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofid-p.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofid-p.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofid-p.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -49,7 +49,7 @@
 /** reset value of dirty flag */
 void qof_collection_mark_clean (QofCollection *);
 void qof_collection_mark_dirty (QofCollection *);
-void qof_collection_print_dirty (QofCollection *col, gpointer dummy);
+void qof_collection_print_dirty (const QofCollection *col, gpointer dummy);
 
 /* @} */
 /* @} */

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofid.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofid.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofid.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -113,7 +113,7 @@
 }
 
 const GUID *
-qof_entity_get_guid (QofEntity *ent)
+qof_entity_get_guid (const QofEntity *ent)
 {
   if (!ent) return guid_null();
   return &ent->guid;
@@ -182,7 +182,7 @@
 /* getters */
 
 QofIdType
-qof_collection_get_type (QofCollection *col)
+qof_collection_get_type (const QofCollection *col)
 {
   return col->e_type;
 }
@@ -303,7 +303,7 @@
 }
 
 QofEntity *
-qof_collection_lookup_entity (QofCollection *col, const GUID * guid)
+qof_collection_lookup_entity (const QofCollection *col, const GUID * guid)
 {
   QofEntity *ent;
   g_return_val_if_fail (col, NULL);
@@ -332,7 +332,7 @@
 }
 
 guint
-qof_collection_count (QofCollection *col)
+qof_collection_count (const QofCollection *col)
 {
 	guint c;
 
@@ -343,7 +343,7 @@
 /* =============================================================== */
 
 gboolean 
-qof_collection_is_dirty (QofCollection *col)
+qof_collection_is_dirty (const QofCollection *col)
 {
    return col ? col->is_dirty : FALSE;
 }
@@ -361,17 +361,17 @@
 }
 
 void
-qof_collection_print_dirty (QofCollection *col, gpointer dummy)
+qof_collection_print_dirty (const QofCollection *col, gpointer dummy)
 {
   if (col->is_dirty)
     printf("%s collection is dirty.\n", col->e_type);
-  qof_collection_foreach(col, qof_instance_print_dirty, NULL);
+  qof_collection_foreach(col, (QofEntityForeachCB)qof_instance_print_dirty, NULL);
 }
 
 /* =============================================================== */
 
 gpointer 
-qof_collection_get_data (QofCollection *col)
+qof_collection_get_data (const QofCollection *col)
 {
    return col ? col->data : NULL;
 }
@@ -398,7 +398,7 @@
 }
 
 void
-qof_collection_foreach (QofCollection *col, QofEntityForeachCB cb_func, 
+qof_collection_foreach (const QofCollection *col, QofEntityForeachCB cb_func, 
                         gpointer user_data)
 {
   struct _iterate iter;

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofid.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofid.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofid.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -178,7 +178,7 @@
 void qof_set_alt_dirty_mode (gboolean enabled);
 
 /** Return the GUID of this entity */
-const GUID * qof_entity_get_guid (QofEntity *);
+const GUID * qof_entity_get_guid (const QofEntity *);
 
 /** @name Collections of Entities 
  @{ */
@@ -187,22 +187,22 @@
 QofCollection * qof_collection_new (QofIdType type);
 
 /** return the number of entities in the collection. */
-guint qof_collection_count (QofCollection *col);
+guint qof_collection_count (const QofCollection *col);
 
 /** destroy the collection */
 void qof_collection_destroy (QofCollection *col);
 
 /** return the type that the collection stores */
-QofIdType qof_collection_get_type (QofCollection *);
+QofIdType qof_collection_get_type (const QofCollection *);
 
 /** Find the entity going only from its guid */
-QofEntity * qof_collection_lookup_entity (QofCollection *, const GUID *);
+QofEntity * qof_collection_lookup_entity (const QofCollection *, const GUID *);
 
 /** Callback type for qof_entity_foreach */
 typedef void (*QofEntityForeachCB) (QofEntity *, gpointer user_data);
 
 /** Call the callback for each entity in the collection. */
-void qof_collection_foreach (QofCollection *, QofEntityForeachCB, 
+void qof_collection_foreach (const QofCollection *, QofEntityForeachCB, 
                              gpointer user_data);
 
 /** Store and retreive arbitrary object-defined data 
@@ -211,11 +211,11 @@
  * destroyed, so that the user has a chance to clean up anything
  * that was put in the 'data' member here.
  */
-gpointer qof_collection_get_data (QofCollection *col);
+gpointer qof_collection_get_data (const QofCollection *col);
 void qof_collection_set_data (QofCollection *col, gpointer user_data);
 
 /** Return value of 'dirty' flag on collection */
-gboolean qof_collection_is_dirty (QofCollection *col);
+gboolean qof_collection_is_dirty (const QofCollection *col);
 
 /** @name QOF_TYPE_COLLECT: Linking one entity to many of one type
 

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -79,28 +79,28 @@
 }
 
 const GUID *
-qof_instance_get_guid (QofInstance *inst)
+qof_instance_get_guid (const QofInstance *inst)
 {
 	if (!inst) return NULL;
 	return &inst->entity.guid;
 }
 
 QofBook *
-qof_instance_get_book (QofInstance *inst)
+qof_instance_get_book (const QofInstance *inst)
 {
 	if (!inst) return NULL;
 	return inst->book;
 }
 
 KvpFrame*
-qof_instance_get_slots (QofInstance *inst)
+qof_instance_get_slots (const QofInstance *inst)
 {
   if (!inst) return NULL;
   return inst->kvp_data;
 }
 
 Timespec
-qof_instance_get_last_update (QofInstance *inst)
+qof_instance_get_last_update (const QofInstance *inst)
 {
 	if (!inst)
 	{
@@ -111,7 +111,7 @@
 }
 
 int
-qof_instance_version_cmp (QofInstance *left, QofInstance *right)
+qof_instance_version_cmp (const QofInstance *left, const QofInstance *right)
 {
 	if (!left && !right) return 0;
 	if (!left) return -1;
@@ -124,7 +124,7 @@
 }
 
 void
-qof_instance_print_dirty (QofEntity *entity, gpointer dummy)
+qof_instance_print_dirty (const QofEntity *entity, gpointer dummy)
 {
   QofInstance *inst = QOF_INSTANCE(entity);
 
@@ -160,14 +160,14 @@
 }
 
 gboolean
-qof_instance_check_edit(QofInstance *inst)
+qof_instance_check_edit(const  QofInstance *inst)
 {
 	if(inst->editlevel > 0) { return TRUE; }
 	return FALSE;
 }
 
 gboolean
-qof_instance_do_free(QofInstance *inst)
+qof_instance_do_free(const QofInstance *inst)
 {
 	return inst->do_free;
 }
@@ -211,7 +211,7 @@
 /* ========================================================== */
 
 void
-qof_instance_gemini (QofInstance *to, QofInstance *from)
+qof_instance_gemini (QofInstance *to, const QofInstance *from)
 {
   time_t now;
 
@@ -234,7 +234,7 @@
 }
 
 QofInstance *
-qof_instance_lookup_twin (QofInstance *src, QofBook *target_book)
+qof_instance_lookup_twin (const QofInstance *src, QofBook *target_book)
 {
 	QofCollection *col;
 	KvpFrame *fr;

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofinstance.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -57,13 +57,13 @@
 void qof_instance_release (QofInstance *inst);
 
 /** Return the book pointer */
-QofBook * qof_instance_get_book (QofInstance *);
+QofBook * qof_instance_get_book (const QofInstance *);
 
 /** Return the GUID of this instance */
-const GUID * qof_instance_get_guid (QofInstance *);
+const GUID * qof_instance_get_guid (const QofInstance *);
 
 /** Return the pointer to the kvp_data */
-KvpFrame* qof_instance_get_slots (QofInstance *);
+KvpFrame* qof_instance_get_slots (const QofInstance *);
 
 /** Return the last time this instance was modified.  If QofInstances
  *  are used with the QofObject storage backends, then the instance
@@ -71,7 +71,7 @@
  *  multi-user updates.  Non-backend code should not set the update 
  *  times. 
  */
-Timespec qof_instance_get_last_update (QofInstance *inst);
+Timespec qof_instance_get_last_update (const QofInstance *inst);
 
 /** Compare two instances, based on thier last update times. 
  *  Returns a negative, zero or positive value, respectively, 
@@ -79,9 +79,9 @@
  *  Accepts NULL pointers, NULL's are by definition earlier
  *  than any value.
  */
-int qof_instance_version_cmp (QofInstance *left, QofInstance *right);
+int qof_instance_version_cmp (const QofInstance *left, const QofInstance *right);
 
-void qof_instance_print_dirty (QofEntity *entity, gpointer dummy);
+void qof_instance_print_dirty (const QofEntity *entity, gpointer dummy);
 
 /** Return value of is_dirty flag */
 gboolean qof_instance_is_dirty (QofInstance *);
@@ -92,9 +92,9 @@
 */
 void qof_instance_set_dirty(QofInstance* inst);
 
-gboolean qof_instance_check_edit(QofInstance *inst);
+gboolean qof_instance_check_edit(const QofInstance *inst);
 
-gboolean qof_instance_do_free(QofInstance *inst);
+gboolean qof_instance_do_free(const QofInstance *inst);
 
 void qof_instance_mark_free(QofInstance *inst);
 
@@ -109,7 +109,7 @@
  *  the gemini kvp includes the book guid as well, so that the right book can
  *  be found.
  */
-void qof_instance_gemini (QofInstance *to, QofInstance *from);
+void qof_instance_gemini (QofInstance *to, const QofInstance *from);
 
 /** The qof_instance_lookup_twin() routine will find the "twin" of this
  *    instance 'src' in the given other 'book' (if the twin exists).
@@ -125,7 +125,7 @@
  *    in 'book', and return it.  If not found, it returns NULL.  This
  *    routine uses the 'gemini' kvp values to do its work. 
  */
-QofInstance * qof_instance_lookup_twin (QofInstance *src, QofBook *book);
+QofInstance * qof_instance_lookup_twin (const QofInstance *src, QofBook *book);
 
 /* @} */
 /* @} */

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofobject-p.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofobject-p.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofobject-p.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -40,7 +40,7 @@
 void qof_object_book_begin (QofBook *book);
 void qof_object_book_end (QofBook *book);
 
-gboolean qof_object_is_dirty (QofBook *book);
+gboolean qof_object_is_dirty (const QofBook *book);
 void qof_object_mark_clean (QofBook *book);
 
 /** \brief check an object can be created and supports iteration

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -89,7 +89,7 @@
 }
 
 gboolean 
-qof_object_is_dirty (QofBook *book)
+qof_object_is_dirty (const QofBook *book)
 {
   GList *l;
 

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofobject.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -92,7 +92,7 @@
   void                (*book_end)(QofBook *);
 
   /** Determine if there are any dirty items in this book */
-  gboolean            (*is_dirty)(QofCollection *);
+  gboolean            (*is_dirty)(const QofCollection *);
 
   /** Mark this object's book clean (for after a load) */
   void                (*mark_clean)(QofCollection *);
@@ -104,7 +104,7 @@
    *  provide this routine, as without it, little of interest can 
     * be done.
    */
-  void                (*foreach)(QofCollection *, QofEntityForeachCB, gpointer);
+  void                (*foreach)(const QofCollection *, QofEntityForeachCB, gpointer);
 
   /** Given a particular item of this type, return a printable string. 
    */

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -473,13 +473,17 @@
    */
   if (sort->param_fcns) 
   {
-    sort->comp_fcn = qof_query_core_get_compare (resObj->param_type);
+    /* First, check if this parameter has a sort function override.
+     * if not then check if there's a global compare function for the type
+     */
+    if (resObj->param_compfcn)
+      sort->comp_fcn = resObj->param_compfcn;
+    else
+      sort->comp_fcn = qof_query_core_get_compare (resObj->param_type);
 
-    /* Hrm, perhaps this is an object compare, not a core compare? */
+    /* Next, perhaps this is an object compare, not a core type compare? */
     if (sort->comp_fcn == NULL)
-    {
       sort->obj_cmp = qof_class_get_default_sort (resObj->param_type);
-    }
   } 
   else if (!safe_strcmp (sort->param_list->data, QUERY_DEFAULT_SORT))
   {
@@ -682,15 +686,17 @@
   }
 }
 
-GList * qof_query_run (QofQuery *q)
+static GList * qof_query_run_internal (QofQuery *q,
+				       void(*run_cb)(QofQueryCB*,gpointer),
+				       gpointer cb_arg)
 {
   GList *matching_objects = NULL;
-  GList *node;
   int        object_count = 0;
 
   if (!q) return NULL;
   g_return_val_if_fail (q->search_for, NULL);
   g_return_val_if_fail (q->books, NULL);
+  g_return_val_if_fail (run_cb, NULL);
   ENTER (" q=%p", q);
 
   /* XXX: Prioritize the query terms? */
@@ -712,27 +718,9 @@
     memset (&qcb, 0, sizeof (qcb));
     qcb.query = q;
 
-    /* For each book */
-    for (node=q->books; node; node=node->next) 
-    {
-      QofBook *book = node->data;
-      QofBackend *be = book->backend;
+    /* Run the query callback */
+    run_cb(&qcb, cb_arg);
 
-      /* run the query in the backend */
-      if (be) 
-      {
-        gpointer compiled_query = g_hash_table_lookup (q->be_compiled, book);
-
-        if (compiled_query && be->run_query)
-        {
-          (be->run_query) (be, compiled_query);
-        }
-      }
-
-      /* And then iterate over all the objects */
-      qof_object_foreach (q->search_for, book, (QofEntityForeachCB) check_item_cb, &qcb);
-    }
-
     matching_objects = qcb.list;
     object_count = qcb.count;
   }
@@ -794,7 +782,68 @@
   return matching_objects;
 }
 
+static void qof_query_run_cb(QofQueryCB* qcb, gpointer cb_arg)
+{
+  GList *node;
+
+  (void)cb_arg; /* unused */
+  g_return_if_fail(qcb);
+
+  for (node=qcb->query->books; node; node=node->next) 
+  {
+    QofBook *book = node->data;
+    QofBackend *be = book->backend;
+
+    /* run the query in the backend */
+    if (be) 
+    {
+      gpointer compiled_query = g_hash_table_lookup (qcb->query->be_compiled,
+						     book);
+
+      if (compiled_query && be->run_query)
+      {
+	(be->run_query) (be, compiled_query);
+      }
+    }
+
+    /* And then iterate over all the objects */
+    qof_object_foreach (qcb->query->search_for, book,
+			(QofEntityForeachCB) check_item_cb, qcb);
+  }
+}
+
+GList * qof_query_run (QofQuery *q)
+{
+  /* Just a wrapper */
+  return qof_query_run_internal(q, qof_query_run_cb, NULL);
+}
+
+static void qof_query_run_subq_cb(QofQueryCB* qcb, gpointer cb_arg)
+{
+  QofQuery* pq = cb_arg;
+
+  g_return_if_fail(pq);
+  g_list_foreach(qof_query_last_run(pq), check_item_cb, qcb);
+}
+
 GList *
+qof_query_run_subquery (QofQuery *subq, const QofQuery* primaryq)
+{
+  if (!subq) return NULL;
+  if (!primaryq) return NULL;
+
+  /* Make sure we're searching for the same thing */
+  g_return_val_if_fail (subq->search_for, NULL);
+  g_return_val_if_fail (primaryq->search_for, NULL);
+  g_return_val_if_fail(!safe_strcmp(subq->search_for, primaryq->search_for),
+		       NULL);
+
+  /* Perform the subquery */
+  return qof_query_run_internal(subq, qof_query_run_subq_cb,
+				(gpointer)primaryq);
+}
+
+GList *
 qof_query_last_run (QofQuery *query)
 {
   if (!query)
@@ -1204,7 +1253,7 @@
 }
 
 void qof_query_add_guid_match (QofQuery *q, GSList *param_list,
-                           const GUID *guid, QofQueryOp op)
+                               const GUID *guid, QofQueryOp op)
 {
   GList *g = NULL;
 

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofquery.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -221,6 +221,16 @@
  */
 GList * qof_query_last_run (QofQuery *query);
 
+/** Perform a subquery, return the results.
+ *  Instead of running over a book, the subquery runs over the results
+ *  of the primary query.
+ *
+ *  Do NOT free the resulting list.  This list is managed internally
+ *  by QofQuery.
+ */
+GList * qof_query_run_subquery (QofQuery *subquery,
+                                const QofQuery* primary_query);
+
 /** Remove all query terms from query.  query matches nothing 
  *  after qof_query_clear().
  */

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore-p.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore-p.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore-p.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,14 +45,6 @@
 			       QofParam *getter,
 			       QofQueryPredData *pdata);
 
-/* A callback for how to compare two (same-type) objects based on a
- * common getter (parameter member), using the provided comparison
- * options (which are the type-specific options).
- */
-typedef gint (*QofCompareFunc) (gpointer a, gpointer b,
-                              gint compare_options,
-                              QofParam *getter);
-
 /* Lookup functions */
 QofQueryPredicateFunc qof_query_core_get_predicate (gchar const *type);
 QofCompareFunc qof_query_core_get_compare (gchar const *type);

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,7 @@
 #include "config.h"
 
 #include <glib.h>
+#include <stdlib.h>
 
 #include "qof.h"
 #include "qofquerycore-p.h"
@@ -182,6 +183,36 @@
   return safe_strcmp (s1, s2);
 }
 
+int
+qof_string_number_compare_func (gpointer a, gpointer b, gint options,
+                                QofParam *getter)
+{
+  const char *s1, *s2;
+  char *sr1, *sr2;
+  long i1, i2;
+  g_return_val_if_fail (a && b && getter &&getter->param_getfcn, COMPARE_ERROR);
+
+  s1 = ((query_string_getter)getter->param_getfcn) (a, getter);
+  s2 = ((query_string_getter)getter->param_getfcn) (b, getter);
+
+  // Deal with NULL strings
+  if (s1 == s2)  return 0;
+  if (!s1 && s2) return -1;
+  if (s1 && !s2) return 1;
+
+  // Convert to integers and test
+  i1 = strtol(s1, &sr1, 0);
+  i2 = strtol(s2, &sr2, 0);
+  if (i1 < i2)  return -1;
+  if (i1 > i2)  return 1;
+
+  // If the integers match, then test the REST of the string as text.
+  if (options == QOF_STRING_MATCH_CASEINSENSITIVE)
+    return safe_strcasecmp (sr1, sr2);
+
+  return safe_strcmp (sr1, sr2);
+}
+
 static void
 string_free_pdata (QofQueryPredData *pd)
 {

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofquerycore.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -187,6 +187,14 @@
  */
 char * qof_query_core_to_string (QofType, gpointer object, QofParam *getter);
 
+/** Compare two parameter(strings) as if they are numbers!
+ *  the two objects, a and b, are the objects being compared
+ *  this_param is the QofParam for this parameter in the objects
+ */
+int qof_string_number_compare_func (gpointer a, gpointer b, gint options,
+                                    QofParam *this_param);
+
+
 #endif /* QOF_QUERYCORE_H */
 /* @} */
 /* @} */

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofsession.c
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofsession.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofsession.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,6 +45,7 @@
 #include "qofbook-p.h"
 #include "qofsession-p.h"
 #include "qofobject-p.h"
+#include "qofla-dir.h" /* for QOF_LIB_DIR */
 
 /** \deprecated should not be static */
 static QofSession * current_session = NULL;
@@ -1015,6 +1016,18 @@
     *p = '\0';
     qof_session_load_backend(session, access_method);
     g_free (access_method);
+#ifdef G_OS_WIN32
+    if (NULL == session->backend)
+    {
+      /* Clear the error condition of previous errors */
+      qof_session_clear_error (session);
+
+      /* On windows, a colon can be part of a normal filename. So if
+	 no backend was found (which means the part before the colon
+	 wasn't an access method), fall back to the file backend. */
+      qof_session_load_backend(session, "file"); 
+    }
+#endif
   }
   else
   {

Modified: gnucash/branches/register-rewrite/lib/libqof/qof/qofutil.h
===================================================================
--- gnucash/branches/register-rewrite/lib/libqof/qof/qofutil.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/lib/libqof/qof/qofutil.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,7 +45,15 @@
 #if HAVE_SCANF_LLD
 # define QOF_SCANF_LLD "%lld"
 #else
-# define QOF_SCANF_LLD "%qd"
+# if HAVE_SCANF_QD
+#  define QOF_SCANF_LLD "%qd"
+# else
+#  if HAVE_SCANF_I64D
+#   define QOF_SCANF_LLD "%I64d"
+#  else
+#   error "No scanf format string is known for LLD. Fix your ./configure so that the correct one is detected!"
+#  endif
+# endif
 #endif
 
 #define QOF_MOD_UTIL "qof-utilities"

Copied: gnucash/branches/register-rewrite/macros/ac_pkg_swig.m4 (from rev 15058, gnucash/trunk/macros/ac_pkg_swig.m4)

Copied: gnucash/branches/register-rewrite/macros/binreloc.m4 (from rev 15058, gnucash/trunk/macros/binreloc.m4)

Deleted: gnucash/branches/register-rewrite/macros/g-wrap.m4
===================================================================
--- gnucash/branches/register-rewrite/macros/g-wrap.m4	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/macros/g-wrap.m4	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,81 +0,0 @@
-dnl g-wrap.m4
-dnl Written by Robert Merkel <rgmerk at mira.net>
-dnl Parts ripped off from guile.m4 and ORBit.m4
-
-dnl check whether we use the old or new guile smobs
-
-AC_DEFUN([AC_GWRAP_CHECK_GUILE],
-[if test x$GUILE = x ; then
-	AC_PATH_PROG(GUILE, guile, no)
- fi
- dnl AC_MSG_WARN(guile is $GUILE)
- if test "${GUILE}" = "no" ; then
-	AC_MSG_ERROR(g-wrap couldn't find guile.)
- fi
-])
-
-dnl AM_PATH_GWRAP ([MINIMUM-VERSION, [ACTION-IF-FOUND.
-dnl	           [ACTION-IF-NOT-FOUND]]])
-
-dnl tests for minimum version of g-wrap.
-dnl sets G_WRAP_CONFIG and GWRAP_OLD_GUILE_SMOB if needed.
-
-AC_DEFUN([AM_PATH_GWRAP],
-[dnl
-dnl
-dnl
-AC_ARG_WITH(g-wrap-prefix,[  --with-g-wrap-prefix=PFX  Prefix where g-wrap is installed (optional)], 
-    gwrap_prefix="$withval", g_wrap_prefix="")
-
-min_gwrap_version=ifelse([$1], , 0.9.1,$1)
-
-if test x${GUILE} = x ; then
-   AC_PATH_PROG(GUILE, guile, no)
-fi
-
-dnl if prefix set, then set them explicitly
-if test x${gwrap_prefix} != x ; then
-   G_WRAP_CONFIG=${gwrap_prefix}/bin/g-wrap-config
-else
-
-  AC_PATH_PROG(G_WRAP_CONFIG, g-wrap-config, no)
-  if test x${G_WRAP_CONFIG} = xno ; then
-	CHECK_VERSION="no"
-	ifelse([$3], , true , [AC_MSG_WARN(g-wrap-config failed)
-	$3])
-  fi
-fi
-
-if test x$CHECK_VERSION != xno ; then
-AC_MSG_CHECKING(for g-wrap - version >= ${min_gwrap_version})
-
-gwrap_major_version=`${G_WRAP_CONFIG} --version | \
-	sed 's/g-wrap-config \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-gwrap_minor_version=`${G_WRAP_CONFIG} --version | \
-	sed 's/g-wrap-config \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-gwrap_micro_version=`${G_WRAP_CONFIG} --version | \
-	sed 's/g-wrap-config \([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-
-
-major_required=`echo ${min_gwrap_version} |\
-        sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'`
-minor_required=`echo ${min_gwrap_version} |\
-	sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'`
-micro_required=`echo ${min_gwrap_version} |\
-	sed 's/\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'`
-
-if ${GUILE} -c "(cond ((> ${gwrap_major_version} ${major_required}) (exit 0))\
-	           ((< ${gwrap_major_version} ${major_required}) (exit 1))\
-                   ((> ${gwrap_minor_version} ${minor_required}) (exit 0))\
-		   ((< ${gwrap_minor_version} ${minor_required}) (exit 1))\
-	           ((< ${gwrap_micro_version} ${micro_required}) (exit 1))\
-		   (else (exit 0)))" ; then
-	AC_MSG_RESULT(yes)
-	ifelse([$2], , true, [$2])
-else
-	AC_MSG_RESULT(no)
-	ifelse([$3], , true , [AC_MSG_WARN(guile check failed)
-	$3])
-fi
-dnl check version
-fi])

Modified: gnucash/branches/register-rewrite/macros/legacy_macros.m4
===================================================================
--- gnucash/branches/register-rewrite/macros/legacy_macros.m4	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/macros/legacy_macros.m4	2007-01-05 17:25:28 UTC (rev 15313)
@@ -14,13 +14,18 @@
    AC_PATH_PROG(GUILE, guile, no)
 fi
 
+dnl We expect the following variables:
+dnl - BUILD_GUILE="yes" if guile-config is available in PATH
+dnl - name_build_guile="guile-config" i.e. the name of guile-config
+dnl - GUILE="/usr/bin/guile" as detected above.
+
 version_ok=
 min_guile_version=ifelse([$1], , 1.3,$1)
 max_guile_version=ifelse([$2], , 99.99.99,$2)
 
 AC_MSG_CHECKING(for guile - ${min_guile_version} <= version < ${max_guile_version})
 
-if test x${BUILD_GUILE} != x -a ${BUILD_GUILE} != no ; then
+if test "x${BUILD_GUILE}" != x -a "x${BUILD_GUILE}" != xno ; then
   guile_version=`${name_build_guile} --version 2>&1`
   guile_version="$guile_version.0"
   guile_major_version=`echo $guile_version | \
@@ -116,7 +121,18 @@
 }
 ],
         am_cv_scanf_lld=yes,
-        am_cv_scanf_lld=no))
+        am_cv_scanf_lld=no,[[
+	# When cross-compiling, simply insert known values here
+	case $host in
+	  *-*-mingw*)
+	    # For mingw we know the result
+	    am_cv_scanf_lld=no
+	    ;;
+	  *)
+	    AC_MSG_ERROR([scanf support unknown.])
+	    ;;
+	esac
+]]))
   if test $am_cv_scanf_lld = yes; then
     AC_DEFINE(HAVE_SCANF_LLD, 1,
       [Define if scanf supports %lld conversions.])
@@ -146,13 +162,65 @@
 }
 ],
         am_cv_scanf_qd=yes,
-        am_cv_scanf_qd=no))
+        am_cv_scanf_qd=no,[[
+	# When cross-compiling, simply insert known values here
+	case $host in
+	  *-*-mingw*)
+	    # For mingw we know the result
+	    am_cv_scanf_qd=no
+	    ;;
+	  *)
+	    AC_MSG_ERROR([scanf support unknown.])
+	    ;;
+	esac
+]]))
   if test $am_cv_scanf_qd = yes; then
     AC_DEFINE(HAVE_SCANF_QD, 1,
       [Define if scanf supports %qd conversions.])
   fi
 ])
 
+AC_DEFUN([SCANF_I64D_CHECK],
+[
+  AC_CACHE_CHECK([if scanf supports %I64d conversions],
+                 am_cv_scanf_i64d,
+      AC_TRY_RUN([
+#include <stdio.h>
+#include <stdlib.h>
+
+int main ()
+{
+  long long int d;
+  long long int e;
+
+  d = 0;
+  e =  100000;
+  e *= 100000;
+  if ((sscanf ("10000000000", "%I64d", &d) != 1) || (d != e))
+    exit (1);
+
+  exit (0);
+}
+],
+        am_cv_scanf_i64d=yes,
+        am_cv_scanf_i64d=no,[[
+	# When cross-compiling, simply insert known values here
+	case $host in
+	  *-*-mingw*)
+	    # For mingw we know the result
+	    am_cv_scanf_i64d=yes
+	    ;;
+	  *)
+	    AC_MSG_ERROR([scanf support unknown.])
+	    ;;
+	esac
+]]))
+  if test $am_cv_scanf_i64d = yes; then
+    AC_DEFINE(HAVE_SCANF_I64D, 1,
+      [Define if scanf supports %I64d conversions.])
+  fi
+])
+
 AC_DEFUN([LANGINFO_D_FMT_CHECK],
 [
   AC_CACHE_CHECK([for nl_langinfo and D_FMT], am_cv_langinfo_dfmt,

Modified: gnucash/branches/register-rewrite/packaging/gnucash.spec.in
===================================================================
--- gnucash/branches/register-rewrite/packaging/gnucash.spec.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/packaging/gnucash.spec.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -7,7 +7,9 @@
 %define _with_ofx 0
 %define _with_hbci 0
 
-%define fc_rel %(rpm -q --queryformat='%{VERSION}' fedora-release)
+# The --whatprovides redhat-release lets us work on RHEL as well as FC
+# Granted, it will look weird, but at least it wont fail outright.
+%define fc_rel %(rpm -q --queryformat='%{VERSION}' --whatprovides redhat-release)
 %define version @-VERSION-@
 %define __libtoolize /bin/true
 
@@ -48,6 +50,7 @@
 BuildRequires: 	bzip2-devel, expat-devel, guile-devel
 BuildRequires: 	libglade2-devel, libgsf-devel
 BuildRequires: 	libjpeg-devel, openssl-devel
+BuildRequires:  libtool-ltdl-devel
 
 %description
 GnuCash is a personal finance manager. A check-book like
@@ -183,8 +186,8 @@
 %{_libdir}/*
 %{_datadir}/gnucash
 %{_datadir}/applications/*
-%{_datadir}/mime-info/gnucash.*
 %{_datadir}/xml/gnucash/xsl/*
+%{_datadir}/pixmaps/*
 %{_sysconfdir}/gconf/schemas/apps_gnucash*
 %if %{_with_ofx}
 %exclude %{_libdir}/gnucash/libgncmod-ofx*

Copied: gnucash/branches/register-rewrite/packaging/win32 (from rev 15058, gnucash/trunk/packaging/win32)


Property changes on: gnucash/branches/register-rewrite/packaging/win32
___________________________________________________________________
Name: svn:ignore
   + gnucash.iss



Modified: gnucash/branches/register-rewrite/po/POTFILES.skip
===================================================================
--- gnucash/branches/register-rewrite/po/POTFILES.skip	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/po/POTFILES.skip	2007-01-05 17:25:28 UTC (rev 15313)
@@ -4,9 +4,10 @@
 src/import-export/csv/gnc-csv2glist.c
 src/business/business-core/gncBusPeriod.c
 src/backend/dwi/qofmap.c
+src/gnome-utils/gnctreemodelsort.c
+src/gnome-utils/gtktreedatalist.c
 src/gnome-utils/gnc-tree-model-selection.c
 src/backend/file/gncmod-backend-file.c
-src/gnome/schemas/apps_gnucash_dialog_scheduled_transctions.schemas.in
 src/backend/file/io-gncbin-r.c
 src/import-export/binary-import/binary-import.glade
 src/import-export/binary-import/druid-commodity.c


Property changes on: gnucash/branches/register-rewrite/src
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
*.diff
*.diffs
*.patch
*.log
*.xac.*.xac
.deps
.libs
gnc-dir.h
.DS_Store
semantic.cache

TAGS

   + Makefile
Makefile.in
*.diff
*.diffs
*.patch
*.log
*.xac.*.xac
.deps
.libs
gnc-dir.h
swig-runtime.h
.DS_Store
semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -28,18 +28,26 @@
 DIST_SUBDIRS = $(NONGUI_SUBDIRS) $(GUI_SUBDIRS_1) report $(GUI_SUBDIRS_2)
 
 if GNUCASH_ENABLE_GUI
-SUBDIRS = $(DIST_SUBDIRS)
+SUBDIRS = . $(DIST_SUBDIRS)
 else 
-SUBDIRS = $(NONGUI_SUBDIRS) report
+SUBDIRS = . $(NONGUI_SUBDIRS) report
 endif
 
 noinst_HEADERS = \
   RecnWindow.h \
+  swig-runtime.h \
   gnc-ui.h
 
 bin_SCRIPTS = gnc-test-env
 
+if BUILDING_FROM_SVN
+swig-runtime.h:
+	$(SWIG) -guile -external-runtime $@
+endif
+MAINTAINERCLEANFILES = swig-runtime.h
+
 EXTRA_DIST = \
+  base-typemaps.i \
   README.modules \
   gnc-test-env \
   valgrind-gnucash.supp \


Property changes on: gnucash/branches/register-rewrite/src/app-utils
___________________________________________________________________
Name: svn:ignore
   - *.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gw-app-utils.scm
gw-app-utils.c
gw-app-utils.h
gw-app-utils.html
i18n.h
g-wrapped
gnucash


semantic.cache

TAGS

   + *.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
swig-app-utils.c
i18n.h
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/app-utils/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,7 @@
 SUBDIRS = . test
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-app-utils.la libgw-app-utils.la
+pkglib_LTLIBRARIES = libgncmod-app-utils.la
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \
@@ -10,13 +10,13 @@
   -I${top_srcdir}/src/core-utils \
   -I${top_srcdir}/src/engine \
   ${GUILE_INCS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GLIB_CFLAGS} \
   ${QOF_CFLAGS} \
   ${GCONF_CFLAGS} \
   ${GTK_CFLAGS}
 
 libgncmod_app_utils_la_SOURCES = \
+  swig-app-utils.c \
   file-utils.c \
   gfec.c \
   gnc-account-merge.c \
@@ -64,34 +64,23 @@
   guile-util.h \
   option-util.h
 
-noinst_HEADERS = \
-  gw-app-utils.h
-
 libgncmod_app_utils_la_LIBADD = \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
-  ${top_builddir}/src/engine/libgw-engine.la \
   ${top_builddir}/src/calculation/libgncmod-calculation.la \
   ${top_builddir}/src/core-utils/libcore-utils.la \
   ${GCONF_LIBS} \
   ${GTK_LIBS} \
-  ${G_WRAP_LINK_ARGS} \
   ${GUILE_LIBS} \
   ${QOF_LIBS} \
   ${GLIB_LIBS}
 
-libgw_app_utils_la_LIBADD = \
-  libgncmod-app-utils.la \
-  ${top_builddir}/src/engine/libgncmod-engine.la \
-  ${top_builddir}/src/engine/libgw-engine.la \
-  ${top_builddir}/src/core-utils/libcore-utils.la \
-  ${G_WRAP_LINK_ARGS} \
-  ${GUILE_LIBS} \
-  ${QOF_LIBS} \
-  ${GLIB_LIBS}
+if BUILDING_FROM_SVN
+swig-app-utils.c: app-utils.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
-libgw_app_utils_la_SOURCES = gw-app-utils.c
-
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
 gncmod_DATA = app-utils.scm 
 
@@ -101,50 +90,34 @@
   config-var.scm \
   date-utilities.scm \
   hooks.scm \
-  kvp-option-registry.scm \
   options.scm \
   prefs.scm \
   simple-obj.scm
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-app-utils.scm gw-app-utils-spec.scm
-
 noinst_DATA = .scm-links
 
 EXTRA_DIST = \
+  app-utils.i \
   ${gncmod_DATA} \
-  ${gncscm_DATA} \
-  ${gwmod_DATA}
+  ${gncscm_DATA}
 
 if GNUCASH_SEPARATE_BUILDDIR
-#For compiling
-SCM_FILE_LINKS = gw-app-utils-spec.scm
 #For executing test cases
-SCM_FILE_LINKS += \
+SCM_FILE_LINKS = \
   ${gncmod_DATA} \
   ${gncscm_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-gw-app-utils.scm gw-app-utils.c gw-app-utils.h: \
-  .scm-links gw-app-utils-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (set! %load-path (cons \"${PWD}\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/engine\" %load-path)) \
-	  (primitive-load \"./gw-app-utils-spec.scm\") \
-	  (gw:generate-wrapset \"gw-app-utils\")"
-
-BUILT_SOURCES = gw-app-utils.scm gw-app-utils.c gw-app-utils.h
-DISTCLEANFILES = ${SCM_FILE_LINKS} gnucash g-wrapped .scm-links \
-                 gw-app-utils.html
+CLEANFILES = ${SCM_FILE_LINKS} gnucash .scm-links
+MAINTAINERCLEANFILES = swig-app-utils.c

Copied: gnucash/branches/register-rewrite/src/app-utils/app-utils.i (from rev 15058, gnucash/trunk/src/app-utils/app-utils.i)

Modified: gnucash/branches/register-rewrite/src/app-utils/app-utils.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/app-utils.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/app-utils.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,8 +1,8 @@
 
 (define-module (gnucash app-utils))
-(use-modules (g-wrapped gw-app-utils))
+(use-modules (sw_app_utils))
 (use-modules (srfi srfi-1))
-(use-modules (gnucash main) (g-wrapped gw-gnc)) ;; FIXME: delete after we finish modularizing.
+(use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash gnc-module))
 
 (gnc:module-load "gnucash/engine" 0)
@@ -125,7 +125,7 @@
 (export gnc:config-file-format-version)
 
 ;; gw-engine-spec.scm
-(re-export gnc:*save-options-hook*)
+(re-export HOOK-SAVE-OPTIONS)
 
 ;; date-utilities.scm
 
@@ -225,14 +225,9 @@
 (export gnc:reldate-initialize)
 
 ;; hooks 
-(re-export gnc:hook-define)
 (export gnc:hook-run-danglers)		;; from hooks.scm
-(re-export gnc:hook-add-dangler)
-(re-export gnc:hook-remove-dangler)
-(re-export gnc:*book-opened-hook*)
-(re-export gnc:*new-book-hook*)
-(re-export gnc:*book-closed-hook*)
-(re-export gnc:*report-hook*)
+(re-export gnc-hook-add-scm-dangler)
+(re-export HOOK-REPORT)
 
 ;; simple-obj
 (export make-simple-class)
@@ -243,16 +238,12 @@
 (export simple-obj-from-list)
 (export make-simple-obj)
 
-;; kvp-option-registry
-(export gnc:register-kvp-option-generator)
-(export gnc:unregister-kvp-option-generator)
-(export gnc:make-kvp-options)
+(define gnc:*kvp-option-path* '("options"))
 (export gnc:*kvp-option-path*)
 
 (load-from-path "c-interface.scm")
 (load-from-path "config-var.scm")
 (load-from-path "options.scm")
-(load-from-path "kvp-option-registry.scm")
 (load-from-path "hooks.scm")
 (load-from-path "prefs.scm")
 (load-from-path "date-utilities.scm")

Modified: gnucash/branches/register-rewrite/src/app-utils/c-interface.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/c-interface.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/c-interface.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -41,7 +41,7 @@
 
 
 ;; gettext functions
-(define gnc:gettext gnc:gettext-helper)
+(define gnc:gettext gnc-gettext-helper)
 (define gnc:_ gnc:gettext)
 (define _ gnc:gettext)
 (define-syntax N_

Modified: gnucash/branches/register-rewrite/src/app-utils/date-utilities.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/date-utilities.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/date-utilities.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -203,22 +203,22 @@
 ;; date-granularity comparison functions.
 
 (define (gnc:timepair-earlier-date t1 t2)
-  (gnc:timepair-earlier (gnc:timepair-canonical-day-time t1)
-			(gnc:timepair-canonical-day-time t2)))
+  (gnc:timepair-earlier (timespecCanonicalDayTime t1)
+			(timespecCanonicalDayTime t2)))
 
 (define (gnc:timepair-later-date t1 t2)
   (gnc:timepair-earlier-date t2 t1))
 
 (define (gnc:timepair-le-date t1 t2)
-  (gnc:timepair-le (gnc:timepair-canonical-day-time t1)
-		   (gnc:timepair-canonical-day-time t2)))
+  (gnc:timepair-le (timespecCanonicalDayTime t1)
+		   (timespecCanonicalDayTime t2)))
 
 (define (gnc:timepair-ge-date t1 t2)
   (gnc:timepair-le t2 t1))
 
 (define (gnc:timepair-eq-date t1 t2)
-  (gnc:timepair-eq (gnc:timepair-canonical-day-time t1)
-		   (gnc:timepair-canonical-day-time t2)))
+  (gnc:timepair-eq (timespecCanonicalDayTime t1)
+		   (timespecCanonicalDayTime t2)))
 
 ;; Build a list of time intervals. 
 ;;
@@ -454,10 +454,10 @@
     (gnc:date->timepair now)))
 
 (define (gnc:get-start-accounting-period)
-  (gnc:secs->timepair (gnc:accounting-period-start)))
+  (gnc:secs->timepair (gnc-accounting-period-fiscal-start)))
 
 (define (gnc:get-end-accounting-period)
-  (gnc:secs->timepair (gnc:accounting-period-end)))
+  (gnc:secs->timepair (gnc-accounting-period-fiscal-end)))
 
 (define (gnc:get-start-this-month)
   (let ((now (localtime (current-time))))

Modified: gnucash/branches/register-rewrite/src/app-utils/gfec.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gfec.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gfec.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -163,3 +163,26 @@
 
   return result;
 }
+
+static int error_in_scm_eval = FALSE;
+
+static void
+error_handler(const char *msg)
+{
+    g_warning(msg);
+    error_in_scm_eval = TRUE;
+}
+
+gboolean
+gfec_try_load(gchar *fn)
+{
+    g_message("looking for %s", fn);
+    if (g_file_test(fn, G_FILE_TEST_EXISTS)) {
+        g_message("trying to load %s", fn);
+        error_in_scm_eval = FALSE;
+        gfec_eval_file(fn, error_handler);
+        return !error_in_scm_eval;
+    }
+    return FALSE;
+}
+

Modified: gnucash/branches/register-rewrite/src/app-utils/gfec.h
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gfec.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gfec.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -10,6 +10,7 @@
 #define GFEC_H
 
 #include <libguile.h>
+#include <glib.h>
 #include "guile-mappings.h"
 
 typedef void (*gfec_error_handler)(const char *error_message);
@@ -17,5 +18,6 @@
 SCM gfec_eval_file(const char *file, gfec_error_handler error_handler);
 SCM gfec_eval_string(const char *str, gfec_error_handler error_handler);
 SCM gfec_apply(SCM proc, SCM arglist, gfec_error_handler error_handler);
+gboolean gfec_try_load(gchar *fn);
 
 #endif

Modified: gnucash/branches/register-rewrite/src/app-utils/gnc-account-merge.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gnc-account-merge.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gnc-account-merge.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,4 +1,5 @@
 /* Copyright (C) 2006 Joshua Sled <jsled at asynchronous.org> */
+#include "config.h"
 #include <glib.h>
 #include "gnc-account-merge.h"
 #include "Account.h"

Modified: gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -51,9 +51,6 @@
   GNCComponentCloseHandler close_handler;
   gpointer user_data;
 
-  SCM refresh_handler_scm;
-  SCM close_handler_scm;
-
   ComponentEventInfo watch_info;
 
   char *component_class;
@@ -404,9 +401,6 @@
   /* found one, add the handler */
   ci = g_new0 (ComponentInfo, 1);
 
-  ci->refresh_handler_scm = SCM_BOOL_F;
-  ci->close_handler_scm = SCM_BOOL_F;
-
   ci->watch_info.event_masks = g_hash_table_new (g_str_hash, g_str_equal);
   ci->watch_info.entity_events = guid_hash_table_new ();
 
@@ -453,32 +447,6 @@
   return ci->component_id;
 }
 
-gint
-gnc_register_gui_component_scm (const char * component_class,
-                                SCM refresh_handler,
-                                SCM close_handler)
-{
-  ComponentInfo *ci;
-
-  /* sanity check */
-  if (!component_class)
-  {
-    PERR ("no class specified");
-    return NO_COMPONENT;
-  }
-
-  ci = gnc_register_gui_component_internal (component_class);
-  g_return_val_if_fail (ci, NO_COMPONENT);
-
-  ci->refresh_handler_scm = refresh_handler;
-  scm_gc_protect_object (refresh_handler);
-
-  ci->close_handler_scm = close_handler;
-  scm_gc_protect_object (close_handler);
-
-  return ci->component_id;
-}
-
 void
 gnc_gui_component_watch_entity (gint component_id,
                                 const GUID *entity,
@@ -579,14 +547,6 @@
   g_free (ci->component_class);
   ci->component_class = NULL;
 
-  if (ci->refresh_handler_scm != SCM_BOOL_F)
-    scm_gc_unprotect_object (ci->refresh_handler_scm);
-  ci->refresh_handler_scm = SCM_BOOL_F;
-
-  if (ci->close_handler_scm != SCM_BOOL_F)
-    scm_gc_unprotect_object (ci->close_handler_scm);
-  ci->close_handler_scm = SCM_BOOL_F;
-
   g_free (ci);
 
 #if CM_DEBUG
@@ -745,8 +705,7 @@
     if (!ci)
       continue;
 
-    if (!ci->refresh_handler &&
-        !SCM_PROCEDUREP (ci->refresh_handler_scm)) {
+    if (!ci->refresh_handler) {
 #if CM_DEBUG
       fprintf (stderr, "no handlers for %s:%d\n", ci->component_class, ci->component_id);
 #endif
@@ -760,11 +719,6 @@
 	fprintf (stderr, "calling %s:%d C handler\n", ci->component_class, ci->component_id);
 #endif
         ci->refresh_handler (NULL, ci->user_data);
-      } else {
-#if CM_DEBUG
-	fprintf (stderr, "calling %s:%d SCM handler\n", ci->component_class, ci->component_id);
-#endif
-        scm_call_0 (ci->refresh_handler_scm);
       }
     }
     else if (changes_match (&ci->watch_info, &changes_backup))
@@ -774,11 +728,6 @@
 	fprintf (stderr, "calling %s:%d C handler\n", ci->component_class, ci->component_id);
 #endif
         ci->refresh_handler (changes_backup.entity_events, ci->user_data);
-      } else {
-#if CM_DEBUG
-	fprintf (stderr, "calling %s:%d SCM handler\n", ci->component_class, ci->component_id);
-#endif
-        scm_call_0 (ci->refresh_handler_scm);
       }
     }
     else
@@ -827,14 +776,11 @@
     return;
   }
 
-  if (!ci->close_handler &&
-      !SCM_PROCEDUREP (ci->close_handler_scm))
+  if (!ci->close_handler)
     return;
 
   if (ci->close_handler)
     ci->close_handler (ci->user_data);
-  else
-    scm_call_0 (ci->close_handler_scm);
 }
 
 void

Modified: gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.h
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gnc-component-manager.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,8 +21,6 @@
 #define GNC_COMPONENT_MANAGER_H
 
 #include <glib.h>
-#include <libguile.h>
-#include "guile-mappings.h"
 
 #include "GNCId.h"
 #include "qof.h"
@@ -154,24 +152,6 @@
                                  GNCComponentCloseHandler close_handler,
                                  gpointer user_data);
 
-/* gnc_register_gui_component_scm
- *   Register a GUI component with the manager with scheme callbacks.
- *
- * component_class: same as gnc_register_gui_component
- * refresh_cb:      refresh handler, may be SCM_BOOL_F, indicating
- *                  no handler. the handler is invoked with no
- *                  arguments
- * close_cb:        close handler, may be SCM_BOOL_F, invoked
- *                  with no arguments
- *
- * Notes:           The same notes apply as in gnc_register_gui_component.
- *
- * Return:          id of component, or NO_COMPONENT if error
- */
-gint gnc_register_gui_component_scm (const char * component_class,
-                                     SCM refresh_handler,
-                                     SCM close_handler);
-
 /* gnc_gui_component_set_session
  *   Set the associated session of this component
  *

Modified: gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,5 +1,5 @@
 /********************************************************************\
- * gnc-helpers.c -- gnucash g-wrap helper functions                 *
+ * gnc-helpers.c -- gnucash app-util helper functions               *
  * Copyright (C) 2000 Linas Vepstas                                 *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
@@ -26,7 +26,7 @@
 #include <libguile.h>
 #include "guile-mappings.h"
 #include <string.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "gnc-engine.h"
 #include "engine-helpers.h"
@@ -67,10 +67,12 @@
   info.commodity = gnc_scm_to_commodity (SCM_CAR (info_scm));
 
   info_scm = SCM_CDR (info_scm);
-  info.max_decimal_places = scm_num2int (SCM_CAR (info_scm), SCM_ARG1, __FUNCTION__);
+  info.max_decimal_places = scm_num2int (SCM_CAR (info_scm), SCM_ARG1,
+                                         __FUNCTION__);
 
   info_scm = SCM_CDR (info_scm);
-  info.min_decimal_places = scm_num2int (SCM_CAR (info_scm), SCM_ARG1, __FUNCTION__);
+  info.min_decimal_places = scm_num2int (SCM_CAR (info_scm), SCM_ARG1,
+                                         __FUNCTION__);
 
   info_scm = SCM_CDR (info_scm);
   info.use_separators = SCM_NFALSEP (SCM_CAR (info_scm));
@@ -117,7 +119,7 @@
  * attempt to optimize the speed of price quote retrieval, this
  * routine only converts the fields that price-quotes.scm uses. Since
  * it converts these fields all at once, it should prevent multiple
- * transitions back and forth from Scheme to C (via g-wrap) to extract
+ * transitions back and forth from Scheme to C to extract
  * the data from a pointers to a gnc-commodity (the older method).
  * This is *not* a reversible conversion as it drops data.
  *
@@ -139,9 +141,9 @@
   source = gnc_commodity_get_quote_source (comm);
   name = gnc_quote_source_get_internal_name (source);
   tz = gnc_commodity_get_quote_tz (comm);
-  comm_scm = gw_wcp_assimilate_ptr (comm, scm_c_eval_string("<gnc:commodity*>"));
-  def_comm_scm = gw_wcp_assimilate_ptr (gnc_default_currency (),
-					scm_c_eval_string("<gnc:commodity*>"));
+  comm_scm = SWIG_NewPointerObj(comm, SWIG_TypeQuery("_p_gnc_commodity"), 0);
+  def_comm_scm = SWIG_NewPointerObj(gnc_default_currency (),
+                                    SWIG_TypeQuery("_p_gnc_commodity"), 0);
 
   if (tz)
     info_scm = scm_cons (scm_makfrom0str (tz), info_scm);

Modified: gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.h
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gnc-helpers.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,5 +1,5 @@
 /********************************************************************\
- * gnc-helpers.h -- gnucash g-wrap helper functions                 *
+ * gnc-helpers.h -- gnucash app-util helper functions               *
  * Copyright (C) 2000 Linas Vepstas                                 *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *

Modified: gnucash/branches/register-rewrite/src/app-utils/gnc-ui-util.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gnc-ui-util.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gnc-ui-util.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,7 @@
 
 #include <glib.h>
 #include <glib/gi18n.h>
+#include <libguile.h>
 #include <ctype.h>
 #include <errno.h>
 #include <limits.h>
@@ -117,18 +118,18 @@
   }
   else if (safe_strcmp (choice, "income_expense") == 0)
   {
-    reverse_type[INCOME]  = TRUE;
-    reverse_type[EXPENSE] = TRUE;
+    reverse_type[ACCT_TYPE_INCOME]  = TRUE;
+    reverse_type[ACCT_TYPE_EXPENSE] = TRUE;
   }
   else
   {
     if (safe_strcmp (choice, "credit") != 0)
-      PERR("bad value '%s'", choice);
-    reverse_type[LIABILITY] = TRUE;
-    reverse_type[PAYABLE]   = TRUE;
-    reverse_type[EQUITY]    = TRUE;
-    reverse_type[INCOME]    = TRUE;
-    reverse_type[CREDIT]    = TRUE;
+      PERR("bad value '%s'", choice ? choice : "(null)");
+    reverse_type[ACCT_TYPE_LIABILITY] = TRUE;
+    reverse_type[ACCT_TYPE_PAYABLE]   = TRUE;
+    reverse_type[ACCT_TYPE_EQUITY]    = TRUE;
+    reverse_type[ACCT_TYPE_INCOME]    = TRUE;
+    reverse_type[ACCT_TYPE_CREDIT]    = TRUE;
   }
 
   if (choice != NULL)
@@ -450,14 +451,14 @@
     return NULL;
 
   atype = xaccAccountGetType (account);
-  if (atype != INCOME && atype != EXPENSE)
+  if (atype != ACCT_TYPE_INCOME && atype != ACCT_TYPE_EXPENSE)
     return NULL;
 
   code = xaccAccountGetTaxUSCode (account);
   if (!code)
     return NULL;
 
-  category = scm_c_eval_string (atype == INCOME ?
+  category = scm_c_eval_string (atype == ACCT_TYPE_INCOME ?
 				"txf-income-categories" :
 				"txf-expense-categories");
 
@@ -592,7 +593,7 @@
   base_name = equity_base_name (equity_type);
 
   account = xaccGetAccountFromName (group, base_name);
-  if (account && xaccAccountGetType (account) != EQUITY)
+  if (account && xaccAccountGetType (account) != ACCT_TYPE_EQUITY)
     account = NULL;
 
   if (!account)
@@ -600,7 +601,7 @@
     base_name = base_name && *base_name ? _(base_name) : "";
 
     account = xaccGetAccountFromName (group, base_name);
-    if (account && xaccAccountGetType (account) != EQUITY)
+    if (account && xaccAccountGetType (account) != ACCT_TYPE_EQUITY)
       account = NULL;
   }
 
@@ -613,7 +614,7 @@
   name = g_strconcat (base_name, " - ",
                       gnc_commodity_get_mnemonic (currency), NULL);
   account = xaccGetAccountFromName (group, name);
-  if (account && xaccAccountGetType (account) != EQUITY)
+  if (account && xaccAccountGetType (account) != ACCT_TYPE_EQUITY)
     account = NULL;
 
   name_exists = (account != NULL);
@@ -638,7 +639,7 @@
   }
 
   parent = xaccGetAccountFromName (group, _("Equity"));
-  if (parent && xaccAccountGetType (parent) != EQUITY)
+  if (parent && xaccAccountGetType (parent) != ACCT_TYPE_EQUITY)
     parent = NULL;
 
   account = xaccMallocAccount (book);
@@ -646,7 +647,7 @@
   xaccAccountBeginEdit (account);
 
   xaccAccountSetName (account, name);
-  xaccAccountSetType (account, EQUITY);
+  xaccAccountSetType (account, ACCT_TYPE_EQUITY);
   xaccAccountSetCommodity (account, currency);
 
   if (parent)

Modified: gnucash/branches/register-rewrite/src/app-utils/gncmod-app-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gncmod-app-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gncmod-app-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -57,6 +57,9 @@
     gnc_hook_run(HOOK_SAVE_OPTIONS, NULL);
 }
 
+
+extern SCM scm_init_sw_app_utils_module(void);
+
 int
 libgncmod_app_utils_LTX_gnc_module_init(int refcount)
 {
@@ -70,9 +73,10 @@
     return FALSE;
   }
 
-  /* publish g-wrapped bindings */
+  scm_init_sw_app_utils_module();
+  /* publish swig bindings */
   /* load the scheme code */
-  lmod("(g-wrapped gw-app-utils)");
+  lmod("(sw_app_utils)");
   lmod("(gnucash app-utils)");
 
   if (refcount == 0) {

Modified: gnucash/branches/register-rewrite/src/app-utils/guile-util.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/guile-util.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/guile-util.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,7 +23,7 @@
 #include <glib.h>
 #include <glib/gi18n.h>
 #include <string.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 #include <libguile.h>
 
 #include "qof.h"
@@ -367,7 +367,7 @@
 SCM
 gnc_copy_split(Split *split, gboolean use_cut_semantics)
 {
-  static SCM split_type = SCM_UNDEFINED;
+  static swig_type_info *split_type = NULL;
   SCM func;
   SCM arg;
 
@@ -378,13 +378,10 @@
   if (!SCM_PROCEDUREP(func))
     return SCM_UNDEFINED;
 
-  if(split_type == SCM_UNDEFINED) {
-    split_type = scm_c_eval_string("<gnc:Split*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(split_type != SCM_UNDEFINED) scm_gc_protect_object(split_type);
-  }
+  if (!split_type)
+      split_type = SWIG_TypeQuery("_p_Split");
 
-  arg = gw_wcp_assimilate_ptr(split, split_type);
+  arg = SWIG_NewPointerObj(split, split_type, 0);
 
   return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
 }
@@ -402,7 +399,7 @@
 gnc_copy_split_scm_onto_split(SCM split_scm, Split *split,
                               QofBook * book)
 {
-  static SCM split_type = SCM_UNDEFINED;
+  static swig_type_info *split_type = NULL;
   SCM result;
   SCM func;
   SCM arg;
@@ -427,13 +424,10 @@
   if (!SCM_PROCEDUREP(func))
     return;
 
-  if(split_type == SCM_UNDEFINED) {
-    split_type = scm_c_eval_string("<gnc:Split*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(split_type != SCM_UNDEFINED) scm_gc_protect_object(split_type);
-  }
+  if (!split_type)
+      split_type = SWIG_TypeQuery("_p_Split");
 
-  arg = gw_wcp_assimilate_ptr(split, split_type);
+  arg = SWIG_NewPointerObj(split, split_type, 0);
 
   scm_call_3(func, split_scm, arg, gnc_book_to_scm (book));
 }
@@ -736,7 +730,7 @@
 SCM
 gnc_copy_trans(Transaction *trans, gboolean use_cut_semantics)
 {
-  static SCM trans_type = SCM_UNDEFINED;
+  static swig_type_info *trans_type = NULL;
   SCM func;
   SCM arg;
 
@@ -747,13 +741,10 @@
   if (!SCM_PROCEDUREP(func))
     return SCM_UNDEFINED;
 
-  if(trans_type == SCM_UNDEFINED) {
-    trans_type = scm_c_eval_string("<gnc:Transaction*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(trans_type != SCM_UNDEFINED) scm_gc_protect_object(trans_type);
-  }
+  if (!trans_type)
+      trans_type = SWIG_TypeQuery("_p_Transaction");
 
-  arg = gw_wcp_assimilate_ptr(trans, trans_type);
+  arg = SWIG_NewPointerObj(trans, trans_type, 0);
 
   return scm_call_2(func, arg, SCM_BOOL(use_cut_semantics));
 }
@@ -798,7 +789,7 @@
                                             gboolean do_commit,
                                             QofBook *book)
 {
-  static SCM trans_type = SCM_UNDEFINED;
+  static swig_type_info *trans_type = NULL;
   SCM result;
   SCM func;
   SCM arg;
@@ -823,13 +814,10 @@
   if (!SCM_PROCEDUREP(func))
     return;
 
-  if(trans_type == SCM_UNDEFINED) {
-    trans_type = scm_c_eval_string("<gnc:Transaction*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(trans_type != SCM_UNDEFINED) scm_gc_protect_object(trans_type);
-  }
+  if (!trans_type)
+      trans_type = SWIG_TypeQuery("_p_Transaction");
 
-  arg = gw_wcp_assimilate_ptr(trans, trans_type);
+  arg = SWIG_NewPointerObj(trans, trans_type, 0);
 
   if ((guid_1 == NULL) || (guid_2 == NULL))
   {
@@ -1088,7 +1076,6 @@
 char *
 gnc_get_debit_string(GNCAccountType account_type)
 {
-  const char *type_string;
   const gchar *string;
   SCM result;
   SCM arg;
@@ -1098,13 +1085,11 @@
   if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_ACCOUNTING_LABELS, NULL))
     return g_strdup(_("Debit"));
 
-  if ((account_type < NO_TYPE) || (account_type >= NUM_ACCOUNT_TYPES))
-    account_type = NO_TYPE;
+  if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
+    account_type = ACCT_TYPE_NONE;
 
-  type_string = xaccAccountTypeEnumAsString(account_type);
+  arg = scm_long2num(account_type);
 
-  arg = scm_str2symbol(type_string);
-
   result = scm_call_1(getters.debit_string, arg);
   if (!SCM_STRINGP(result))
     return NULL;
@@ -1126,7 +1111,6 @@
 char *
 gnc_get_credit_string(GNCAccountType account_type)
 {
-  const char *type_string;
   const gchar *string;
   SCM result;
   SCM arg;
@@ -1136,13 +1120,11 @@
   if (gnc_gconf_get_bool(GCONF_GENERAL, KEY_ACCOUNTING_LABELS, NULL))
     return g_strdup(_("Credit"));
 
-  if ((account_type < NO_TYPE) || (account_type >= NUM_ACCOUNT_TYPES))
-    account_type = NO_TYPE;
+  if ((account_type < ACCT_TYPE_NONE) || (account_type >= NUM_ACCOUNT_TYPES))
+    account_type = ACCT_TYPE_NONE;
 
-  type_string = xaccAccountTypeEnumAsString(account_type);
+  arg = scm_long2num(account_type);
 
-  arg = scm_str2symbol(type_string);
-
   result = scm_call_1(getters.credit_string, arg);
   if (!SCM_STRINGP(result))
     return NULL;

Deleted: gnucash/branches/register-rewrite/src/app-utils/gw-app-utils-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/gw-app-utils-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/gw-app-utils-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,418 +0,0 @@
-(define-module (g-wrapped gw-app-utils-spec))
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(use-modules (g-wrap))
-(use-modules (g-wrap simple-type))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(use-modules (g-wrapped gw-engine-spec))
-
-(let ((ws (gw:new-wrapset "gw-app-utils")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-depends-on ws "gw-engine")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-app-utils))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset) 
-     (list 
-      "#include <config.h>\n"
-      "#include <option-util.h>\n"
-      "#include <gnc-euro.h>\n"
-      "#include <gnc-exp-parser.h>\n"
-      "#include <gnc-ui-util.h>\n"
-      "#include <gnc-gettext-util.h>\n"
-      "#include <gnc-helpers.h>\n"
-      "#include <gnc-accounting-period.h>\n"
-      "#include <gnc-session.h>\n"
-      "#include <gnc-component-manager.h>\n")))
-
-  (gw:wrap-simple-type ws '<gnc:print-amount-info-scm> "GNCPrintAmountInfo"
-                       '("gnc_printinfo_p(" scm-var ")")
-                       '(c-var " = gnc_scm2printinfo(" scm-var ");\n")
-                       '(scm-var " = gnc_printinfo2scm(" c-var ");\n"))
-
-  (gw:wrap-simple-type ws '<gnc:quote-info-scm> "gnc_commodity *"
-                       '("FALSE")
-                       '(c-var " = NULL;\n")
-                       '(scm-var " = gnc_quoteinfo2scm(" c-var ");\n"))
-
-  (gw:wrap-as-wct ws
-                  '<gnc:OptionChangeCallback>
-                  "GNCOptionChangeCallback" "const GNCOptionChangeCallback")
-
-  (gw:wrap-as-wct ws '<gnc:OptionDB*> "GNCOptionDB*" "const GNCOptionDB*")
-
-  (gw:wrap-function
-   ws
-   'gnc:get-current-group
-   '<gnc:AccountGroup*>
-   "gnc_get_current_group"
-   '()
-   "Get the current top-level group.")
-
-  (gw:wrap-function
-   ws
-   'gnc:get-current-book
-   '<gnc:Book*>
-   "gnc_get_current_book"
-   '()
-   "Get the current top-level book.")
-
-  (gw:wrap-function
-   ws
-   'gnc:get-current-session
-   '<gnc:Session*>
-   "gnc_get_current_session"
-   '()
-   "Get the current session.")
-
-  (gw:wrap-function
-   ws
-   'gnc:parse-amount
-   '<gw:scm>
-   "gnc_parse_amount_helper"
-   '(((<gw:mchars> caller-owned const) str)
-     (<gw:bool> monetary))
-   "Parse the expression and return either a gnc numeric or #f.")
-
-  (gw:wrap-function
-   ws
-   'gnc:gettext-helper
-   '(<gw:mchars> caller-owned const)
-   "gnc_gettext_helper"
-   '(((<gw:mchars> caller-owned const) str))
-   "Returns the translated version of string")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-db-new
-   '<gnc:OptionDB*>
-   "gnc_option_db_new"
-   '((<gw:scm> guile-options))
-   "Create an option DB with the set of guile options")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-db-destroy
-   '<gw:void>
-   "gnc_option_db_destroy"
-   '((<gnc:OptionDB*> option-db))
-   "Destroy the OptionDB")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-db-set-option-selectable-by-name
-   '<gw:void>
-   "gnc_option_db_set_option_selectable_by_name"
-   '((<gw:scm> guile-options)
-     ((<gw:mchars> caller-owned const) section)
-     ((<gw:mchars> caller-owned const) name)
-     (<gw:bool> selectable))
-   "Set the appropriate option widget to be selectable or not selectable, depending on if <gw:bool> selectable is true or false respectively.")
-
-  (gw:wrap-function
-   ws
-   'gnc:default-currency
-   '(<gnc:commodity*> const)
-   "gnc_default_currency"
-   '()
-   "Return the new-account default currency set by the user.")
-
-  (gw:wrap-function
-   ws
-   'gnc:default-report-currency
-   '(<gnc:commodity*> const)
-   "gnc_default_report_currency"
-   '()
-   "Return the default report currency set by the user.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount->string
-   '(<gw:mchars> callee-owned const)
-   "xaccPrintAmount"
-   '((<gnc:numeric> amount)
-     (<gnc:print-amount-info-scm> info))
-   "Print amount using current locale. The info argument
-determines formatting details.")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-invoke-callback
-   '<gw:void>
-   "gncp_option_invoke_callback"
-   '((<gnc:OptionChangeCallback> callback) (<gw:void*> data))
-   "Invoke the c option callback on the given data.")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-db-register-option
-   '<gw:void>
-   "gncp_option_db_register_option"
-   '((<gw:int> db_handle) (<gw:scm> option))
-   "Register the option with the option database db_handle.")
-
-  (gw:wrap-function
-   ws
-   'gnc:locale-decimal-places
-   '<gw:int>
-   "gnc_locale_decimal_places"
-   '()
-   "Return the number of decimal places for this locale.")
-
-  (gw:wrap-function
-   ws
-   'gnc:locale-default-currency
-   '(<gnc:commodity*> const)
-   "gnc_locale_default_currency"
-   '()
-   "Return the default currency for the current locale.")
-
-  (gw:wrap-function
-   ws
-   'gnc:locale-default-iso-currency-code
-   '(<gw:mchars> callee-owned const)
-   "gnc_locale_default_iso_currency_code"
-   '()
-   "Return the default iso currency code for the current locale.")
-
-  (gw:wrap-function
-   ws
-   'gnc:register-gui-component
-   '<gw:int>
-   "gnc_register_gui_component_scm"
-   '(((<gw:mchars> caller-owned const) component-class)
-     (<gw:scm> refresh-handler)
-     (<gw:scm> close-handler))
-   "Register a gui component with the component manager.")
-
-  (gw:wrap-function
-   ws
-   'gnc:gui-component-watch-entity
-   '<gw:void>
-   "gnc_gui_component_watch_entity_direct"
-   '((<gw:int> component-id)
-     (<gnc:guid-scm> entity)
-     (<gnc:event-type> event-type-mask))
-   "Watch the events for a particular entity.")
-
-  (gw:wrap-function
-   ws
-   'gnc:gui-component-watch-entity-type
-   '<gw:void>
-   "gnc_gui_component_watch_entity_type"
-   '((<gw:int> component-id)
-     ((<gw:mchars> caller-owned const) id-type)
-     (<gnc:event-type> event-type-mask))
-   "Watch the events for a particular entity type.")
-
-  (gw:wrap-function
-   ws
-   'gnc:unregister-gui-component
-   '<gw:void>
-   "gnc_unregister_gui_component"
-   '((<gw:int> component-id))
-   "Unregister a gui component by id.")
-
-  (gw:wrap-function
-   ws
-   'gnc:suspend-gui-refresh
-   '<gw:void>
-   "gnc_suspend_gui_refresh"
-   '()
-   "Suspend gui refresh events.")
-
-  (gw:wrap-function
-   ws
-   'gnc:resume-gui-refresh
-   '<gw:void>
-   "gnc_resume_gui_refresh"
-   '()
-   "Resume gui refresh events.")
-
-  (gw:wrap-function
-   ws
-   'gnc:gui-refresh-all
-   '<gw:void>
-   "gnc_gui_refresh_all"
-   '()
-   "Refresh all gui components.")
-
-  (gw:wrap-function
-   ws
-   'gnc:gui-refresh-suspended
-   '<gw:bool>
-   "gnc_gui_refresh_suspended"
-   '()
-   "Return #t if refreshes are suspended.")
-
-  (gw:wrap-function
-   ws
-   'gnc:close-gui-component
-   '<gw:void>
-   "gnc_close_gui_component"
-   '((<gw:int> component-id))
-   "Close a gui component by id.")
-
-  (gw:wrap-function
-   ws
-   'gnc:account-get-full-name
-   '(<gw:mchars> caller-owned)
-   "gnc_account_get_full_name"
-   '((<gnc:Account*> account))
-   "Return the fully-qualified name of the account.")
-
-  (gw:wrap-function
-   ws
-   'gnc:default-print-info
-   '<gnc:print-amount-info-scm>
-   "gnc_default_print_info"
-   '((<gw:bool> use_symbol))
-   "Return the default print info object.")
-
-  (gw:wrap-function
-   ws
-   'gnc:commodity-print-info
-   '<gnc:print-amount-info-scm>
-   "gnc_commodity_print_info"
-   '((<gnc:commodity*> commodity) (<gw:bool> use_symbol))
-   "Return the default print info for commodity.")
-
-  (gw:wrap-function
-   ws
-   'gnc:account-print-info
-   '<gnc:print-amount-info-scm>
-   "gnc_account_print_info"
-   '((<gnc:Account*> account) (<gw:bool> use_symbol))
-   "Return a print info for printing account balances.")
-
-  (gw:wrap-function
-   ws
-   'gnc:split-amount-print-info
-   '<gnc:print-amount-info-scm>
-   "gnc_split_amount_print_info"
-   '((<gnc:Split*> split) (<gw:bool> use_symbol))
-   "Return a print info for printing split amounts.")
-
-  (gw:wrap-function
-   ws
-   'gnc:split-value-print-info
-   '<gnc:print-amount-info-scm>
-   "gnc_split_value_print_info"
-   '((<gnc:Split*> split) (<gw:bool> use_symbol))
-   "Return a print info for print split value quantities.")
-
-  (gw:wrap-function
-   ws
-   'gnc:share-print-info-places
-   '<gnc:print-amount-info-scm>
-   "gnc_share_print_info_places"
-   '((<gw:int> decplaces))
-   "Return a print info for printing share quantities to 'n' places.")
-
-  (gw:wrap-function
-   ws
-   'gnc:default-share-print-info
-   '<gnc:print-amount-info-scm>
-   "gnc_default_share_print_info"
-   '()
-   "Return a print info for printing generic share quantities.")
-
-  (gw:wrap-function
-   ws
-   'gnc:default-price-print-info
-   '<gnc:print-amount-info-scm>
-   "gnc_default_price_print_info"
-   '()
-   "Return a print info for printing generic price quantities.")
-
-  (gw:wrap-function
-   ws
-   'gnc:account-reverse-balance?
-   '<gw:bool>
-   "gnc_reverse_balance"
-   '((<gnc:Account*> account))
-   "Given an account, find out whether the balance should be reversed for display")
-
-  (gw:wrap-function
-   ws
-   'gnc:is-euro-currency
-   '<gw:bool>
-   "gnc_is_euro_currency"
-   '((<gnc:commodity*> currency))
-   "Check if a given currency is a EURO currency")
-
-  (gw:wrap-function
-   ws
-   'gnc:is-euro-currency-code
-   '<gw:bool>
-   "gnc_is_euro_currency_code"
-   '(((<gw:mchars> caller-owned const) str))
-   "Check if a given currency is a EURO currency")
-
-  (gw:wrap-function
-   ws
-   'gnc:convert-to-euro
-   '<gnc:numeric>
-   "gnc_convert_to_euro"
-   '((<gnc:commodity*> currency) (<gnc:numeric> value))
-   "Convert the value from the given currency to EURO")
-
-  (gw:wrap-function
-   ws
-   'gnc:convert-from-euro
-   '<gnc:numeric>
-   "gnc_convert_from_euro"
-   '((<gnc:commodity*> currency) (<gnc:numeric> value))
-   "Convert the value from EURO to the given currency")
-
-  (gw:wrap-function
-   ws
-   'gnc:euro-currency-get-rate
-   '<gnc:numeric>
-   "gnc_euro_currency_get_rate"
-   '((<gnc:commodity*> currency))
-   "Returns the exchange rate from the given currency to EURO")
-
-  (gw:wrap-function
-   ws
-   'gnc:get-euro
-   '<gnc:commodity*>
-   "gnc_get_euro"
-   '()
-   "Returns the commodity EURO")
-
-  (gw:wrap-function
-   ws
-   'gnc:commodity-table-get-quotable-commodities-info
-   '(gw:glist-of <gnc:quote-info-scm> caller-owned)
-   "gnc_commodity_table_get_quotable_commodities"
-   '((<gnc:commodity-table*> table))
-   "Return a list of all the quotable commodities in a given namespace in the table.")
-
-  (gw:wrap-function
-   ws
-   'gnc:accounting-period-start
-   '<gw:int>
-   "gnc_accounting_period_fiscal_start"
-   '()
-   "Returns the beginning of the preferred accounting period")
-
-  (gw:wrap-function
-   ws
-   'gnc:accounting-period-end
-   '<gw:int>
-   "gnc_accounting_period_fiscal_end"
-   '()
-   "Returns the end of the preferred accounting period"))

Modified: gnucash/branches/register-rewrite/src/app-utils/hooks.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/hooks.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/hooks.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -17,6 +17,6 @@
 
 (define (gnc:hook-run-danglers hook . args)
   (if (null? args)
-      (set! args #f)
+      (set! args '())
       (set! args (car args)))
-  (gnc:hook-run-danglers-real hook args))
+  (gnc-hook-run hook args))

Deleted: gnucash/branches/register-rewrite/src/app-utils/kvp-option-registry.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/kvp-option-registry.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/kvp-option-registry.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,61 +0,0 @@
-;; Code for the kvp/option registry
-;;
-;; Copyright (C) 2002, Derek Atkins  <derek at ihtfp.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
-
-
-(use-modules (ice-9 slib))
-(require 'hash)
-
-(define gnc:*kvp-option-path* '("options"))
-
-(define gnc:*kvp-option-registry* (make-hash-table 23))
-
-(define (get-ref id-type)
-  (let ((gen-list (hash-ref gnc:*kvp-option-registry* id-type)))
-    (if gen-list gen-list '())))
-
-
-;;
-;; the generator should be a procedure that takes one argument,
-;; an options object.  The procedure should fill in the options with
-;; its defined kvp options.
-;;
-(define (gnc:register-kvp-option-generator id-type generator)
-  (let ((gen-list (get-ref id-type)))
-    (hash-set! gnc:*kvp-option-registry*
-	       id-type (append gen-list (list generator)))))
-
-(define (gnc:unregister-kvp-option-generator id-type generator)
-  (let ((gen-list (get-ref id-type)))
-    (hash-set! gnc:*kvp-option-registry*
-	       id-type (delq! generator gen-list))))
-
-;;
-;; create a new options object for the requested type
-;;
-(define (gnc:make-kvp-options id-type)
-  (let ((gen-list (get-ref id-type))
-	(options (gnc:new-options)))
-    (map
-     (lambda (generator)
-       (generator options))
-     gen-list)
-
-    options))

Modified: gnucash/branches/register-rewrite/src/app-utils/option-util.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/option-util.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/option-util.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -34,7 +34,7 @@
 #include "qof.h"
 #include "guile-mappings.h"
 
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 /* TODO: 
 
@@ -267,23 +267,12 @@
 
 /* Create an option DB for a particular data type */
 GNCOptionDB *
-gnc_option_db_new_for_type(SCM id_type)
+gnc_option_db_new_for_type(QofIdType id_type)
 {
-  static SCM make_option_proc = SCM_UNDEFINED;
   SCM options;
 
   if (!id_type) return NULL;
-
-  if (make_option_proc == SCM_UNDEFINED) {
-    make_option_proc = scm_c_eval_string("gnc:make-kvp-options");
-    if (!SCM_PROCEDUREP (make_option_proc)) {
-      PERR ("not a procedure\n");
-      make_option_proc = SCM_UNDEFINED;
-      return NULL;
-    }
-  }
-
-  options = scm_call_1 (make_option_proc, id_type);
+  options = gnc_make_kvp_options(id_type);
   return gnc_option_db_new (options);
 }
 
@@ -312,9 +301,8 @@
       return;
     }
   }
+  scm_slots = SWIG_NewPointerObj(slots, SWIG_TypeQuery("_p_KvpFrame"), 0);
 
-  scm_slots = gw_wcp_assimilate_ptr (slots, scm_c_eval_string("<gnc:kvp-frame*>"));
-
   scm_call_3 (kvp_to_scm, odb->guile_options, scm_slots, kvp_option_path);
 }
 
@@ -344,7 +332,7 @@
     }
   }
 
-  scm_slots = gw_wcp_assimilate_ptr (slots, scm_c_eval_string("<gnc:kvp-frame*>"));
+  scm_slots = SWIG_NewPointerObj(slots, SWIG_TypeQuery("p_KvpFrame"), 0);
 
   scm_call_3 (scm_to_kvp, odb->guile_options, scm_slots, kvp_option_path);
 }
@@ -443,9 +431,6 @@
                                        const char *section,
                                        const char *name)
 {
-  static SCM void_type = SCM_UNDEFINED;
-  static SCM callback_type = SCM_UNDEFINED;
-
   SCM register_proc;
   SCM arg;
   SCM args;
@@ -461,18 +446,6 @@
     return SCM_UNDEFINED;
   }
 
-  if(void_type == SCM_UNDEFINED) {
-    void_type = scm_c_eval_string("<gw:void*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(void_type != SCM_UNDEFINED) scm_gc_protect_object(void_type);
-  }
-  if(callback_type == SCM_UNDEFINED) {
-    callback_type = scm_c_eval_string("<gnc:OptionChangeCallback>");
-    /* don't really need this - types are bound globally anyway. */
-    if(callback_type != SCM_UNDEFINED)
-      scm_gc_protect_object(callback_type);
-  }
-
   /* Now build the args list for apply */
   args = SCM_EOL;
 
@@ -480,11 +453,12 @@
   args = scm_cons(odb->guile_options, args);
 
   /* next the data */
-  arg = gw_wcp_assimilate_ptr(data, void_type);
+  arg = SWIG_NewPointerObj(data, SWIG_TypeQuery("_p_void"), 0);
   args = scm_cons(arg, args);
 
   /* next the callback */
-  arg = gw_wcp_assimilate_ptr(callback, callback_type);
+  arg = SWIG_NewPointerObj(
+      callback, SWIG_TypeQuery("GNCOptionChangeCallback"), 0);
   args = scm_cons(arg, args);
 
   /* next the name */
@@ -1040,7 +1014,6 @@
 {
   SCM pair;
   SCM lst;
-  SCM conv_func;
   GList *type_list = NULL;
 
   initialize_getters();
@@ -1048,12 +1021,6 @@
   pair = scm_call_1(getters.option_data, option->guile_option);
   lst = SCM_CDR(pair);
 
-  conv_func = scm_c_eval_string ("gw:enum-<gnc:AccountType>-val->int");
-  if (!SCM_PROCEDUREP (conv_func)) {
-    PERR ("Cannot obtain conv_func");
-    return NULL;
-  }
-
   while (!SCM_NULLP (lst)) {
     GNCAccountType type;
     SCM item;
@@ -1062,8 +1029,6 @@
     item = SCM_CAR (lst);
     lst = SCM_CDR (lst);
 
-    item = scm_call_1(conv_func, item);
-
     if (SCM_FALSEP (scm_integer_p (item))) {
       PERR ("Invalid type");
     } else {
@@ -1451,7 +1416,7 @@
  * Returns: nothing                                                 *
 \********************************************************************/
 void
-gncp_option_db_register_option(GNCOptionDBHandle handle, SCM guile_option)
+gnc_option_db_register_option(GNCOptionDBHandle handle, SCM guile_option)
 {
   GNCOptionDB *odb;
   GNCOption *option;
@@ -2816,3 +2781,51 @@
 
   return value;
 }
+
+/* For now, this is global, just like when it was in guile.
+   But, it should be make per-book. */
+static GHashTable *kvp_registry = NULL;
+
+static void
+init_table(void)
+{
+    if (!kvp_registry)
+        kvp_registry = g_hash_table_new(g_str_hash, g_str_equal);
+}
+
+/*
+ * the generator should be a procedure that takes one argument,
+ * an options object.  The procedure should fill in the options with
+ * its defined kvp options.
+ */
+void
+gnc_register_kvp_option_generator(QofIdType id_type, SCM generator)
+{
+    GList *list;
+    init_table();
+    list = g_hash_table_lookup(kvp_registry, id_type);
+    list = g_list_prepend(list, generator);
+    g_hash_table_insert(kvp_registry, (gpointer) id_type, list);
+    scm_gc_protect_object(generator);
+}
+
+
+/*  create a new options object for the requested type */
+SCM
+gnc_make_kvp_options(QofIdType id_type)
+{
+    GList *list, *p;
+    SCM gnc_new_options = SCM_UNDEFINED;
+    SCM options = SCM_UNDEFINED;
+
+    init_table();
+    list = g_hash_table_lookup(kvp_registry, id_type);
+    gnc_new_options = scm_c_eval_string("gnc:new-options");
+    options = scm_call_0(gnc_new_options);
+
+    for (p = list; p; p = p->next) {
+        SCM generator = p->data;
+        scm_call_1(generator, options);
+    }
+    return options;
+}

Modified: gnucash/branches/register-rewrite/src/app-utils/option-util.h
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/option-util.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/option-util.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -65,14 +65,14 @@
 /* Create an option DB for a particular type, and save/load from a kvp.
  * This assumes the gnc:*kvp-option-path* location for the options
  * in the kvp.
- *
- * Note: the id_type MUST be a reference to the actual SCM
- * gnc:id-type.  Just wrapping the type in scheme is *NOT* sufficient.
  */
-GNCOptionDB * gnc_option_db_new_for_type(SCM id_type);
+GNCOptionDB * gnc_option_db_new_for_type(QofIdType id_type);
 void gnc_option_db_load_from_kvp(GNCOptionDB* odb, kvp_frame *slots);
 void gnc_option_db_save_to_kvp(GNCOptionDB* odb, kvp_frame *slots);
 
+void gnc_register_kvp_option_generator(QofIdType id_type, SCM generator);
+SCM gnc_make_kvp_options(QofIdType id_type);
+
 void gnc_option_db_set_ui_callbacks (GNCOptionDB *odb,
                                      GNCOptionGetUIValue get_ui_value,
                                      GNCOptionSetUIValue set_ui_value,
@@ -260,10 +260,10 @@
 				    gboolean years, const char *custom);
 
 
+void gnc_option_db_register_option(GNCOptionDBHandle handle,
+                                   SCM guile_option);
+
 /* private */
-void gncp_option_db_register_option(GNCOptionDBHandle handle,
-                                    SCM guile_option);
-
 void gncp_option_invoke_callback(GNCOptionChangeCallback callback,
                                  gpointer data);
 

Modified: gnucash/branches/register-rewrite/src/app-utils/options.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/options.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/options.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -198,9 +198,9 @@
      (lambda (x) (set! value x))
      (lambda () default-value)
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f value p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (set! value v))))
      (lambda (x)
@@ -222,9 +222,9 @@
      (lambda (x) (set! value x))
      (lambda () default-value)
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f value p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (set! value v))))
      (lambda (x)
@@ -256,9 +256,9 @@
      (lambda (x) (set! value x))
      (lambda () default-value)
      (gnc:restore-form-generator value->string)     
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f value p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (set! value v))))
      (lambda (x)
@@ -278,12 +278,12 @@
   (define (currency->scm currency)
     (if (string? currency)
         currency
-        (gnc:commodity-get-mnemonic currency)))
+        (gnc-commodity-get-mnemonic currency)))
 
   (define (scm->currency currency)
     (if (string? currency)
-        (gnc:commodity-table-lookup
-         (gnc:book-get-commodity-table (gnc:get-current-book))
+        (gnc-commodity-table-lookup
+         (gnc-commodity-table-get-table (gnc-get-current-book))
          GNC_COMMODITY_NS_CURRENCY currency)
         currency))
 
@@ -295,9 +295,9 @@
       (lambda (x) (set! value (currency->scm x)))
       (lambda ()  (scm->currency default-value))
       (gnc:restore-form-generator value->string)
-      (lambda (f p) (gnc:kvp-frame-set-slot-path f value p))
+      (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
       (lambda (f p)
-	(let ((v (gnc:kvp-frame-get-slot-path f p)))
+	(let ((v (kvp-frame-get-slot-path-gslist f p)))
 	  (if (and v (string? v))
 	      (set! value v))))
       (lambda (x) (list #t x))
@@ -314,14 +314,14 @@
   (define (budget->guid budget)
     (if (string? budget)
         budget
-        (gnc:budget-get-guid budget)))
+        (gncBudgetGetGUID budget)))
 
   (define (guid->budget budget)
     (if (string? budget)
-        (gnc:budget-lookup budget (gnc:get-current-book))
+        (gnc-budget-lookup budget (gnc-get-current-book))
         budget))
 
-  (let* ((default-value (gnc:budget-get-default (gnc:get-current-book)))
+  (let* ((default-value (gnc-budget-get-default (gnc-get-current-book)))
          (value (budget->guid default-value))
          (option-set #f)
          (value->string (lambda ()
@@ -342,11 +342,11 @@
              (set! option-set #t)) ;; setter
      (lambda ()
        (guid->budget
-        (gnc:budget-get-default (gnc:get-current-book)))) ;; default-getter
+        (gnc-budget-get-default (gnc-get-current-book)))) ;; default-getter
      (gnc:restore-form-generator value->string) ;; ??
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f value p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
          (if (and v (string? v))
              (set! value v))))
      (lambda (x) (list #t x)) ;; value-validator
@@ -367,12 +367,12 @@
               GNC_COMMODITY_NS_CURRENCY
               commodity)
         (list 'commodity-scm
-              (gnc:commodity-get-namespace commodity)
-              (gnc:commodity-get-mnemonic commodity))))
+              (gnc-commodity-get-namespace commodity)
+              (gnc-commodity-get-mnemonic commodity))))
 
   (define (scm->commodity scm)
-    (gnc:commodity-table-lookup
-     (gnc:book-get-commodity-table (gnc:get-current-book))
+    (gnc-commodity-table-lookup
+     (gnc-commodity-table-get-table (gnc-get-current-book))
      (cadr scm) (caddr scm)))
 
    (let* ((value (commodity->scm default-value))
@@ -387,11 +387,11 @@
       (lambda () default-value)
       (gnc:restore-form-generator value->string)
       (lambda (f p) 
-	(gnc:kvp-frame-set-slot-path f (cadr value) (append p '("ns")))
-	(gnc:kvp-frame-set-slot-path f (caddr value) (append p '("monic"))))
+	(kvp-frame-set-slot-path-gslist f (cadr value) (append p '("ns")))
+	(kvp-frame-set-slot-path-gslist f (caddr value) (append p '("monic"))))
       (lambda (f p)
-	(let ((ns (gnc:kvp-frame-get-slot-path f (append p '("ns"))))
-	      (monic (gnc:kvp-frame-get-slot-path f (append p '("monic")))))
+	(let ((ns (kvp-frame-get-slot-path-gslist f (append p '("ns"))))
+	      (monic (kvp-frame-get-slot-path-gslist f (append p '("monic")))))
 	  (if (and ns monic (string? ns) (string? monic))
 	      (set! value (list 'commodity-scm ns monic)))))
       (lambda (x) (list #t x))
@@ -445,9 +445,9 @@
                       (setter-function-called-cb x)))
       (lambda () default-value)
       (gnc:restore-form-generator value->string)
-      (lambda (f p) (gnc:kvp-frame-set-slot-path f value p))
+      (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
       (lambda (f p)
-	(let ((v (gnc:kvp-frame-get-slot-path f p)))
+	(let ((v (kvp-frame-get-slot-path-gslist f p)))
 	  (if (and v (boolean? v) (not (equal? v default-value)))
 	      (set! value v))))
       (lambda (x)
@@ -519,16 +519,16 @@
      default-getter
      (gnc:restore-form-generator value->string) ;; generate-restore-form
      (lambda (f p)     ;; scm->kvp
-       (gnc:kvp-frame-set-slot-path f (symbol->string (car value))
+       (kvp-frame-set-slot-path-gslist f (symbol->string (car value))
 				    (append p '("type")))
-       (gnc:kvp-frame-set-slot-path f
+       (kvp-frame-set-slot-path-gslist f
 				    (if (symbol? (cdr value))
 					(symbol->string (cdr value))
 					(cdr value))
 				    (append p '("value"))))
      (lambda (f p)     ;; kvp->scm
-       (let ((t (gnc:kvp-frame-get-slot-path f (append p '("type"))))
-	     (v (gnc:kvp-frame-get-slot-path f (append p '("value")))))
+       (let ((t (kvp-frame-get-slot-path-gslist f (append p '("type"))))
+	     (v (kvp-frame-get-slot-path-gslist f (append p '("value")))))
 	 (if (and t v (string? t))
 	     (set! value (cons (string->symbol t)
 			       (if (string? v) (string->symbol v) v))))))
@@ -615,11 +615,11 @@
   (define (convert-to-guid item)
     (if (string? item)
         item
-        (gnc:account-get-guid item)))
+        (gncAccountGetGUID item)))
 
   (define (convert-to-account item)
     (if (string? item)
-        (gnc:account-lookup item (gnc:get-current-book))
+        (xaccAccountLookup item (gnc-get-current-book))
         item))
 
   (let* ((option (map convert-to-guid (default-getter)))
@@ -642,8 +642,8 @@
        (if (not account-list) (set! account-list (default-getter)))
        (set! account-list
              (filter (lambda (x) (if (string? x)
-                                     (gnc:account-lookup
-                                      x (gnc:get-current-book))
+                                     (xaccAccountLookup
+                                      x (gnc-get-current-book))
                                      x)) account-list))
        (let* ((result (validator account-list))
               (valid (car result))
@@ -659,20 +659,20 @@
        (define (save-acc list count)
 	 (if (not (null? list))
 	     (let ((key (string-append "acc" (gnc:value->string count))))
-	       (gnc:kvp-frame-set-slot-path f (car list) (append p (list key)))
+	       (kvp-frame-set-slot-path-gslist f (car list) (append p (list key)))
 	       (save-acc (cdr list) (+ 1 count)))))
 
        (if option-set
 	   (begin
-	     (gnc:kvp-frame-set-slot-path f (length option)
+	     (kvp-frame-set-slot-path-gslist f (length option)
 					  (append p '("len")))
 	     (save-acc option 0))))
      (lambda (f p)
-       (let ((len (gnc:kvp-frame-get-slot-path f (append p '("len")))))
+       (let ((len (kvp-frame-get-slot-path-gslist f (append p '("len")))))
 	 (define (load-acc count)
 	   (if (< count len)
 	       (let* ((key (string-append "acc" (gnc:value->string count)))
-		      (guid (gnc:kvp-frame-get-slot-path
+		      (guid (kvp-frame-get-slot-path-gslist
 			     f (append p (list key)))))
 		 (cons guid (load-acc (+ count 1))))
 	       '()))
@@ -717,26 +717,27 @@
   (define (convert-to-guid item)
     (if (string? item)
         item
-        (gnc:account-get-guid item)))
+        (gncAccountGetGUID item)))
 
   (define (convert-to-account item)
     (if (string? item)
-        (gnc:account-lookup item (gnc:get-current-book))
+        (xaccAccountLookup item (gnc-get-current-book))
         item))
 
   (define (find-first-account)
     (define (find-first account-list)
       (if (null? account-list)
-	  #f
+	  '()
 	  (let* ((this-account (car account-list))
-		 (account-type (gw:enum-<gnc:AccountType>-val->sym
-				(gnc:account-get-type this-account) #f)))
-	    (if (if (null? acct-type-list) #t (member account-type acct-type-list))
+		 (account-type (xaccAccountGetType this-account)))
+	    (if (if (null? acct-type-list)
+                    #t
+                    (member account-type acct-type-list))
 		this-account
 		(find-first (cdr account-list))))))
 
-    (let* ((current-group (gnc:get-current-group))
-	   (account-list (gnc:group-get-subaccounts current-group)))
+    (let* ((current-group (gnc-get-current-group))
+	   (account-list (xaccGroupGetSubAccountsSorted current-group)))
       (find-first account-list)))
 	   
   (define (get-default)
@@ -773,9 +774,9 @@
 	     (gnc:error "Illegal account value set"))))
      (lambda () (convert-to-account (get-default)))
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f value p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f value p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (set! value v))))
      validator
@@ -852,9 +853,9 @@
            (gnc:error "Illegal Multichoice option set")))
      (lambda () default-value)
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f (symbol->string value) p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f (symbol->string value) p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (set! value (string->symbol v)))))
      (lambda (x)
@@ -938,9 +939,9 @@
            (gnc:error "Illegal Radiobutton option set")))
      (lambda () default-value)
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f (symbol->string value) p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f (symbol->string value) p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (set! value (string->symbol v)))))
      (lambda (x)
@@ -1004,16 +1005,16 @@
        (define (save-item list count)
 	 (if (not (null? list))
 	     (let ((key (string-append "item" (gnc:value->string count))))
-	       (gnc:kvp-frame-set-slot-path f (car list) (append p (list key)))
+	       (kvp-frame-set-slot-path-gslist f (car list) (append p (list key)))
 	       (save-item (cdr list) (+ 1 count)))))
-       (gnc:kvp-frame-set-slot-path f (length value) (append p '("len")))
+       (kvp-frame-set-slot-path-gslist f (length value) (append p '("len")))
        (save-item value 0))
      (lambda (f p)
-       (let ((len (gnc:kvp-frame-get-slot-path f (append p '("len")))))
+       (let ((len (kvp-frame-get-slot-path-gslist f (append p '("len")))))
 	 (define (load-item count)
 	   (if (< count len)
 	       (let* ((key (string-append "item" (gnc:value->string count)))
-		      (val (gnc:kvp-frame-get-slot-path
+		      (val (kvp-frame-get-slot-path-gslist
 			    f (append p (list key)))))
 		 (cons val (load-item (+ count 1))))
 	       '()))
@@ -1052,9 +1053,9 @@
      (lambda (x) (set! value x))
      (lambda () default-value)
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f (symbol->string value) p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f (symbol->string value) p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (number? v))
 	     (set! value v))))
      (lambda (x)
@@ -1091,16 +1092,16 @@
          default-value)
   (let* ((value (if (list? default-value)
                     default-value
-                    (gnc:query->scm default-value)))
+                    (gnc-query2scm default-value)))
          (value->string (lambda ()
                           (string-append "'" (gnc:value->string value)))))
     (gnc:make-option
      section name "" 'query #f
      (lambda () value)
-     (lambda (x) (set! value (if (list? x) x (gnc:query->scm x))))
+     (lambda (x) (set! value (if (list? x) x (gnc-query2scm x))))
      (lambda () (if (list? default-value)
                     default-value
-                    (gnc:query->scm default-value)))
+                    (gnc-query2scm default-value)))
      (gnc:restore-form-generator value->string)
      #f
      #f
@@ -1212,18 +1213,18 @@
      (lambda () (def-value))
      (gnc:restore-form-generator value->string)
      (lambda (f p)
-       (gnc:kvp-frame-set-slot-path
+       (kvp-frame-set-slot-path-gslist
 	f (symbol->string (car value)) (append p '("fmt")))
-       (gnc:kvp-frame-set-slot-path
+       (kvp-frame-set-slot-path-gslist
 	f (symbol->string (cadr value)) (append p '("month")))
-       (gnc:kvp-frame-set-slot-path
+       (kvp-frame-set-slot-path-gslist
 	f (if (caddr value) 1 0) (append p '("years")))
-       (gnc:kvp-frame-set-slot-path f (cadddr value) (append p '("custom"))))
+       (kvp-frame-set-slot-path-gslist f (cadddr value) (append p '("custom"))))
      (lambda (f p)
-       (let ((fmt (gnc:kvp-frame-get-slot-path f (append p '("fmt"))))
-	     (month (gnc:kvp-frame-get-slot-path f (append p '("month"))))
-	     (years (gnc:kvp-frame-get-slot-path f (append p '("years"))))
-	     (custom (gnc:kvp-frame-get-slot-path f (append p '("custom")))))
+       (let ((fmt (kvp-frame-get-slot-path-gslist f (append p '("fmt"))))
+	     (month (kvp-frame-get-slot-path-gslist f (append p '("month"))))
+	     (years (kvp-frame-get-slot-path-gslist f (append p '("years"))))
+	     (custom (kvp-frame-get-slot-path-gslist f (append p '("custom")))))
 	 (if (and
 	      fmt (string? fmt)
 	      month (string? month)
@@ -1449,7 +1450,7 @@
   ((options 'register-callback) section name callback))
 
 (define (gnc:options-register-c-callback section name c-callback data options)
-  (let ((callback (lambda () (gnc:option-invoke-callback c-callback data))))
+  (let ((callback (lambda () (gncp-option-invoke-callback c-callback data))))
     ((options 'register-callback) section name callback)))
 
 (define (gnc:options-unregister-callback-id id options)
@@ -1469,7 +1470,7 @@
 
 (define (gnc:options-scm->kvp options kvp-frame key-path clear-kvp?)
   (if clear-kvp?
-      (gnc:kvp-frame-delete-at-path kvp-frame key-path))
+      (gnc-kvp-frame-delete-at-path kvp-frame key-path))
   ((options 'scm->kvp) kvp-frame key-path))
 
 (define (gnc:options-kvp->scm options kvp-frame key-path)
@@ -1509,7 +1510,7 @@
 (define (gnc:send-options db_handle options)
   (gnc:options-for-each
    (lambda (option)
-     (gnc:option-db-register-option db_handle option))
+     (gnc-option-db-register-option db_handle option))
    options))
 
 (define (gnc:save-options options options-string file header truncate?)

Modified: gnucash/branches/register-rewrite/src/app-utils/prefs.scm
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/prefs.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/prefs.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -19,7 +19,6 @@
 
 (require 'sort)
 (require 'hash-table)
-(use-modules (g-wrapped gw-core-utils))
 
 ;; (define gnc:*double-entry-restriction*
 ;;   (gnc:make-config-var
@@ -64,36 +63,36 @@
 ;;;;;; Create config vars
 
 (define gnc:*debit-strings*
-  (list (cons 'NO_TYPE   (N_ "Funds In"))
-        (cons 'BANK      (N_ "Deposit"))
-        (cons 'CASH      (N_ "Receive"))
-        (cons 'CREDIT    (N_ "Payment"))
-        (cons 'ASSET     (N_ "Increase"))
-        (cons 'LIABILITY (N_ "Decrease"))
-        (cons 'STOCK     (N_ "Buy"))
-        (cons 'MUTUAL    (N_ "Buy"))
-        (cons 'CURRENCY  (N_ "Buy"))
-        (cons 'INCOME    (N_ "Charge"))
-        (cons 'EXPENSE   (N_ "Expense"))
-	(cons 'PAYABLE   (N_ "Payment"))
-	(cons 'RECEIVABLE (N_ "Invoice"))
-        (cons 'EQUITY    (N_ "Decrease"))))
+  (list (cons ACCT-TYPE-NONE       (N_ "Funds In"))
+        (cons ACCT-TYPE-BANK       (N_ "Deposit"))
+        (cons ACCT-TYPE-CASH       (N_ "Receive"))
+        (cons ACCT-TYPE-CREDIT     (N_ "Payment"))
+        (cons ACCT-TYPE-ASSET      (N_ "Increase"))
+        (cons ACCT-TYPE-LIABILITY  (N_ "Decrease"))
+        (cons ACCT-TYPE-STOCK      (N_ "Buy"))
+        (cons ACCT-TYPE-MUTUAL     (N_ "Buy"))
+        (cons ACCT-TYPE-CURRENCY   (N_ "Buy"))
+        (cons ACCT-TYPE-INCOME     (N_ "Charge"))
+        (cons ACCT-TYPE-EXPENSE    (N_ "Expense"))
+        (cons ACCT-TYPE-PAYABLE    (N_ "Payment"))
+        (cons ACCT-TYPE-RECEIVABLE (N_ "Invoice"))
+        (cons ACCT-TYPE-EQUITY     (N_ "Decrease"))))
 
 (define gnc:*credit-strings*
-  (list (cons 'NO_TYPE   (N_ "Funds Out"))
-        (cons 'BANK      (N_ "Withdrawal"))
-        (cons 'CASH      (N_ "Spend"))
-        (cons 'CREDIT    (N_ "Charge"))
-        (cons 'ASSET     (N_ "Decrease"))
-        (cons 'LIABILITY (N_ "Increase"))
-        (cons 'STOCK     (N_ "Sell"))
-        (cons 'MUTUAL    (N_ "Sell"))
-        (cons 'CURRENCY  (N_ "Sell"))
-        (cons 'INCOME    (N_ "Income"))
-        (cons 'EXPENSE   (N_ "Rebate"))
-	(cons 'PAYABLE   (N_ "Bill"))
-	(cons 'RECEIVABLE (N_ "Payment"))
-        (cons 'EQUITY    (N_ "Increase"))))
+  (list (cons ACCT-TYPE-NONE       (N_ "Funds Out"))
+        (cons ACCT-TYPE-BANK       (N_ "Withdrawal"))
+        (cons ACCT-TYPE-CASH       (N_ "Spend"))
+        (cons ACCT-TYPE-CREDIT     (N_ "Charge"))
+        (cons ACCT-TYPE-ASSET      (N_ "Decrease"))
+        (cons ACCT-TYPE-LIABILITY  (N_ "Increase"))
+        (cons ACCT-TYPE-STOCK      (N_ "Sell"))
+        (cons ACCT-TYPE-MUTUAL     (N_ "Sell"))
+        (cons ACCT-TYPE-CURRENCY   (N_ "Sell"))
+        (cons ACCT-TYPE-INCOME     (N_ "Income"))
+        (cons ACCT-TYPE-EXPENSE    (N_ "Rebate"))
+        (cons ACCT-TYPE-PAYABLE    (N_ "Bill"))
+        (cons ACCT-TYPE-RECEIVABLE (N_ "Payment"))
+        (cons ACCT-TYPE-EQUITY     (N_ "Increase"))))
 
 (define (gnc:get-debit-string type)
   (_ (assoc-ref gnc:*debit-strings* type)))

Modified: gnucash/branches/register-rewrite/src/app-utils/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,6 @@
 TESTS = \
   test-link-module \
   test-load-module \
-  test-component-manager \
   test-exp-parser \
   test-scm-query-string \
   test-print-parse-amount
@@ -22,14 +21,14 @@
   --gnc-module-dir ${top_builddir}/src/app-utils \
   --gnc-module-dir ${top_srcdir}/src/engine \
   --gnc-module-dir ${top_srcdir}/src/app-utils \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_builddir}/src/scm \
   --guile-load-dir ${top_builddir}/src/gnome-utils \
+  --guile-load-dir ${top_builddir}/src/core-utils \
   --guile-load-dir ${top_builddir}/src/gnome \
   --library-dir    ${top_builddir}/src/gnome-utils \
-  --library-dir    ${top_builddir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --library-dir    ${top_builddir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})
@@ -38,7 +37,6 @@
    ${top_builddir}/src/engine/libgncmod-engine.la \
    ${top_builddir}/src/gnc-module/libgncmodule.la \
    ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
-   ${top_builddir}/src/engine/libgw-engine.la \
    ${top_builddir}/src/test-core/libgncmod-test.la \
    ${top_builddir}/src/engine/test-core/libgncmod-test-engine.la \
    ${top_builddir}/src/core-utils/libcore-utils.la \
@@ -54,8 +52,7 @@
   test-print-queries
 
 EXTRA_DIST = \
-  test-load-module \
-  test-component-manager
+  test-load-module
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \

Deleted: gnucash/branches/register-rewrite/src/app-utils/test/test-component-manager
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/test/test-component-manager	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/test/test-component-manager	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,49 +0,0 @@
-#! /bin/bash
-exec guile -s "$0" 
-!#
-
-(use-modules (gnucash gnc-module))
-(gnc:module-system-init)
-
-(or (gnc:module-load "gnucash/app-utils" 0)
-    (error "can't load module"))
-
-(let ((id #f)
-      (refresh-ran #f)
-      (close-ran #f))
-
-  (define (refresh-handler)
-    (set! refresh-ran #t))
-
-  (define (close-handler)
-    (set! close-ran #t)
-    (gnc:unregister-gui-component id))
-
-  (set! id (gnc:register-gui-component "test-class"
-                                       refresh-handler
-                                       close-handler))
-  (or (not (equal? id -1))
-      (error "can't register"))
-
-  (gnc:gui-refresh-all)
-
-  (or refresh-ran (error "refresh didn't run"))
-
-  (gnc:close-gui-component id)
-
-  (or close-ran (error "close didn't run"))
-
-  (set! refresh-ran #f)
-  (set! close-ran #f)
-
-  (gnc:gui-refresh-all)
-  (gnc:close-gui-component id)
-
-  (or (not (or refresh-ran close-ran))
-      (error "component not removed")))
-
-(exit 0)
-
-;; Local Variables:
-;; mode: scheme
-;; End:

Modified: gnucash/branches/register-rewrite/src/app-utils/test/test-load-module
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/test/test-load-module	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/test/test-load-module	2007-01-05 17:25:28 UTC (rev 15313)
@@ -8,7 +8,7 @@
 (if (gnc:module-load "gnucash/app-utils" 0)
     (begin    
       (if (and (procedure? gnc:error->string)
-               (procedure? gnc:guid-new)
+               (procedure? gnc-default-currency)
 	       (macro? N_)
 	       (string=? (N_ "foobar") "foobar"))
           (exit 0)

Modified: gnucash/branches/register-rewrite/src/app-utils/test/test-print-parse-amount.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/test/test-print-parse-amount.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/test/test-print-parse-amount.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <glib.h>
 #include <stdlib.h>
 

Modified: gnucash/branches/register-rewrite/src/app-utils/test/test-print-queries.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/test/test-print-queries.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/test/test-print-queries.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,4 +1,5 @@
 
+#include "config.h"
 #include <glib.h>
 #include <libguile.h>
 #include "guile-mappings.h"

Modified: gnucash/branches/register-rewrite/src/app-utils/test/test-scm-query-string.c
===================================================================
--- gnucash/branches/register-rewrite/src/app-utils/test/test-scm-query-string.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/app-utils/test/test-scm-query-string.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,4 +1,5 @@
 
+#include "config.h"
 #include <glib.h>
 #include <libguile.h>
 #include "guile-mappings.h"

Modified: gnucash/branches/register-rewrite/src/backend/file/gnc-account-xml-v2.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/gnc-account-xml-v2.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/gnc-account-xml-v2.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -117,41 +117,6 @@
     if(kf)
     {
         xmlNodePtr kvpnode = kvp_frame_to_dom_tree(act_slots_string, kf);
-#if ((GNUCASH_MAJOR_VERSION == 1) && (GNUCASH_MINOR_VERSION < 10))
-	{
-	  /* Temporary backwards compatability hack. Create kvp slot
-	   * information for the stock quote data in case the user has
-	   * to fall back to the production code. */
-	  xmlNodePtr slot_node, val_node;
-	  gnc_commodity *com;
-	  gnc_quote_source *source;
-	  const gchar *tz;
-
-	  com = xaccAccountGetCommodity(act);
-	  if (com &&
-	      (!gnc_commodity_is_iso(com) || xaccAccountGetType(act) == CURRENCY) &&
-	      gnc_commodity_get_quote_flag(com)) {
-	    if (!kvpnode)
-	      kvpnode= xmlNewNode(NULL, BAD_CAST act_slots_string);
-
-	    slot_node = xmlNewChild(kvpnode, NULL, BAD_CAST "slot", NULL);
-	    xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:key", BAD_CAST "old-price-source");
-
-	    source = gnc_commodity_get_quote_source(com);
-	    val_node = xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:value",
-				       BAD_CAST gnc_quote_source_get_old_internal_name(source));
-	    xmlSetProp(val_node, BAD_CAST "type", BAD_CAST "string");
-
-	    tz = gnc_commodity_get_quote_tz(com);
-	    if (tz) {
-	      slot_node = xmlNewChild(kvpnode, NULL, BAD_CAST "slot", NULL);
-	      xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:key", BAD_CAST "old-quote-tz");
-	      val_node = xmlNewTextChild(slot_node, NULL, BAD_CAST "slot:value", BAD_CAST tz);
-	      xmlSetProp(val_node, BAD_CAST "type", BAD_CAST "string");
-	    }
-	  }
-	}
-#endif
         if(kvpnode)
         {
             xmlAddChild(ret, kvpnode);

Modified: gnucash/branches/register-rewrite/src/backend/file/gnc-backend-file.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/gnc-backend-file.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/gnc-backend-file.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -199,37 +199,51 @@
                    gboolean ignore_lock, gboolean create_if_nonexistent)
 {
     FileBackend *be = (FileBackend*) be_start;
-    char *p;
 
     ENTER (" ");
 
     /* Make sure the directory is there */
-    be->dirname = xaccResolveFilePath(book_id);
-    if (NULL == be->dirname)
+    be->fullpath = xaccResolveFilePath(book_id);
+    if (NULL == be->fullpath)
     {
         qof_backend_set_error (be_start, ERR_FILEIO_FILE_NOT_FOUND);
         return;
     }
-    be->fullpath = g_strdup (be->dirname);
     be->be.fullpath = be->fullpath;
-    p = strrchr (be->dirname, '/');
-    if (p && p != be->dirname)
+    be->dirname = g_path_get_dirname (be->fullpath);
+
     {
         struct stat statbuf;
         int rc;
 
-        *p = '\0';
+	/* Again check whether the directory can be accessed */
         rc = stat (be->dirname, &statbuf);
         if (rc != 0 || !S_ISDIR(statbuf.st_mode))
         {
+	    /* Error on stat or if it isn't a directory means we
+	       cannot find this filename */
             qof_backend_set_error (be_start, ERR_FILEIO_FILE_NOT_FOUND);
             g_free (be->fullpath); be->fullpath = NULL;
             g_free (be->dirname); be->dirname = NULL;
             return;
         }
+
+	/* Now check whether we can stat(2) the file itself */
         rc = stat (be->fullpath, &statbuf);
+        if ((rc != 0) && (!create_if_nonexistent))
+        {
+	    /* Error on stat means the file doesn't exist */
+            qof_backend_set_error (be_start, ERR_FILEIO_FILE_NOT_FOUND);
+            g_free (be->fullpath); be->fullpath = NULL;
+            g_free (be->dirname); be->dirname = NULL;
+            return;
+        }
         if (rc == 0 && S_ISDIR(statbuf.st_mode))
        {
+	    /* FIXME: What is actually checked here? Whether the
+	       fullpath erroneously points to a directory or what? 
+	       Then the error message should be changed into something
+	       much more clear! */
             qof_backend_set_error (be_start, ERR_FILEIO_UNKNOWN_FILE_TYPE);
             g_free (be->fullpath); be->fullpath = NULL;
             g_free (be->dirname); be->dirname = NULL;
@@ -267,8 +281,23 @@
     if (be->lockfd > 0)
         close (be->lockfd);
 
-    if (be->lockfile)
-        unlink (be->lockfile);
+    if (be->lockfile) {
+        int rv;
+#ifdef G_OS_WIN32
+	/* On windows, we need to allow write-access before
+	   unlink() can succeed */
+	rv = chmod (be->lockfile, S_IWRITE | S_IREAD);
+	if (rv) {
+	    PWARN("Error on chmod(%s): %d: %s", be->lockfile,
+		  errno, strerror(errno) ? strerror(errno) : "");
+	}
+#endif
+	rv = unlink (be->lockfile);
+	if (rv) {
+	    PWARN("Error on unlink(%s): %d: %s", be->lockfile,
+		  errno, strerror(errno) ? strerror(errno) : "");
+	}
+    }
 
     g_free (be->dirname);
     be->dirname = NULL;
@@ -667,7 +696,7 @@
         if (gnc_file_be_select_files (dent) == 0)
              continue;
 
-        name = g_strconcat(be->dirname, "/", dent->d_name, NULL);
+        name = g_build_filename(be->dirname, dent->d_name, (char*)NULL);
         len = strlen(name) - 4;
 
         /* Is this file associated with the current data file */
@@ -758,12 +787,12 @@
 
     /* XXX it would be nice for the user if we made the book 
      * closing date and/or title part of the file-name. */
-    p = strrchr (str, '/');
+    p = strrchr (str, G_DIR_SEPARATOR);
     p++;
     p = stpcpy (p, "book-");
     p = guid_to_string_buff (qof_book_get_guid(book), p);
     p = stpcpy (p, "-");
-    q = strrchr (fbe->fullpath, '/');
+    q = strrchr (fbe->fullpath, G_DIR_SEPARATOR);
     q++;
     p = stpcpy (p, q);
     p = stpcpy (p, ".gml");
@@ -865,8 +894,24 @@
         if (FALSE == rc) error = ERR_FILEIO_PARSE_ERROR;
         break;
     default:
-        PWARN("File not any known type");
-        error = ERR_FILEIO_UNKNOWN_FILE_TYPE;
+        /* If file type wasn't known, check errno again to give the
+	   user some more useful feedback for some particular error
+	   conditions. */
+        switch (errno)
+	{
+	case EACCES: /* No read permission */
+	  PWARN("No read permission to file");
+	  error = ERR_FILEIO_FILE_EACCES;
+	  break;
+	case EISDIR: /* File is a directory - but on this error we don't arrive here */
+	  PWARN("Filename is a directory");
+	  error = ERR_FILEIO_FILE_NOT_FOUND;
+	  break;
+	default:
+	  PWARN("File not any known type");
+	  error = ERR_FILEIO_UNKNOWN_FILE_TYPE;
+	  break;
+	}
         break;
     }
 

Modified: gnucash/branches/register-rewrite/src/backend/file/gnc-book-xml-v2.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/gnc-book-xml-v2.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/gnc-book-xml-v2.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -62,15 +62,14 @@
 #ifdef IMPLEMENT_BOOK_DOM_TREES_LATER
 
 static void
-append_group (xmlNodePtr parent, AccountGroup *grp)
+append_group(xmlNodePtr parent, AccountGroup *grp)
 {
     GList *list;
     GList *node;
 
     list = xaccGroupGetAccountList(grp);
 
-    for (node = list; node; node = node->next) 
-    {
+    for (node = list; node; node = node->next) {
         xmlNodePtr accnode;
         AccountGroup *newgrp;
 
@@ -80,9 +79,7 @@
         newgrp = xaccAccountGetChildren((Account*)(node->data));
 
         if (newgrp)
-        {
             append_group(accnode, newgrp);
-        }
     }
 }
 
@@ -109,16 +106,14 @@
     ret = xmlNewNode(NULL, BAD_CAST gnc_book_string);
     xmlSetProp(ret, BAD_CAST "version", BAD_CAST gnc_v2_book_version_string);
 
-    xmlAddChild(ret, guid_to_dom_tree(book_id_string, qof_book_get_guid(book)));
+    xmlAddChild(ret, guid_to_dom_tree(book_id_string, 
+                                      qof_book_get_guid(book)));
 
-    if(qof_book_get_slots(book))
-    {
+    if (qof_book_get_slots(book)) {
         xmlNodePtr kvpnode = kvp_frame_to_dom_tree(book_slots_string,
                                                    qof_book_get_slots(book));
-        if(kvpnode)
-        {
+        if (kvpnode)
             xmlAddChild(ret, kvpnode);
-        }
     }
 
 #ifdef IMPLEMENT_BOOK_DOM_TREES_LATER
@@ -127,18 +122,19 @@
      * that we are only going to hand-edit the file at a higher layer.
      * And that's OK, since its probably a performance boost anyway.
      */
-    xmlAddChild(ret, gnc_commodity_dom_tree_create (gnc_book_get_commodity_table(book)));
-    xmlAddChild(ret, gnc_pricedb_dom_tree_create (gnc_book_get_pricedb(book)));
-    append_group (ret, gnc_book_get_group(book));
+    xmlAddChild(ret, gnc_commodity_dom_tree_create(
+                    gnc_book_get_commodity_table(book)));
+    xmlAddChild(ret, gnc_pricedb_dom_tree_create(gnc_book_get_pricedb(book)));
+    append_group(ret, gnc_book_get_group(book));
 
-    xaccGroupForEachTransaction (gnc_book_get_group(book),
-                                traverse_txns, ret);
+    xaccGroupForEachTransaction(gnc_book_get_group(book), traverse_txns, ret);
 
     xmlAddChild(ret, gnc_freqSpec_dom_tree_create (book));
 
     /* xxx FIXME hack alert how are we going to handle 
      *  gnc_book_get_template_group handled ???   */
-    xmlAddChild(ret, gnc_schedXaction_dom_tree_create (gnc_book_get_schedxactions(book)));
+    xmlAddChild(ret, gnc_schedXaction_dom_tree_create(
+                    gnc_book_get_schedxactions(book)));
 
 #endif 
 
@@ -147,7 +143,7 @@
 
 /* ================================================================ */
 /* same as above, but we write out directly.  Only handle the guid 
- * and slots, everythign else is handled elsewehere */
+ * and slots, everything else is handled elsewhere */
 
 void
 write_book_parts(FILE *out, QofBook *book)
@@ -156,22 +152,21 @@
 
     domnode = guid_to_dom_tree(book_id_string, qof_book_get_guid(book));
     xmlElemDump(out, NULL, domnode);
-    if(fprintf(out, "\n") < 0) {
-		qof_backend_set_error(qof_book_get_backend(book), ERR_FILEIO_WRITE_ERROR);
-		xmlFreeNode (domnode);
-		return;
-	}
+    if (fprintf(out, "\n") < 0) {
+        qof_backend_set_error(qof_book_get_backend(book), 
+                              ERR_FILEIO_WRITE_ERROR);
+        xmlFreeNode(domnode);
+        return;
+    }
     xmlFreeNode (domnode);
 
-    if(qof_book_get_slots(book))
-    {
+    if (qof_book_get_slots(book)) {
         xmlNodePtr kvpnode = kvp_frame_to_dom_tree(book_slots_string,
                                                    qof_book_get_slots(book));
-        if(kvpnode)
-        {
+        if(kvpnode) {
             xmlElemDump(out, NULL, kvpnode);
             fprintf(out, "\n");
-            xmlFreeNode (kvpnode);
+            xmlFreeNode(kvpnode);
         }
     }
 }
@@ -180,7 +175,7 @@
 /* ================================================================ */
 
 static gboolean
-book_id_handler (xmlNodePtr node, gpointer book_pdata)
+book_id_handler(xmlNodePtr node, gpointer book_pdata)
 {
     QofBook *book = book_pdata;
     GUID *guid;
@@ -216,9 +211,9 @@
 
 static gboolean
 gnc_book_end_handler(gpointer data_for_children,
-                        GSList* data_from_children, GSList* sibling_data,
-                        gpointer parent_data, gpointer global_data,
-                        gpointer *result, const gchar *tag)
+                     GSList* data_from_children, GSList* sibling_data,
+                     gpointer parent_data, gpointer global_data,
+                     gpointer *result, const gchar *tag)
 {
     int successful;
     xmlNodePtr tree = (xmlNodePtr)data_for_children;
@@ -227,25 +222,17 @@
 
     successful = TRUE;
 
-    if(parent_data)
-    {
-        return TRUE;
-    }
+    if (parent_data) return TRUE;
 
     /* OK.  For some messed up reason this is getting called again with a
        NULL tag.  So we ignore those cases */
-    if(!tag)
-    {
-        return TRUE;
-    }
+    if (!tag) return TRUE;
 
     g_return_val_if_fail(tree, FALSE);
 
     book = dom_tree_to_book(tree, book);
-    if (NULL != book)
-    {
+    if (!book)
         gdata->cb(tag, gdata->parsedata, book);
-    }
 
     xmlFreeNode(tree);
 
@@ -263,12 +250,12 @@
     gxpf_data *gdata = (gxpf_data*)global_data;
     QofBook *book = gdata->bookdata;
 
-    if(parent_data) { return TRUE; }
-    if(!tag) { return TRUE; }
+    if (parent_data) return TRUE;
+    if (!tag) return TRUE;
 
     g_return_val_if_fail(tree, FALSE);
 
-    successful = book_id_handler (tree, book);
+    successful = book_id_handler(tree, book);
     xmlFreeNode(tree);
 
     return successful;
@@ -276,17 +263,17 @@
 
 static gboolean
 gnc_book_slots_end_handler(gpointer data_for_children,
-                        GSList* data_from_children, GSList* sibling_data,
-                        gpointer parent_data, gpointer global_data,
-                        gpointer *result, const gchar *tag)
+                           GSList* data_from_children, GSList* sibling_data,
+                           gpointer parent_data, gpointer global_data,
+                           gpointer *result, const gchar *tag)
 {
     gboolean successful;
     xmlNodePtr tree = (xmlNodePtr)data_for_children;
     gxpf_data *gdata = (gxpf_data*)global_data;
     QofBook *book = gdata->bookdata;
 
-    if(parent_data) { return TRUE; }
-    if(!tag) { return TRUE; }
+    if (parent_data) return TRUE;
+    if (!tag) return TRUE;
 
     g_return_val_if_fail(tree, FALSE);
 
@@ -303,8 +290,7 @@
 
     successful = dom_tree_generic_parse (node, book_handlers_v2,
                                          book);
-    if (!successful)
-    {
+    if (!successful) {
         PERR ("failed to parse book");
         book = NULL;
     }

Modified: gnucash/branches/register-rewrite/src/backend/file/gnc-commodity-xml-v2.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/gnc-commodity-xml-v2.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/gnc-commodity-xml-v2.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -79,13 +79,7 @@
     xmlAddChild(ret, text_to_dom_tree(cmdty_id,
                                       gnc_commodity_get_mnemonic(com)));
 
-    /* Enforce backward compatability with 1.8 for the 1.9/2.0 release
-     * series. */
-    if (
-#if (GNUCASH_MAJOR_VERSION < 2) || ((GNUCASH_MAJOR_VERSION == 2) && (GNUCASH_MINOR_VERSION == 0))
-	TRUE ||
-#endif
-	!currency) {
+    if (!currency) {
       if(gnc_commodity_get_fullname(com))
       {
       	  xmlAddChild(ret, text_to_dom_tree(cmdty_name,

Modified: gnucash/branches/register-rewrite/src/backend/file/io-gncbin-r.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/io-gncbin-r.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/io-gncbin-r.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -672,21 +672,21 @@
     err = read( fd, &(ff_acctype), sizeof(char) );
     if( err != sizeof(char) ) { return NULL; }
     switch (ff_acctype) {
-      case FF_BANK: 		{ acctype = BANK; 		break; }
-      case FF_CASH: 		{ acctype = CASH; 		break; }
-      case FF_ASSET: 		{ acctype = ASSET; 		break; }
-      case FF_CREDIT: 		{ acctype = CREDIT; 		break; }
-      case FF_LIABILITY:	{ acctype = LIABILITY; 		break; }
-      case FF_STOCK: 		{ acctype = STOCK; 		break; }
-      case FF_MUTUAL: 		{ acctype = MUTUAL; 		break; }
-      case FF_INCOME: 		{ acctype = INCOME; 		break; }
-      case FF_EXPENSE: 		{ acctype = EXPENSE; 		break; }
-      case FF_EQUITY: 		{ acctype = EQUITY; 		break; }
-      case FF_CHECKING: 	{ acctype = CHECKING; 		break; }
-      case FF_SAVINGS: 		{ acctype = SAVINGS; 		break; }
-      case FF_MONEYMRKT: 	{ acctype = MONEYMRKT;	 	break; }
-      case FF_CREDITLINE: 	{ acctype = CREDITLINE; 	break; }
-      case FF_CURRENCY: 	{ acctype = CURRENCY; 		break; }
+      case FF_BANK: 		{ acctype = ACCT_TYPE_BANK; 		break; }
+      case FF_CASH: 		{ acctype = ACCT_TYPE_CASH; 		break; }
+      case FF_ASSET: 		{ acctype = ACCT_TYPE_ASSET; 		break; }
+      case FF_CREDIT: 		{ acctype = ACCT_TYPE_CREDIT; 		break; }
+      case FF_LIABILITY:	{ acctype = ACCT_TYPE_LIABILITY;	break; }
+      case FF_STOCK: 		{ acctype = ACCT_TYPE_STOCK; 		break; }
+      case FF_MUTUAL: 		{ acctype = ACCT_TYPE_MUTUAL; 		break; }
+      case FF_INCOME: 		{ acctype = ACCT_TYPE_INCOME; 		break; }
+      case FF_EXPENSE: 		{ acctype = ACCT_TYPE_EXPENSE; 		break; }
+      case FF_EQUITY: 		{ acctype = ACCT_TYPE_EQUITY; 		break; }
+      case FF_CHECKING: 	{ acctype = ACCT_TYPE_CHECKING; 	break; }
+      case FF_SAVINGS: 		{ acctype = ACCT_TYPE_SAVINGS; 		break; }
+      case FF_MONEYMRKT: 	{ acctype = ACCT_TYPE_MONEYMRKT; 	break; }
+      case FF_CREDITLINE: 	{ acctype = ACCT_TYPE_CREDITLINE; 	break; }
+      case FF_CURRENCY: 	{ acctype = ACCT_TYPE_CURRENCY;		break; }
       default: return NULL;
     }
     xaccAccountSetType (acc, acctype);
@@ -869,7 +869,7 @@
   if(!acc) return(FALSE);
 
   acc_type = xaccAccountGetType(acc);
-  if ((acc_type == STOCK) || (acc_type == MUTUAL)) {
+  if ((acc_type == ACCT_TYPE_STOCK) || (acc_type == ACCT_TYPE_MUTUAL)) {
     const char *tmp = readString( fd, token );
     if(NULL == tmp) return(FALSE);
     if(strlen(tmp) > 0) dxaccAccountSetPriceSrc(acc, tmp);

Modified: gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/io-gncxml-v2.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -121,20 +121,11 @@
 add_transaction_local(sixtp_gdv2 *data, Transaction *trn)
 {
     gnc_commodity_table *table;
-    Split *spl;
-    int i;
     
     table = gnc_book_get_commodity_table (data->book);
 
     xaccTransBeginEdit (trn);
     xaccTransScrubCurrency (trn);
-
-    for(i = 0, spl = xaccTransGetSplit(trn, i);
-        spl;
-        i++, spl = xaccTransGetSplit(trn, i))
-    {
-        xaccAccountInsertSplit(xaccSplitGetAccount(spl), spl);
-    }
     xaccTransCommitEdit (trn);
 
     data->counter.transactions_loaded++;

Modified: gnucash/branches/register-rewrite/src/backend/file/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -62,7 +62,7 @@
   ${top_srcdir}/src/backend/file/sixtp-stack.c \
   ${top_srcdir}/src/backend/file/sixtp-to-dom-parser.c \
   test-string-converters.c
-  
+
 test_xml_account_SOURCES = \
   ${top_srcdir}/src/backend/file/sixtp-dom-parsers.c \
   ${top_srcdir}/src/backend/file/sixtp-dom-generators.c \
@@ -181,9 +181,9 @@
   --gnc-module-dir ${top_builddir}/src/gnc-module \
   --gnc-module-dir ${top_builddir}/src/engine \
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
-  --gnc-module-dir ${top_srcdir}/src/engine \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/src/backend/file \
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --gnc-module-dir ${top_srcdir}/src/engine
 
 TESTS_ENVIRONMENT := \
   GNC_ACCOUNT_PATH=${top_srcdir}/accounts/C \
@@ -217,8 +217,6 @@
 LDADD = ${top_builddir}/src/test-core/libgncmod-test.la \
         ${top_builddir}/src/gnc-module/libgncmodule.la \
         ${top_builddir}/src/engine/libgncmod-engine.la \
-        ${top_builddir}/src/engine/libgw-engine.la \
-        ${top_builddir}/src/engine/libgw-kvp.la \
         ${top_builddir}/src/engine/test-core/libgncmod-test-engine.la \
         ${top_builddir}/src/core-utils/libcore-utils.la \
         ./libgnc-test-file-stuff.la \

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-file-stuff.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-file-stuff.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-file-stuff.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -204,7 +204,8 @@
 }
 
 gboolean
-equals_node_val_vs_commodity(xmlNodePtr node, const gnc_commodity *com, QofBook *book)
+equals_node_val_vs_commodity(xmlNodePtr node, const gnc_commodity *com, 
+                             QofBook *book)
 {
     gnc_commodity *cmpcom;
 

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-load-backend.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-load-backend.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-load-backend.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,6 +25,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h"
 #include "qof.h"
 #include "cashobjects.h"
 #include "test-stuff.h"

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-load-example-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-load-example-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-load-example-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,6 +21,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h"
 #include <glib.h>
 #include <libguile.h>
 #include <string.h>

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-load-xml2.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-load-xml2.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-load-xml2.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -26,6 +26,7 @@
  * @brief test the loading of a version-2 gnucash XML file
  */
 
+#include "config.h"
 #include <stdlib.h>
 #include <stdio.h>
 #include <sys/types.h>

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-save-in-lang.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-save-in-lang.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-save-in-lang.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <glib.h>
 #include <unistd.h>
 #include <sys/types.h>

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-xml-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-xml-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-xml-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -370,5 +370,5 @@
     qof_session_destroy(session);        
     print_test_results();
     qof_close();
-  return 0;
+    return 0;
 }

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-xml-commodity.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-xml-commodity.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-xml-commodity.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -220,7 +220,7 @@
 }
 
 int
-main (int argc, char ** argv)
+main(int argc, char ** argv)
 {
     gnc_engine_init(argc, argv);
     book = qof_book_new ();

Modified: gnucash/branches/register-rewrite/src/backend/file/test/test-xml2-is-file.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/file/test/test-xml2-is-file.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/file/test/test-xml2-is-file.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,3 +1,4 @@
+#include "config.h"
 #include <stdlib.h>
 #include <string.h>
 

Modified: gnucash/branches/register-rewrite/src/backend/postgres/putil.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/postgres/putil.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/postgres/putil.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -31,6 +31,7 @@
  * 
  */
 
+#include "config.h" 
 #include <glib.h> 
 #include <glib/gi18n.h>
 #include <libpq-fe.h>  

Modified: gnucash/branches/register-rewrite/src/backend/postgres/putil.h
===================================================================
--- gnucash/branches/register-rewrite/src/backend/postgres/putil.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/postgres/putil.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -210,7 +210,7 @@
  * -- sqlname -- input -- the name of the field in the sql table
  * -- fun -- input -- a subroutine returning a value
  * -- ndiffs -- input/output -- integer, incremented if the 
- *              value ofthe field and the value returned by
+ *              value of the field and the value returned by
  *              the subroutine differ.
  *
  * The different macros compare different field types.
@@ -245,7 +245,7 @@
 }
 
 /* Compare guids. A NULL GUID from the engine is considered to 
- * match any value of a GUID in teh sql database.  This is 
+ * match any value of a GUID in the sql database.  This is 
  * equality is used to enable deletion, where the GUID may have
  * already been set to NULL in the engine, but not yet in the DB.
  */

Modified: gnucash/branches/register-rewrite/src/backend/postgres/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/backend/postgres/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/postgres/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -8,9 +8,7 @@
   --gnc-module-dir ${top_builddir}/src/engine \
   --guile-load-dir ${top_srcdir}/src/engine \
   --gnc-module-dir ${top_builddir}/src/backend/file \
-  --gnc-module-dir ${top_builddir}/src/backend/postgres \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --gnc-module-dir ${top_builddir}/src/backend/postgres
 
 TESTS_ENVIRONMENT := \
   TEST_DB_SOCKET_DIR=`pwd`/gnc_test_db_sock \
@@ -26,8 +24,6 @@
         ${top_builddir}/src/gnc-module/libgncmodule.la \
         ${top_builddir}/src/engine/libgncmod-engine.la \
         ${top_builddir}/src/engine/libgncmod-engine.la \
-        ${top_builddir}/src/engine/libgw-engine.la \
-        ${top_builddir}/src/engine/libgw-kvp.la \
         ${top_builddir}/src/engine/test-core/libgncmod-test-engine.la \
         -lltdl \
 	-lpq

Modified: gnucash/branches/register-rewrite/src/backend/postgres/test/run-tests.sh
===================================================================
--- gnucash/branches/register-rewrite/src/backend/postgres/test/run-tests.sh	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/postgres/test/run-tests.sh	2007-01-05 17:25:28 UTC (rev 15313)
@@ -14,7 +14,7 @@
 elif [ "${PGHOST}X" != "X" ]; then
 # This expects the logged in user to have authority
 # to create databases.
-    if [ "${PGPORT}X" == "X" ]; then
+    if [ "${PGPORT}X" = "X" ]; then
 	export PGPORT=5432
     fi
     ./test-db $PGHOST $PGPORT || EXIT_VALUE=1

Modified: gnucash/branches/register-rewrite/src/backend/postgres/test/test-db.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/postgres/test/test-db.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/postgres/test/test-db.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,6 +15,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h" 
 #include <glib.h>
 #include <libpq-fe.h>
 #include <stdlib.h>

Modified: gnucash/branches/register-rewrite/src/backend/postgres/test/test-load-backend.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/postgres/test/test-load-backend.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/postgres/test/test-load-backend.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,6 +25,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h" 
 #include "qof.h"
 #include "cashobjects.h"
 #include "test-stuff.h"

Modified: gnucash/branches/register-rewrite/src/backend/postgres/test/test-period.c
===================================================================
--- gnucash/branches/register-rewrite/src/backend/postgres/test/test-period.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/backend/postgres/test/test-period.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,6 +22,7 @@
  * December 2001
  */
 
+#include "config.h" 
 #include <ctype.h>
 #include <glib.h>
 #include <time.h>

Copied: gnucash/branches/register-rewrite/src/base-typemaps.i (from rev 15058, gnucash/trunk/src/base-typemaps.i)

Modified: gnucash/branches/register-rewrite/src/bin/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/bin/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,11 +2,10 @@
 SUBDIRS = . overrides test
 
 AM_CFLAGS = -I${top_builddir} ${GLIB_CFLAGS} ${GNOME_CFLAGS} ${GTK_CFLAGS} \
+  ${GUILE_INCS} \
   ${QOF_CFLAGS} \
-  -DPREFIX=\"${prefix}\" \
-  -DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
-  -DDATADIR=\"${GNC_SHAREDIR}\" \
-  -DLIBDIR=\"${GNC_LIBDIR}\" \
+  -DPKGSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
+  -DPKGDATADIR=\"${GNC_SHAREDIR}\" \
   -DGNC_HELPDIR=\"${GNC_HELPDIR}\" \
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/core-utils \
@@ -31,43 +30,30 @@
 gnucash: gnucash.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	    -e 's:@-BIN_DIR-@:${bindir}:g' \
-	    -e 's:@-G_WRAP_MODULE_DIR-@:${G_WRAP_MODULE_DIR}:g' \
-	    -e 's:@-G_WRAP_LIB_DIR-@:${G_WRAP_LIB_DIR}:g' \
-	    -e 's:@-GNC_GUILE_MODULE_DIR-@:${GNC_SHAREDIR}/guile-modules:g' \
-	    -e 's:@-GNC_SCM_INSTALL_DIR-@:${GNC_SCM_INSTALL_DIR}:g' \
-            -e 's:@-GNC_LIB_INSTALLDIR-@:${libdir}:' \
-            -e 's:@-GNC_PKGLIB_INSTALLDIR-@:${pkglibdir}:g' \
-	    -e 's:@-GNC_MODULE_DIR-@:${GNC_MODULE_DIR}:g'
+	    -e 's#@-BIN_DIR-@#${bindir}#g' \
+	    -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
+	    -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
+            -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
+            -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
+	    -e 's#@-PATH_SEPARATOR-@#${PATH_SEPARATOR}#g' \
+	    -e 's#@-GNC_MODULE_DIR-@#${GNC_MODULE_DIR}#g'
 	mv $@.tmp $@
 	chmod u+x $@
 
-BUILT_SOURCES = i18n.h
-
-i18n.h: i18n.h.in ${top_builddir}/config.status Makefile
-	rm -f $@.tmp
-	sed < $< > $@.tmp \
-            -e 's:@-PACKAGE-@:${PACKAGE}:g' \
-            -e 's:@-LOCALE_DIR-@:${LOCALE_DIR}:g'
-	mv $@.tmp $@
-
-
 gnucash-valgrind: gnucash-valgrind.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	    -e 's:@-BIN_DIR-@:${bindir}:g' \
-	    -e 's:@-G_WRAP_MODULE_DIR-@:${G_WRAP_MODULE_DIR}:g' \
-	    -e 's:@-G_WRAP_LIB_DIR-@:${G_WRAP_LIB_DIR}:g' \
-	    -e 's:@-GNC_GUILE_MODULE_DIR-@:${GNC_SHAREDIR}/guile-modules:g' \
-	    -e 's:@-GNC_SCM_INSTALL_DIR-@:${GNC_SCM_INSTALL_DIR}:g' \
-            -e 's:@-GNC_LIB_INSTALLDIR-@:${libdir}:' \
-            -e 's:@-GNC_PKGLIB_INSTALLDIR-@:${pkglibdir}:g' \
-	    -e 's:@-GNC_MODULE_DIR-@:${GNC_MODULE_DIR}:g' \
-	    -e "s:@-TOP_SRC_DIR-@:`pwd`/${top_srcdir}:g"
+	    -e 's#@-BIN_DIR-@#${bindir}#g' \
+	    -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
+	    -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
+            -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
+            -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
+	    -e 's#@-GNC_MODULE_DIR-@#${GNC_MODULE_DIR}#g' \
+	    -e "s#@-TOP_SRC_DIR-@#`pwd`/${top_srcdir}#g"
 	mv $@.tmp $@
 	chmod u+x $@
 
-CLEANFILES = gnucash gnucash-valgrind
+CLEANFILES = $(BUILT_SOURCES) gnucash gnucash-valgrind
 
 # We handle gnucash scripts in a somewhat unexpected way, but we do
 # this so that a user who doesn't necessarily have the right
@@ -91,7 +77,7 @@
 # if you change gncoverridedir, make sure you change ./overrides/Makefile.am too.
 gncoverridesdir = ${GNC_LIBEXECDIR}/overrides
 
-EXTRA_DIST = generate-gnc-script update-gnucash-gconf.in i18n.h.in \
+EXTRA_DIST = generate-gnc-script update-gnucash-gconf.in \
 	gnucash.in gnucash-valgrind.in
 
 ## Gnucash scripts -- real code is in overrides, these just get you there.
@@ -99,7 +85,6 @@
 	${srcdir}/generate-gnc-script $@ "${gncoverridesdir}"
 
 CLEANFILES += ${gnc_common_scripts} update-gnucash-gconf
-DISTCLEANFILES = i18n.h
 
 ## We borrow guile's convention and use @-...-@ as the substitution
 ## brackets here, instead of the usual @... at .  This prevents autoconf
@@ -109,6 +94,6 @@
 		${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	    -e 's:@-GCONF_SCHEMA_FILE_DIR-@:${GCONF_SCHEMA_FILE_DIR}:g'
+	    -e 's#@-GCONF_SCHEMA_FILE_DIR-@#${GCONF_SCHEMA_FILE_DIR}#g'
 	mv $@.tmp $@
 	chmod +x $@

Modified: gnucash/branches/register-rewrite/src/bin/gnucash-bin.c
===================================================================
--- gnucash/branches/register-rewrite/src/bin/gnucash-bin.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/gnucash-bin.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -33,7 +33,8 @@
 #include <libgnome/libgnome.h>
 #include "glib.h"
 #include "gnc-module.h"
-#include "i18n.h"
+#include "gnc-path.h"
+#include "binreloc.h"
 #include "gnc-version.h"
 #include "gnc-engine.h"
 #include "gnc-filepath-utils.h"
@@ -49,7 +50,15 @@
 #include "gnc-plugin-file-history.h"
 #include "gnc-gconf-utils.h"
 #include "dialog-new-user.h"
+#include "gnc-session.h"
+#include "engine-helpers.h"
+#include "swig-runtime.h"
 
+#ifdef HAVE_GETTEXT
+#  include <libintl.h>
+#  include <locale.h>
+#endif
+
 /* GNUCASH_SVN is defined whenever we're building from an SVN tree */
 #ifdef GNUCASH_SVN
 static int is_development_version = TRUE;
@@ -73,15 +82,15 @@
 	    _("This is a development version. It may or may not work.\n"),
 	    _("Report bugs and other problems to gnucash-devel at gnucash.org.\n"),
 	    _("You can also lookup and file bug reports at http://bugzilla.gnome.org\n"),
-	    _("The last stable version was "), "GnuCash 1.8.12",
-	    _("The next stable version will be "), "GnuCash 2.0");
+	    _("The last stable version was "), "GnuCash 2.0.2",
+	    _("The next stable version will be "), "GnuCash 2.2");
 }
 
 /* Priority of paths: The default is set at build time.  It may be
    overridden by environment variables, which may, in turn, be
    overridden by command line options.  */
-static char *config_path = SYSCONFDIR;
-static char *share_path = DATADIR;
+static char *config_path = PKGSYSCONFDIR;
+static char *share_path = PKGDATADIR;
 static char *help_path = GNC_HELPDIR;
 
 static void
@@ -97,29 +106,7 @@
         help_path = path;
 }
 
-static int error_in_scm_eval = FALSE;
-
-static void
-error_handler(const char *msg)
-{
-    g_warning(msg);
-    error_in_scm_eval = TRUE;
-}
-
 static gboolean
-try_load(gchar *fn)
-{
-    g_message("looking for %s", fn);
-    if (g_file_test(fn, G_FILE_TEST_EXISTS)) {
-        g_message("trying to load %s", fn);
-        error_in_scm_eval = FALSE;
-        gfec_eval_file(fn, error_handler);
-        return !error_in_scm_eval;
-    }
-    return FALSE;
-}
-
-static gboolean
 try_load_config_array(const gchar *fns[])
 {
     gchar *filename;
@@ -127,7 +114,7 @@
 
     for (i = 0; fns[i]; i++) {
         filename = gnc_build_dotgnucash_path(fns[i]);
-        if (try_load(filename)) {
+        if (gfec_try_load(filename)) {
             g_free(filename);
             return TRUE;
         }
@@ -152,8 +139,9 @@
     if (is_system_config_loaded) return;
 
     update_message("loading system configuration");
+    /* FIXME: use runtime paths from gnc-path.c here */
     system_config = g_build_filename(config_path, "config", NULL);
-    is_system_config_loaded = try_load(system_config);
+    is_system_config_loaded = gfec_try_load(system_config);
     g_free(system_config);
 }
 
@@ -352,7 +340,6 @@
         { "gnucash/register/register-gnome", 0, FALSE },
         { "gnucash/import-export/qif-import", 0, FALSE },
         { "gnucash/import-export/ofx", 0, TRUE },
-        { "gnucash/import-export/mt940", 0, TRUE },
         { "gnucash/import-export/log-replay", 0, TRUE },
         { "gnucash/import-export/hbci", 0, TRUE },
         { "gnucash/report/report-system", 0, FALSE },
@@ -374,16 +361,23 @@
             gnc_module_load(modules[i].name, modules[i].version);
     }
     if (!gnc_engine_is_initialized()) {
+#ifdef G_OS_WIN32
+        g_warning("GnuCash engine indicates it hasn't been initialized correctly. On Windows this mechanism is know not to work. Ignoring for now.\n");
+        /* See more detailed discussion here
+	   https://lists.gnucash.org/pipermail/gnucash-devel/2006-September/018529.html */
+#else
         g_error("GnuCash engine failed to initialize.  Exiting.\n");
         exit(0);
+#endif
     }
 }
 
 static void
 inner_main_add_price_quotes(void *closure, int argc, char **argv)
 {
-    SCM mod, add_quotes, scm_filename, scm_result;
-    
+    SCM mod, add_quotes, scm_book, scm_result = SCM_BOOL_F;
+    QofSession *session = NULL;
+
     mod = scm_c_resolve_module("gnucash price-quotes");
     scm_set_current_module(mod);
 
@@ -392,22 +386,42 @@
     qof_event_suspend();
     scm_c_eval_string("(gnc:price-quotes-install-sources)");
 
-    if (gnc_quote_source_fq_installed()) {
-      add_quotes = scm_c_eval_string("gnc:add-quotes-to-book-at-url");
-      scm_filename = scm_makfrom0str (add_quotes_file);
-      scm_result = scm_call_1(add_quotes, scm_filename);
+    if (!gnc_quote_source_fq_installed()) {
+        g_print(_("No quotes retrieved. Finance::Quote isn't "
+                  "installed properly.\n"));
+        goto fail;
+    }
 
-      if (!SCM_NFALSEP(scm_result)) {
+    add_quotes = scm_c_eval_string("gnc:book-add-quotes");
+    session = gnc_get_current_session();
+    if (!session) goto fail;
+
+    qof_session_begin(session, add_quotes_file, FALSE, FALSE);
+    if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR) goto fail;
+
+    qof_session_load(session, NULL);
+    if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR) goto fail;
+
+    scm_book = gnc_book_to_scm(qof_session_get_book(session));
+    scm_result = scm_call_2(add_quotes, SCM_BOOL_F, scm_book);
+
+    qof_session_save(session, NULL);
+    if (qof_session_get_error(session) != ERR_BACKEND_NO_ERR) goto fail;
+
+    qof_session_destroy(session);
+    if (!SCM_NFALSEP(scm_result)) {
         g_error("Failed to add quotes to %s.", add_quotes_file);
-        gnc_shutdown(1);
-      }
-    } else {
-      g_print(_("No quotes retrieved. Finance::Quote isn't installed properly.\n"));
+        goto fail;
     }
 
     qof_event_resume();
     gnc_shutdown(0);
     return;
+ fail:
+    if (session && qof_session_get_error(session) != ERR_BACKEND_NO_ERR)
+        g_error("Session Error: %s", qof_session_get_error_message(session));
+    qof_event_resume();
+    gnc_shutdown(1);
 }
 
 static char *
@@ -485,14 +499,22 @@
 
 int main(int argc, char ** argv)
 {
+    gchar *localedir;
+    GError *binreloc_error = NULL;
 
+    /* Init binreloc */
+    if (!gbr_init (&binreloc_error) ) {
+      printf("main: Error on gbr_init: %s\n", binreloc_error->message);
+    }
+    localedir = gnc_path_get_localedir ();
 #ifdef HAVE_GETTEXT
     /* setlocale (LC_ALL, ""); is already called by gtk_set_locale()
        via gtk_init(). */
-    bindtextdomain (TEXT_DOMAIN, LOCALE_DIR);
-    textdomain (TEXT_DOMAIN);
-    bind_textdomain_codeset (TEXT_DOMAIN, "UTF-8");
+    bindtextdomain (GETTEXT_PACKAGE, localedir);
+    textdomain (GETTEXT_PACKAGE);
+    bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
 #endif
+    g_free (localedir);
 
     gnc_module_system_init();
     envt_override();
@@ -500,12 +522,24 @@
     gnc_print_unstable_message();
 
     if (add_quotes_file) {
+        gchar *prefix = gnc_path_get_prefix ();
+	gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
+	gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
+	gchar *pkglibdir = gnc_path_get_pkglibdir ();
         /* This option needs to run without a display, so we can't
            initialize any GUI libraries.  */
         gnome_program_init(
             "gnucash", VERSION, LIBGNOME_MODULE,
             argc, argv,
-            GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
+	    GNOME_PARAM_APP_PREFIX, prefix,
+	    GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
+	    GNOME_PARAM_APP_DATADIR, pkgdatadir,
+	    GNOME_PARAM_APP_LIBDIR, pkglibdir,
+	    GNOME_PARAM_NONE);
+	g_free (prefix);
+	g_free (pkgsysconfdir);
+	g_free (pkgdatadir);
+	g_free (pkglibdir);
         scm_boot_guile(argc, argv, inner_main_add_price_quotes, 0);
         exit(0);  /* never reached */
     }

Modified: gnucash/branches/register-rewrite/src/bin/gnucash-valgrind.in
===================================================================
--- gnucash/branches/register-rewrite/src/bin/gnucash-valgrind.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/gnucash-valgrind.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -8,7 +8,6 @@
 
 GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@:${GNC_MODULE_PATH}"
 
-EXTRA_PATH="@-G_WRAP_MODULE_DIR-@"
 EXTRA_PATH="${EXTRA_PATH}:@-GNC_GUILE_MODULE_DIR-@"
 EXTRA_PATH="${EXTRA_PATH}:@-GNC_SCM_INSTALL_DIR-@"
 GUILE_LOAD_PATH="${EXTRA_PATH}:${GUILE_LOAD_PATH}"
@@ -16,7 +15,6 @@
 EXTRA_LIBS="${GNC_MODULE_PATH}"
 EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_LIB_INSTALLDIR-@"
 EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_MODULE_DIR-@"
-EXTRA_LIBS="${EXTRA_LIBS}:@-G_WRAP_LIB_DIR-@"
 
 LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
 LTDL_LIBRARY_PATH="${EXTRA_LIBS}:${LTDL_LIBRARY_PATH}"

Modified: gnucash/branches/register-rewrite/src/bin/gnucash.in
===================================================================
--- gnucash/branches/register-rewrite/src/bin/gnucash.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/gnucash.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,20 +6,18 @@
 GUILE_WARN_DEPRECATED="no"
 export GUILE_WARN_DEPRECATED
 
-GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@:${GNC_MODULE_PATH}"
+GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@@-PATH_SEPARATOR-@${GNC_MODULE_PATH}"
 
-EXTRA_PATH="@-G_WRAP_MODULE_DIR-@"
-EXTRA_PATH="${EXTRA_PATH}:@-GNC_GUILE_MODULE_DIR-@"
-EXTRA_PATH="${EXTRA_PATH}:@-GNC_SCM_INSTALL_DIR-@"
-GUILE_LOAD_PATH="${EXTRA_PATH}:${GUILE_LOAD_PATH}"
+EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_GUILE_MODULE_DIR-@"
+EXTRA_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@@-GNC_SCM_INSTALL_DIR-@"
+GUILE_LOAD_PATH="${EXTRA_PATH}@-PATH_SEPARATOR-@${GUILE_LOAD_PATH}"
 
 EXTRA_LIBS="${GNC_MODULE_PATH}"
-EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_LIB_INSTALLDIR-@"
-EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_MODULE_DIR-@"
-EXTRA_LIBS="${EXTRA_LIBS}:@-G_WRAP_LIB_DIR-@"
+EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_LIB_INSTALLDIR-@"
+EXTRA_LIBS="${EXTRA_LIBS}@-PATH_SEPARATOR-@@-GNC_MODULE_DIR-@"
 
-LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
-LTDL_LIBRARY_PATH="${EXTRA_LIBS}:${LTDL_LIBRARY_PATH}"
+LD_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${LD_LIBRARY_PATH}"
+LTDL_LIBRARY_PATH="${EXTRA_LIBS}@-PATH_SEPARATOR-@${LTDL_LIBRARY_PATH}"
 
 export GNC_MODULE_PATH
 export GUILE_LOAD_PATH

Deleted: gnucash/branches/register-rewrite/src/bin/i18n.h.in
===================================================================
--- gnucash/branches/register-rewrite/src/bin/i18n.h.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/i18n.h.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,29 +0,0 @@
-/**-*-c-*-***********************************************************\
- * i18n.h -- internationalization with gettext                      *
- * Copyright (C) 1999 Laurent Pélecq                                *
- * Copyright (C) 2000 Dave Peticolas <peticola at cs.ucdavis.edu>      *
- *                                                                  *
- * 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, write to the Free Software      *
- * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.        *
-\********************************************************************/
-
-#include "config.h"
-
-#ifdef HAVE_GETTEXT
-#  include <libintl.h>
-#  include <locale.h>
-#endif
-
-#define TEXT_DOMAIN		"@-PACKAGE-@"
-#define LOCALE_DIR		"@-LOCALE_DIR-@"

Modified: gnucash/branches/register-rewrite/src/bin/overrides/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/bin/overrides/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/overrides/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,7 +23,7 @@
 guile: guile.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	    -e 's:@-GUILE-@:${GUILE}:'
+	    -e 's#@-GUILE-@#${GUILE}#'
 	mv $@.tmp $@
 	chmod u+x $@
 CLEANFILES = guile
@@ -31,14 +31,12 @@
 gnucash-env: gnucash-env.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-	    -e 's:@-G_WRAP_MODULE_DIR-@:${G_WRAP_MODULE_DIR}:g' \
-	    -e 's:@-G_WRAP_LIB_DIR-@:${G_WRAP_LIB_DIR}:g' \
-	    -e 's:@-GNC_GUILE_MODULE_DIR-@:${GNC_SHAREDIR}/guile-modules:g' \
-	    -e 's:@-GNC_SCM_INSTALL_DIR-@:${GNC_SCM_INSTALL_DIR}:g' \
-            -e 's:@-GNC_LIB_INSTALLDIR-@:${libdir}:' \
-            -e 's:@-GNC_PKGLIB_INSTALLDIR-@:${pkglibdir}:g' \
-	    -e 's:@-GNC_MODULE_DIR-@:${GNC_MODULE_DIR}:g' \
-            -e 's:@-GNC_SCRIPT_OVERRIDE_DIR-@:${gncoverridedir}:g'
+	    -e 's#@-GNC_GUILE_MODULE_DIR-@#${GNC_SHAREDIR}/guile-modules#g' \
+	    -e 's#@-GNC_SCM_INSTALL_DIR-@#${GNC_SCM_INSTALL_DIR}#g' \
+            -e 's#@-GNC_LIB_INSTALLDIR-@#${libdir}#' \
+            -e 's#@-GNC_PKGLIB_INSTALLDIR-@#${pkglibdir}#g' \
+	    -e 's#@-GNC_MODULE_DIR-@#${GNC_MODULE_DIR}#g' \
+            -e 's#@-GNC_SCRIPT_OVERRIDE_DIR-@#${gncoverridedir}#g'
 	mv $@.tmp $@
 	chmod u+x $@
 CLEANFILES += gnucash-env
@@ -46,11 +44,9 @@
 gnucash-build-env: gnucash-build-env.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-            -e 's:@-GNC_TEST_SRFI_LOAD_CMD-@:@GNC_TEST_SRFI_LOAD_CMD@:g' \
-	    -e 's:@-G_WRAP_MODULE_DIR-@:${G_WRAP_MODULE_DIR}:g' \
-	    -e 's:@-G_WRAP_LIB_DIR-@:${G_WRAP_LIB_DIR}:g' \
-            -e 's:@-GNC_BUILDDIR-@:${PWD}/${top_builddir}:g' \
-            -e 's:@-GNC_SRCDIR-@:${PWD}/${top_srcdir}:g'
+            -e 's#@-GNC_TEST_SRFI_LOAD_CMD-@#@GNC_TEST_SRFI_LOAD_CMD@#g' \
+            -e 's#@-GNC_BUILDDIR-@#${PWD}/${top_builddir}#g' \
+            -e 's#@-GNC_SRCDIR-@#${PWD}/${top_srcdir}#g'
 	mv $@.tmp $@
 	chmod u+x $@
 CLEANFILES += gnucash-build-env

Modified: gnucash/branches/register-rewrite/src/bin/overrides/gnucash-build-env.in
===================================================================
--- gnucash/branches/register-rewrite/src/bin/overrides/gnucash-build-env.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/overrides/gnucash-build-env.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -10,8 +10,6 @@
 
 top_srcdir="@-GNC_SRCDIR-@"
 top_builddir="@-GNC_BUILDDIR-@"
-G_WRAP_MODULE_DIR="@-G_WRAP_MODULE_DIR-@"
-G_WRAP_LIB_DIR="@-G_WRAP_LIB_DIR-@"
 
 if test "${GNC_CONFIG_PATH}"x = x
 then
@@ -33,8 +31,6 @@
 
 eval `@-GNC_SRCDIR-@/src/gnc-test-env @-GNC_TEST_SRFI_LOAD_CMD-@ \
   --library-dir ${top_builddir}/src/gnome \
-  --library-dir ${G_WRAP_LIB_DIR} \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_builddir}/src/scm \
   --guile-load-dir ${top_builddir}/lib/guile-www \
   --guile-load-dir ${top_builddir}/src/gnome \

Modified: gnucash/branches/register-rewrite/src/bin/overrides/gnucash-env.in
===================================================================
--- gnucash/branches/register-rewrite/src/bin/overrides/gnucash-env.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/overrides/gnucash-env.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,7 +6,6 @@
 
 GNC_MODULE_PATH="@-GNC_PKGLIB_INSTALLDIR-@:${GNC_MODULE_PATH}"
 
-EXTRA_PATH="@-G_WRAP_MODULE_DIR-@"
 EXTRA_PATH="${EXTRA_PATH}:@-GNC_GUILE_MODULE_DIR-@"
 EXTRA_PATH="${EXTRA_PATH}:@-GNC_SCM_INSTALL_DIR-@"
 
@@ -15,7 +14,6 @@
 EXTRA_LIBS="${GNC_MODULE_PATH}"
 EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_LIB_INSTALLDIR-@"
 EXTRA_LIBS="${EXTRA_LIBS}:@-GNC_MODULE_DIR-@"
-EXTRA_LIBS="${EXTRA_LIBS}:@-G_WRAP_LIB_DIR-@"
 
 LD_LIBRARY_PATH="${EXTRA_LIBS}:${LD_LIBRARY_PATH}"
 LTDL_LIBRARY_PATH="${EXTRA_LIBS}:${LTDL_LIBRARY_PATH}"

Modified: gnucash/branches/register-rewrite/src/bin/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/bin/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/bin/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,6 @@
 TESTS = test-version
 
 TESTS_ENVIRONMENT := \
-	PATH="..:${PATH}"
+	PATH="..:${PATH}" LD_LIBRARY_PATH="${top_builddir}/lib/libqof/qof/.libs:${LD_LIBRARY_PATH}"
 
 EXTRA_DIST = test-version


Property changes on: gnucash/branches/register-rewrite/src/business/business-core
___________________________________________________________________
Name: svn:ignore
   - *.lo
*.la
.deps
.libs
.scm-links
Makefile
Makefile.in
gw-business-core.c
gw-business-core.h
gw-business-core.html
gw-business-core.scm
.DS_Store
*.loT
g-wrapped
gnucash


semantic.cache

TAGS

   + *.lo
*.la
.deps
.libs
.scm-links
Makefile
Makefile.in
swig-business-core.c
.DS_Store
*.loT
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/business/business-core/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,18 +1,19 @@
 SUBDIRS = . test file
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-business-core.la libgw-business-core.la
+pkglib_LTLIBRARIES = libgncmod-business-core.la
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/engine \
   -I${top_srcdir}/src/gnc-module \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${QOF_CFLAGS} \
   ${GLIB_CFLAGS} 
 
 libgncmod_business_core_la_SOURCES = \
+  swig-business-core.c \
+  gncBusGuile.c \
   businessmod-core.c \
   gncAddress.c \
   gncBillTerm.c \
@@ -52,13 +53,11 @@
   gncTaxTable.h \
   gncTaxTableP.h \
   gncVendor.h \
-  gncVendorP.h \
-  gw-business-core.h
+  gncVendorP.h
 
 libgncmod_business_core_la_LIBADD = \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
-  ${G_WRAP_LINK_ARGS} \
   ${QOF_LIBS} \
   ${GUILE_LIBS} \
   ${GLIB_LIBS} \
@@ -66,57 +65,33 @@
 
 # business-core-helpers.c
 
-libgw_business_core_la_SOURCES = \
-  gncBusGuile.c \
-  gw-business-core.c
+if BUILDING_FROM_SVN
+swig-business-core.c: business-core.i ${noinst_HEADERS}
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
-libgw_business_core_la_LDFLAGS = ${G_WRAP_LINK_ARGS}
-libgw_business_core_la_LIBADD  = \
-  libgncmod-business-core.la \
-  ${top_builddir}/src/engine/libgw-engine.la \
-  ${top_builddir}/src/engine/libgncmod-engine.la \
-  ${QOF_LIBS} \
-  ${GLIB_LIBS}
-
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
 gncmod_DATA = business-core.scm
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = \
-  gw-business-core.scm \
-  gw-business-core-spec.scm
+EXTRA_DIST = business-core.i ${gncmod_DATA}
 
-EXTRA_DIST = \
-  ${gncmod_DATA} \
-  ${gwmod_DATA}
-
 if GNUCASH_SEPARATE_BUILDDIR
-#For compiling
-SCM_FILE_LINKS = gw-business-core-spec.scm
 #For executing test cases
-SCM_FILE_LINKS += ${gncmod_DATA}
+SCM_FILE_LINKS = ${gncmod_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-gw-business-core.scm gw-business-core.c gw-business-core.h: \
- .scm-links gw-business-core-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	 (set! %load-path (cons \"${PWD}\" %load-path)) \
-	 (set! %load-path (cons \"../../engine\" %load-path)) \
-	 (primitive-load \"./gw-business-core-spec.scm\") \
-	 (gw:generate-wrapset \"gw-business-core\")"
-
-BUILT_SOURCES = gw-business-core.scm gw-business-core.c gw-business-core.h
-DISTCLEANFILES = g-wrapped gnucash .scm-links ${SCM_FILE_LINKS} \
-                 gw-business-core.html
+noinst_DATA = .scm-links
+CLEANFILES = gnucash .scm-links ${SCM_FILE_LINKS}
+MAINTAINERCLEANFILES = swig-business-core.c

Copied: gnucash/branches/register-rewrite/src/business/business-core/business-core.i (from rev 15058, gnucash/trunk/src/business/business-core/business-core.i)

Modified: gnucash/branches/register-rewrite/src/business/business-core/business-core.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/business-core.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/business-core.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,25 +1,24 @@
 (define-module (gnucash business-core))
-(use-modules (g-wrapped gw-business-core))
+(use-modules (sw_business_core))
 (use-modules (gnucash gnc-module))
 (gnc:module-load "gnucash/engine" 0)
 
 (define (gnc:owner-get-address owner)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type owner) #f)))
-    (case type
-      ((gnc-owner-customer)
-       (let ((c (gnc:owner-get-customer owner)))
-	 (gnc:customer-get-addr c)))
-      ((gnc-owner-vendor)
-       (let ((v (gnc:owner-get-vendor owner)))
-	 (gnc:vendor-get-addr v)))
-      ((gnc-owner-employee)
-       (let ((e (gnc:owner-get-employee owner)))
-	 (gnc:employee-get-addr e)))
-      ((gnc-owner-job)
+  (let ((type (gncOwnerGetType owner)))
+    (cond
+      ((eqv? type GNC-OWNER-CUSTOMER)
+       (let ((c (gncOwnerGetCustomer owner)))
+	 (gncCustomerGetAddr c)))
+      ((eqv? type GNC-OWNER-VENDOR)
+       (let ((v (gncOwnerGetVendor owner)))
+	 (gncVendorGetAddr v)))
+      ((eqv? type GNC-OWNER-EMPLOYEE)
+       (let ((e (gncOwnerGetEmployee owner)))
+	 (gncEmployeeGetAddr e)))
+      ((eqv? type GNC-OWNER-JOB)
        (gnc:owner-get-address (gnc:job-get-owner
-			       (gnc:owner-get-job owner))))
-      (else ""))))
+			       (gncOwnerGetJob owner))))
+      (else '()))))
 
 ;
 ; The -dep functions return combined strings of the appropriate
@@ -36,13 +35,12 @@
   (define (just-name name)
     (if name name ""))
 
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type owner) #f)))
-    (case type
-      ((gnc-owner-job)
+  (let ((type (gncOwnerGetType owner)))
+    (cond
+      ((eqv? type GNC-OWNER-JOB)
        (gnc:owner-get-name-dep (gnc:job-get-owner
-				(gnc:owner-get-job owner))))
-      (else (just-name (gnc:owner-get-name owner))))))
+				(gncOwnerGetJob owner))))
+      (else (just-name (gncOwnerGetName owner))))))
 
 (define (gnc:owner-get-address-dep owner)
   (define (add-if-exists lst new)
@@ -56,10 +54,10 @@
      (else (string-append (build-string (cdr lst)) "\n" (car lst)))))
   (let ((lst '())
 	(addr (gnc:owner-get-address owner)))
-    (set! lst (add-if-exists lst (gnc:address-get-addr1 addr)))
-    (set! lst (add-if-exists lst (gnc:address-get-addr2 addr)))
-    (set! lst (add-if-exists lst (gnc:address-get-addr3 addr)))
-    (set! lst (add-if-exists lst (gnc:address-get-addr4 addr)))
+    (set! lst (add-if-exists lst (gncAddressGetAddr1 addr)))
+    (set! lst (add-if-exists lst (gncAddressGetAddr2 addr)))
+    (set! lst (add-if-exists lst (gncAddressGetAddr3 addr)))
+    (set! lst (add-if-exists lst (gncAddressGetAddr4 addr)))
     (build-string lst)))
 
 (define (gnc:owner-get-name-and-address-dep owner)
@@ -70,45 +68,44 @@
 	addr)))
 
 (define (gnc:owner-get-owner-id owner)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type owner) #f)))
-    (case type
-      ((gnc-owner-customer)
-       (let ((c (gnc:owner-get-customer owner)))
-	 (gnc:customer-get-id c)))
-      ((gnc-owner-vendor)
-       (let ((v (gnc:owner-get-vendor owner)))
-	 (gnc:vendor-get-id v)))
-      ((gnc-owner-employee)
-       (let ((e (gnc:owner-get-employee owner)))
-	 (gnc:employee-get-id e)))
-      ((gnc-owner-job)
-       (gnc:owner-get-owner-id (gnc:job-get-owner (gnc:owner-get-job owner))))
+  (let ((type (gncOwnerGetType owner)))
+    (cond
+      ((eqv? type GNC-OWNER-CUSTOMER)
+       (let ((c (gncOwnerGetCustomer owner)))
+	 (gncCustomerGetID c)))
+      ((eqv? type GNC-OWNER-VENDOR)
+       (let ((v (gncOwnerGetVendor owner)))
+	 (gncVendorGetID v)))
+      ((eqv? type GNC-OWNER-EMPLOYEE)
+       (let ((e (gncOwnerGetEmployee owner)))
+	 (gncEmployeeGetID e)))
+      ((eqv? type GNC-OWNER-JOB)
+       (gnc:owner-get-owner-id (gncJobGetOwner (gncOwnerGetJob owner))))
       (else ""))))
 
 (define (gnc:entry-type-percent-p type-val)
-  (let ((type (gw:enum-<gnc:GncAmountType>-val->sym type-val #f)))
-    (equal? type 'gnc-amount-type-percent)))
+  (let ((type type-val))
+    (equal? type GNC-AMT-TYPE-PERCENT)))
 
 (define (gnc:owner-from-split split result-owner)
-  (let* ((trans (gnc:split-get-parent split))
-	 (invoice (gnc:invoice-get-invoice-from-txn trans))
-	 (temp-owner (gnc:owner-create))
+  (let* ((trans (xaccSplitGetParent split))
+	 (invoice (gncInvoiceGetInvoiceFromTxn trans))
+	 (temp-owner (gncOwnerCreate))
 	 (owner #f))
 
     (if invoice
-	(set! owner (gnc:invoice-get-owner invoice))
-	(let ((split-list (gnc:transaction-get-splits trans)))
+	(set! owner (gncInvoiceGetOwner invoice))
+	(let ((split-list (xaccTransGetSplitList trans)))
 	  (define (check-splits splits)
 	    (if (and splits (not (null? splits)))
 		(let* ((split (car splits))
-		       (lot (gnc:split-get-lot split)))
+		       (lot (xaccSplitGetLot split)))
 		  (if lot
-		      (let* ((invoice (gnc:invoice-get-invoice-from-lot lot))
+		      (let* ((invoice (gncInvoiceGetInvoiceFromLot lot))
 			     (owner? (gnc:owner-get-owner-from-lot
 				      lot temp-owner)))
 			(if invoice
-			    (set! owner (gnc:invoice-get-owner invoice))
+			    (set! owner (gncInvoiceGetOwner invoice))
 			    (if owner?
 				(set! owner temp-owner)
 				(check-splits (cdr splits)))))
@@ -117,12 +114,12 @@
 
     (if owner
 	(begin
-	  (gnc:owner-copy-into-owner (gnc:owner-get-end-owner owner) result-owner)
-	  (gnc:owner-destroy temp-owner)
+	  (gncOwnerCopy (gncOwnerGetEndOwner owner) result-owner)
+	  (gncOwnerDestroy temp-owner)
 	  result-owner)
 	(begin
-	  (gnc:owner-destroy temp-owner)
-	  #f))))
+	  (gncOwnerDestroy temp-owner)
+	  #f)))) ;; FIXME!
 
 
 (export gnc:owner-get-address)

Modified: gnucash/branches/register-rewrite/src/business/business-core/businessmod-core.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/businessmod-core.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/businessmod-core.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -30,7 +30,6 @@
 
 #include "gnc-module.h"
 #include "gnc-module-api.h"
-#include "gw-business-core.h"
 
 #include "gncAddressP.h"
 #include "gncBillTermP.h"
@@ -44,6 +43,8 @@
 #include "gncTaxTableP.h"
 #include "gncVendorP.h"
 
+extern SCM scm_init_sw_business_core_module (void);
+
 /* version of the gnc module system interface we require */
 int libgncmod_business_core_LTX_gnc_module_system_interface = 0;
 
@@ -94,7 +95,8 @@
     gncVendorRegister ();
   }
   
-  scm_c_eval_string("(use-modules (g-wrapped gw-business-core))");
+  scm_init_sw_business_core_module();
+  scm_c_eval_string("(use-modules (sw_business_core))");
   scm_c_eval_string("(use-modules (gnucash business-core))");
 
   return TRUE;

Modified: gnucash/branches/register-rewrite/src/business/business-core/file/gncmod-business-backend-file.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/file/gncmod-business-backend-file.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/file/gncmod-business-backend-file.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
  *
  *********************************************************************/
 
+#include "config.h"
 #include <stdio.h>
 #include <glib.h>
 

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncBillTerm.h
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncBillTerm.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncBillTerm.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -59,17 +59,19 @@
  * ??? huh?
  * NOTE: This enum /depends/ on starting at value 1
  */
+#ifndef SWIG
 #define ENUM_TERMS_TYPE(_)  \
  _(GNC_TERM_TYPE_DAYS,=1) \
  _(GNC_TERM_TYPE_PROXIMO,)
 
 DEFINE_ENUM(GncBillTermType, ENUM_TERMS_TYPE)
-
-/*typedef enum {
+#else
+typedef enum {
   GNC_TERM_TYPE_DAYS = 1,
   GNC_TERM_TYPE_PROXIMO,
 } GncBillTermType;
-*/
+#endif
+
 /** @name Create/Destroy Functions 
  @{ */
 GncBillTerm * gncBillTermCreate (QofBook *book);
@@ -108,7 +110,6 @@
 
 GncBillTerm *gncBillTermLookupByName (QofBook *book, const char *name);
 GList * gncBillTermGetTerms (QofBook *book);
-KvpFrame* gncBillTermGetSlots (GncBillTerm *term);
 
 const char *gncBillTermGetName (GncBillTerm *term);
 const char *gncBillTermGetDescription (GncBillTerm *term);

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncBusGuile.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncBusGuile.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncBusGuile.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,28 +25,26 @@
 
 #include "gncBusGuile.h"
 #include "engine-helpers.h"
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
+#define FUNC_NAME __FUNCTION__
 
-static SCM
+static swig_type_info *
 get_acct_type ()
 {
-  static SCM account_type = SCM_UNDEFINED;
+  static swig_type_info * account_type = NULL;
 
-  if(account_type == SCM_UNDEFINED) {
-    account_type = scm_c_eval_string("<gnc:Account*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(account_type != SCM_UNDEFINED) scm_gc_protect_object(account_type);
-  }
+  if (!account_type)
+      account_type = SWIG_TypeQuery("_p_Account");
 
   return account_type;
 }
 
 int gnc_account_value_pointer_p (SCM arg)
 {
-  SCM account_type = get_acct_type();
+  swig_type_info * account_type = get_acct_type();
 
   return (SCM_CONSP (arg) &&
-	  gw_wcp_is_of_type_p(account_type, SCM_CAR (arg)) &&
+	  SWIG_IsPointerOfType(SCM_CAR (arg), account_type) &&
 	  gnc_numeric_p (SCM_CDR (arg)));
 }
 
@@ -55,15 +53,15 @@
   GncAccountValue *res;
   Account *acc = NULL;
   gnc_numeric value;
-  SCM account_type = get_acct_type();
+  swig_type_info * account_type = get_acct_type();
   SCM val;
 
   /* Get the account */
   val = SCM_CAR (valuearg);
-  if (!gw_wcp_is_of_type_p (account_type, val))
+  if (!SWIG_IsPointerOfType (val, account_type))
     return NULL;
 
-  acc = gw_wcp_get_ptr (val);
+  acc = SWIG_MustGetPtr(val, account_type, 1, 0);
 
   /* Get the value */
   val = SCM_CDR (valuearg);
@@ -78,7 +76,7 @@
 
 SCM gnc_account_value_ptr_to_scm (GncAccountValue *av)
 {
-  SCM account_type = get_acct_type();
+  swig_type_info * account_type = get_acct_type();
   gnc_commodity * com;
   gnc_numeric val;
 
@@ -88,6 +86,6 @@
   val = gnc_numeric_convert (av->value, gnc_commodity_get_fraction (com),
 			     GNC_RND_ROUND);
 
-  return scm_cons (gw_wcp_assimilate_ptr (av->account, account_type),
+  return scm_cons (SWIG_NewPointerObj(av->account, account_type, 0),
 		   gnc_numeric_to_scm (val));
 }

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncCustomer.h
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncCustomer.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncCustomer.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -120,7 +120,6 @@
 gboolean gncCustomerGetTaxTableOverride (GncCustomer *customer);
 GncTaxTable* gncCustomerGetTaxTable (GncCustomer *customer);
 
-KvpFrame *gncCustomerGetSlots (GncCustomer *customer);
 GList * gncCustomerGetJoblist (GncCustomer *customer, gboolean show_all);
 /** @} */
 

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncEntry.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncEntry.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncEntry.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1141,7 +1141,7 @@
   return (is_inv ? entry->i_tax_value_rounded : entry->b_tax_value_rounded);
 }
 
-GList * gncEntryReturnTaxValues (GncEntry *entry, gboolean is_inv)
+AccountValueList * gncEntryReturnTaxValues (GncEntry *entry, gboolean is_inv)
 {
   if (!entry) return NULL;
   gncEntryRecomputeValues (entry);

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncEntry.h
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncEntry.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncEntry.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -169,7 +169,8 @@
 gnc_numeric gncEntryReturnValue (GncEntry *entry, gboolean is_inv);
 gnc_numeric gncEntryReturnDiscountValue (GncEntry *entry, gboolean is_inv);
 gnc_numeric gncEntryReturnTaxValue (GncEntry *entry, gboolean is_inv);
-GList * gncEntryReturnTaxValues (GncEntry *entry, gboolean is_inv);
+typedef GList AccountValueList;
+AccountValueList * gncEntryReturnTaxValues (GncEntry *entry, gboolean is_inv);
 
 /** Compute the Entry value, tax-value, and discount_value, based on
  * the quantity, price, discount, tax-table, and types.  The value is

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -94,6 +94,11 @@
   qof_event_gen (&invoice->inst.entity, QOF_EVENT_MODIFY, NULL);
 }
 
+QofBook * gncInvoiceGetBook(GncInvoice *x)
+{
+    return qof_instance_get_book(QOF_INSTANCE(x));
+}
+
 /* ================================================================== */
 /* Create/Destroy Functions */
 
@@ -639,7 +644,7 @@
   return invoice->to_charge_amount;
 }
 
-GList * gncInvoiceGetEntries (GncInvoice *invoice)
+EntryList * gncInvoiceGetEntries (GncInvoice *invoice)
 {
   if (!invoice) return NULL;
   return invoice->entries;

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.h
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncInvoice.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -43,6 +43,7 @@
 #include "gncEntry.h"
 #include "gncOwner.h"
 #include "gnc-lot.h"
+#include "qofbook.h"
 
 #define GNC_ID_INVOICE    "gncInvoice"
 #define GNC_IS_INVOICE(obj)  (QOF_CHECK_TYPE((obj), GNC_ID_INVOICE))
@@ -108,7 +109,8 @@
 gnc_numeric gncInvoiceGetTotalSubtotal (GncInvoice *invoice);
 gnc_numeric gncInvoiceGetTotalTax (GncInvoice *invoice);
 
-GList * gncInvoiceGetEntries (GncInvoice *invoice);
+typedef GList EntryList;
+EntryList * gncInvoiceGetEntries (GncInvoice *invoice);
 
 /** Post this invoice to an account.  Returns the new Transaction
  * that is tied to this invoice.   The transaction is set with
@@ -164,7 +166,6 @@
 #define gncInvoiceLookup(book,guid)    \
        QOF_BOOK_LOOKUP_ENTITY((book),(guid),GNC_ID_INVOICE, GncInvoice)
 
-gboolean gncInvoiceIsDirty (GncInvoice *invoice);
 void gncInvoiceBeginEdit (GncInvoice *invoice);
 void gncInvoiceCommitEdit (GncInvoice *invoice);
 int gncInvoiceCompare (GncInvoice *a, GncInvoice *b);
@@ -192,8 +193,9 @@
 #define INVOICE_FROM_LOT	"invoice-from-lot"
 #define INVOICE_FROM_TXN	"invoice-from-txn"
 
+QofBook *gncInvoiceGetBook(GncInvoice *x);
+
 /** deprecated functions */
-#define gncInvoiceGetBook(x) qof_instance_get_book(QOF_INSTANCE(x))
 #define gncInvoiceGetGUID(x) qof_instance_get_guid(QOF_INSTANCE(x))
 #define gncInvoiceRetGUID(x) (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null()))
 #define gncInvoiceLookupDirect(G,B) gncInvoiceLookup((B),&(G))

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncJob.h
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncJob.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncJob.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -70,7 +70,6 @@
 
 /** @} */
 gboolean gncJobGetActive (GncJob *job);
-gboolean gncJobIsDirty (GncJob *job);
 
 /** Return a pointer to the instance gncJob that is identified
  *  by the guid, and is residing in the book. Returns NULL if the

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncOrder.h
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncOrder.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncOrder.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -76,7 +76,6 @@
 /* Get the list Entries */
 GList * gncOrderGetEntries (GncOrder *order);
 
-gboolean gncOrderIsDirty (GncOrder *order);
 void gncOrderBeginEdit (GncOrder *order);
 void gncOrderCommitEdit (GncOrder *order);
 int gncOrderCompare (GncOrder *a, GncOrder *b);

Modified: gnucash/branches/register-rewrite/src/business/business-core/gncOwner.h
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gncOwner.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gncOwner.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -33,7 +33,7 @@
 #ifndef GNC_OWNER_H_
 #define GNC_OWNER_H_
 
-typedef struct gnc_owner_s GncOwner;
+typedef struct _gncOwner GncOwner;
 
 #define GNC_ID_OWNER   "gncOwner"
 
@@ -67,17 +67,15 @@
 /** set the owner from the entity. */
 void qofOwnerSetEntity (GncOwner *owner, QofEntity *ent);
 
-/** \brief Set the parent owner. */
-void qofOwnerSetEndOwner (GncOwner *owner, GncOwner *parent);
-GncOwner* qofOwnerCreate (QofBook *book);
-
 gboolean
 gncOwnerRegister(void);
 
 /** @} */
 
+#ifndef SWIG
+
 /** \struct GncOwner */
-struct gnc_owner_s {
+struct _gncOwner {
   GncOwnerType     type;      /**< Customer, Job, Vendor, Employee or Undefined. */
   union {
     gpointer       undefined;
@@ -89,6 +87,8 @@
   gpointer         qof_temp; /**< Set type independently of the owner. */
 };
 
+#endif /* SWIG */
+
 /** \name Setup routines
 @{
 */

Deleted: gnucash/branches/register-rewrite/src/business/business-core/gw-business-core-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/gw-business-core-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/gw-business-core-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,1179 +0,0 @@
-;;; -*-scheme-*-
-
-;(debug-enable 'backtrace)
-;(debug-enable 'debug)
-;(read-enable 'positions)
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(define-module (g-wrapped gw-business-core-spec)
-  :use-module (g-wrap))
-
-(use-modules (g-wrap))
-(use-modules (g-wrap simple-type))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-
-(use-modules (g-wrapped gw-engine-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(let ((ws (gw:new-wrapset "gw-business-core")))
-  
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-depends-on ws "gw-engine")
-  
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-business-core))
-  
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <gncAddress.h>\n"
-      "#include <gncBillTerm.h>\n"
-      "#include <gncCustomer.h>\n"
-      "#include <gncEmployee.h>\n"
-      "#include <gncEntry.h>\n"
-      "#include <gncInvoice.h>\n"
-      "#include <gncJob.h>\n"
-      "#include <gncOrder.h>\n"
-      "#include <gncOwner.h>\n"
-      "#include <gncTaxTable.h>\n"
-      "#include <gncVendor.h>\n"
-      "#include <gncBusGuile.h>\n")))
-
-  (gw:wrapset-add-cs-initializers!
-   ws
-   (lambda (wrapset client-wrapset status-var)
-     (if client-wrapset
-         '()
-         (gw:inline-scheme '(use-modules (gnucash business-core))))))
-  
-  ;; The core Business Object Types
-
-  (gw:wrap-as-wct ws '<gnc:GncAddress*> "GncAddress*" "const GncAddress*")
-  (gw:wrap-as-wct ws '<gnc:GncBillTerm*> "GncBillTerm*" "const GncBillTerm*")
-  (gw:wrap-as-wct ws '<gnc:GncCustomer*> "GncCustomer*" "const GncCustomer*")
-  (gw:wrap-as-wct ws '<gnc:GncEmployee*> "GncEmployee*" "const GncEmployee*")
-  (gw:wrap-as-wct ws '<gnc:GncEntry*> "GncEntry*" "const GncEntry*")
-  (gw:wrap-as-wct ws '<gnc:GncInvoice*> "GncInvoice*" "const GncInvoice*")
-  (gw:wrap-as-wct ws '<gnc:GncJob*> "GncJob*" "const GncJob*")
-  (gw:wrap-as-wct ws '<gnc:GncOrder*> "GncOrder*" "const GncOrder*")
-  (gw:wrap-as-wct ws '<gnc:GncOwner*> "GncOwner*" "const GncOwner*")
-  (gw:wrap-as-wct ws '<gnc:GncTaxTable*> "GncTaxTable*" "const GncTaxTable*")
-  (gw:wrap-as-wct ws '<gnc:GncVendor*> "GncVendor*" "const GncVendor*")
-
-  (let ((wt (gw:wrap-enumeration ws '<gnc:GncOwnerType> "GncOwnerType")))
-    (gw:enum-add-value! wt "GNC_OWNER_NONE" 'gnc-owner-none)
-    (gw:enum-add-value! wt "GNC_OWNER_UNDEFINED" 'gnc-owner-undefined)
-    (gw:enum-add-value! wt "GNC_OWNER_CUSTOMER" 'gnc-owner-customer)
-    (gw:enum-add-value! wt "GNC_OWNER_JOB" 'gnc-owner-job)
-    (gw:enum-add-value! wt "GNC_OWNER_VENDOR" 'gnc-owner-vendor)
-    (gw:enum-add-value! wt "GNC_OWNER_EMPLOYEE" 'gnc-owner-employee)
-    #t)
-
-  (let ((wt (gw:wrap-enumeration ws '<gnc:GncAmountType> "GncAmountType")))
-    (gw:enum-add-value! wt "GNC_AMT_TYPE_VALUE" 'gnc-amount-type-value)
-    (gw:enum-add-value! wt "GNC_AMT_TYPE_PERCENT" 'gnc-amount-type-percent)
-    #t)
-
-  (let ((wt (gw:wrap-enumeration ws '<gnc:GncTaxIncluded> "GncTaxIncluded")))
-    (gw:enum-add-value! wt "GNC_TAXINCLUDED_YES" 'gnc-tax-included-yes)
-    (gw:enum-add-value! wt "GNC_TAXINCLUDED_NO" 'gnc-tax-included-no)
-    (gw:enum-add-value! wt "GNC_TAXINCLUDED_USEGLOBAL" 'gnc-tax-included-useglobal)
-    #t)
-
-  (let ((wt (gw:wrap-enumeration ws '<gnc:GncBillTermType> "GncBillTermType")))
-    (gw:enum-add-value! wt "GNC_TERM_TYPE_DAYS" 'gnc-term-type-days)
-    (gw:enum-add-value! wt "GNC_TERM_TYPE_PROXIMO" 'gnc-term-type-proximo)
-    #t)
-
-  ;; Wrap the GncAccountValue type (gncTaxTable.h)
-  (gw:wrap-simple-type
-   ws
-   '<gnc:GncAccountValue*> "GncAccountValue*"
-   '("gnc_account_value_pointer_p(" scm-var ")")
-   '(c-var " = gnc_scm_to_account_value_ptr(" scm-var ");\n")
-   '(scm-var " = gnc_account_value_ptr_to_scm(" c-var ");\n"))
-
-  ;;
-  ;; Define business Query parameters
-  ;;
-
-  (gw:wrap-value ws 'gnc:invoice-from-lot '<gnc:id-type> "INVOICE_FROM_LOT")
-  (gw:wrap-value ws 'gnc:invoice-from-txn '<gnc:id-type> "INVOICE_FROM_TXN")
-  (gw:wrap-value ws 'gnc:invoice-owner '<gnc:id-type> "INVOICE_OWNER")
-
-  (gw:wrap-value ws 'gnc:owner-from-lot '<gnc:id-type> "OWNER_FROM_LOT")
-  (gw:wrap-value ws 'gnc:owner-parentg '<gnc:id-type> "OWNER_PARENTG")
-
-  ;;
-  ;; gncAddress.h
-  ;;
-
-  ; Set Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:address-set-name
-   '<gw:void>
-   "gncAddressSetName"
-   '((<gnc:GncAddress*> address) ((<gw:mchars> callee-owned const) name))
-   "Set the address name")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-set-addr1
-   '<gw:void>
-   "gncAddressSetAddr1"
-   '((<gnc:GncAddress*> address) ((<gw:mchars> callee-owned const) addr1))
-   "Set the address's addr1")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-set-addr2
-   '<gw:void>
-   "gncAddressSetAddr2"
-   '((<gnc:GncAddress*> address) ((<gw:mchars> callee-owned const) addr2))
-   "Set the address's addr2")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-set-addr3
-   '<gw:void>
-   "gncAddressSetAddr3"
-   '((<gnc:GncAddress*> address) ((<gw:mchars> callee-owned const) addr3))
-   "Set the address's addr3")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-set-addr4
-   '<gw:void>
-   "gncAddressSetAddr4"
-   '((<gnc:GncAddress*> address) ((<gw:mchars> callee-owned const) addr4))
-   "Set the address's addr4")
-
-  ; Get Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-name
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetName"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Name Entry")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-addr1
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetAddr1"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Addr1 Entry")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-addr2
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetAddr2"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Addr2 Entry")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-addr3
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetAddr3"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Addr3 Entry")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-addr4
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetAddr4"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Addr4 Entry")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-phone
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetPhone"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Phone Entry")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-fax
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetFax"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Fax Entry")
-
-  (gw:wrap-function
-   ws
-   'gnc:address-get-email
-   '(<gw:mchars> callee-owned const)
-   "gncAddressGetEmail"
-   '((<gnc:GncAddress*> address))
-   "Return the Address's Email Entry")
-
-  ;;
-  ;; gncBillTerm.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:bill-term-get-name
-   '(<gw:mchars> callee-owned const)
-   "gncBillTermGetName"
-   '((<gnc:GncBillTerm*> term))
-   "Return the Bill-term name")
-
-  (gw:wrap-function
-   ws
-   'gnc:bill-term-get-description
-   '(<gw:mchars> callee-owned const)
-   "gncBillTermGetDescription"
-   '((<gnc:GncBillTerm*> term))
-   "Return the printable Bill-term description")
-
-  ;;
-  ;; gncCustomer.h
-  ;;
-
-  ; Set Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-create
-   '<gnc:GncCustomer*>
-   "gncCustomerCreate"
-   '((<gnc:Book*> book))
-   "Create a new customer")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-set-id
-   '<gw:void>
-   "gncCustomerSetID"
-   '((<gnc:GncCustomer*> customer) ((<gw:mchars> callee-owned const) id))
-   "Set the customer ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-set-name
-   '<gw:void>
-   "gncCustomerSetName"
-   '((<gnc:GncCustomer*> customer) ((<gw:mchars> callee-owned const) name))
-   "Set the customer Name")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-set-currency
-   '<gw:void>
-   "gncCustomerSetCurrency"
-   '((<gnc:GncCustomer*> customer) (<gnc:commodity*> currency))
-   "Set the Customer Currency")
-
-  ; Get Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-guid
-   '<gnc:guid-scm>
-   "gncCustomerRetGUID"
-   '((<gnc:GncCustomer*> customer))
-   "Return the GUID of the customer")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-lookup
-   '<gnc:GncCustomer*>
-   "gncCustomerLookupDirect"
-   '((<gnc:guid-scm> guid) (<gnc:Book*> book))
-   "Lookup the customer with GUID guid.")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-id
-   '(<gw:mchars> callee-owned const)
-   "gncCustomerGetID"
-   '((<gnc:GncCustomer*> customer))
-   "Return the Customer's ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-name
-   '(<gw:mchars> callee-owned const)
-   "gncCustomerGetName"
-   '((<gnc:GncCustomer*> customer))
-   "Return the Customer's Name")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-addr
-   '<gnc:GncAddress*>
-   "gncCustomerGetAddr"
-   '((<gnc:GncCustomer*> customer))
-   "Return the Customer's Billing Address")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-shipaddr
-   '<gnc:GncAddress*>
-   "gncCustomerGetShipAddr"
-   '((<gnc:GncCustomer*> customer))
-   "Return the Customer's Shipping Address")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-notes
-   '(<gw:mchars> callee-owned const)
-   "gncCustomerGetNotes"
-   '((<gnc:GncCustomer*> customer))
-   "Return the Customer's Notes")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-currency
-   '<gnc:commodity*>
-   "gncCustomerGetCurrency"
-   '((<gnc:GncCustomer*> customer))
-   "Get the Customer Currency")
-
-  ;;
-  ;; gncEmployee.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:employee-get-guid
-   '<gnc:guid-scm>
-   "gncEmployeeRetGUID"
-   '((<gnc:GncEmployee*> employee))
-   "Return the GUID of the employee")
-
-  (gw:wrap-function
-   ws
-   'gnc:employee-lookup
-   '<gnc:GncEmployee*>
-   "gncEmployeeLookupDirect"
-   '((<gnc:guid-scm> guid) (<gnc:Book*> book))
-   "Lookup the employee with GUID guid.")
-
-  (gw:wrap-function
-   ws
-   'gnc:employee-get-id
-   '(<gw:mchars> callee-owned const)
-   "gncEmployeeGetID"
-   '((<gnc:GncEmployee*> employee))
-   "Return the Employee's ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-get-username
-   '(<gw:mchars> callee-owned const)
-   "gncEmployeeGetUsername"
-   '((<gnc:GncEmployee*> employee))
-   "Return the Employee's Username")
-
-  (gw:wrap-function
-   ws
-   'gnc:employee-get-addr
-   '<gnc:GncAddress*>
-   "gncEmployeeGetAddr"
-   '((<gnc:GncEmployee*> employee))
-   "Return the Employee's Address")
-
-  ;;
-  ;; gncEntry.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-date
-   '<gnc:time-pair>
-   "gncEntryGetDate"
-   '((<gnc:GncEntry*> entry))
-   "Return the entry's date")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-description
-   '(<gw:mchars> callee-owned const)
-   "gncEntryGetDescription"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Description")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-action
-   '(<gw:mchars> callee-owned const)
-   "gncEntryGetAction"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Action")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-quantity
-   '<gnc:numeric>
-   "gncEntryGetQuantity"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Quantity")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-inv-price
-   '<gnc:numeric>
-   "gncEntryGetInvPrice"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Price")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-inv-discount
-   '<gnc:numeric>
-   "gncEntryGetInvDiscount"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Discount")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-inv-discount-type
-   '<gw:int>
-   "gncEntryGetInvDiscountType"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's discount type")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-bill-price
-   '<gnc:numeric>
-   "gncEntryGetBillPrice"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Price")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-inv-taxable
-   '<gw:bool>
-   "gncEntryGetInvTaxable"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Taxable value")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-inv-tax-table
-   '<gnc:GncTaxTable*>
-   "gncEntryGetInvTaxTable"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Invoice Tax Table")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-bill-taxable
-   '<gw:bool>
-   "gncEntryGetBillTaxable"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Taxable value")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-bill-tax-table
-   '<gnc:GncTaxTable*>
-   "gncEntryGetBillTaxTable"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Bill Tax Table")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-value
-   '<gnc:numeric>
-   "gncEntryReturnValue"
-   '((<gnc:GncEntry*> entry) (<gw:bool> invoice?))
-   "Return the Entry's computed Value (after discount)")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-tax-value
-   '<gnc:numeric>
-   "gncEntryReturnTaxValue"
-   '((<gnc:GncEntry*> entry) (<gw:bool> invoice?))
-   "Return the Entry's computed Tax Value")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-discount-value
-   '<gnc:numeric>
-   "gncEntryReturnDiscountValue"
-   '((<gnc:GncEntry*> entry) (<gw:bool> invoice?))
-   "Return the Entry's computed Discount Value")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-tax-values
-   '(gw:glist-of <gnc:GncAccountValue*> callee-owned)
-   "gncEntryReturnTaxValues"
-   '((<gnc:GncEntry*> entry) (<gw:bool> invoice?))
-   "Return the Entry's list of computed Tax Values for each Tax account")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-invoice
-   '<gnc:GncInvoice*>
-   "gncEntryGetInvoice"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Invoice")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-bill
-   '<gnc:GncInvoice*>
-   "gncEntryGetBill"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Bill")
-
-  (gw:wrap-function
-   ws
-   'gnc:entry-get-order
-   '<gnc:GncOrder*>
-   "gncEntryGetOrder"
-   '((<gnc:GncEntry*> entry))
-   "Return the Entry's Order")
-
-  ;;
-  ;; gncInvoice.h
-  ;;
-
-  ; Set Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-guid
-   '<gnc:guid-scm>
-   "gncInvoiceRetGUID"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the GUID of the invoice")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-lookup
-   '<gnc:GncInvoice*>
-   "gncInvoiceLookupDirect"
-   '((<gnc:guid-scm> guid) (<gnc:Book*> book))
-   "Lookup the invoice with GUID guid.")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-create
-   '<gnc:GncInvoice*>
-   "gncInvoiceCreate"
-   '((<gnc:Book*> book))
-   "Create a new invoice")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-set-id
-   '<gw:void>
-   "gncInvoiceSetID"
-   '((<gnc:GncInvoice*> invoice) ((<gw:mchars> callee-owned const) id))
-   "Set the Invoice ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-set-owner
-   '<gw:void>
-   "gncInvoiceSetOwner"
-   '((<gnc:GncInvoice*> invoice) (<gnc:GncOwner*> owner))
-   "Set the Invoice Owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-set-date-opened
-   '<gw:void>
-   "gncInvoiceSetDateOpened"
-   '((<gnc:GncInvoice*> invoice) (<gnc:time-pair> date))
-   "Set the Invoice-Opened Date")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-set-terms
-   '<gw:void>
-   "gncInvoiceSetTerms"
-   '((<gnc:GncInvoice*> invoice) (<gnc:GncBillTerm*> term))
-   "Set the Invoice Terms")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-set-currency
-   '<gw:void>
-   "gncInvoiceSetCurrency"
-   '((<gnc:GncInvoice*> invoice) (<gnc:commodity*> currency))
-   "Set the Invoice Currency")
-
-  ; Get Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-book
-   '<gnc:Book*>
-   "gncInvoiceGetBook"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's book")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-id
-   '(<gw:mchars> callee-owned const)
-   "gncInvoiceGetID"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-owner
-   '<gnc:GncOwner*>
-   "gncInvoiceGetOwner"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's Owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-date-opened
-   '<gnc:time-pair>
-   "gncInvoiceGetDateOpened"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the Date the invoice was opened")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-date-posted
-   '<gnc:time-pair>
-   "gncInvoiceGetDatePosted"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the Date the invoice was posted")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-date-due
-   '<gnc:time-pair>
-   "gncInvoiceGetDateDue"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the Date the invoice is due")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-terms
-   '(<gnc:GncBillTerm*>)
-   "gncInvoiceGetTerms"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's Terms")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-billing-id
-   '(<gw:mchars> callee-owned const)
-   "gncInvoiceGetBillingID"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's Billing ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-notes
-   '(<gw:mchars> callee-owned const)
-   "gncInvoiceGetNotes"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's Notes")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-currency
-   '<gnc:commodity*>
-   "gncInvoiceGetCurrency"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's currency")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-entries
-   '(gw:glist-of <gnc:GncEntry*> callee-owned)
-   "gncInvoiceGetEntries"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the invoice's list of Entries")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-posted-lot
-   '<gnc:Lot*>
-   "gncInvoiceGetPostedLot"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the posted Lot for this Invoice.")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-posted-account
-   '<gnc:Account*>
-   "gncInvoiceGetPostedAcc"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the posted Account for this Invoice.")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-posted-txn
-   '<gnc:Transaction*>
-   "gncInvoiceGetPostedTxn"
-   '((<gnc:GncInvoice*> invoice))
-   "Return the posted Transaction for this Invoice.")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-invoice-from-lot
-   '<gnc:GncInvoice*>
-   "gncInvoiceGetInvoiceFromLot"
-   '((<gnc:Lot*> lot))
-   "Return the Invoice attached to a Lot.")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-get-invoice-from-txn
-   '<gnc:GncInvoice*>
-   "gncInvoiceGetInvoiceFromTxn"
-   '((<gnc:Transaction*> txn))
-   "Return the Invoice attached to a Txn.")
-
-  ;;
-  ;; gncJob.h
-  ;;
-
-  ; Set Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:job-create
-   '<gnc:GncJob*>
-   "gncJobCreate"
-   '((<gnc:Book*> book))
-   "Create a new Job")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-set-id
-   '<gw:void>
-   "gncJobSetID"
-   '((<gnc:GncJob*> job) ((<gw:mchars> callee-owned const) id))
-   "Set the job ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-set-name
-   '<gw:void>
-   "gncJobSetName"
-   '((<gnc:GncJob*> job) ((<gw:mchars> callee-owned const) name))
-   "Set the job Name")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-set-reference
-   '<gw:void>
-   "gncJobSetReference"
-   '((<gnc:GncJob*> job) ((<gw:mchars> callee-owned const) reference))
-   "Set the job Reference")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-set-owner
-   '<gw:void>
-   "gncJobSetOwner"
-   '((<gnc:GncJob*> job) (<gnc:GncOwner*> owner))
-   "Set the job Owner")
-
-  ; Get Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:job-get-id
-   '(<gw:mchars> callee-owned const)
-   "gncJobGetID"
-   '((<gnc:GncJob*> job))
-   "Return the Job's ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-get-name
-   '(<gw:mchars> callee-owned const)
-   "gncJobGetName"
-   '((<gnc:GncJob*> job))
-   "Return the Job's Name")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-get-reference
-   '(<gw:mchars> callee-owned const)
-   "gncJobGetReference"
-   '((<gnc:GncJob*> job))
-   "Return the Job's Reference")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-get-owner
-   '<gnc:GncOwner*>
-   "gncJobGetOwner"
-   '((<gnc:GncJob*> job))
-   "Return the Job's Owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-get-guid
-   '<gnc:guid-scm>
-   "gncJobRetGUID"
-   '((<gnc:GncJob*> job))
-   "Return the guid of the job")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-lookup
-   '<gnc:GncJob*>
-   "gncJobLookupDirect"
-   '((<gnc:guid-scm> guid) (<gnc:Book*> book))
-   "Lookup the job with GUID guid.")
-
-  ;;
-  ;; gncOrder.h
-  ;;
-
-  ; Set Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:order-create
-   '<gnc:GncOrder*>
-   "gncOrderCreate"
-   '((<gnc:Book*> book))
-   "Create a new order")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-set-id
-   '<gw:void>
-   "gncOrderSetID"
-   '((<gnc:GncOrder*> order) ((<gw:mchars> callee-owned const) id))
-   "Set the Order ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-set-owner
-   '<gw:void>
-   "gncOrderSetOwner"
-   '((<gnc:GncOrder*> order) (<gnc:GncOwner*> owner))
-   "Set the Order Owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-set-date-opened
-   '<gw:void>
-   "gncOrderSetDateOpened"
-   '((<gnc:GncOrder*> order) (<gnc:time-pair> date))
-   "Set the Order's Opened Date")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-set-reference
-   '<gw:void>
-   "gncOrderSetReference"
-   '((<gnc:GncOrder*> order) ((<gw:mchars> callee-owned const) id))
-   "Set the Order Reference")
-
-  ; Get Functions
-
-  (gw:wrap-function
-   ws
-   'gnc:order-get-id
-   '(<gw:mchars> callee-owned const)
-   "gncOrderGetID"
-   '((<gnc:GncOrder*> order))
-   "Return the Order's ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-get-owner
-   '<gnc:GncOwner*>
-   "gncOrderGetOwner"
-   '((<gnc:GncOrder*> order))
-   "Return the Order's Owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-get-date-opened
-   '<gnc:time-pair>
-   "gncOrderGetDateOpened"
-   '((<gnc:GncOrder*> order))
-   "Return the Date the order was opened")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-get-date-closed
-   '<gnc:time-pair>
-   "gncOrderGetDateClosed"
-   '((<gnc:GncOrder*> order))
-   "Return the Date the order was closed")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-get-notes
-   '(<gw:mchars> callee-owned const)
-   "gncOrderGetNotes"
-   '((<gnc:GncOrder*> order))
-   "Return the Order's Notes")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-get-reference
-   '(<gw:mchars> callee-owned const)
-   "gncOrderGetReference"
-   '((<gnc:GncOrder*> order))
-   "Return the Order's Reference")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-get-entries
-   '(gw:glist-of <gnc:GncEntry*> callee-owned)
-   "gncOrderGetEntries"
-   '((<gnc:GncOrder*> order))
-   "Return the Order's list of Entries")
-
-  ;;
-  ;; gncOwner.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-create
-   '<gnc:GncOwner*>
-   "gncOwnerCreate"
-   '()
-   "Create a GncOwner object")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-destroy
-   '<gw:void>
-   "gncOwnerDestroy"
-   '((<gnc:GncOwner*> owner))
-   "Destroy a GncOwner object")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-init-customer
-   '<gw:void>
-   "gncOwnerInitCustomer"
-   '((<gnc:GncOwner*> owner) (<gnc:GncCustomer*> customer))
-   "Initialize an owner to hold a Customer.  The Customer may be NULL.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-init-job
-   '<gw:void>
-   "gncOwnerInitJob"
-   '((<gnc:GncOwner*> owner) (<gnc:GncJob*> job))
-   "Initialize an owner to hold a Job.  The Job may be NULL.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-init-vendor
-   '<gw:void>
-   "gncOwnerInitVendor"
-   '((<gnc:GncOwner*> owner) (<gnc:GncVendor*> vendor))
-   "Initialize an owner to hold a Vendor.  The Vendor may be NULL.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-init-employee
-   '<gw:void>
-   "gncOwnerInitEmployee"
-   '((<gnc:GncOwner*> owner) (<gnc:GncEmployee*> employee))
-   "Initialize an owner to hold a Employee.  The Employee may be NULL.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-type
-   '<gnc:GncOwnerType>
-   "gncOwnerGetType"
-   '((<gnc:GncOwner*> owner))
-   "Return the type of this owner.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-customer
-   '<gnc:GncCustomer*>
-   "gncOwnerGetCustomer"
-   '((<gnc:GncOwner*> owner))
-   "Return the customer of this owner.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-job
-   '<gnc:GncJob*>
-   "gncOwnerGetJob"
-   '((<gnc:GncOwner*> owner))
-   "Return the job of this owner.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-vendor
-   '<gnc:GncVendor*>
-   "gncOwnerGetVendor"
-   '((<gnc:GncOwner*> owner))
-   "Return the vendor of this owner.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-employee
-   '<gnc:GncEmployee*>
-   "gncOwnerGetEmployee"
-   '((<gnc:GncOwner*> owner))
-   "Return the employee of this owner.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-equal
-   '<gw:bool>
-   "gncOwnerEqual"
-   '((<gnc:GncOwner*> owner1) (<gnc:GncOwner*> owner2))
-   "Compare owner1 and owner2 and return if they are equal")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-end-owner
-   '<gnc:GncOwner*>
-   "gncOwnerGetEndOwner"
-   '((<gnc:GncOwner*> owner))
-   "Returns the End Owner of this owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-owner-from-lot
-   '<gw:bool>
-   "gncOwnerGetOwnerFromLot"
-   '((<gnc:Lot*> lot) (<gnc:GncOwner*> owner))
-   "Compute the owner from the Lot, and fills in owner.  Returns TRUE if successful.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-guid
-   '<gnc:guid-scm>
-   "gncOwnerRetGUID"
-   '((<gnc:GncOwner*> owner))
-   "Return the GUID of this owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-name
-   '(<gw:mchars> callee-owned const)
-   "gncOwnerGetName"
-   '((<gnc:GncOwner*> owner))
-   "Return the Name of this owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-copy-into-owner
-   '<gw:void>
-   "gncOwnerCopy"
-   '((<gnc:GncOwner*> src-owner) (<gnc:GncOwner*> dest-owner))
-   "Copy the src-owner to the dest-owner")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-is-valid?
-   '<gw:bool>
-   "gncOwnerIsValid"
-   '((<gnc:GncOwner*> owner))
-   "Is this a real owner?  Return TRUE IFF there is an actual owner.")
-
-  (gw:wrap-function
-   ws
-   'gnc:owner-get-currency
-   '<gnc:commodity*>
-   "gncOwnerGetCurrency"
-   '((<gnc:GncOwner*> owner))
-   "Return the owner's currency")
-
-  ;;
-  ;; gncTaxTable.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:taxtable-get-guid
-   '<gnc:guid-scm>
-   "gncTaxTableRetGUID"
-   '((<gnc:GncTaxTable*> taxtable))
-   "Return the GUID of the taxtable")
-
-  (gw:wrap-function
-   ws
-   'gnc:taxtable-lookup
-   '<gnc:GncTaxTable*>
-   "gncTaxTableLookupDirect"
-   '((<gnc:guid-scm> guid) (<gnc:Book*> book))
-   "Lookup the tax table with GUID guid.")
-
-  ;;
-  ;; gncVendor.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-get-guid
-   '<gnc:guid-scm>
-   "gncVendorRetGUID"
-   '((<gnc:GncVendor*> vendor))
-   "Return the GUID of the vendor")
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-lookup
-   '<gnc:GncVendor*>
-   "gncVendorLookupDirect"
-   '((<gnc:guid-scm> guid) (<gnc:Book*> book))
-   "Lookup the vendor with GUID guid.")
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-get-id
-   '(<gw:mchars> callee-owned const)
-   "gncVendorGetID"
-   '((<gnc:GncVendor*> vendor))
-   "Return the Vendor's ID")
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-get-name
-   '(<gw:mchars> callee-owned const)
-   "gncVendorGetName"
-   '((<gnc:GncVendor*> vendor))
-   "Return the Vendor's Name")
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-get-addr
-   '<gnc:GncAddress*>
-   "gncVendorGetAddr"
-   '((<gnc:GncVendor*> vendor))
-   "Return the Vendor's Billing Address")
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-get-notes
-   '(<gw:mchars> callee-owned const)
-   "gncVendorGetNotes"
-   '((<gnc:GncVendor*> vendor))
-   "Return the Vendor's Notes")
-
-)

Modified: gnucash/branches/register-rewrite/src/business/business-core/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -13,9 +13,7 @@
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${top_builddir}/src/test-core/libgncmod-test.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
-  ${top_builddir}/src/engine/libgw-engine.la \
   ../libgncmod-business-core.la \
-  ../libgw-business-core.la \
   ${GLIB_LIBS} \
   ${QOF_LIBS} \
   -lltdl
@@ -35,9 +33,8 @@
   --gnc-module-dir ${top_builddir}/src/engine \
   --gnc-module-dir ${top_builddir}/src/business/business-core \
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
-  --gnc-module-dir ${top_srcdir}/src/engine \
-  --library-dir    ${G_WRAP_LIB_DIR} \
-  --guile-load-dir ${G_WRAP_MODULE_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --gnc-module-dir ${top_srcdir}/src/engine
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/business/business-core/test/test-address.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/test/test-address.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/test/test-address.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,7 @@
  *
  *********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include "cashobjects.h"
 #include "gncAddressP.h"

Modified: gnucash/branches/register-rewrite/src/business/business-core/test/test-business.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/test/test-business.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/test/test-business.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
  *
  *********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include <libguile.h>
 

Modified: gnucash/branches/register-rewrite/src/business/business-core/test/test-customer.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/test/test-customer.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/test/test-customer.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,7 @@
  *
  *********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/business/business-core/test/test-employee.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/test/test-employee.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/test/test-employee.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,7 @@
  *
  *********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include "qof.h"
 #include "gncEmployeeP.h"

Modified: gnucash/branches/register-rewrite/src/business/business-core/test/test-job.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/test/test-job.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/test/test-job.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,7 @@
  *
  *********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include "qof.h"
 #include "gncJobP.h"

Modified: gnucash/branches/register-rewrite/src/business/business-core/test/test-vendor.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-core/test/test-vendor.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-core/test/test-vendor.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,7 @@
  *
  *********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include "gncInvoiceP.h"
 #include "gncCustomerP.h"


Property changes on: gnucash/branches/register-rewrite/src/business/business-gnome
___________________________________________________________________
Name: svn:ignore
   - *.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gw-business-gnome.c
gw-business-gnome.h
gw-business-gnome.html
gw-business-gnome.scm
.DS_Store
g-wrapped
gnucash


semantic.cache

TAGS

   + *.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
swig-business-gnome.c
.DS_Store
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/business/business-gnome/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,7 @@
 SUBDIRS = . glade schemas ui
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-business-gnome.la libgw-business-gnome.la
+pkglib_LTLIBRARIES = libgncmod-business-gnome.la
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \
@@ -22,7 +22,6 @@
   ${GTKHTML_CFLAGS} \
   ${GDK_PIXBUF_CFLAGS} \
   ${GLIB_CFLAGS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${QOF_CFLAGS} \
   -I${top_srcdir}/src/register/register-core \
@@ -64,8 +63,7 @@
   dialog-vendor.h \
   gnc-plugin-business.h \
   gnc-plugin-page-invoice.h \
-  search-owner.h \
-  gw-business-gnome.h
+  search-owner.h
 
 libgncmod_business_gnome_la_LIBADD = \
   ${top_builddir}/src/business/business-core/libgncmod-business-core.la \
@@ -82,21 +80,11 @@
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${GLADE_LIBS} \
   ${GNOME_LIBS} \
-  ${G_WRAP_LINK_ARGS} \
   ${GUILE_LIBS} \
   ${GLIB_LIBS} \
   ${QOF_LIBS} \
   ${EFENCE_LIBS}
 
-
-libgw_business_gnome_la_SOURCES = gw-business-gnome.c
-
-libgw_business_gnome_la_LDFLAGS = ${G_WRAP_LINK_ARGS}
-libgw_business_gnome_la_LIBADD  = \
-  libgncmod-business-gnome.la \
-  ${G_WRAP_LINK_ARGS} \
-  ${GUILE_LIBS}
-
 # For Business Reports
 gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report/
 gncscmmod_DATA =
@@ -104,48 +92,26 @@
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
 gncmod_DATA = business-gnome.scm
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = \
-  gw-business-gnome.scm \
-  gw-business-gnome-spec.scm
-
 EXTRA_DIST = \
   ${gncmod_DATA} \
-  ${gwmod_DATA} \
   ${gncscmmod_DATA}
 
 if GNUCASH_SEPARATE_BUILDDIR
 #Only needed when srcdir and builddir are different
-#for compiling
-SCM_FILE_LINKS = gw-business-gnome-spec.scm
 #for running
-SCM_FILE_LINKS += ${gncmod_DATA}
+SCM_FILE_LINKS = ${gncmod_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-gw-business-gnome.scm gw-business-gnome.c gw-business-gnome.h: \
-  .scm-links gw-business-gnome-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	 (set! %load-path (cons \"${PWD}\" %load-path)) \
-	 (set! %load-path (cons \"../business-core\" %load-path)) \
-	 (set! %load-path (cons \"${srcdir}/../business-core\" %load-path)) \
-	 (set! %load-path (cons \"../../engine\" %load-path)) \
-	 (set! %load-path (cons \"../../app-utils\" %load-path)) \
-	 (set! %load-path (cons \"../../gnome-utils\" %load-path)) \
-	 (primitive-load \"./gw-business-gnome-spec.scm\") \
-	 (gw:generate-wrapset \"gw-business-gnome\")"
-
-BUILT_SOURCES = gw-business-gnome.scm gw-business-gnome.c gw-business-gnome.h
-CLEANFILES = g-wrapped gnucash .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-business-gnome.html
+noinst_DATA = .scm-links
+CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,7 @@
  *
  * Written By: Derek Atkins <warlord at MIT.EDU>
  * Copyright (C) 2001,2002,2006 Derek Atkins
+ * 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
@@ -32,6 +33,7 @@
 #include "gnc-ui-util.h"
 #include "qof.h"
 #include "gnc-component-manager.h"
+#include "gnc-gtk-utils.h"
 
 #include "gncCustomer.h"
 #include "gncJob.h"
@@ -304,20 +306,27 @@
 gnc_fill_account_select_combo (GtkWidget *combo, GNCBook *book,
 			       GList *acct_types)
 {
-  GList *list, *node, *names = NULL;
+  GtkListStore *store;
+  GtkEntry *entry;
+  GList *list, *node;
   char *text;
-  gboolean found = FALSE;
 
-  g_return_if_fail (combo);
+  g_return_if_fail (combo && GTK_IS_COMBO_BOX_ENTRY(combo));
   g_return_if_fail (book);
   g_return_if_fail (acct_types);
 
   /* Figure out if anything is set in the combo */
-  text = gtk_editable_get_chars (GTK_EDITABLE ((GTK_COMBO (combo))->entry), 0, -1);
+  text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(combo));
 
   list = xaccGroupGetSubAccounts (gnc_book_get_group (book));
 
-  /* Create a list of names.  Figure out if we've got the 'saved' one */
+  /* Clear the existing list */
+  entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(combo)));
+  gtk_entry_set_text(entry, "");
+  store = GTK_LIST_STORE(gtk_combo_box_get_model(GTK_COMBO_BOX(combo)));
+  gtk_list_store_clear(store);
+
+ /* Add the account names to the combo box */
   for (node = list; node; node = node->next) {
     Account *account = node->data;
     char *name;
@@ -328,28 +337,15 @@
       continue;
 
     name = xaccAccountGetFullName (account);
-    if (name != NULL) {
-      names = g_list_append (names, name);
-      if (!safe_strcmp (name, text))
-	found = TRUE;
-    }
+    gtk_combo_box_append_text(GTK_COMBO_BOX(combo), name);
+    g_free(name);
   }
+  gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
 
   g_list_free (list);
 
-  /* set the popdown strings and the default to last selected choice
-   * (or the first entry if none was previously selected */
+  gnc_cbe_set_by_string(GTK_COMBO_BOX_ENTRY(combo), text);
 
-  if (names) {
-    gtk_combo_set_popdown_strings (GTK_COMBO (combo), names);
-    gtk_entry_set_text (GTK_ENTRY ((GTK_COMBO (combo))->entry),
-			found ? text : names->data);
-  }
-
-  for (node = names; node; node = node->next)
-    g_free (node->data);
-  g_list_free (names);
-
   if (text)
     g_free (text);
 }
@@ -361,13 +357,13 @@
 
   switch (gncOwnerGetType (owner)) {
   case GNC_OWNER_CUSTOMER:
-    return (g_list_prepend (NULL, (gpointer)RECEIVABLE));
+    return (g_list_prepend (NULL, (gpointer)ACCT_TYPE_RECEIVABLE));
   case GNC_OWNER_VENDOR:
   case GNC_OWNER_EMPLOYEE:
-    return (g_list_prepend (NULL, (gpointer)PAYABLE));
+    return (g_list_prepend (NULL, (gpointer)ACCT_TYPE_PAYABLE));
     break;
   default:
-    return (g_list_prepend (NULL, (gpointer)NO_TYPE));
+    return (g_list_prepend (NULL, (gpointer)ACCT_TYPE_NONE));
   }
 }
 

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/business-gnome.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,5 +1,4 @@
 (define-module (gnucash business-gnome))
-(use-modules (g-wrapped gw-business-gnome))
 (use-modules (gnucash gnc-module))
 
 (gnc:module-load "gnucash/gnome-utils" 0)
@@ -22,8 +21,8 @@
     (set-current-module m)))
 
 (define (business-report-function)
-  (gnc:add-extension
+  (gnc-add-scm-extension
    (gnc:make-menu gnc:menuname-business-reports
 		  (list gnc:menuname-reports))))
 
-(gnc:hook-add-dangler gnc:*report-hook* business-report-function)
+(gnc-hook-add-scm-dangler HOOK-REPORT business-report-function)

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/business-options-gnome.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/business-options-gnome.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/business-options-gnome.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -26,7 +26,7 @@
 
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 #include <libguile.h>
 
 #include "gnc-ui-util.h"
@@ -39,6 +39,8 @@
 #include "business-gnome-utils.h"
 #include "dialog-invoice.h"
 
+#define FUNC_NAME __FUNCTION__
+
 static GtkWidget *
 create_owner_widget (GNCOption *option, GncOwnerType type, GtkWidget *hbox)
 {
@@ -94,12 +96,9 @@
 get_owner_type_from_option (GNCOption *option)
 {
   SCM odata = gnc_option_get_option_data (option);
-  SCM conv_func;
 
-  conv_func = scm_c_eval_string ("gw:enum-<gnc:GncOwnerType>-val->int");
-  odata = scm_call_1 (conv_func, odata);
-
-  return scm_num2long (odata, SCM_ARG1, __FUNCTION__);
+  /* The option data is enum-typed.  It's just the enum value. */
+  return (GncOwnerType) scm_num2int(odata, SCM_ARG1, __FUNCTION__);
 }
 
 
@@ -135,11 +134,11 @@
   GncOwner owner_def;
   GncOwner *owner;
 
-  if (!gw_wcp_p (value))
+  if (!SWIG_IsPointer (value))
     scm_misc_error("business_options:owner_set_value",
-		   "Item is not a gw:wcp.", value);
+		   "SCM is not a wrapped pointer.", value);
 
-  owner = gw_wcp_get_ptr (value);
+  owner = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncOwner"), 1, 0);
 
   /* XXX: should we verify that the owner type is correct? */
   if (!owner) {
@@ -164,7 +163,7 @@
   owner.type = type;
   gnc_owner_get_owner (widget, &owner);
 
-  return gw_wcp_assimilate_ptr (&owner, scm_c_eval_string("<gnc:GncOwner*>"));
+  return SWIG_NewPointerObj(&owner, SWIG_TypeQuery("_p__gncOwner"), 0);
 }
 
 
@@ -203,11 +202,11 @@
   GncOwner owner;
   GncCustomer *customer;
 
-  if (!gw_wcp_p (value))
+  if (!SWIG_IsPointer (value))
     scm_misc_error("business_options:customer_set_value",
-		   "Item is not a gw:wcp.", value);
+		   "SCM is not a wrapped pointer.", value);
 
-  customer = gw_wcp_get_ptr (value);
+  customer = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncCustomer"), 1, 0);
   gncOwnerInitCustomer (&owner, customer);
 
   widget = gnc_option_get_widget (option);
@@ -222,9 +221,8 @@
   GncOwner owner;
 
   gnc_owner_get_owner (widget, &owner);
-
-  return gw_wcp_assimilate_ptr (owner.owner.undefined,
-				scm_c_eval_string("<gnc:GncCustomer*>"));
+  return SWIG_NewPointerObj(owner.owner.undefined,
+                            SWIG_TypeQuery("_p__gncCustomer"), 0);
 }
 
 
@@ -263,11 +261,11 @@
   GncOwner owner;
   GncVendor *vendor;
 
-  if (!gw_wcp_p (value))
+  if (!SWIG_IsPointer (value))
     scm_misc_error("business_options:vendor_set_value",
-		   "Item is not a gw:wcp.", value);
+		   "SCM is not a wrapped pointer.", value);
 
-  vendor = gw_wcp_get_ptr (value);
+  vendor = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncVendor"), 1, 0);
   gncOwnerInitVendor (&owner, vendor);
 
   widget = gnc_option_get_widget (option);
@@ -282,9 +280,8 @@
   GncOwner owner;
 
   gnc_owner_get_owner (widget, &owner);
-
-  return gw_wcp_assimilate_ptr (owner.owner.undefined,
-				scm_c_eval_string("<gnc:GncVendor*>"));
+  return SWIG_NewPointerObj(owner.owner.undefined,
+                            SWIG_TypeQuery("_p__gncVendor"), 0);
 }
 
 /********************************************************************/
@@ -322,11 +319,11 @@
   GncOwner owner;
   GncEmployee *employee;
 
-  if (!gw_wcp_p (value))
+  if (!SWIG_IsPointer (value))
     scm_misc_error("business_options:employee_set_value",
-		   "Item is not a gw:wcp.", value);
+		   "SCM is not a wrapped pointer.", value);
 
-  employee = gw_wcp_get_ptr (value);
+  employee = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncEmployee"), 1, 0);
   gncOwnerInitEmployee (&owner, employee);
 
   widget = gnc_option_get_widget (option);
@@ -342,8 +339,8 @@
 
   gnc_owner_get_owner (widget, &owner);
 
-  return gw_wcp_assimilate_ptr (owner.owner.undefined,
-				scm_c_eval_string("<gnc:GncEmployee*>"));
+  return SWIG_NewPointerObj(owner.owner.undefined,
+                            SWIG_TypeQuery("_p__gncEmployee"), 0);
 }
 
 /********************************************************************/
@@ -396,11 +393,11 @@
 {
   GncInvoice *invoice;
 
-  if (!gw_wcp_p (value))
+  if (!SWIG_IsPointer (value))
     scm_misc_error("business_options:invoice_set_value",
-		   "Item is not a gw:wcp.", value);
+		   "SCM is not a wrapped pointer.", value);
 
-  invoice = gw_wcp_get_ptr (value);
+  invoice = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncInvoice"), 1, 0);
 
   widget = gnc_option_get_widget (option);
   gnc_general_search_set_selected (GNC_GENERAL_SEARCH (widget), invoice);
@@ -414,7 +411,7 @@
   GncInvoice *invoice;
 
   invoice = gnc_general_search_get_selected (GNC_GENERAL_SEARCH (widget));
-  return gw_wcp_assimilate_ptr (invoice, scm_c_eval_string("<gnc:GncInvoice*>"));
+  return SWIG_NewPointerObj(invoice, SWIG_TypeQuery("_p__gncInvoice"), 0);
 }
 
 
@@ -471,11 +468,11 @@
 {
   GncTaxTable *taxtable;
 
-  if (!gw_wcp_p (value))
+  if (!SWIG_IsPointer (value))
     scm_misc_error("business_options:taxtable_set_value",
-		   "Item is not a gw:wcp.", value);
+		   "SCM is not a wrapped pointer.", value);
 
-  taxtable = gw_wcp_get_ptr (value);
+  taxtable = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncTaxTable"), 1, 0);
 
   widget = gnc_option_get_widget (option);
   gnc_ui_optionmenu_set_value (widget, taxtable);
@@ -489,7 +486,7 @@
   GncTaxTable *taxtable;
 
   taxtable = gnc_ui_optionmenu_get_value (widget);
-  return gw_wcp_assimilate_ptr (taxtable, scm_c_eval_string("<gnc:GncTaxTable*>"));
+  return SWIG_NewPointerObj(taxtable, SWIG_TypeQuery("_p__gncTaxTable"), 0);
 }
 
 
@@ -510,6 +507,7 @@
     { NULL }
   };
 
+  SWIG_GetModule(NULL); /* Work-around for SWIG bug. */
   for (i = 0; options[i].option_name; i++)
     gnc_options_ui_register_option (&(options[i]));
 }

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/businessmod-gnome.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/businessmod-gnome.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/businessmod-gnome.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -35,7 +35,6 @@
 #include "gnc-hooks.h"
 #include "gnc-module.h"
 #include "gnc-module-api.h"
-#include "gw-business-gnome.h"
 
 #include "search-core-type.h"
 #include "search-owner.h"
@@ -101,10 +100,28 @@
   //    return FALSE;
   //  }
 
-  scm_c_eval_string("(use-modules (g-wrapped gw-business-gnome))");
   scm_c_eval_string("(use-modules (gnucash business-gnome))");
   scm_c_eval_string("(use-modules (gnucash report business-reports))");
 
+  // temp code until gnc:url-type is wrapped
+  /*
+  {
+      SCM wct_gnc_url_type = scm_c_eval_string("<gnc:url-type>");
+      SCM tmp;
+
+      tmp = gw_wcp_assimilate_ptr(GNC_CUSTOMER_MODULE_NAME, wct_gnc_url_type);
+      scm_c_define("gnc:url-type-customer", tmp);
+      tmp = gw_wcp_assimilate_ptr(GNC_VENDOR_MODULE_NAME, wct_gnc_url_type);
+      scm_c_define("gnc:url-type-vendor", tmp);
+      tmp = gw_wcp_assimilate_ptr(GNC_EMPLOYEE_MODULE_NAME, wct_gnc_url_type);
+      scm_c_define("gnc:url-type-employee", tmp);
+      tmp = gw_wcp_assimilate_ptr(GNC_INVOICE_MODULE_NAME, wct_gnc_url_type);
+      scm_c_define("gnc:url-type-invoice", tmp);
+      tmp = gw_wcp_assimilate_ptr(URL_TYPE_OWNERREPORT, wct_gnc_url_type);
+      scm_c_define("gnc:url-type-ownerreport", tmp);
+  }
+  */
+
   if (refcount == 0) {
     /* Register the Owner search type */
     gnc_search_core_register_type (GNC_OWNER_MODULE_NAME,

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/dialog-billterms.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/dialog-billterms.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/dialog-billterms.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * dialog-billterms.c -- Dialog to create and edit billing terms
  * Copyright (C) 2002 Derek Atkins
  * Author: Derek Atkins <warlord at MIT.EDU>
+ * 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
@@ -39,13 +40,18 @@
 
 #define DIALOG_BILLTERMS_CM_CLASS "billterms-dialog"
 
-void billterms_row_selected (GtkCList *clist, gint row, gint column,
-			     GdkEventButton *event, gpointer user_data);
+enum term_cols {
+  BILL_TERM_COL_NAME = 0,
+  BILL_TERM_COL_TERM,
+  NUM_BILL_TERM_COLS
+};
+
 void billterms_new_term_cb (GtkButton *button, BillTermsWindow *btw);
 void billterms_delete_term_cb (GtkButton *button, BillTermsWindow *btw);
 void billterms_edit_term_cb (GtkButton *button, BillTermsWindow *btw);
 void billterms_window_close (GtkWidget *widget, gpointer data);
 void billterms_window_destroy_cb (GtkWidget *widget, gpointer data);
+void billterms_type_combobox_changed (GtkComboBox *cb, gpointer data);
 
 typedef struct _billterm_notebook {
   GtkTooltips *		tooltips;
@@ -68,7 +74,7 @@
 
 struct _billterms_window {
   GtkWidget *	dialog;
-  GtkWidget *	terms_clist;
+  GtkWidget *	terms_view;
   GtkWidget *	desc_entry;
   GtkWidget *	type_label;
   GtkWidget *	term_vbox;
@@ -342,53 +348,16 @@
   show_notebook (&nbt->notebook);
 }
 
-static void
-on_days1_activate (GtkWidget *w, gpointer data)
+void
+billterms_type_combobox_changed (GtkComboBox *cb, gpointer data)
 {
   NewBillTerm *nbt = data;
+  gint value;
 
-  maybe_set_type (nbt, GNC_TERM_TYPE_DAYS);
+  value = gtk_combo_box_get_active(cb);
+  maybe_set_type (nbt, value + 1);
 }
 
-static void
-on_proximo1_activate (GtkWidget *w, gpointer data)
-{
-  NewBillTerm *nbt = data;
-
-  maybe_set_type (nbt, GNC_TERM_TYPE_PROXIMO);
-}
-
-static void
-make_menu (GtkWidget *omenu, NewBillTerm *nbt)
-{
-  GladeXML *xml;
-  GtkWidget *popup;
-
-  /* Open and read the Popup XML */
-  xml = gnc_glade_xml_new ("billterms.glade", "Term Type Popup");
-  popup = glade_xml_get_widget (xml, "Term Type Popup");
-
-  /* Glade insists on making this a tearoff menu. */
-  if (gnc_gconf_menus_have_tearoff()) {
-    GtkMenuShell *ms = GTK_MENU_SHELL (popup);
-    GtkWidget *tearoff;
-
-    tearoff = g_list_nth_data (ms->children, 0);
-    ms->children = g_list_remove (ms->children, tearoff);
-    gtk_widget_destroy (tearoff);
-  }
-
-  /* attach the signal handlers */
-  glade_xml_signal_connect_data (xml, "on_days1_activate",
-				 G_CALLBACK (on_days1_activate), nbt);
-  glade_xml_signal_connect_data (xml, "on_proximo1_activate",
-				 G_CALLBACK (on_proximo1_activate), nbt);
-
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), popup);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (omenu),
-			       nbt->notebook.type - 1);
-}
-
 static GncBillTerm *
 new_billterm_dialog (BillTermsWindow *btw, GncBillTerm *term,
 		     const char *name)
@@ -396,7 +365,7 @@
   GncBillTerm *created_term = NULL;
   NewBillTerm *nbt;
   GladeXML *xml;
-  GtkWidget *box;
+  GtkWidget *box, *combo_box;
   gint response;
   gboolean done;
   const gchar *dialog_name;
@@ -432,7 +401,8 @@
     nbt->notebook.type = GNC_TERM_TYPE_DAYS;
 
   /* Create the menu */
-  make_menu (glade_xml_get_widget (xml, "type_menu"), nbt);
+  combo_box = glade_xml_get_widget (xml, "type_combobox");
+  gtk_combo_box_set_active(GTK_COMBO_BOX(combo_box), nbt->notebook.type - 1);
 
   /* Show the right notebook page */
   show_notebook (&nbt->notebook);
@@ -509,27 +479,26 @@
 billterms_window_refresh (BillTermsWindow *btw)
 {
   GList *list, *node;
-  GtkAdjustment *vadjustment;
-  GtkCList *clist;
-  gfloat save_value = 0.0;
+  GncBillTerm *term;
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeSelection *selection;
+  GtkTreeRowReference *reference = NULL;
 
   g_return_if_fail (btw);
-  clist = GTK_CLIST (btw->terms_clist);
+  view = GTK_TREE_VIEW (btw->terms_view);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
 
-  vadjustment = gtk_clist_get_vadjustment (clist);
-  if (vadjustment)
-    save_value = vadjustment->value;
-
   /* Clear the list */
-  gtk_clist_freeze (clist);
-  gtk_clist_clear (clist);
-
+  gtk_list_store_clear (store);
   gnc_gui_component_clear_watches (btw->component_id);
 
   /* Add the items to the list */
   list = gncBillTermGetTerms (btw->book);
 
-  /* If there are no erms, clear the term display */
+  /* If there are no terms, clear the term display */
   if (list == NULL) {
     btw->current_term = NULL;
     billterms_term_refresh (btw);
@@ -538,20 +507,21 @@
   }
 
   for ( node = list; node; node = node->next) {
-    char *row_text[2];
-    gint row;
-    GncBillTerm *term = node->data;
-
+    term = node->data;
     gnc_gui_component_watch_entity (btw->component_id,
 				    gncBillTermGetGUID (term),
 				    QOF_EVENT_MODIFY);
 
-    row_text[0] = (char *)gncBillTermGetName (term);
-    row_text[1] = NULL;
-
-    row = gtk_clist_prepend (clist, row_text);
-    gtk_clist_set_row_data (clist, row, term);
-    gtk_clist_set_selectable (clist, row, TRUE);
+    gtk_list_store_prepend(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       BILL_TERM_COL_NAME, gncBillTermGetName(term),
+		       BILL_TERM_COL_TERM, term,
+		       -1);
+    if (term == btw->current_term) {
+      path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+      gtk_tree_path_free(path);
+    }
   }
 
   g_list_free (list);
@@ -560,49 +530,46 @@
 				       GNC_BILLTERM_MODULE_NAME,
 				       QOF_EVENT_CREATE | QOF_EVENT_DESTROY);
 
-  if (vadjustment) {
-    save_value = CLAMP (save_value, vadjustment->lower,
-			vadjustment->upper - vadjustment->page_size);
-    gtk_adjustment_set_value (vadjustment, save_value);
+  if (reference) {
+    path = gtk_tree_row_reference_get_path(reference);
+    gtk_tree_row_reference_free(reference);
+    if (path) {
+      selection = gtk_tree_view_get_selection(view);
+      gtk_tree_selection_select_path(selection, path);
+      gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE, 0.5, 0.0);
+      gtk_tree_path_free(path);
+    }
   }
-
-  gtk_clist_thaw (clist);
-
-  {
-    gint row = gtk_clist_find_row_from_data (clist, btw->current_term);
-
-    if (row < 0)
-      row = 0;
-
-    gtk_clist_select_row (clist, row, 0);
-
-    /* If this row isn't visible, move it to the center */
-    if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_FULL)
-      gtk_clist_moveto (clist, row, 0, 0.5, 0);
-  }
-  /* select_row() above will refresh the term display */
 }
 
-void
-billterms_row_selected (GtkCList *clist, gint row, gint column,
-			GdkEventButton *event, gpointer user_data)
+static void
+billterm_selection_changed (GtkTreeSelection *selection,
+			    BillTermsWindow  *btw) 
 {
-  BillTermsWindow *btw = user_data;
-  GncBillTerm *term = gtk_clist_get_row_data (clist, row);
+  GncBillTerm *term = NULL;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
 
   g_return_if_fail (btw);
-  g_return_if_fail (term);
 
+  if (gtk_tree_selection_get_selected(selection, &model, &iter))
+    gtk_tree_model_get(model, &iter, BILL_TERM_COL_TERM, &term, -1);
+
   /* If we've changed, then reset the term list */
   if (term != btw->current_term)
     btw->current_term = term;
 
   /* And force a refresh of the entries */
   billterms_term_refresh (btw);
+}
 
-  /* If the user double-clicked on the item, pop up the edit window */
-  if (event && event->type == GDK_2BUTTON_PRESS)
-    new_billterm_dialog (btw, term, NULL);
+static void
+billterm_selection_activated (GtkTreeView       *tree_view,
+			      GtkTreePath       *path,
+			      GtkTreeViewColumn *column,
+			      BillTermsWindow   *btw)
+{
+  new_billterm_dialog (btw, btw->current_term, NULL);
 }
 
 void
@@ -702,6 +669,11 @@
   BillTermsWindow *btw;
   GladeXML *xml;
   GtkWidget *widget;
+  GtkTreeView *view;
+  GtkTreeViewColumn *column;
+  GtkCellRenderer *renderer;
+  GtkListStore *store;
+  GtkTreeSelection *selection;
 
   if (!book) return NULL;
 
@@ -724,11 +696,29 @@
   /* Open and read the XML */
   xml = gnc_glade_xml_new ("billterms.glade", "Terms Window");
   btw->dialog = glade_xml_get_widget (xml, "Terms Window");
-  btw->terms_clist = glade_xml_get_widget (xml, "terms_clist");
+  btw->terms_view = glade_xml_get_widget (xml, "terms_view");
   btw->desc_entry = glade_xml_get_widget (xml, "desc_entry");
   btw->type_label = glade_xml_get_widget (xml, "type_label");
   btw->term_vbox = glade_xml_get_widget (xml, "term_vbox");
 
+  /* Initialize the view */
+  view = GTK_TREE_VIEW(btw->terms_view);
+  store = gtk_list_store_new (NUM_BILL_TERM_COLS, G_TYPE_STRING, G_TYPE_POINTER);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes("", renderer,
+						    "text", BILL_TERM_COL_NAME,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  g_signal_connect(view, "row-activated",
+		   G_CALLBACK(billterm_selection_activated), btw);
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(billterm_selection_changed), btw);
+
   /* Initialize the notebook widgets */
   init_notebook_widgets (&btw->notebook, TRUE,
 			 GTK_DIALOG (btw->dialog), btw);

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/dialog-employee.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/dialog-employee.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/dialog-employee.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -473,7 +473,7 @@
   ew->ccard_acct_check = glade_xml_get_widget (xml, "ccard_check");
 
   edit = gnc_account_sel_new();
-  acct_types = g_list_prepend(NULL, (gpointer)CREDIT);
+  acct_types = g_list_prepend(NULL, (gpointer)ACCT_TYPE_CREDIT);
   gnc_account_sel_set_acct_filters (GNC_ACCOUNT_SEL(edit), acct_types);
   g_list_free (acct_types);
 

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/dialog-invoice.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/dialog-invoice.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/dialog-invoice.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -27,8 +27,8 @@
 
 #include <gnome.h>
 #include <glib/gi18n.h>
-#include <g-wrap-wct.h>
 #include <libguile.h>
+#include "swig-runtime.h"
 
 #include "gncObject.h"
 #include "QueryCore.h"
@@ -569,7 +569,7 @@
   func = scm_c_eval_string ("gnc:invoice-report-create");
   g_return_if_fail (SCM_PROCEDUREP (func));
 
-  arg = gw_wcp_assimilate_ptr (invoice, scm_c_eval_string("<gnc:GncInvoice*>"));
+  arg = SWIG_NewPointerObj(invoice, SWIG_TypeQuery("_p__gncInvoice"), 0);
   args = scm_cons (arg, args);
 
   /* scm_gc_protect_object(func); */
@@ -734,7 +734,6 @@
 void gnc_business_call_owner_report (GncOwner *owner, Account *acc)
 {
   int id;
-  SCM qtype;
   SCM args;
   SCM func;
   SCM arg;
@@ -747,20 +746,17 @@
   g_return_if_fail (SCM_PROCEDUREP (func));
 
   if (acc) {
-    qtype = scm_c_eval_string("<gnc:Account*>");
-    g_return_if_fail (qtype != SCM_UNDEFINED);
+    swig_type_info * qtype = SWIG_TypeQuery("_p_Account");
+    g_return_if_fail (qtype);
 
-    arg = gw_wcp_assimilate_ptr (acc, qtype);
+    arg = SWIG_NewPointerObj(acc, qtype, 0);
     g_return_if_fail (arg != SCM_UNDEFINED);
     args = scm_cons (arg, args);
   } else {
     args = scm_cons (SCM_BOOL_F, args);
   }
 
-  qtype = scm_c_eval_string("<gnc:GncOwner*>");
-  g_return_if_fail (qtype != SCM_UNDEFINED);
-
-  arg = gw_wcp_assimilate_ptr (owner, qtype);
+  arg = SWIG_NewPointerObj(owner, SWIG_TypeQuery("_p__gncOwner"), 0);
   g_return_if_fail (arg != SCM_UNDEFINED);
   args = scm_cons (arg, args);
 

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/dialog-payment.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/dialog-payment.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/dialog-payment.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * dialog-payment.c -- Dialog for payment entry
  * Copyright (C) 2002,2006 Derek Atkins
  * Author: Derek Atkins <warlord at MIT.EDU>
+ * 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
@@ -34,6 +35,7 @@
 #include "qof.h"
 #include "gnc-date-edit.h"
 #include "gnc-amount-edit.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-tree-view-account.h"
 #include "Transaction.h"
 #include "Account.h"
@@ -246,7 +248,7 @@
   }
 
   /* Verify the "post" account */
-  text = gtk_entry_get_text (GTK_ENTRY ((GTK_COMBO (pw->post_combo))->entry));
+  text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pw->post_combo));
   if (!text || safe_strcmp (text, "") == 0) {
     text = _("You must enter an account name for posting.");
     gnc_error_dialog (pw->dialog, text);
@@ -318,11 +320,11 @@
 
   for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
     switch (i) {
-    case BANK:
-    case CASH:
-    case CREDIT:
-    case ASSET:
-    case LIABILITY:
+    case ACCT_TYPE_BANK:
+    case ACCT_TYPE_CASH:
+    case ACCT_TYPE_CREDIT:
+    case ACCT_TYPE_ASSET:
+    case ACCT_TYPE_LIABILITY:
       avi.include_type[i] = TRUE;
       break;
     default:
@@ -383,6 +385,7 @@
   pw->num_entry = glade_xml_get_widget (xml, "num_entry");
   pw->memo_entry = glade_xml_get_widget (xml, "memo_entry");
   pw->post_combo = glade_xml_get_widget (xml, "post_combo");
+  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(pw->post_combo));
 
   label = glade_xml_get_widget (xml, "owner_label");
   box = glade_xml_get_widget (xml, "owner_box");
@@ -451,7 +454,7 @@
     const gchar *text;
     const char *acct_type;
 
-    text = gtk_entry_get_text(GTK_ENTRY((GTK_COMBO(pw->post_combo))->entry));
+    text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(pw->post_combo));
     if (!text || safe_strcmp (text, "") == 0) {
   
       /* XXX: I know there's only one type here */

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/glade/billterms.glade
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/glade/billterms.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/glade/billterms.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -107,30 +107,14 @@
 		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		      <child>
-			<widget class="GtkCList" id="terms_clist">
+			<widget class="GtkTreeView" id="terms_view">
 			  <property name="visible">True</property>
 			  <property name="can_focus">True</property>
-			  <property name="n_columns">1</property>
-			  <property name="column_widths">80</property>
-			  <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-			  <property name="show_titles">False</property>
-			  <property name="shadow_type">GTK_SHADOW_IN</property>
-			  <signal name="select_row" handler="billterms_row_selected" last_modification_time="Mon, 08 Sep 2003 02:00:56 GMT"/>
-
-			  <child>
-			    <widget class="GtkLabel" id="label23">
-			      <property name="label" translatable="yes"></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.5</property>
-			      <property name="yalign">0.5</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">0</property>
-			    </widget>
-			  </child>
+			  <property name="headers_visible">False</property>
+			  <property name="rules_hint">True</property>
+			  <property name="reorderable">False</property>
+			  <property name="enable_search">True</property>
+			  <property name="fixed_height_mode">False</property>
 			</widget>
 		      </child>
 		    </widget>
@@ -561,37 +545,6 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkOptionMenu" id="type_menu">
-	      <property name="visible">True</property>
-	      <property name="tooltip" translatable="yes">Choose the type of Billing Term</property>
-	      <property name="can_focus">True</property>
-	      <property name="history">0</property>
-
-	      <child internal-child="menu">
-		<widget class="GtkMenu" id="convertwidget3">
-		  <property name="visible">True</property>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget4">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Type Menu</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="left_attach">1</property>
-	      <property name="right_attach">2</property>
-	      <property name="top_attach">5</property>
-	      <property name="bottom_attach">6</property>
-	      <property name="x_options">fill</property>
-	      <property name="y_options"></property>
-	    </packing>
-	  </child>
-
-	  <child>
 	    <widget class="GtkHBox" id="notebook_box">
 	      <property name="visible">True</property>
 	      <property name="homogeneous">False</property>
@@ -785,7 +738,7 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">type_menu</property>
+		  <property name="mnemonic_widget">type_combobox</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -798,6 +751,24 @@
 	      <property name="y_options">fill</property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <widget class="GtkComboBox" id="type_combobox">
+	      <property name="visible">True</property>
+	      <property name="items" translatable="yes">Days
+Proximo</property>
+	      <property name="focus_on_click">True</property>
+	      <signal name="changed" handler="billterms_type_combobox_changed" last_modification_time="Tue, 06 Jun 2006 01:17:37 GMT"/>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">5</property>
+	      <property name="bottom_attach">6</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>
@@ -991,7 +962,7 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">type_menu</property>
+		  <property name="mnemonic_widget">type_combobox</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -1006,25 +977,12 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkOptionMenu" id="type_menu">
+	    <widget class="GtkComboBox" id="type_combobox">
 	      <property name="visible">True</property>
-	      <property name="tooltip" translatable="yes">Choose the type of Billing Term</property>
-	      <property name="can_focus">True</property>
-	      <property name="history">0</property>
-
-	      <child internal-child="menu">
-		<widget class="GtkMenu" id="convertwidget3">
-		  <property name="visible">True</property>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget4">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Type Menu</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
+	      <property name="items" translatable="yes">Days
+Proximo</property>
+	      <property name="focus_on_click">True</property>
+	      <signal name="changed" handler="billterms_type_combobox_changed" last_modification_time="Tue, 06 Jun 2006 01:17:37 GMT"/>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
@@ -1032,7 +990,7 @@
 	      <property name="top_attach">2</property>
 	      <property name="bottom_attach">3</property>
 	      <property name="x_options">fill</property>
-	      <property name="y_options"></property>
+	      <property name="y_options">fill</property>
 	    </packing>
 	  </child>
 
@@ -1065,30 +1023,6 @@
   </child>
 </widget>
 
-<widget class="GtkMenu" id="Term Type Popup">
-  <property name="visible">True</property>
-
-  <child>
-    <widget class="GtkMenuItem" id="days1">
-      <property name="visible">True</property>
-      <property name="tooltip" translatable="yes">Number of days from now</property>
-      <property name="label" translatable="yes">Days</property>
-      <property name="use_underline">True</property>
-      <signal name="activate" handler="on_days1_activate"/>
-    </widget>
-  </child>
-
-  <child>
-    <widget class="GtkMenuItem" id="proximo1">
-      <property name="visible">True</property>
-      <property name="tooltip" translatable="yes">Absolute Day-of-the-month</property>
-      <property name="label" translatable="yes">Proximo</property>
-      <property name="use_underline">True</property>
-      <signal name="activate" handler="on_proximo1_activate"/>
-    </widget>
-  </child>
-</widget>
-
 <widget class="GtkWindow" id="Term Notebook">
   <property name="title" translatable="yes">window1</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/glade/payment.glade
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/glade/payment.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/glade/payment.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -95,7 +95,7 @@
 		      <child>
 			<widget class="GtkLabel" id="owner_label">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="no">(owner)</property>
+			  <property name="label">(owner)</property>
 			  <property name="use_underline">False</property>
 			  <property name="use_markup">False</property>
 			  <property name="justify">GTK_JUSTIFY_RIGHT</property>
@@ -116,7 +116,7 @@
 		      <child>
 			<widget class="GtkLabel" id="invoice_label">
 			  <property name="visible">True</property>
-			  <property name="label" translatable="no">(invoice)</property>
+			  <property name="label">(invoice)</property>
 			  <property name="use_underline">False</property>
 			  <property name="use_markup">False</property>
 			  <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -309,7 +309,7 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char" translatable="yes">*</property>
+			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -328,7 +328,7 @@
 			  <property name="max_length">0</property>
 			  <property name="text" translatable="yes"></property>
 			  <property name="has_frame">True</property>
-			  <property name="invisible_char" translatable="yes">*</property>
+			  <property name="invisible_char">*</property>
 			  <property name="activates_default">False</property>
 			</widget>
 			<packing>
@@ -381,57 +381,11 @@
 	      <property name="shadow_type">GTK_SHADOW_ETCHED_IN</property>
 
 	      <child>
-		<widget class="GtkCombo" id="post_combo">
-		  <property name="border_width">3</property>
+		<widget class="GtkComboBoxEntry" id="post_combo">
 		  <property name="visible">True</property>
-		  <property name="value_in_list">True</property>
-		  <property name="allow_empty">False</property>
-		  <property name="case_sensitive">False</property>
-		  <property name="enable_arrow_keys">True</property>
-		  <property name="enable_arrows_always">False</property>
-
-		  <child internal-child="entry">
-		    <widget class="GtkEntry" id="combo-entry1">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="editable">True</property>
-		      <property name="visibility">True</property>
-		      <property name="max_length">0</property>
-		      <property name="text" translatable="yes"></property>
-		      <property name="has_frame">True</property>
-		      <property name="invisible_char" translatable="yes">*</property>
-		      <property name="activates_default">False</property>
-		    </widget>
-		  </child>
-
-		  <child internal-child="list">
-		    <widget class="GtkList" id="convertwidget1">
-		      <property name="visible">True</property>
-		      <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
-		      <child>
-			<widget class="GtkListItem" id="convertwidget2">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkLabel" id="convertwidget3">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes"></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>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
+		  <property name="items">Dummy Entry</property>
+		  <property name="has_frame">True</property>
+		  <property name="focus_on_click">True</property>
 		</widget>
 	      </child>
 

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/gnc-plugin-business.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/gnc-plugin-business.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/gnc-plugin-business.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -922,25 +922,25 @@
 	gncOwnerInitJob(owner, job);
 
 	// Create the A/R account
-	xaccAccountSetType(ar_acct, RECEIVABLE);
+	xaccAccountSetType(ar_acct, ACCT_TYPE_RECEIVABLE);
 	xaccAccountSetName(ar_acct, "A/R");
 	xaccAccountSetCommodity(ar_acct, gnc_default_currency());
 	xaccGroupInsertAccount(group, ar_acct);
 
 	// Create the Income account
-	xaccAccountSetType(inc_acct, INCOME);
+	xaccAccountSetType(inc_acct, ACCT_TYPE_INCOME);
 	xaccAccountSetName(inc_acct, "Income");
 	xaccAccountSetCommodity(inc_acct, gnc_default_currency());
 	xaccGroupInsertAccount(group, inc_acct);
 
 	// Create the Bank account
-	xaccAccountSetType(bank_acct, BANK);
+	xaccAccountSetType(bank_acct, ACCT_TYPE_BANK);
 	xaccAccountSetName(bank_acct, "Bank");
 	xaccAccountSetCommodity(bank_acct, gnc_default_currency());
 	xaccGroupInsertAccount(group, bank_acct);
 
 	// Create the Tax account
-	xaccAccountSetType(tax_acct, LIABILITY);
+	xaccAccountSetType(tax_acct, ACCT_TYPE_LIABILITY);
 	xaccAccountSetName(tax_acct, "Tax-Holding");
 	xaccAccountSetCommodity(tax_acct, gnc_default_currency());
 	xaccGroupInsertAccount(group, tax_acct);

Deleted: gnucash/branches/register-rewrite/src/business/business-gnome/gw-business-gnome-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/gw-business-gnome-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/gw-business-gnome-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,267 +0,0 @@
-;;; -*-scheme-*-
-
-;(debug-enable 'backtrace)
-;(debug-enable 'debug)
-;(read-enable 'positions)
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(define-module (g-wrapped gw-business-gnome-spec)
-  :use-module (g-wrap))
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-
-(use-modules (g-wrapped gw-business-core-spec))
-(use-modules (g-wrapped gw-gnome-utils-spec))
-
-(let ((ws (gw:new-wrapset "gw-business-gnome")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-
-  (gw:wrapset-depends-on ws "gw-business-core")
-  (gw:wrapset-depends-on ws "gw-engine")
-  (gw:wrapset-depends-on ws "gw-gnome-utils")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-business-gnome))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <config.h>\n"
-      "#include <gtk/gtk.h>\n"
-      "#include <business-urls.h>\n"
-      "#include <dialog-billterms.h>\n"
-      "#include <dialog-customer.h>\n"
-      "#include <dialog-employee.h>\n"
-      "#include <dialog-invoice.h>\n"
-      "#include <dialog-job.h>\n"
-      "#include <dialog-order.h>\n"
-      "#include <dialog-payment.h>\n"
-      "#include <dialog-vendor.h>\n"
-      )))
-
-  (gw:wrapset-add-cs-initializers!
-   ws
-   (lambda (wrapset client-wrapset status-var) 
-     (if client-wrapset
-         '()
-         (gw:inline-scheme '(use-modules (gnucash business-gnome))))))
-  
-  ;;
-  ;; Business URL Types
-  ;;
-  (gw:wrap-value ws 'gnc:url-type-customer '<gnc:url-type> 
-		 "GNC_CUSTOMER_MODULE_NAME")
-  (gw:wrap-value ws 'gnc:url-type-vendor '<gnc:url-type> 
-		 "GNC_VENDOR_MODULE_NAME")
-  (gw:wrap-value ws 'gnc:url-type-employee '<gnc:url-type> 
-		 "GNC_EMPLOYEE_MODULE_NAME")
-  (gw:wrap-value ws 'gnc:url-type-invoice '<gnc:url-type> 
-		 "GNC_INVOICE_MODULE_NAME")
-  (gw:wrap-value ws 'gnc:url-type-ownerreport '<gnc:url-type>
-		 "URL_TYPE_OWNERREPORT")
-
-
-  ;;
-  ;; dialog-billterms.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:billterms-new
-   '<gw:void>
-   "gnc_ui_billterms_window_new"
-   '((<gnc:Book*> book))
-   "Dialog: view and edit the available Billing Terms.")
-
-  ;;
-  ;; dialog-customer.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-new
-   '<gw:void>
-   "gnc_ui_customer_new"
-   '((<gnc:Book*> book))
-   "Dialog: create a new GncCustomer.")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-edit
-   '<gw:void>
-   "gnc_ui_customer_edit"
-   '((<gnc:GncCustomer*> customer))
-   "Dialog: Edit a GncCustomer.")
-
-  (gw:wrap-function
-   ws
-   'gnc:customer-search
-   '<gw:void>
-   "gnc_customer_search"
-   '((<gnc:GncCustomer*> start_selection) (<gnc:Book*> book) )
-   "Dialog: Find a GncCustomer.  Start_selection may be NULL.")
-
-  ;;
-  ;; dialog-employee.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:employee-new
-   '<gw:void>
-   "gnc_ui_employee_new"
-   '((<gnc:Book*> book))
-   "Dialog: create a new GncEmployee.")
-
-  (gw:wrap-function
-   ws
-   'gnc:employee-edit
-   '<gw:void>
-   "gnc_ui_employee_edit"
-   '((<gnc:GncEmployee*> employee))
-   "Dialog: Edit a GncEmployee.")
-
-  (gw:wrap-function
-   ws
-   'gnc:employee-search
-   '<gw:void>
-   "gnc_employee_search"
-   '((<gnc:GncEmployee*> start_selection) (<gnc:Book*> book))
-   "Dialog: Find a GncEmployee.  Start_selection may be NULL.")
-
-  ;;
-  ;; dialog-invoice.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-new
-   '<gw:void>
-   "gnc_ui_invoice_new"
-   '((<gnc:GncOwner*> owner) (<gnc:Book*> book))
-   "Dialog: create a new GncInvoice.")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-edit
-   '<gw:void>
-   "gnc_ui_invoice_edit"
-   '((<gnc:GncInvoice*> invoice))
-   "Dialog: Edit a GncInvoice.")
-
-  (gw:wrap-function
-   ws
-   'gnc:invoice-search
-   '<gw:void>
-   "gnc_invoice_search"
-   '((<gnc:GncInvoice*> start_selection) (<gnc:GncOwner*> owner)
-     (<gnc:Book*> book))
-   "Dialog: Select a GncInvoice.  Either start_selection or "
-   "owner may be NULL.")
-  
-  ;;
-  ;; dialog-job.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:job-new
-   '<gw:void>
-   "gnc_ui_job_new"
-   '((<gnc:GncOwner*> default_owner) (<gnc:Book*> book))
-   "Dialog: create a new GncJob.  Owner may be NULL.")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-edit
-   '<gw:void>
-   "gnc_ui_job_edit"
-   '((<gnc:GncJob*> job))
-   "Dialog: Edit a GncJob.")
-
-  (gw:wrap-function
-   ws
-   'gnc:job-search
-   '<gw:void>
-   "gnc_job_search"
-   '((<gnc:GncJob*> job) (<gnc:GncOwner*> owner) (<gnc:Book*> book))
-   "Dialog: Search for a job.  Job and Owner may be NULL.")
-
-  ;;
-  ;; dialog-order.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:order-new
-   '<gw:void>
-   "gnc_ui_order_new"
-   '((<gnc:GncOwner*> owner) (<gnc:Book*> book))
-   "Dialog: create a new GncOrder.")
-
-  (gw:wrap-function
-   ws
-   'gnc:order-edit
-   '<gw:void>
-   "gnc_ui_order_edit"
-   '((<gnc:GncOrder*> order))
-   "Dialog: Edit a GncOrder.")
-
-
-  (gw:wrap-function
-   ws
-   'gnc:order-search
-   '<gw:void>
-   "gnc_order_search"
-   '((<gnc:GncOrder*> start_selection) (<gnc:GncOwner*> order_owner)
-     (<gnc:Book*> book) )
-   "Dialog: Select a GncOrder.  Either start_selection or "
-   "order_owner may be NULL.")
-  
-  ;;
-  ;; dialog-payment.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:payment-new
-   '<gw:void>
-   "gnc_ui_payment_new"
-   '((<gnc:GncOwner*> owner) (<gnc:Book*> book))
-   "Dialog: Enter a payment.  The owner may be NULL.")
-
-  ;;
-  ;; dialog-vendor.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-new
-   '<gw:void>
-   "gnc_ui_vendor_new"
-   '((<gnc:Book*> book))
-   "Dialog: create a new GncVendor.")
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-edit
-   '<gw:void>
-   "gnc_ui_vendor_edit"
-   '((<gnc:GncVendor*> vendor))
-   "Dialog: Edit a GncVendor.")
-
-  (gw:wrap-function
-   ws
-   'gnc:vendor-search
-   '<gw:void>
-   "gnc_vendor_search"
-   '((<gnc:GncVendor*> start_selection) (<gnc:Book*> book))
-   "Dialog: Select a GncVendor.  Start_selection may be NULL.")
-  
-)

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/schemas/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/schemas/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/schemas/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,10 +12,10 @@
 install-data-local:
 if GCONF_SCHEMAS_INSTALL
 	-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
-	-GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA)
+	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-2 --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
 endif

Modified: gnucash/branches/register-rewrite/src/business/business-gnome/search-owner.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-gnome/search-owner.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-gnome/search-owner.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -32,6 +34,7 @@
 
 #include "business-gnome-utils.h"
 #include "search-owner.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -199,12 +202,15 @@
 }
 
 static void
-type_option_changed (GtkWidget *widget, GNCSearchOwner *fe)
+type_combo_changed (GtkWidget *widget, GNCSearchOwner *fe)
 {
   GNCSearchOwnerPrivate *priv;
-  GncOwnerType type = (GncOwnerType)
-    g_object_get_data (G_OBJECT (widget), "option");
+  GncOwnerType type;
 
+  g_return_if_fail(GTK_IS_COMBO_BOX(widget));
+
+  type = gnc_combo_box_search_get_active(GTK_COMBO_BOX(widget));
+
   /* If the type changed or if we don't have a type create the owner_choice */
   priv = GNC_SEARCH_OWNER_GET_PRIVATE(fe);
   if (type != gncOwnerGetType (&(priv->owner))) {
@@ -216,99 +222,43 @@
 }
 
 static GtkWidget *
-add_type_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-		    GncOwnerType type)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) type);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (type_option_changed),
-		    user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_TYPE_MENU_ITEM(str,tp) { \
-	item = add_type_menu_item (menu, fe, str, tp); \
-	if (type == tp) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_type_menu (GNCSearchCoreType *fe)
 {
   GNCSearchOwner *fi = (GNCSearchOwner *)fe;
   GNCSearchOwnerPrivate *priv;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
   GncOwnerType type;
 
-  menu = gtk_menu_new ();
-
   priv = GNC_SEARCH_OWNER_GET_PRIVATE(fi);
   type = gncOwnerGetType (&(priv->owner));
 
-  ADD_TYPE_MENU_ITEM (_("Customer"), GNC_OWNER_CUSTOMER);
-  first = item;
-  ADD_TYPE_MENU_ITEM (_("Vendor"), GNC_OWNER_VENDOR);
-  ADD_TYPE_MENU_ITEM (_("Employee"), GNC_OWNER_EMPLOYEE);
-  ADD_TYPE_MENU_ITEM (_("Job"), GNC_OWNER_JOB);
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+  gnc_combo_box_search_add(combo, _("Customer"), GNC_OWNER_CUSTOMER);
+  gnc_combo_box_search_add(combo, _("Vendor"), GNC_OWNER_VENDOR);
+  gnc_combo_box_search_add(combo, _("Employee"), GNC_OWNER_EMPLOYEE);
+  gnc_combo_box_search_add(combo, _("Job"), GNC_OWNER_JOB);
 
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
+  g_signal_connect (combo, "changed", G_CALLBACK (type_combo_changed), fe);
+  gnc_combo_box_search_set_active(combo, type);
 
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
+  return GTK_WIDGET(combo);
 
-  return opmenu;
-}
 
-static void
-how_option_changed (GtkWidget *widget, GNCSearchOwner *fe)
-{
-  fe->how = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
 }
 
 static GtkWidget *
-add_how_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       query_compare_t option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (how_option_changed),
-		    user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_HOW_MENU_ITEM(str,op) { \
-	item = add_how_menu_item (menu, fe, str, op); \
-	if (fi->how == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_how_menu (GNCSearchCoreType *fe)
 {
   GNCSearchOwner *fi = (GNCSearchOwner *)fe;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+  gnc_combo_box_search_add(combo, _("is"), GUID_MATCH_ANY);
+  gnc_combo_box_search_add(combo, _("is not"), GUID_MATCH_NONE);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : GUID_MATCH_ANY);
 
-  ADD_HOW_MENU_ITEM (_("is"), GUID_MATCH_ANY);
-  first = item;			/* Force one */
-  ADD_HOW_MENU_ITEM (_("is not"), GUID_MATCH_NONE);
-
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static GtkWidget *

Modified: gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedger.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedger.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedger.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -627,6 +627,7 @@
   gboolean taxable, taxincluded;
   GncTaxTable *table;
   GList *taxes = NULL;
+  int denom = 100;
 
   gnc_entry_ledger_get_numeric (ledger, ENTRY_QTY_CELL, &qty);
   gnc_entry_ledger_get_numeric (ledger, ENTRY_PRIC_CELL, &price);
@@ -670,9 +671,15 @@
     table = NULL;
   }
 
+  if (ledger->invoice)
+  {
+    gnc_commodity *currency = gncInvoiceGetCurrency(ledger->invoice);
+    if (currency)
+      denom = gnc_commodity_get_fraction(currency);
+  }
+
   gncEntryComputeValue (qty, price, (taxable ? table : NULL), taxincluded,
-			discount, disc_type, disc_how,
-			100,  /* XXX -- compute a real denominator */
+			discount, disc_type, disc_how, denom,
 			value, NULL, &taxes);
 
   /* return the tax value */

Modified: gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedgerLoad.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedgerLoad.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-ledger/gncEntryLedgerLoad.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -132,14 +132,15 @@
 
   /* Don't add A/R, A/P, Bank, Cash, or Equity accounts */
   type = xaccAccountGetType (account);
-  if (type == PAYABLE || type == RECEIVABLE ||
-      type == CASH || type == BANK || type == EQUITY)
+  if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE ||
+      type == ACCT_TYPE_CASH || type == ACCT_TYPE_BANK ||
+      type == ACCT_TYPE_EQUITY)
   {
     return TRUE;
   }
 
   /* If this is an ORDER or INVOICE, then leave out the expenses.  */
-  if (type == EXPENSE) return TRUE;
+  if (type == ACCT_TYPE_EXPENSE) return TRUE;
 
   /* Don't add placeholder accounts */
   if (xaccAccountGetPlaceholder (account)) return TRUE;
@@ -154,14 +155,15 @@
 
   /* Don't add A/R, A/P, Bank, Cash, or Equity accounts */
   type = xaccAccountGetType (account);
-  if (type == PAYABLE || type == RECEIVABLE ||
-      type == CASH || type == BANK || type == EQUITY)
+  if (type == ACCT_TYPE_PAYABLE || type == ACCT_TYPE_RECEIVABLE ||
+      type == ACCT_TYPE_CASH || type == ACCT_TYPE_BANK ||
+      type == ACCT_TYPE_EQUITY)
   {
     return TRUE;
   }
 
   /* If this is a BILL, then leave out the incomes */
-  if (type == INCOME) return TRUE;
+  if (type == ACCT_TYPE_INCOME) return TRUE;
 
   /* Don't add placeholder accounts */
   if (xaccAccountGetPlaceholder (account)) return TRUE;
@@ -274,8 +276,6 @@
  */
 void gnc_entry_ledger_load (GncEntryLedger *ledger, GList *entry_list)
 {
-  static SCM id_book = SCM_UNDEFINED;
-
   GncEntry *blank_entry, *find_entry;
   CursorBuffer *cursor_buffer;
   Table *table;
@@ -357,11 +357,8 @@
 	  break;
 	}
 
-	if (id_book == SCM_UNDEFINED)
-	  id_book = scm_c_eval_string ("gnc:id-book");
-
 	/* Compute the proper taxtable */
-	odb = gnc_option_db_new_for_type (id_book);
+	odb = gnc_option_db_new_for_type (GNC_ID_BOOK);
 	gnc_option_db_load_from_kvp (odb, gnc_book_get_slots (ledger->book));
 
 	switch (gncOwnerGetType (owner)) {

Modified: gnucash/branches/register-rewrite/src/business/business-reports/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -14,20 +14,24 @@
 endif
 
 .scm-links:
-	rm -f gnucash report
-	$(LN_S) -f . gnucash
-	$(LN_S) -f ${srcdir} report 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/report
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
+clean-local:
+	$(RM) -rf gnucash
+
 noinst_DATA = .scm-links
 
 EXTRA_DIST = \
   ${gncscmmod_DATA}
 
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/business/business-reports/aging.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/aging.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/aging.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -67,13 +67,13 @@
 
 (define num-buckets 4)
 (define (new-bucket-vector)
-  (make-vector num-buckets (gnc:numeric-zero)))
+  (make-vector num-buckets (gnc-numeric-zero)))
 
 (define make-company-private
   (record-constructor company-info '(currency bucket-vector overpayment owner-obj)))
 
 (define (make-company currency owner-obj)
-  (make-company-private currency (new-bucket-vector) (gnc:numeric-zero) owner-obj))
+  (make-company-private currency (new-bucket-vector) (gnc-numeric-zero) owner-obj))
 
 (define company-get-currency
   (record-accessor company-info 'currency))
@@ -116,11 +116,11 @@
 	      (find-bucket (+ current-bucket 1) bucket-intervals date)))))
 
   (define (calculate-adjusted-values amount overpayment)
-    (if (>= (gnc:numeric-compare amount overpayment) 0)
-	(cons (gnc:numeric-sub-fixed amount overpayment)
-	      (gnc:numeric-zero))
-	(cons (gnc:numeric-zero)
-	      (gnc:numeric-sub-fixed overpayment amount))))
+    (if (>= (gnc-numeric-compare amount overpayment) 0)
+	(cons (gnc-numeric-sub-fixed amount overpayment)
+	      (gnc-numeric-zero))
+	(cons (gnc-numeric-zero)
+	      (gnc-numeric-sub-fixed overpayment amount))))
 
   (let* ((current-overpayment (company-get-overpayment company))
 	 (adjusted-values (calculate-adjusted-values amount current-overpayment))
@@ -129,7 +129,7 @@
 	 (bucket-index (find-bucket 0 bucket-intervals date))
 	 (buckets (company-get-buckets company))
 	 (new-bucket-value 
-	  (gnc:numeric-add-fixed adjusted-amount (vector-ref buckets bucket-index))))
+	  (gnc-numeric-add-fixed adjusted-amount (vector-ref buckets bucket-index))))
     (vector-set! buckets bucket-index new-bucket-value)
     (company-set-buckets company buckets)
     (company-set-overpayment company adjusted-overpayment)))
@@ -144,15 +144,15 @@
     (if (>= current-bucket-index (vector-length buckets))
 	amount
 	(let ((current-bucket-amt (vector-ref buckets current-bucket-index)))
-	  (if (>= (gnc:numeric-compare current-bucket-amt amount) 0)
+	  (if (>= (gnc-numeric-compare current-bucket-amt amount) 0)
 	      (begin
-		(vector-set! buckets current-bucket-index (gnc:numeric-sub-fixed 
+		(vector-set! buckets current-bucket-index (gnc-numeric-sub-fixed
 							   current-bucket-amt amount))
-		(gnc:numeric-zero))
+		(gnc-numeric-zero))
 	      (begin
-		(vector-set! buckets current-bucket-index (gnc:numeric-zero))
+		(vector-set! buckets current-bucket-index (gnc-numeric-zero))
 		(process-payment-driver 
-		 (gnc:numeric-sub-fixed amount current-bucket-amt)
+		 (gnc-numeric-sub-fixed amount current-bucket-amt)
 		 buckets
 		 (+ current-bucket-index 1)))))))
   
@@ -161,8 +161,8 @@
     (gnc:debug "processing payment of " amount)
     (gnc:debug "overpayment was " overpayment)
 
-	(if (gnc:numeric-positive-p overpayment)
-	    (company-set-overpayment company (gnc:numeric-add-fixed overpayment amount))
+	(if (gnc-numeric-positive-p overpayment)
+	    (company-set-overpayment company (gnc-numeric-add-fixed overpayment amount))
 	    
 	    (let ((result (process-payment-driver amount (company-get-buckets company) 0)))
 	      (gnc:debug "payment-driver processed.  new overpayment: " result)
@@ -179,36 +179,36 @@
 			     reverse? show-zeros)
 
   (define (do-update value)
-    (let* ((transaction (gnc:split-get-parent split))
-	   (temp-owner (gnc:owner-create))
+    (let* ((transaction (xaccSplitGetParent split))
+	   (temp-owner (gncOwnerCreate))
 	   (owner (gnc:owner-from-split split temp-owner)))
 
       (if
        owner
-       (let* ((guid (gnc:owner-get-guid owner))
-	      (this-currency (gnc:transaction-get-currency transaction))
-	      (this-date (gnc:transaction-get-date-posted transaction))
+       (let* ((guid (gncOwnerReturnGUID owner))
+	      (this-currency (xaccTransGetCurrency transaction))
+	      (this-date (gnc-transaction-get-date-posted transaction))
 	      (company-info (hash-ref hash guid)))
 
 	 (gnc:debug "update-company-hash called")
 	 (gnc:debug "owner: " owner ", guid: " guid)
 	 (gnc:debug "split-value: " value)
-	 (if reverse? (set! value (gnc:numeric-neg value)))
+	 (if reverse? (set! value (gnc-numeric-neg value)))
 	 (if company-info
 	     ;; if it's an existing company, destroy the temp owner and
 	     ;; then make sure the currencies match
 	     (begin
-	       (gnc:owner-destroy temp-owner)
-	       (if (not (gnc:commodity-equiv?
+	       (gncOwnerDestroy temp-owner)
+	       (if (not (gnc-commodity-equiv
 			 this-currency
 			 (company-get-currency company-info)))
 		   (cons #f (sprintf
 			     (_ "Transactions relating to '%s' contain \
-more than one currency.  This report is not designed to cope with this possibility.")  (gnc:owner-get-name owner)))
+more than one currency.  This report is not designed to cope with this possibility.")  (gncOwnerGetName owner)))
 		   (begin
 		     (gnc:debug "it's an old company")
-		     (if (gnc:numeric-negative-p value)
-			 (process-invoice company-info (gnc:numeric-neg value) bucket-intervals this-date)
+		     (if (gnc-numeric-negative-p value)
+			 (process-invoice company-info (gnc-numeric-neg value) bucket-intervals this-date)
 			 (process-payment company-info value))
 		     (hash-set! hash guid company-info)
 		     (cons #t guid))))
@@ -217,19 +217,19 @@
 	     (begin
 	       (gnc:debug "value" value)
 	       (let ((new-company (make-company this-currency owner)))
-		 (if (gnc:numeric-negative-p value)
-		     (process-invoice new-company (gnc:numeric-neg value) bucket-intervals this-date)
+		 (if (gnc-numeric-negative-p value)
+		     (process-invoice new-company (gnc-numeric-neg value) bucket-intervals this-date)
 		     (process-payment new-company value))
 		 (hash-set! hash guid new-company))
 	       (cons #t guid))))
        ; else (no owner)
-       (gnc:owner-destroy temp-owner))))
+       (gncOwnerDestroy temp-owner))))
   
   ;; figure out if this split is part of a closed lot
   ;; also save the split value...
-  (let* ((lot (gnc:split-get-lot split))
-	 (value (gnc:split-get-value split))
-	 (is-paid? (if (null? lot) #f (gnc:lot-closed? lot))))
+  (let* ((lot (xaccSplitGetLot split))
+	 (value (xaccSplitGetValue split))
+	 (is-paid? (if (null? lot) #f (gnc-lot-is-closed lot))))
 
     ;; if it's closed, then ignore it because it doesn't matter.
     ;; XXX: we _could_ just set the value to 0 in order to list
@@ -240,11 +240,11 @@
 
 ;; get the total debt from the buckets
 (define (buckets-get-total buckets)
-  (let ((running-total (gnc:numeric-zero))
+  (let ((running-total (gnc-numeric-zero))
 	(buckets-list (vector->list buckets)))
     (for-each (lambda (bucket)
 		(set! running-total
-		      (gnc:numeric-add-fixed bucket running-total)))
+		      (gnc-numeric-add-fixed bucket running-total)))
 	      buckets-list)
     running-total))
 
@@ -258,7 +258,7 @@
 	 (bucket-b (company-get-buckets company-b))
 	 (total-a (buckets-get-total bucket-a))
 	 (total-b (buckets-get-total bucket-b))
-	 (difference-sign (gnc:numeric-compare (gnc:numeric-sub-fixed total-a total-b) (gnc:numeric-zero))))
+	 (difference-sign (gnc-numeric-compare (gnc-numeric-sub-fixed total-a total-b) (gnc-numeric-zero))))
 	 ;; if same totals, compare by name
 	 (if (= difference-sign 0)
 	     (gnc:safe-strcmp (car litem-a) (car litem-b))
@@ -270,11 +270,11 @@
   (define (driver buckets-a buckets-b)
     (if (null? buckets-a)
 	0
-	(let ((diff (gnc:numeric-compare 
-		     (gnc:numeric-sub-fixed 
+	(let ((diff (gnc-numeric-compare
+		     (gnc-numeric-sub-fixed
 		      (car buckets-a) 
 		      (car buckets-b)) 
-		     (gnc:numeric-zero))))
+		     (gnc-numeric-zero))))
 	  (if (= diff 0)
 	      (driver (cdr buckets-a) (cdr buckets-b))
 	      diff))))
@@ -304,14 +304,14 @@
     (set! begindate (decdate begindate NinetyDayDelta))	;XXX - 360 days!?!
     (gnc:debug "begindate" begindate)
     (gnc:debug "date" date)
-    (gnc:query-set-book query (gnc:get-current-book))
-    (gnc:query-set-match-non-voids-only! query (gnc:get-current-book))
-    (gnc:query-add-single-account-match query account 'query-and)
-    (gnc:query-add-date-match-timepair query #t begindate #t date 'query-and)
-    (gnc:query-set-sort-order query 
-			      (list gnc:split-trans gnc:trans-date-posted)
+    (qof-query-set-book query (gnc-get-current-book))
+    (gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
+    (xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
+    (xaccQueryAddDateMatchTS query #t begindate #t date QOF-QUERY-AND)
+    (qof-query-set-sort-order query
+			      (list SPLIT-TRANS TRANS-DATE-POSTED)
 			      '() '())
-    (gnc:query-set-sort-increasing query #t #t #t)))
+    (qof-query-set-sort-increasing query #t #t #t)))
      
 
 (define (aging-options-generator options)
@@ -386,7 +386,7 @@
 
   (define (get-name a)
     (let* ((owner (company-get-owner-obj (cdr a))))
-      (gnc:owner-get-name owner)))
+      (gncOwnerGetName owner)))
 
   ;; Predicates for sorting the companys once the data has been collected
 
@@ -472,12 +472,12 @@
 
   ;; convert the buckets in the header data structure 
   (define (convert-to-monetary-list bucket-list currency overpayment)
-    (let* ((running-total (gnc:numeric-neg overpayment))
+    (let* ((running-total (gnc-numeric-neg overpayment))
 	   (monetised-buckets
 	   (map (lambda (bucket-list-entry)
 		  (begin
 		    (set! running-total 
-			  (gnc:numeric-add-fixed running-total bucket-list-entry))
+			  (gnc-numeric-add-fixed running-total bucket-list-entry))
 		  (gnc:make-gnc-monetary currency bucket-list-entry)))
 		(vector->list bucket-list))))
       (append (reverse monetised-buckets) 
@@ -533,7 +533,7 @@
 	(exchange-fn (gnc:case-exchange-fn price-source report-currency report-date))
 	(total-collector-list (make-collector-list))
 	(table (gnc:make-html-table))
-	(query (gnc:malloc-query))
+	(query (qof-query-create-for-splits))
 	(company-list '())
 	(work-done 0)
 	(work-to-do 0)
@@ -546,7 +546,7 @@
     (if account
         (begin
           (gnc:html-document-set-title!
-           document (string-append report-title ": " (gnc:account-get-name account)))
+           document (string-append report-title ": " (xaccAccountGetName account)))
           (gnc:html-document-set-headline! document
                                            (gnc:html-markup
                                             "!" 
@@ -554,7 +554,7 @@
                                             ": "
                                             (gnc:html-markup-anchor
                                              (gnc:account-anchor-text account)
-                                             (gnc:account-get-name account))))))
+                                             (xaccAccountGetName account))))))
 
     (gnc:html-table-set-col-headers! table heading-list)
 				     
@@ -562,7 +562,7 @@
 	(begin
 	  (setup-query query account report-date)
 	  ;; get the appropriate splits
-	  (let ((splits (gnc:query-get-splits query)))
+	  (let ((splits (qof-query-run query)))
 ;	    (gnc:debug "splits" splits)
 
 	    ;; build the table
@@ -602,7 +602,7 @@
 						(cdr company-list-entry))))
 			       (owner (company-get-owner-obj
 				       (cdr company-list-entry)))
-			       (company-name (gnc:owner-get-name owner)))
+			       (company-name (gncOwnerGetName owner)))
 
 			  (add-to-column-totals total-collector-list
 						monetary-list)
@@ -627,7 +627,7 @@
 				    (gnc:owner-anchor-text owner)
 				    company-name))
 				  monetary-list))
-			  (gnc:owner-destroy owner)))			
+			  (gncOwnerDestroy owner)))
 		      company-list)
 
 	    ;; add the totals
@@ -643,10 +643,8 @@
 	(gnc:html-document-add-object!
 	 document
 	 (gnc:make-html-text
-	  (string-append
-	   "No Valid Account Selected.  "
-	   "Click on the Options button and select the account to use."))))
-    (gnc:free-query query)
+	  (_ "No valid account selected.  Click on the Options button and select the account to use."))))
+    (qof-query-destroy query)
     (gnc:report-finished)
     document))
 

Modified: gnucash/branches/register-rewrite/src/business/business-reports/business-reports.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/business-reports.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/business-reports.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -28,74 +28,72 @@
 (gnc:module-load "gnucash/report/standard-reports" 0)
 (gnc:module-load "gnucash/business-utils" 0)
 
-;; this defines gnc:url-type-ownerreport and pulls in gnome-utils
-;; to define gnc:html-build-url
+;; this defines URL-TYPE-OWNERREPORT and pulls in gnome-utils
+;; to define gnc-build-url
 (gnc:module-load "gnucash/business-gnome" 0)
 
 (define gnc:menuname-business-reports (N_ "_Business"))
 
 (define (guid-ref idstr type guid)
-  (gnc:html-build-url type (string-append idstr guid) #f))
+  (gnc-build-url type (string-append idstr guid) ""))
 
 (define (gnc:customer-anchor-text customer)
-  (guid-ref "customer=" gnc:url-type-customer (gnc:customer-get-guid customer)))
+  (guid-ref "customer=" URL-TYPE-CUSTOMER (gncCustomerReturnGUID customer)))
 
 (define (gnc:job-anchor-text job)
-  (guid-ref "job=" gnc:url-type-job (gnc:job-get-guid job)))
+  (guid-ref "job=" URL-TYPE-JOB (gncJobReturnGUID job)))
 
 (define (gnc:vendor-anchor-text vendor)
-  (guid-ref "vendor=" gnc:url-type-vendor (gnc:vendor-get-guid vendor)))
+  (guid-ref "vendor=" URL-TYPE-VENDOR (gncVendorReturnGUID vendor)))
 
 (define (gnc:employee-anchor-text employee)
-  (guid-ref "employee=" gnc:url-type-employee (gnc:employee-get-guid employee)))
+  (guid-ref "employee=" URL-TYPE-EMPLOYEE (gncEmployeeReturnGUID employee)))
 
 (define (gnc:invoice-anchor-text invoice)
-  (guid-ref "invoice=" gnc:url-type-invoice (gnc:invoice-get-guid invoice)))
+  (guid-ref "invoice=" URL-TYPE-INVOICE (gncInvoiceReturnGUID invoice)))
 
 (define (gnc:owner-anchor-text owner)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type (gnc:owner-get-end-owner owner)) #f)))
-    (case type
-      ((gnc-owner-customer)
-       (gnc:customer-anchor-text (gnc:owner-get-customer owner)))
+  (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
+    (cond
+      ((eqv? type GNC-OWNER-CUSTOMER)
+       (gnc:customer-anchor-text (gncOwnerGetCustomer owner)))
 
-      ((gnc-owner-vendor)
-       (gnc:vendor-anchor-text (gnc:owner-get-vendor owner)))
+      ((eqv? type GNC-OWNER-VENDOR)
+       (gnc:vendor-anchor-text (gncOwnerGetVendor owner)))
 
-      ((gnc-owner-employee)
-       (gnc:employee-anchor-text (gnc:owner-get-employee owner)))
+      ((eqv? type GNC-OWNER-EMPLOYEE)
+       (gnc:employee-anchor-text (gncOwnerGetEmployee owner)))
 
-      ((gnc-owner-job)
-       (gnc:job-anchor-text (gnc:owner-get-job owner)))
+      ((eqv? type GNC-OWNER-JOB)
+       (gnc:job-anchor-text (gncOwnerGetJob owner)))
 
       (else
        ""))))
 
 (define (gnc:owner-report-text owner acc)
-  (let* ((end-owner (gnc:owner-get-end-owner owner))
-	 (type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type end-owner) #f))
+  (let* ((end-owner (gncOwnerGetEndOwner owner))
+	 (type (gncOwnerGetType end-owner))
 	 (ref #f))
 
-    (case type
-      ((gnc-owner-customer)
+    (cond
+      ((eqv? type GNC-OWNER-CUSTOMER)
        (set! ref "owner=c:"))
 
-      ((gnc-owner-vendor)
+      ((eqv? type GNC-OWNER-VENDOR)
        (set! ref "owner=v:"))
 
-      ((gnc-owner-employee)
+      ((eqv? type GNC-OWNER-EMPLOYEE)
        (set! ref "owner=e:"))
 
       (else (set! ref "unknown-type=")))
 
     (if ref
 	(begin
-	  (set! ref (string-append ref (gnc:owner-get-guid end-owner)))
+	  (set! ref (string-append ref (gncOwnerReturnGUID end-owner)))
 	  (if acc
 	      (set! ref (string-append ref "&acct="
-				       (gnc:account-get-guid acc))))
-	  (gnc:html-build-url gnc:url-type-ownerreport ref #f))
+				       (gncAccountGetGUID acc))))
+	  (gnc-build-url URL-TYPE-OWNERREPORT ref ""))
 	ref)))
 
 (export gnc:menuname-business-reports)

Modified: gnucash/branches/register-rewrite/src/business/business-reports/easy-invoice.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/easy-invoice.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/easy-invoice.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -142,7 +142,7 @@
 	    (val (cdr item))
 	    (ref (hash-ref hash acct)))
 
-       (hash-set! hash acct (if ref (gnc:numeric-add-fixed ref val) val))))
+       (hash-set! hash acct (if ref (gnc-numeric-add-fixed ref val) val))))
    values))
 
 
@@ -167,54 +167,54 @@
   (let* ((row-contents '())
 	 (entry-value (gnc:make-gnc-monetary
 		       currency
-		       (gnc:entry-get-value entry invoice?)))
+		       (gncEntryReturnValue entry invoice?)))
 	 (entry-tax-value (gnc:make-gnc-monetary
 			   currency
-			   (gnc:entry-get-tax-value entry invoice?))))
+			   (gncEntryReturnTaxValue entry invoice?))))
 
     (if (date-col column-vector)
         (addto! row-contents
-                (gnc:print-date (gnc:entry-get-date entry))))
+                (gnc-print-date (gncEntryGetDate entry))))
 
     (if (description-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-description entry)))
+		(gncEntryGetDescription entry)))
 
     (if (action-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-action entry)))
+		(gncEntryGetAction entry)))
 
     (if (quantity-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
-		 (gnc:entry-get-quantity entry))))
+		 (gncEntryGetQuantity entry))))
 
     (if (price-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
 		 (gnc:make-gnc-monetary
-		  currency (if invoice? (gnc:entry-get-inv-price entry)
-			       (gnc:entry-get-bill-price entry))))))
+		  currency (if invoice? (gncEntryGetInvPrice entry)
+			       (gncEntryGetBillPrice entry))))))
 
     (if (discount-col column-vector)
 	(addto! row-contents
 		(if invoice?
 		    (gnc:make-html-table-cell/markup
 		     "number-cell"
-		     (monetary-or-percent (gnc:entry-get-inv-discount entry)
+		     (monetary-or-percent (gncEntryGetInvDiscount entry)
 					  currency
-					  (gnc:entry-get-inv-discount-type entry)))
+					  (gncEntryGetInvDiscountType entry)))
 		    "")))
 
     (if (tax-col column-vector)
 	(addto! row-contents
 		(if (if invoice?
-			(and (gnc:entry-get-inv-taxable entry)
-			     (gnc:entry-get-inv-tax-table entry))
-			(and (gnc:entry-get-bill-taxable entry)
-			     (gnc:entry-get-bill-tax-table entry)))
+			(and (gncEntryGetInvTaxable entry)
+			     (gncEntryGetInvTaxTable entry))
+			(and (gncEntryGetBillTaxable entry)
+			     (gncEntryGetBillTaxTable entry)))
 		    ;; This "T" is supposed to be an abbrev. for Tax?
 		    (_ "T") "")))
 
@@ -244,7 +244,7 @@
 
   (gnc:register-inv-option
    (gnc:make-invoice-option invoice-page invoice-name "x" ""
-			    (lambda () #f) #f))
+			    (lambda () '()) #f))
 
   (gnc:register-inv-option
    (gnc:make-simple-boolean-option
@@ -376,9 +376,9 @@
 
   (let ((show-payments (opt-val "Display" "Payments"))
 	(display-all-taxes (opt-val "Display" "Individual Taxes"))
-	(lot (gnc:invoice-get-posted-lot invoice))
-	(txn (gnc:invoice-get-posted-txn invoice))
-	(currency (gnc:invoice-get-currency invoice)))
+	(lot (gncInvoiceGetPostedLot invoice))
+	(txn (gncInvoiceGetPostedTxn invoice))
+	(currency (gncInvoiceGetCurrency invoice)))
 
     (define (colspan monetary used-columns)
       (cond
@@ -391,7 +391,7 @@
 	  monetary
 	  (let ((amt (gnc:gnc-monetary-amount monetary)))
 	    (if amt
-		(if (gnc:numeric-negative-p amt)
+		(if (gnc-numeric-negative-p amt)
 		    (gnc:monetary-neg monetary)
 		    monetary)
 		monetary))))
@@ -415,10 +415,10 @@
 		  currency-totals)))
 
     (define (add-payment-row table used-columns split total-collector)
-      (let* ((t (gnc:split-get-parent split))
-	     (currency (gnc:transaction-get-currency t))
+      (let* ((t (xaccSplitGetParent split))
+	     (currency (xaccTransGetCurrency t))
 	     ;; XXX Need to know when to reverse the value
-	     (amt (gnc:make-gnc-monetary currency (gnc:split-get-value split)))
+	     (amt (gnc:make-gnc-monetary currency (xaccSplitGetValue split)))
 	     (payment-style "grand-total")
 	     (row '()))
 	
@@ -428,7 +428,7 @@
 
 	(if (date-col used-columns)
 	    (addto! row
-		    (gnc:print-date (gnc:transaction-get-date-posted t))))
+		    (gnc-print-date (gnc-transaction-get-date-posted t))))
 
 	(if (description-col used-columns)
 	    (addto! row (_ "Payment, thank you")))
@@ -462,8 +462,8 @@
 		(hash-for-each
 		 (lambda (acct value)
 		   (let ((collector (gnc:make-commodity-collector))
-			 (commodity (gnc:account-get-commodity acct))
-			 (name (gnc:account-get-name acct)))
+			 (commodity (xaccAccountGetCommodity acct))
+			 (name (xaccAccountGetName acct)))
 		     (collector 'add commodity value)
 		     (add-subtotal-row table used-columns collector
 				       "grand-total" name)))
@@ -475,14 +475,14 @@
 
 	    (if (and show-payments lot)
 		(let ((splits (sort-list!
-			       (gnc:lot-get-splits lot)
+			       (gnc-lot-get-split-list lot)
 			       (lambda (s1 s2)
-				 (let ((t1 (gnc:split-get-parent s1))
-				       (t2 (gnc:split-get-parent s2)))
-				   (< (gnc:transaction-order t1 t2) 0))))))
+				 (let ((t1 (xaccSplitGetParent s1))
+				       (t2 (xaccSplitGetParent s2)))
+				   (< (xaccTransOrder t1 t2) 0))))))
 		  (for-each
 		   (lambda (split)
-		     (if (not (equal? (gnc:split-get-parent split) txn))
+		     (if (not (equal? (xaccSplitGetParent split) txn))
 			 (add-payment-row table used-columns
 					  split total-collector)))
 		   splits)))
@@ -506,7 +506,7 @@
 					      invoice?)))
 
 	    (if display-all-taxes
-		(let ((tax-list (gnc:entry-get-tax-values current invoice?)))
+		(let ((tax-list (gncEntryReturnTaxValues current invoice?)))
 		  (update-account-hash acct-hash tax-list))
 		(tax-collector 'add
 			       (gnc:gnc-monetary-commodity (cdr entry-values))
@@ -539,7 +539,7 @@
     (let* ((table (gnc:make-html-table))
 	   (used-columns (build-column-used options))
 	   (width (num-columns-required used-columns))
-	   (entries (gnc:invoice-get-entries invoice))
+	   (entries (gncInvoiceGetEntries invoice))
 	   (totals (gnc:make-commodity-collector)))
 
       (gnc:html-table-set-col-headers!
@@ -591,7 +591,7 @@
      (list "<br>"))
     (for-each
      (lambda (order)
-       (let* ((reference (gnc:order-get-reference order)))
+       (let* ((reference (gncOrderGetReference order)))
 	 (if (and reference (> (string-length reference) 0))
 	     (gnc:html-table-append-row!
 	      table
@@ -609,7 +609,7 @@
    table
    (list
     (string-append label ":&nbsp;")
-    (string-expand (gnc:print-date date) #\space "&nbsp;"))))
+    (string-expand (gnc-print-date date) #\space "&nbsp;"))))
 
 (define (make-date-table)
   (let ((table (gnc:make-html-table)))
@@ -624,11 +624,11 @@
 
 (define (make-myname-table book)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*)))))
 
@@ -674,7 +674,7 @@
 	 (table '())
 	 (orders '())
 	 (invoice (opt-val invoice-page invoice-name))
-	 (owner #f)
+	 (owner '())
 	 (references? (opt-val "Display" "References"))
 	 (title (_ "Invoice"))
 	 (invoice? #f))
@@ -685,19 +685,18 @@
 
     (if invoice
 	(begin
-	  (set! owner (gnc:invoice-get-owner invoice))
-	  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-		       (gnc:owner-get-type 
-			(gnc:owner-get-end-owner owner)) #f)))
-	    (case type
-	      ((gnc-owner-customer)
+	  (set! owner (gncInvoiceGetOwner invoice))
+	  (let ((type (gncOwnerGetType
+			(gncOwnerGetEndOwner owner))))
+	    (cond
+	      ((eqv? type GNC-OWNER-CUSTOMER)
 	       (set! invoice? #t))
-	      ((gnc-owner-vendor)
+	      ((eqv? type GNC-OWNER-VENDOR)
 	       (set! title (_ "Bill")))
-	      ((gnc-owner-employee)
+	      ((eqv? type GNC-OWNER-EMPLOYEE)
 	       (set! title (_ "Expense Voucher")))))
 	  (set! title (sprintf #f (_"%s #%d") title
-			       (gnc:invoice-get-id invoice)))))
+			       (gncInvoiceGetID invoice)))))
 
 ;    (gnc:html-document-set-title! document title)
 
@@ -715,14 +714,14 @@
         (add-html! document "<td align='left'>")
         (add-html! document "<b><u>")
 	(add-html! document (sprintf #f (_ "Invoice #%d")
-				     (gnc:invoice-get-id invoice)))
+				     (gncInvoiceGetID invoice)))
         (add-html! document "</u></b></td>")
         (add-html! document "<td align='right'>")
 
         (if (opt-val "Display" "My Company ID")
-          (let* ((book (gnc:invoice-get-book invoice))
-                 (slots (gnc:book-get-slots book))
-	         (taxid (gnc:kvp-frame-get-slot-path
+          (let* ((book (gncInvoiceGetBook invoice))
+                 (slots (gnc-book-get-slots book))
+	         (taxid (kvp-frame-get-slot-path-gslist
 		    slots (append gnc:*kvp-option-path*
 		                  (list gnc:*business-label* gnc:*company-id*)))))
                  (if (and taxid (> (string-length taxid) 0))
@@ -738,7 +737,7 @@
         (make-break! document)
 
         ; add the client and company name table
-	(let ((book (gnc:invoice-get-book invoice)))
+	(let ((book (gncInvoiceGetBook invoice)))
 	  (set! table (make-entry-table invoice
 					(gnc:report-options report-obj)
 					add-order invoice?))
@@ -760,9 +759,8 @@
         )
 
         ; add the date
-        (let ((date-table #f)
-              (post-date (gnc:invoice-get-date-posted invoice))
-              (due-date (gnc:invoice-get-date-due invoice)))
+        (let ((post-date (gncInvoiceGetDatePosted invoice))
+              (due-date (gncInvoiceGetDateDue invoice)))
           (if (not (equal? post-date (cons 0 0)))
             (begin
               (add-html! document "<table border=0><tr>")
@@ -770,7 +768,7 @@
               (add-html! document "Date: ")
               (add-html! document "</td>")
               (add-html! document "<td>")
-              (add-html! document (gnc:print-date post-date))
+              (add-html! document (gnc-print-date post-date))
               (add-html! document "</td>")
               (if (opt-val "Display" "Due Date")
                 (begin
@@ -778,7 +776,7 @@
                   (add-html! document "Due: ")
                   (add-html! document "</td>")
                   (add-html! document "<td>")
-                  (add-html! document (gnc:print-date due-date))
+                  (add-html! document (gnc-print-date due-date))
                   (add-html! document "</td>")))
               (add-html! document "</tr></table>"))
             (add-html! document 
@@ -791,7 +789,7 @@
         (make-break! document)
 
         (if (opt-val "Display" "Billing ID")
-          (let ((billing-id (gnc:invoice-get-billing-id invoice)))
+          (let ((billing-id (gncInvoiceGetBillingID invoice)))
             (if (and billing-id (> (string-length billing-id) 0))
               (begin
                 (gnc:html-document-add-object!
@@ -803,8 +801,8 @@
                 (make-break! document)))))
 
         (if (opt-val "Display" "Billing Terms")
-          (let* ((term (gnc:invoice-get-terms invoice))
-            (terms (gnc:bill-term-get-description term)))
+          (let* ((term (gncInvoiceGetTerms invoice))
+            (terms (gncBillTermGetDescription term)))
             (if (and terms (> (string-length terms) 0))
               (gnc:html-document-add-object!
                 document
@@ -829,7 +827,7 @@
 
 	(if (opt-val "Display" "Invoice Notes")
           (begin
-            (let ((notes (gnc:invoice-get-notes invoice)))
+            (let ((notes (gncInvoiceGetNotes invoice)))
               (gnc:html-document-add-object!
                document
                (gnc:make-html-text

Modified: gnucash/branches/register-rewrite/src/business/business-reports/fancy-invoice.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/fancy-invoice.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/fancy-invoice.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -160,7 +160,7 @@
 	    (val (cdr item))
 	    (ref (hash-ref hash acct)))
 
-       (hash-set! hash acct (if ref (gnc:numeric-add-fixed ref val) val))))
+       (hash-set! hash acct (if ref (gnc-numeric-add-fixed ref val) val))))
    values))
 
 (define (monetary-or-percent numeric currency entry-type)
@@ -173,54 +173,54 @@
   (let* ((row-contents '())
 	 (entry-value (gnc:make-gnc-monetary
 		       currency
-		       (gnc:entry-get-value entry invoice?)))
+		       (gncEntryReturnValue entry invoice?)))
 	 (entry-tax-value (gnc:make-gnc-monetary
 			   currency
-			   (gnc:entry-get-tax-value entry invoice?))))
+			   (gncEntryReturnTaxValue entry invoice?))))
 
     (if (date-col column-vector)
         (addto! row-contents
-                (gnc:print-date (gnc:entry-get-date entry))))
+                (gnc-print-date (gncEntryGetDate entry))))
 
     (if (description-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-description entry)))
+		(gncEntryGetDescription entry)))
 
     (if (action-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-action entry)))
+		(gncEntryGetAction entry)))
 
     (if (quantity-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
-		 (gnc:entry-get-quantity entry))))
+		 (gncEntryGetQuantity entry))))
 
     (if (price-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
 		 (gnc:make-gnc-monetary
-		  currency (if invoice? (gnc:entry-get-inv-price entry)
-			       (gnc:entry-get-bill-price entry))))))
+		  currency (if invoice? (gncEntryGetInvPrice entry)
+			       (gncEntryGetBillPrice entry))))))
 
     (if (discount-col column-vector)
 	(addto! row-contents
 		(if invoice?
 		    (gnc:make-html-table-cell/markup
 		     "number-cell"
-		     (monetary-or-percent (gnc:entry-get-inv-discount entry)
+		     (monetary-or-percent (gncEntryGetInvDiscount entry)
 					  currency
-					  (gnc:entry-get-inv-discount-type entry)))
+					  (gncEntryGetInvDiscountType entry)))
 		    "")))
 
     (if (tax-col column-vector)
 	(addto! row-contents
 		(if (if invoice?
-			(and (gnc:entry-get-inv-taxable entry)
-			     (gnc:entry-get-inv-tax-table entry))
-			(and (gnc:entry-get-bill-taxable entry)
-			     (gnc:entry-get-bill-tax-table entry)))
+			(and (gncEntryGetInvTaxable entry)
+			     (gncEntryGetInvTaxTable entry))
+			(and (gncEntryGetBillTaxable entry)
+			     (gncEntryGetBillTaxTable entry)))
 		    (_ "T") "")))
 
     (if (taxvalue-col column-vector)
@@ -251,7 +251,7 @@
 
   (gnc:register-inv-option
    (gnc:make-invoice-option invoice-page invoice-name "x" ""
-			    (lambda () #f) #f))
+			    (lambda () '()) #f))
 
   (gnc:register-inv-option
    (gnc:make-simple-boolean-option
@@ -349,7 +349,7 @@
    (gnc:make-complex-boolean-option
     (N_ "Display") (N_ "Payable to")
      "ua1" (N_ "Display the Payable to: information") #t #f
-     (lambda (x) (gnc:option-db-set-option-selectable-by-name
+     (lambda (x) (gnc-option-db-set-option-selectable-by-name
 		  gnc:*report-options* "Display" "Payable to string" x))))
 
   (gnc:register-inv-option
@@ -362,7 +362,7 @@
    (gnc:make-complex-boolean-option
     (N_ "Display") (N_ "Company contact")
      "ub1" (N_ "Display the Company contact information") #t #f
-     (lambda (x) (gnc:option-db-set-option-selectable-by-name
+     (lambda (x) (gnc-option-db-set-option-selectable-by-name
 		  gnc:*report-options* "Display" "Company contact string" x))))
 
   (gnc:register-inv-option
@@ -389,9 +389,9 @@
 
   (let ((show-payments (opt-val "Display" "Payments"))
 	(display-all-taxes (opt-val "Display" "Individual Taxes"))
-	(lot (gnc:invoice-get-posted-lot invoice))
-	(txn (gnc:invoice-get-posted-txn invoice))
-	(currency (gnc:invoice-get-currency invoice))
+	(lot (gncInvoiceGetPostedLot invoice))
+	(txn (gncInvoiceGetPostedTxn invoice))
+	(currency (gncInvoiceGetCurrency invoice))
 	(entries-added 0))
 
     (define (colspan monetary used-columns)
@@ -405,7 +405,7 @@
 	  monetary
 	  (let ((amt (gnc:gnc-monetary-amount monetary)))
 	    (if amt
-		(if (gnc:numeric-negative-p amt)
+		(if (gnc-numeric-negative-p amt)
 		    (gnc:monetary-neg monetary)
 		    monetary)
 		monetary))))
@@ -432,10 +432,10 @@
 		  currency-totals)))
 
     (define (add-payment-row table used-columns split total-collector)
-      (let* ((t (gnc:split-get-parent split))
-	     (currency (gnc:transaction-get-currency t))
+      (let* ((t (xaccSplitGetParent split))
+	     (currency (xaccTransGetCurrency t))
 	     ;; XXX Need to know when to reverse the value
-	     (amt (gnc:make-gnc-monetary currency (gnc:split-get-value split)))
+	     (amt (gnc:make-gnc-monetary currency (xaccSplitGetValue split)))
 	     (payment-style "grand-total")
 	     (row '()))
 	
@@ -445,7 +445,7 @@
 
 	(if (date-col used-columns)
 	    (addto! row
-		    (gnc:print-date (gnc:transaction-get-date-posted t))))
+		    (gnc-print-date (gnc-transaction-get-date-posted t))))
 
 	(if (description-col used-columns)
 	    (addto! row (_ "Payment, thank you")))
@@ -488,8 +488,8 @@
 		(hash-for-each
 		 (lambda (acct value)
 		   (let ((collector (gnc:make-commodity-collector))
-			 (commodity (gnc:account-get-commodity acct))
-			 (name (gnc:account-get-name acct)))
+			 (commodity (xaccAccountGetCommodity acct))
+			 (name (xaccAccountGetName acct)))
 		     (collector 'add commodity value)
 		     (add-subtotal-row table used-columns collector
 				       "grand-total" (string-expand
@@ -502,14 +502,14 @@
 
 	    (if (and show-payments lot)
 		(let ((splits (sort-list!
-			       (gnc:lot-get-splits lot)
+			       (gnc-lot-get-split-list lot)
 			       (lambda (s1 s2)
-				 (let ((t1 (gnc:split-get-parent s1))
-				       (t2 (gnc:split-get-parent s2)))
-				   (< (gnc:transaction-order t1 t2) 0))))))
+				 (let ((t1 (xaccSplitGetParent s1))
+				       (t2 (xaccSplitGetParent s2)))
+				   (< (xaccTransOrder t1 t2) 0))))))
 		  (for-each
 		   (lambda (split)
-		     (if (not (equal? (gnc:split-get-parent split) txn))
+		     (if (not (equal? (xaccSplitGetParent split) txn))
 			 (add-payment-row table used-columns
 					  split total-collector)))
 		   splits)))
@@ -534,7 +534,7 @@
 					      invoice?)))
 
 	    (if display-all-taxes
-		(let ((tax-list (gnc:entry-get-tax-values current invoice?)))
+		(let ((tax-list (gncEntryReturnTaxValues current invoice?)))
 		  (update-account-hash acct-hash tax-list))
 		(tax-collector 'add
 			       (gnc:gnc-monetary-commodity (cdr entry-values))
@@ -569,7 +569,7 @@
     (let* ((table (gnc:make-html-table))
 	   (used-columns (build-column-used options))
 	   (width (num-columns-required used-columns))
-	   (entries (gnc:invoice-get-entries invoice))
+	   (entries (gncInvoiceGetEntries invoice))
 	   (totals (gnc:make-commodity-collector)))
 
       (gnc:html-table-set-col-headers!
@@ -628,7 +628,7 @@
      (list "<br>"))
     (for-each
      (lambda (order)
-       (let* ((reference (gnc:order-get-reference order)))
+       (let* ((reference (gncOrderGetReference order)))
 	 (if (and reference (> (string-length reference) 0))
 	     (gnc:html-table-append-row!
 	      table
@@ -649,7 +649,7 @@
     ;; for the invoice date/due date fields
     ;; I could have taken the format from the report options, but... ;)
     (string-expand (strftime "%B %e, %Y" (localtime (car date))) #\space "&nbsp;")
-    ;;(string-expand (gnc:print-date date) #\space "&nbsp;")
+    ;;(string-expand (gnc-print-date date) #\space "&nbsp;")
     )))
 
 (define (make-date-table)
@@ -665,26 +665,26 @@
 
 (define (make-myname-table book date-format)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-;;	 (contact (gnc:kvp-frame-get-slot-path
+;;	 (contact (kvp-frame-get-slot-path-gslist
 ;;		slots (append gnc:*kvp-option-path*
 ;;			      (list gnc:*business-label* gnc:*company-contact*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*))))
-	 (id (gnc:kvp-frame-get-slot-path
+	 (id (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-id*))))
-	 (phone (gnc:kvp-frame-get-slot-path
+	 (phone (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-phone*))))
-	 (fax (gnc:kvp-frame-get-slot-path
+	 (fax (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-fax*))))
-	 (url (gnc:kvp-frame-get-slot-path
+	 (url (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-url*))))
 	 (invoice-cell (gnc:make-html-table-cell))
@@ -757,7 +757,7 @@
 	 (table '())
 	 (orders '())
 	 (invoice (opt-val invoice-page invoice-name))
-	 (owner #f)
+	 (owner '())
 	 (references? (opt-val "Display" "References"))
 	 (title (_ "Invoice"))
 	 (invoice? #f))
@@ -768,26 +768,25 @@
 
     (if invoice
 	(begin
-	  (set! owner (gnc:invoice-get-owner invoice))
-	  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-		       (gnc:owner-get-type 
-			(gnc:owner-get-end-owner owner)) #f)))
-	    (case type
-	      ((gnc-owner-customer)
+	  (set! owner (gncInvoiceGetOwner invoice))
+	  (let ((type (gncOwnerGetType
+                       (gncOwnerGetEndOwner owner))))
+	    (cond
+	      ((eqv? type GNC-OWNER-CUSTOMER)
 	       (set! invoice? #t))
-	      ((gnc-owner-vendor)
+	      ((eqv? type GNC-OWNER-VENDOR)
 	       (set! title (_ "Bill")))
-	      ((gnc-owner-employee)
+	      ((eqv? type GNC-OWNER-EMPLOYEE)
 	       (set! title (_ "Expense Voucher")))))
 	  (set! title (sprintf #f (_"%s #%d") title
-			       (gnc:invoice-get-id invoice)))))
+			       (gncInvoiceGetID invoice)))))
     ;; oli-custom - title redundant, "Invoice" moved to myname-table,
     ;; invoice number moved below
     ;;(gnc:html-document-set-title! document title)
 
     (if invoice
-	(let* ((book (gnc:invoice-get-book invoice))
-	      (slots (gnc:book-get-slots book))
+	(let* ((book (gncInvoiceGetBook invoice))
+	      (slots (gnc-book-get-slots book))
 	      (date-object #f)
 	      (helper-table (gnc:make-html-table)))
 	  (set! table (make-entry-table invoice
@@ -835,8 +834,8 @@
 	   'attribute (list "width" "100%"))
 
 	  (set! date-object (let ((date-table #f)
-		(post-date (gnc:invoice-get-date-posted invoice))
-		(due-date (gnc:invoice-get-date-due invoice)))
+		(post-date (gncInvoiceGetDatePosted invoice))
+		(due-date (gncInvoiceGetDateDue invoice)))
 
 	    (if (not (equal? post-date (cons 0 0)))
 		(begin
@@ -844,7 +843,7 @@
 		  ;; oli-custom - moved invoice number here
 		  (gnc:html-table-append-row!
 		   date-table (list (sprintf #f (_ "Invoice&nbsp;#&nbsp;%d")
-                                             (gnc:invoice-get-id invoice))))
+                                             (gncInvoiceGetID invoice))))
 		  (make-date-row! date-table (_ "Invoice&nbsp;Date") post-date)
 		  (make-date-row! date-table (_ "Due&nbsp;Date") due-date)
 		  date-table)
@@ -876,7 +875,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Billing ID")
-	      (let ((billing-id (gnc:invoice-get-billing-id invoice)))
+	      (let ((billing-id (gncInvoiceGetBillingID invoice)))
 		(if (and billing-id (> (string-length billing-id) 0))
 		    (begin
 		      (gnc:html-document-add-object!
@@ -888,8 +887,8 @@
 		      (make-break! document)))))
 
 	  (if (opt-val "Display" "Billing Terms")
-	      (let* ((term (gnc:invoice-get-terms invoice))
-		     (terms (gnc:bill-term-get-description term)))
+	      (let* ((term (gncInvoiceGetTerms invoice))
+		     (terms (gncBillTermGetDescription term)))
 		(if (and terms (> (string-length terms) 0))
 		    (gnc:html-document-add-object!
 		     document
@@ -906,7 +905,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Invoice Notes")
-	      (let ((notes (gnc:invoice-get-notes invoice)))
+	      (let ((notes (gncInvoiceGetNotes invoice)))
 		(gnc:html-document-add-object!
 		 document
 		 (gnc:make-html-text
@@ -915,7 +914,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Payable to")
-	      (let* ((name (gnc:kvp-frame-get-slot-path
+	      (let* ((name (kvp-frame-get-slot-path-gslist
 			    slots (append gnc:*kvp-option-path*
 					  (list gnc:*business-label*
 						gnc:*company-name*))))
@@ -930,7 +929,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Company contact")
-	      (let* ((contact (gnc:kvp-frame-get-slot-path
+	      (let* ((contact (kvp-frame-get-slot-path-gslist
 			       slots (append gnc:*kvp-option-path*
 					     (list gnc:*business-label*
 						   gnc:*company-contact*))))

Modified: gnucash/branches/register-rewrite/src/business/business-reports/invoice.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/invoice.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/invoice.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -136,7 +136,7 @@
 	    (val (cdr item))
 	    (ref (hash-ref hash acct)))
 
-       (hash-set! hash acct (if ref (gnc:numeric-add-fixed ref val) val))))
+       (hash-set! hash acct (if ref (gnc-numeric-add-fixed ref val) val))))
    values))
 
 
@@ -161,54 +161,54 @@
   (let* ((row-contents '())
 	 (entry-value (gnc:make-gnc-monetary
 		       currency
-		       (gnc:entry-get-value entry invoice?)))
+		       (gncEntryReturnValue entry invoice?)))
 	 (entry-tax-value (gnc:make-gnc-monetary
 			   currency
-			   (gnc:entry-get-tax-value entry invoice?))))
+			   (gncEntryReturnTaxValue entry invoice?))))
 
     (if (date-col column-vector)
         (addto! row-contents
-                (gnc:print-date (gnc:entry-get-date entry))))
+                (gnc-print-date (gncEntryGetDate entry))))
 
     (if (description-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-description entry)))
+		(gncEntryGetDescription entry)))
 
     (if (action-col column-vector)
         (addto! row-contents
-		(gnc:entry-get-action entry)))
+		(gncEntryGetAction entry)))
 
     (if (quantity-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
-		 (gnc:entry-get-quantity entry))))
+		 (gncEntryGetQuantity entry))))
 
     (if (price-col column-vector)
 	(addto! row-contents
 		(gnc:make-html-table-cell/markup
 		 "number-cell"
 		 (gnc:make-gnc-monetary
-		  currency (if invoice? (gnc:entry-get-inv-price entry)
-			       (gnc:entry-get-bill-price entry))))))
+		  currency (if invoice? (gncEntryGetInvPrice entry)
+			       (gncEntryGetBillPrice entry))))))
 
     (if (discount-col column-vector)
 	(addto! row-contents
 		(if invoice?
 		    (gnc:make-html-table-cell/markup
 		     "number-cell"
-		     (monetary-or-percent (gnc:entry-get-inv-discount entry)
+		     (monetary-or-percent (gncEntryGetInvDiscount entry)
 					  currency
-					  (gnc:entry-get-inv-discount-type entry)))
+					  (gncEntryGetInvDiscountType entry)))
 		    "")))
 
     (if (tax-col column-vector)
 	(addto! row-contents
 		(if (if invoice?
-			(and (gnc:entry-get-inv-taxable entry)
-			     (gnc:entry-get-inv-tax-table entry))
-			(and (gnc:entry-get-bill-taxable entry)
-			     (gnc:entry-get-bill-tax-table entry)))
+			(and (gncEntryGetInvTaxable entry)
+			     (gncEntryGetInvTaxTable entry))
+			(and (gncEntryGetBillTaxable entry)
+			     (gncEntryGetBillTaxTable entry)))
 		    (_ "T") "")))
 
     (if (taxvalue-col column-vector)
@@ -237,7 +237,7 @@
 
   (gnc:register-inv-option
    (gnc:make-invoice-option invoice-page invoice-name "x" ""
-			    (lambda () #f) #f))
+			    (lambda () '()) #f))
 
   (gnc:register-inv-option
    (gnc:make-simple-boolean-option
@@ -342,9 +342,9 @@
 
   (let ((show-payments (opt-val "Display" "Payments"))
 	(display-all-taxes (opt-val "Display" "Individual Taxes"))
-	(lot (gnc:invoice-get-posted-lot invoice))
-	(txn (gnc:invoice-get-posted-txn invoice))
-	(currency (gnc:invoice-get-currency invoice)))
+	(lot (gncInvoiceGetPostedLot invoice))
+	(txn (gncInvoiceGetPostedTxn invoice))
+	(currency (gncInvoiceGetCurrency invoice)))
 
     (define (colspan monetary used-columns)
       (cond
@@ -357,7 +357,7 @@
 	  monetary
 	  (let ((amt (gnc:gnc-monetary-amount monetary)))
 	    (if amt
-		(if (gnc:numeric-negative-p amt)
+		(if (gnc-numeric-negative-p amt)
 		    (gnc:monetary-neg monetary)
 		    monetary)
 		monetary))))
@@ -381,10 +381,10 @@
 		  currency-totals)))
 
     (define (add-payment-row table used-columns split total-collector)
-      (let* ((t (gnc:split-get-parent split))
-	     (currency (gnc:transaction-get-currency t))
+      (let* ((t (xaccSplitGetParent split))
+	     (currency (xaccTransGetCurrency t))
 	     ;; XXX Need to know when to reverse the value
-	     (amt (gnc:make-gnc-monetary currency (gnc:split-get-value split)))
+	     (amt (gnc:make-gnc-monetary currency (xaccSplitGetValue split)))
 	     (payment-style "grand-total")
 	     (row '()))
 	
@@ -394,7 +394,7 @@
 
 	(if (date-col used-columns)
 	    (addto! row
-		    (gnc:print-date (gnc:transaction-get-date-posted t))))
+		    (gnc-print-date (gnc-transaction-get-date-posted t))))
 
 	(if (description-col used-columns)
 	    (addto! row (_ "Payment, thank you")))
@@ -426,8 +426,8 @@
 		(hash-for-each
 		 (lambda (acct value)
 		   (let ((collector (gnc:make-commodity-collector))
-			 (commodity (gnc:account-get-commodity acct))
-			 (name (gnc:account-get-name acct)))
+			 (commodity (xaccAccountGetCommodity acct))
+			 (name (xaccAccountGetName acct)))
 		     (collector 'add commodity value)
 		     (add-subtotal-row table used-columns collector
 				       "grand-total" name)))
@@ -439,14 +439,14 @@
 
 	    (if (and show-payments lot)
 		(let ((splits (sort-list!
-			       (gnc:lot-get-splits lot)
+			       (gnc-lot-get-split-list lot)
 			       (lambda (s1 s2)
-				 (let ((t1 (gnc:split-get-parent s1))
-				       (t2 (gnc:split-get-parent s2)))
-				   (< (gnc:transaction-order t1 t2) 0))))))
+				 (let ((t1 (xaccSplitGetParent s1))
+				       (t2 (xaccSplitGetParent s2)))
+				   (< (xaccTransOrder t1 t2) 0))))))
 		  (for-each
 		   (lambda (split)
-		     (if (not (equal? (gnc:split-get-parent split) txn))
+		     (if (not (equal? (xaccSplitGetParent split) txn))
 			 (add-payment-row table used-columns
 					  split total-collector)))
 		   splits)))
@@ -470,7 +470,7 @@
 					      invoice?)))
 
 	    (if display-all-taxes
-		(let ((tax-list (gnc:entry-get-tax-values current invoice?)))
+		(let ((tax-list (gncEntryReturnTaxValues current invoice?)))
 		  (update-account-hash acct-hash tax-list))
 		(tax-collector 'add
 			       (gnc:gnc-monetary-commodity (cdr entry-values))
@@ -503,7 +503,7 @@
     (let* ((table (gnc:make-html-table))
 	   (used-columns (build-column-used options))
 	   (width (num-columns-required used-columns))
-	   (entries (gnc:invoice-get-entries invoice))
+	   (entries (gncInvoiceGetEntries invoice))
 	   (totals (gnc:make-commodity-collector)))
 
       (gnc:html-table-set-col-headers!
@@ -555,7 +555,7 @@
      (list "<br>"))
     (for-each
      (lambda (order)
-       (let* ((reference (gnc:order-get-reference order)))
+       (let* ((reference (gncOrderGetReference order)))
 	 (if (and reference (> (string-length reference) 0))
 	     (gnc:html-table-append-row!
 	      table
@@ -572,7 +572,7 @@
    table
    (list
     (string-append label ":&nbsp;")
-    (string-expand (gnc:print-date date) #\space "&nbsp;"))))
+    (string-expand (gnc-print-date date) #\space "&nbsp;"))))
 
 (define (make-date-table)
   (let ((table (gnc:make-html-table)))
@@ -587,11 +587,11 @@
 
 (define (make-myname-table book date-format)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*)))))
 
@@ -627,7 +627,7 @@
 	 (table '())
 	 (orders '())
 	 (invoice (opt-val invoice-page invoice-name))
-	 (owner #f)
+	 (owner '())
 	 (references? (opt-val "Display" "References"))
 	 (title (_ "Invoice"))
 	 (invoice? #f))
@@ -638,24 +638,23 @@
 
     (if invoice
 	(begin
-	  (set! owner (gnc:invoice-get-owner invoice))
-	  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-		       (gnc:owner-get-type 
-			(gnc:owner-get-end-owner owner)) #f)))
-	    (case type
-	      ((gnc-owner-customer)
+	  (set! owner (gncInvoiceGetOwner invoice))
+	  (let ((type (gncOwnerGetType
+                       (gncOwnerGetEndOwner owner))))
+	    (cond
+	      ((eqv? type GNC-OWNER-CUSTOMER)
 	       (set! invoice? #t))
-	      ((gnc-owner-vendor)
+	      ((eqv? type GNC-OWNER-VENDOR)
 	       (set! title (_ "Bill")))
-	      ((gnc-owner-employee)
+	      ((eqv? type GNC-OWNER-EMPLOYEE)
 	       (set! title (_ "Expense Voucher")))))
 	  (set! title (sprintf #f (_"%s #%d") title
-			       (gnc:invoice-get-id invoice)))))
+			       (gncInvoiceGetID invoice)))))
 
     (gnc:html-document-set-title! document title)
 
     (if invoice
-	(let ((book (gnc:invoice-get-book invoice)))
+	(let ((book (gncInvoiceGetBook invoice)))
 	  (set! table (make-entry-table invoice
 					(gnc:report-options report-obj)
 					add-order invoice?))
@@ -671,8 +670,8 @@
 	   (make-myname-table book (opt-val "Display" "Today Date Format")))
 
 	  (let ((date-table #f)
-		(post-date (gnc:invoice-get-date-posted invoice))
-		(due-date (gnc:invoice-get-date-due invoice)))
+		(post-date (gncInvoiceGetDatePosted invoice))
+		(due-date (gncInvoiceGetDateDue invoice)))
 
 	    (if (not (equal? post-date (cons 0 0)))
 		(begin
@@ -696,7 +695,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Billing ID")
-	      (let ((billing-id (gnc:invoice-get-billing-id invoice)))
+	      (let ((billing-id (gncInvoiceGetBillingID invoice)))
 		(if (and billing-id (> (string-length billing-id) 0))
 		    (begin
 		      (gnc:html-document-add-object!
@@ -708,8 +707,8 @@
 		      (make-break! document)))))
 
 	  (if (opt-val "Display" "Billing Terms")
-	      (let* ((term (gnc:invoice-get-terms invoice))
-		     (terms (gnc:bill-term-get-description term)))
+	      (let* ((term (gncInvoiceGetTerms invoice))
+		     (terms (gncBillTermGetDescription term)))
 		(if (and terms (> (string-length terms) 0))
 		    (gnc:html-document-add-object!
 		     document
@@ -726,7 +725,7 @@
 	  (make-break! document)
 
 	  (if (opt-val "Display" "Invoice Notes")
-	      (let ((notes (gnc:invoice-get-notes invoice)))
+	      (let ((notes (gncInvoiceGetNotes invoice)))
 		(gnc:html-document-add-object!
 		 document
 		 (gnc:make-html-text

Modified: gnucash/branches/register-rewrite/src/business/business-reports/owner-report.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/owner-report.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/owner-report.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -115,7 +115,7 @@
 
 (define num-buckets 4)
 (define (new-bucket-vector)
-  (make-vector num-buckets (gnc:numeric-zero)))
+  (make-vector num-buckets (gnc-numeric-zero)))
 
 (define (make-interval-list to-date)
   (let ((begindate to-date))
@@ -126,10 +126,10 @@
 
 
 (define (make-aging-table options query bucket-intervals reverse?)
-  (let ((lots (gnc:query-get-lots query 'query-txn-match-any))
+  (let ((lots (xaccQueryGetLots query QUERY-TXN-MATCH-ANY))
 	(buckets (new-bucket-vector))
-	(payments (gnc:numeric-zero))
-	(currency (gnc:default-currency)) ;XXX
+	(payments (gnc-numeric-zero))
+	(currency (gnc-default-currency)) ;XXX
 	(table (gnc:make-html-table)))
 
     (define (in-interval this-date current-bucket)
@@ -145,24 +145,24 @@
 
     (define (apply-invoice date value)
       (let* ((bucket-index (find-bucket 0 bucket-intervals date))
-	     (new-value (gnc:numeric-add-fixed
+	     (new-value (gnc-numeric-add-fixed
 			 value
 			 (vector-ref buckets bucket-index))))
 	(vector-set! buckets bucket-index new-value)))
 
     (define (apply-payment value)
-      (set! payments (gnc:numeric-add-fixed value payments)))
+      (set! payments (gnc-numeric-add-fixed value payments)))
 
     (for-each
      (lambda (lot)
-       (let* ((bal (gnc:lot-get-balance lot))
-	      (invoice (gnc:invoice-get-invoice-from-lot lot))
-	      (post-date (gnc:invoice-get-date-posted invoice)))
+       (let* ((bal (gnc-lot-get-balance lot))
+	      (invoice (gncInvoiceGetInvoiceFromLot lot))
+	      (post-date (gncInvoiceGetDatePosted invoice)))
 
-	 (if (not (gnc:numeric-zero-p bal))
+	 (if (not (gnc-numeric-zero-p bal))
 	     (begin
 	       (if reverse?
-		   (set! bal (gnc:numeric-neg bal)))
+		   (set! bal (gnc-numeric-neg bal)))
 	       (if invoice
 		   (begin
 		     (apply-invoice post-date bal))
@@ -192,13 +192,13 @@
 ;;
 (define (add-txn-row table txn acc column-vector odd-row? printed?
 		     inv-str reverse? start-date total)
-  (let* ((type (gnc:transaction-get-txn-type txn))
-	 (date (gnc:transaction-get-date-posted txn))
+  (let* ((type (xaccTransGetTxnType txn))
+	 (date (gnc-transaction-get-date-posted txn))
 	 (due-date #f)
-	 (value (gnc:transaction-get-account-value txn acc))
-	 (split (gnc:transaction-get-split txn 0))
-	 (invoice (gnc:invoice-get-invoice-from-txn txn))
-	 (currency (gnc:transaction-get-currency txn))
+	 (value (xaccTransGetAccountValue txn acc))
+	 (split (xaccTransGetSplit txn 0))
+	 (invoice (gncInvoiceGetInvoiceFromTxn txn))
+	 (currency (xaccTransGetCurrency txn))
 	 (type-str
 	  (cond
 	   ((equal? type gnc:transaction-type-invoice)
@@ -215,12 +215,12 @@
     (define (make-row date due-date num type-str memo value)
       (let ((row-contents '()))
 	(if (date-col column-vector)
-	    (addto! row-contents (gnc:print-date date)))
+	    (addto! row-contents (gnc-print-date date)))
 	(if (date-due-col column-vector)
 	    (addto! row-contents 
 		    (if (and due-date
 			     (not (equal? due-date (cons 0 0))))
-			(gnc:print-date due-date)
+			(gnc-print-date due-date)
 			"")))
 	(if (num-col column-vector)
 	    (addto! row-contents num))
@@ -236,7 +236,7 @@
 	row-contents))
 
     (if reverse?
-	(set! value (gnc:numeric-neg value)))
+	(set! value (gnc-numeric-neg value)))
 
     (if (gnc:timepair-later start-date date)
 	(begin
@@ -245,7 +245,7 @@
 	  (if (not printed?)
 	      (begin
 		(set! printed? #t)
-		(if (not (gnc:numeric-zero-p total))
+		(if (not (gnc-numeric-zero-p total))
 		    (let ((row (make-row start-date #f "" (_ "Balance") "" total))
 			  (row-style (if odd-row? "normal-row" "alternate-row")))
 		      (gnc:html-table-append-row/markup! table row-style
@@ -256,10 +256,10 @@
 	  
 	  ; Now print out the invoice row
 	  (if invoice
-	      (set! due-date (gnc:invoice-get-date-due invoice)))
+	      (set! due-date (gncInvoiceGetDateDue invoice)))
 
-	  (let ((row (make-row date due-date (gnc:transaction-get-num txn)
-			       type-str (gnc:split-get-memo split) value))
+	  (let ((row (make-row date due-date (xaccTransGetNum txn)
+			       type-str (xaccSplitGetMemo split) value))
 		(row-style (if odd-row? "normal-row" "alternate-row")))
 
 	    (gnc:html-table-append-row/markup! table row-style
@@ -273,10 +273,10 @@
 
 
 (define (make-txn-table options query acc start-date end-date)
-  (let ((txns (gnc:query-get-transactions query 'query-txn-match-any))
+  (let ((txns (xaccQueryGetTransactions query QUERY-TXN-MATCH-ANY))
 	(used-columns (build-column-used options))
-	(total (gnc:numeric-zero))
-	(currency (gnc:default-currency)) ;XXX
+	(total (gnc-numeric-zero))
+	(currency (gnc-default-currency)) ;XXX
 	(table (gnc:make-html-table))
 	(inv-str (gnc:option-value (gnc:lookup-option options "__reg"
 						      "inv-str")))
@@ -288,13 +288,13 @@
      (make-heading-list used-columns))
 
     ; Order the transactions properly
-    (set! txns (sort txns (lambda (a b) (> 0 (gnc:transaction-order a b)))))
+    (set! txns (sort txns (lambda (a b) (> 0 (xaccTransOrder a b)))))
 
     (let ((printed? #f)
 	  (odd-row? #t))
       (for-each
        (lambda (txn)
-	 (let ((type (gnc:transaction-get-txn-type txn)))
+	 (let ((type (xaccTransGetTxnType txn)))
 	   (if
 	    (or (equal? type gnc:transaction-type-invoice)
 		(equal? type gnc:transaction-type-payment))
@@ -302,7 +302,7 @@
 				       inv-str reverse? start-date total)))
 
 	      (set! printed? (car result))
-	      (set! total (gnc:numeric-add-fixed total (cadr result)))
+	      (set! total (gnc-numeric-add-fixed total (cadr result)))
 	      (set! odd-row? (caddr result))
 	      ))))
        txns))
@@ -312,7 +312,7 @@
      "grand-total"
      (append (cons (gnc:make-html-table-cell/markup
 		    "total-label-cell"
-		    (if (gnc:numeric-negative-p total)
+		    (if (gnc-numeric-negative-p total)
 			(_ "Total Credit")
 			(_ "Total Due")))
 		   '())
@@ -348,7 +348,7 @@
   (gnc:register-inv-option
    (gnc:make-owner-option owner-page owner-string "v"
 			  (N_ "The company for this report")
-			  (lambda () #f) #f owner-type))
+			  (lambda () '()) #f owner-type))
 
   (gnc:register-inv-option
    (gnc:make-internal-option "__reg" "owner-type" owner-type))
@@ -403,13 +403,16 @@
   gnc:*report-options*)
 	     
 (define (customer-options-generator)
-  (options-generator '(receivable) 'gnc-owner-customer (_ "Invoice") #f))
+  (options-generator (list ACCT-TYPE-RECEIVABLE) GNC-OWNER-CUSTOMER
+                     (_ "Invoice") #f))
 
 (define (vendor-options-generator)
-  (options-generator '(payable) 'gnc-owner-vendor (_ "Bill") #t))
+  (options-generator (list ACCT-TYPE-PAYABLE) GNC-OWNER-VENDOR
+                     (_ "Bill") #t))
 
 (define (employee-options-generator)
-  (options-generator '(payable) 'gnc-owner-employee (_ "Expense Report") #t))
+  (options-generator (list ACCT-TYPE-PAYABLE) GNC-OWNER-EMPLOYEE
+                     (_ "Expense Report") #t))
 
 (define (string-expand string character replace-string)
   (define (car-line chars)
@@ -430,26 +433,26 @@
   (line-helper (string->list string)))
 
 (define (setup-query q owner account end-date)
-  (let* ((guid (gnc:owner-get-guid (gnc:owner-get-end-owner owner))))
+  (let* ((guid (gncOwnerReturnGUID (gncOwnerGetEndOwner owner))))
 
-    (gnc:query-add-guid-match
+    (qof-query-add-guid-match
      q 
-     (list gnc:split-trans gnc:invoice-from-txn gnc:invoice-owner
-	   gnc:owner-parentg)
-     guid 'query-or)
-    (gnc:query-add-guid-match
+     (list SPLIT-TRANS INVOICE-FROM-TXN INVOICE-OWNER
+	   OWNER-PARENTG)
+     guid QOF-QUERY-OR)
+    (qof-query-add-guid-match
      q
-     (list gnc:split-lot gnc:owner-from-lot gnc:owner-parentg)
-     guid 'query-or)
-    (gnc:query-add-guid-match
+     (list SPLIT-LOT OWNER-FROM-LOT OWNER-PARENTG)
+     guid QOF-QUERY-OR)
+    (qof-query-add-guid-match
      q
-     (list gnc:split-lot gnc:invoice-from-lot gnc:invoice-owner
-	   gnc:owner-parentg)
-     guid 'query-or)
+     (list SPLIT-LOT INVOICE-FROM-LOT INVOICE-OWNER
+	   OWNER-PARENTG)
+     guid QOF-QUERY-OR)
 
-    (gnc:query-add-single-account-match q account 'query-and)
-    (gnc:query-add-date-match-timepair q #f end-date #t end-date 'query-and)
-    (gnc:query-set-book q (gnc:get-current-book))
+    (xaccQueryAddSingleAccountMatch q account QOF-QUERY-AND)
+    (xaccQueryAddDateMatchTS q #f end-date #t end-date QOF-QUERY-AND)
+    (qof-query-set-book q (gnc-get-current-book))
     q))
 
 (define (make-owner-table owner)
@@ -476,7 +479,7 @@
    table
    (list
     (string-append label ":&nbsp;")
-    (string-expand (gnc:print-date date) #\space "&nbsp;"))))
+    (string-expand (gnc-print-date date) #\space "&nbsp;"))))
 
 (define (make-date-table)
   (let ((table (gnc:make-html-table)))
@@ -491,11 +494,11 @@
 
 (define (make-myname-table book date-format)
   (let* ((table (gnc:make-html-table))
-	 (slots (gnc:book-get-slots book))
-	 (name (gnc:kvp-frame-get-slot-path
+	 (slots (gnc-book-get-slots book))
+	 (name (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-name*))))
-	 (addy (gnc:kvp-frame-get-slot-path
+	 (addy (kvp-frame-get-slot-path-gslist
 		slots (append gnc:*kvp-option-path*
 			      (list gnc:*business-label* gnc:*company-addy*)))))
 
@@ -531,7 +534,7 @@
   (let* ((document (gnc:make-html-document))
 	 (table '())
 	 (orders '())
-	 (query (gnc:malloc-query))
+	 (query (qof-query-create-for-splits))
 	 (account (opt-val owner-page acct-string))
 	 (owner (opt-val owner-page owner-string))
 	 (start-date (gnc:timepair-start-day-time 
@@ -540,28 +543,28 @@
 	 (end-date (gnc:timepair-end-day-time 
 		       (gnc:date-option-absolute-time
 			(opt-val gnc:pagename-general (N_ "To")))))
-	 (book (gnc:get-current-book)) ;XXX Grab this from elsewhere
-	 (owner-type (opt-val "__reg" "owner-type"))
+	 (book (gnc-get-current-book)) ;XXX Grab this from elsewhere
+	 (type (opt-val "__reg" "owner-type"))
 	 (type-str ""))
 
-    (case owner-type
-      ((gnc-owner-customer)
+    (cond
+      ((eqv? type GNC-OWNER-CUSTOMER)
        (set! type-str (N_ "Customer")))
-      ((gnc-owner-vendor)
+      ((eqv? type GNC-OWNER-VENDOR)
        (set! type-str (N_ "Vendor")))
-      ((gnc-owner-employee)
+      ((eqv? type GNC-OWNER-EMPLOYEE)
        (set! type-str (N_ "Employee"))))
 
     (gnc:html-document-set-title!
      document (string-append (_ type-str) " " (_ "Report")))
 
-    (if (gnc:owner-is-valid? owner)
+    (if (gncOwnerIsValid owner)
 	(begin
 	  (setup-query query owner account end-date)
 
 	  (gnc:html-document-set-title!
 	   document
-           (string-append (_ type-str ) " " (_ "Report:") " " (gnc:owner-get-name owner)))
+           (string-append (_ type-str ) " " (_ "Report:") " " (gncOwnerGetName owner)))
 
            (gnc:html-document-set-headline!
             document (gnc:html-markup
@@ -570,7 +573,7 @@
                       " " (_ "Report:") " "
                       (gnc:html-markup-anchor
                        (gnc:owner-anchor-text owner)
-                       (gnc:owner-get-name owner))))
+                       (gncOwnerGetName owner))))
 	  
 	  (if account
 	      (begin
@@ -603,9 +606,9 @@
 	    (string-append
 	     (_ "Date Range")
 	     ": "
-	     (gnc:print-date start-date)
+	     (gnc-print-date start-date)
 	     " - "
-	     (gnc:print-date end-date))))
+	     (gnc-print-date end-date))))
 
 	  (make-break! document)
 
@@ -617,47 +620,45 @@
 	 (gnc:make-html-text
 	  (sprintf #f 
 		   (_ "No valid %s selected.  Click on the Options button to select a company.")
-		   type-str))))
+		   (_ type-str))))) ;; FIXME because of translations: Please change this string into full sentences instead of sprintf, because in non-english languages the "no valid" has different forms depending on the grammatical gender of the "%s".
 
-    (gnc:free-query query)
+    (qof-query-destroy query)
     document))
 
 (define (find-first-account type)
   (define (find-first group num index)
     (if (>= index num)
-	#f
-	(let* ((this-account (gnc:group-get-account group index))
-	       (account-type (gw:enum-<gnc:AccountType>-val->sym
-			      (gnc:account-get-type this-account) #f)))
+	'()
+	(let* ((this-account (xaccGroupGetAccount group index))
+	       (account-type (xaccAccountGetType this-account)))
 	  (if (eq? account-type type)
 	      this-account
 	      (find-first group num (+ index 1))))))
 
-  (let* ((current-group (gnc:get-current-group))
-	 (num-accounts (gnc:group-get-num-accounts
+  (let* ((current-group (gnc-get-current-group))
+	 (num-accounts (xaccGroupGetNumAccounts
 			current-group)))
     (if (> num-accounts 0)
 	(find-first current-group num-accounts 0)
-	#f)))
+	'())))
 
 (define (find-first-account-for-owner owner)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type (gnc:owner-get-end-owner owner)) #f)))
-    (case type
-      ((gnc-owner-customer)
-       (find-first-account 'receivable))
+  (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
+    (cond
+      ((eqv? type GNC-OWNER-CUSTOMER)
+       (find-first-account ACCT-TYPE-RECEIVABLE))
 
-      ((gnc-owner-vendor)
-       (find-first-account 'payable))
+      ((eqv? type GNC-OWNER-VENDOR)
+       (find-first-account ACCT-TYPE-PAYABLE))
 
-      ((gnc-owner-employee)
-       (find-first-account 'payable))
+      ((eqv? type GNC-OWNER-EMPLOYEE)
+       (find-first-account ACCT-TYPE-PAYABLE))
 
-      ((gnc-owner-job)
-       (find-first-account-for-owner (gnc:owner-get-end-owner owner)))
+      ((eqv? type GNC-OWNER-JOB)
+       (find-first-account-for-owner (gncOwnerGetEndOwner owner)))
 
       (else
-       #f))))
+       '()))))
 
 (gnc:define-report
  'version 1
@@ -693,16 +694,15 @@
     (gnc:make-report report-name options)))
 
 (define (owner-report-create owner account)
-  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-	       (gnc:owner-get-type (gnc:owner-get-end-owner owner)) #f)))
-    (case type
-      ((gnc-owner-customer)
+  (let ((type (gncOwnerGetType (gncOwnerGetEndOwner owner))))
+    (cond
+      ((eqv? type GNC-OWNER-CUSTOMER)
        (owner-report-create-internal (N_ "Customer Report") owner account))
 
-      ((gnc-owner-vendor)
+      ((eqv? type GNC-OWNER-VENDOR)
        (owner-report-create-internal (N_ "Vendor Report") owner account))
 
-      ((gnc-owner-employee)
+      ((eqv? type GNC-OWNER-EMPLOYEE)
        (owner-report-create-internal (N_ "Employee Report") owner account))
 
       (else #f))))
@@ -718,20 +718,20 @@
 	 account split query journal? double? title
 	 debit-string credit-string)
 
-  (let* ((temp-owner (gnc:owner-create))
+  (let* ((temp-owner (gncOwnerCreate))
 	 (owner (gnc:owner-from-split split temp-owner))
 	 (res #f))
 
     (if owner
 	(set! res (gnc:owner-report-create owner account)))
 
-    (gnc:owner-destroy temp-owner)
+    (gncOwnerDestroy temp-owner)
     res))
 
-(gnc:register-report-hook 'receivable #t
+(gnc:register-report-hook ACCT-TYPE-RECEIVABLE #t
 			  gnc:owner-report-create-internal)
 
-(gnc:register-report-hook 'payable #t
+(gnc:register-report-hook ACCT-TYPE-PAYABLE #t
 			  gnc:owner-report-create-internal)
 
 (export gnc:owner-report-create)

Modified: gnucash/branches/register-rewrite/src/business/business-reports/payables.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/payables.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/payables.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -49,7 +49,7 @@
      (gnc:make-account-sel-limited-option
       acc-page this-acc
       (N_ "The payable account you wish to examine") "zz"
-      #f #f '(payable)))
+      #f #f (list ACCT-TYPE-PAYABLE)))
 
     (aging-options-generator options)))
 
@@ -83,5 +83,5 @@
 	 debit-string credit-string)
   (payables-report-create-internal account))
 
-(gnc:register-report-hook 'payable #f
+(gnc:register-report-hook ACCT-TYPE-PAYABLE #f
 			  gnc:payables-report-create-internal)

Modified: gnucash/branches/register-rewrite/src/business/business-reports/receivables.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-reports/receivables.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-reports/receivables.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -49,7 +49,7 @@
      (gnc:make-account-sel-limited-option
       acc-page this-acc
       (N_ "The receivables account you wish to examine") "w"
-      #f #f '(receivable)))
+      #f #f (list ACCT-TYPE-RECEIVABLE)))
 
     (aging-options-generator options)))
 
@@ -84,5 +84,5 @@
 	 debit-string credit-string)
   (receivables-report-create-internal account))
 
-(gnc:register-report-hook 'receivable #f
+(gnc:register-report-hook ACCT-TYPE-RECEIVABLE #f
 			  gnc:receivables-report-create-internal)

Modified: gnucash/branches/register-rewrite/src/business/business-utils/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-utils/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-utils/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,7 +6,6 @@
   -I${top_srcdir}/src/gnc-module \
   -I${top_srcdir}/src/app-utils \
   -I${top_srcdir}/src/business/business-core \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${GLIB_CFLAGS} \
   ${QOF_CFLAGS} \
@@ -22,7 +21,6 @@
 libgncmod_business_utils_la_LIBADD = \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
-  ${G_WRAP_LINK_ARGS} \
   ${GUILE_LIBS} \
   ${GLIB_LIBS} \
   ${QOF_LIBS} \
@@ -50,14 +48,18 @@
 endif
 
 .scm-links: 
-	rm -f gnucash
-	$(LN_S) -f ${srcdir} gnucash 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-CLEANFILES = gnucash .scm-links
+clean-local:
+	$(RM) -rf gnucash
+
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/business/business-utils/business-options.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-utils/business-options.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-utils/business-options.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,11 +25,11 @@
 #include "config.h"
 
 #include "business-options.h"
+#include "swig-runtime.h"
 
-#include <g-wrap-wct.h>
+#define FUNC_NAME __FUNCTION__
 
-
-#define LOOKUP_OPTION(fcn) { \
+#define LOOKUP_OPTION(fcn) \
   GNCOption *option; \
   SCM getter; \
   SCM value; \
@@ -46,13 +46,9 @@
   value = scm_call_0 (getter); \
   if (value == SCM_BOOL_F) \
     return NULL; \
-  \
-  if (!gw_wcp_p(value)) \
-    scm_misc_error(fcn, "Item is not a gw:wcp.", value); \
-  \
-  return gw_wcp_get_ptr(value); \
-}
-	
+  SWIG_GetModule(NULL); /* Work-around for SWIG bug. */       \
+  if (!SWIG_IsPointer(value))             \
+    scm_misc_error(fcn, "SCM is not a wrapped pointer.", value)
 
 GncTaxTable*
 gnc_option_db_lookup_taxtable_option(GNCOptionDB *odb,
@@ -61,6 +57,7 @@
 				     GncTaxTable * default_value)
 {
   LOOKUP_OPTION("gnc_option_db_lookup_taxtable_option");
+  return SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncTaxTable"), 1, 0);
 }
 
 GncInvoice*
@@ -70,6 +67,7 @@
 				    GncInvoice * default_value)
 {
   LOOKUP_OPTION("gnc_option_db_lookup_invoice_option");
+  return SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncInvoice"), 1, 0);
 }
 
 GncCustomer*
@@ -79,6 +77,7 @@
 				     GncCustomer * default_value)
 {
   LOOKUP_OPTION("gnc_option_db_lookup_customer_option");
+  return SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncCustomer"), 1, 0);
 }
 
 GncVendor*
@@ -88,4 +87,5 @@
 				   GncVendor * default_value)
 {
   LOOKUP_OPTION("gnc_option_db_lookup_vendor_option");
+  return SWIG_MustGetPtr(value, SWIG_TypeQuery("_p__gncVendor"), 1, 0);
 }

Modified: gnucash/branches/register-rewrite/src/business/business-utils/business-options.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-utils/business-options.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-utils/business-options.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,6 +24,8 @@
 ;; invoice pointers may be used to set the value of the option. The
 ;; option always returns a single invoice pointer.
 
+(use-modules (gnucash main))
+
 (define (gnc:make-invoice-option
 	 section
 	 name
@@ -35,11 +37,11 @@
   (define (convert-to-guid item)
     (if (string? item)
         item
-        (gnc:invoice-get-guid item)))
+        (gncInvoiceReturnGUID item)))
 
   (define (convert-to-invoice item)
     (if (string? item)
-        (gnc:invoice-lookup item (gnc:get-current-book))
+        (gncInvoiceLookupFlip item (gnc-get-current-book))
         item))
 
   (let* ((option (convert-to-guid (default-getter)))
@@ -71,9 +73,9 @@
 	     (gnc:error "Illegal invoice value set"))))
      (lambda () (convert-to-invoice (default-getter)))
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f option p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f option p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (begin
 	       (set! option v)
@@ -96,11 +98,11 @@
   (define (convert-to-guid item)
     (if (string? item)
         item
-        (gnc:customer-get-guid item)))
+        (gncCustomerReturnGUID item)))
 
   (define (convert-to-customer item)
     (if (string? item)
-        (gnc:customer-lookup item (gnc:get-current-book))
+        (gncCustomerLookupFlip item (gnc-get-current-book))
         item))
 
   (let* ((option (convert-to-guid (default-getter)))
@@ -132,9 +134,9 @@
 	     (gnc:error "Illegal customer value set"))))
      (lambda () (convert-to-customer (default-getter)))
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f option p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f option p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (begin
 	       (set! option v)
@@ -157,11 +159,11 @@
   (define (convert-to-guid item)
     (if (string? item)
         item
-        (gnc:vendor-get-guid item)))
+        (gncVendorReturnGUID item)))
 
   (define (convert-to-vendor item)
     (if (string? item)
-        (gnc:vendor-lookup item (gnc:get-current-book))
+        (gncVendorLookupFlip item (gnc-get-current-book))
         item))
 
   (let* ((option (convert-to-guid (default-getter)))
@@ -193,9 +195,9 @@
 	     (gnc:error "Illegal vendor value set"))))
      (lambda () (convert-to-vendor (default-getter)))
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f option p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f option p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (begin
 	       (set! option v)
@@ -218,11 +220,11 @@
   (define (convert-to-guid item)
     (if (string? item)
         item
-        (gnc:employee-get-guid item)))
+        (gncEmployeeReturnGUID item)))
 
   (define (convert-to-employee item)
     (if (string? item)
-        (gnc:employee-lookup item (gnc:get-current-book))
+        (gncEmployeeLookupFlip item (gnc-get-current-book))
         item))
 
   (let* ((option (convert-to-guid (default-getter)))
@@ -254,9 +256,9 @@
 	     (gnc:error "Illegal employee value set"))))
      (lambda () (convert-to-employee (default-getter)))
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f option p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f option p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (begin
 	       (set! option v)
@@ -277,44 +279,43 @@
 	 value-validator
 	 owner-type)
 
-  (let ((option-value (gnc:owner-create)))
+  (let ((option-value (gncOwnerCreate)))
 
     (define (convert-to-pair item)
       (if (pair? item)
 	  item
-	  (cons (gw:enum-<gnc:GncOwnerType>-val->sym
-		 (gnc:owner-get-type item) #f)
-		(gnc:owner-get-guid item))))
+	  (cons (gncOwnerGetType item)
+		(gncOwnerReturnGUID item))))
 
     (define (convert-to-owner pair)
       (if (pair? pair)
-	  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym (car pair) #f)))
-	    (case type
-	      ((gnc-owner-customer)
-	       (gnc:owner-init-customer
+	  (let ((type (car pair)))
+	    (cond
+	      ((eqv? type GNC-OWNER-CUSTOMER)
+	       (gncOwnerInitCustomer
 		option-value
-		(gnc:customer-lookup (cdr pair) (gnc:get-current-book)))
+		(gncCustomerLookupFlip (cdr pair) (gnc-get-current-book)))
 	       option-value)
 
-	       ((gnc-owner-vendor)
-		(gnc:owner-init-vendor
+	       ((eqv? type GNC-OWNER-VENDOR)
+		(gncOwnerInitVendor
 		 option-value
-		 (gnc:vendor-lookup (cdr pair) (gnc:get-current-book)))
+		 (gncVendorLookupFlip (cdr pair) (gnc-get-current-book)))
 		option-value)
 
-	       ((gnc-owner-employee)
-		(gnc:owner-init-employee
+	       ((eqv? type GNC-OWNER-EMPLOYEE)
+		(gncOwnerInitEmployee
 		 option-value
-		 (gnc:employee-lookup (cdr pair) (gnc:get-current-book)))
+		 (gncEmployeeLookupFlip (cdr pair) (gnc-get-current-book)))
 		option-value)
 
-	       ((gnc-owner-job)
-		(gnc:owner-init-job
+	       ((eqv? type GNC-OWNER-JOB)
+		(gncOwnerInitJob
 		 option-value
-		 (gnc:job-lookup (cdr pair) (gnc:get-current-book)))
+		 (gncJobLookupFlip (cdr pair) (gnc-get-current-book)))
 		option-value)
 
-	       (else #f)))
+	       (else '())))
 	  pair))
 
     (let* ((option (convert-to-pair (default-getter)))
@@ -330,10 +331,9 @@
 	   (validator
 	    (if (not value-validator)
 		(lambda (owner)
-		  (let ((type (gw:enum-<gnc:GncOwnerType>-val->sym
-			       (if (pair? owner)
-				   (car owner)
-				   (gnc:owner-get-type owner)) #f)))
+		  (let ((type (if (pair? owner)
+                                  (car owner)
+                                  (gncOwnerGetType owner))))
 		    (if (equal? type owner-type)
 			(list #t owner)
 			(list #f "Owner-Type Mismatch"))))
@@ -356,13 +356,13 @@
        (lambda () (convert-to-owner (default-getter)))
        (gnc:restore-form-generator value->string)
        (lambda (f p)
-	 (gnc:kvp-frame-set-slot-path f (symbol->string (car option))
+	 (kvp-frame-set-slot-path-gslist f (symbol->string (car option))
 				      (append p '("type")))
-	 (gnc:kvp-frame-set-slot-path f (cdr option)
+	 (kvp-frame-set-slot-path-gslist f (cdr option)
 				      (append p '("value"))))
        (lambda (f p)
-	 (let ((t (gnc:kvp-frame-get-slot-path f (append p '("type"))))
-	       (v (gnc:kvp-frame-get-slot-path f (append p '("value")))))
+	 (let ((t (kvp-frame-get-slot-path-gslist f (append p '("type"))))
+	       (v (kvp-frame-get-slot-path-gslist f (append p '("value")))))
 	   (if (and t v (string? t) (string? v))
 	       (begin
 		 (set! option (cons (string->symbol t) v))
@@ -386,11 +386,11 @@
   (define (convert-to-guid item)
     (if (string? item)
         item
-        (gnc:taxtable-get-guid item)))
+        (gncTaxTableReturnGUID item)))
 
   (define (convert-to-taxtable item)
     (if (string? item)
-        (gnc:taxtable-lookup item (gnc:get-current-book))
+        (gncTaxTableLookupFlip item (gnc-get-current-book))
         item))
 
   (let* ((option (convert-to-guid (default-getter)))
@@ -422,9 +422,9 @@
 	     (gnc:error "Illegal taxtable value set"))))
      (lambda () (convert-to-taxtable (default-getter)))
      (gnc:restore-form-generator value->string)
-     (lambda (f p) (gnc:kvp-frame-set-slot-path f option p))
+     (lambda (f p) (kvp-frame-set-slot-path-gslist f option p))
      (lambda (f p)
-       (let ((v (gnc:kvp-frame-get-slot-path f p)))
+       (let ((v (kvp-frame-get-slot-path-gslist f p)))
 	 (if (and v (string? v))
 	     (begin
 	       (set! option v)

Modified: gnucash/branches/register-rewrite/src/business/business-utils/business-prefs.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/business-utils/business-prefs.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/business-utils/business-prefs.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -68,13 +68,13 @@
    (gnc:make-taxtable-option
     gnc:*business-label* (N_ "Default Customer TaxTable")
     "e" (N_ "The default tax table to apply to customers.")
-    (lambda () #f) #f))
+    (lambda () '()) #f))
 
   (reg-option
    (gnc:make-taxtable-option
     gnc:*business-label* (N_ "Default Vendor TaxTable")
     "f" (N_ "The default tax table to apply to vendors.")
-    (lambda () #f) #f))
+    (lambda () '()) #f))
 
   (reg-option
    (gnc:make-dateformat-option
@@ -83,4 +83,4 @@
     #f))
 )
 
-(gnc:register-kvp-option-generator gnc:id-book book-options-generator)
+(gnc-register-kvp-option-generator QOF-ID-BOOK-SCM book-options-generator)


Property changes on: gnucash/branches/register-rewrite/src/business/dialog-tax-table
___________________________________________________________________
Name: svn:ignore
   - *.gladep
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gw-dialog-tax-table.c
gw-dialog-tax-table.h
gw-dialog-tax-table.html
gw-dialog-tax-table.scm
g-wrapped
gnucash


semantic.cache

TAGS

   + *.gladep
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
swig-dialog-tax-table.c
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/business/dialog-tax-table/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/business/dialog-tax-table/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/dialog-tax-table/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,6 @@
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-dialog-tax-table.la libgw-dialog-tax-table.la
+pkglib_LTLIBRARIES = libgncmod-dialog-tax-table.la
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \
@@ -17,16 +17,15 @@
   ${GDK_PIXBUF_CFLAGS} \
   ${GLIB_CFLAGS} \
   ${QOF_CFLAGS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS}
 
 libgncmod_dialog_tax_table_la_SOURCES = \
+  swig-dialog-tax-table.c \
   gncmod-dialog-tax-table.c \
   dialog-tax-table.c
 
 noinst_HEADERS = \
-  dialog-tax-table.h \
-  gw-dialog-tax-table.h
+  dialog-tax-table.h
 
 libgncmod_dialog_tax_table_la_LIBADD = \
   ${top_builddir}/src/business/business-core/libgncmod-business-core.la \
@@ -37,22 +36,16 @@
   ${GLADE_LIBS} \
   ${GUILE_LIBS} \
   ${GNOME_LIBS} \
-  ${G_WRAP_LINK_ARGS} \
   ${GLIB_LIBS} \
   ${QOF_LIBS} \
   ${EFENCE_LIBS}
 
-libgw_dialog_tax_table_la_SOURCES = gw-dialog-tax-table.c
+if BUILDING_FROM_SVN
+swig-dialog-tax-table.c: dialog-tax-table.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
-libgw_dialog_tax_table_la_LIBADD = \
-  libgncmod-dialog-tax-table.la \
-  ${G_WRAP_LINK_ARGS}
-
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = \
-  gw-dialog-tax-table.scm \
-  gw-dialog-tax-table-spec.scm
-
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
 gncmod_DATA = dialog-tax-table.scm
 
@@ -60,42 +53,27 @@
 glade_DATA = tax-tables.glade
 
 EXTRA_DIST = \
+  dialog-tax-table.i \
   ${glade_DATA} \
-  ${gwmod_DATA} \
   ${gncmod_DATA}
 
 if GNUCASH_SEPARATE_BUILDDIR
 #Only needed when srcdir and builddir are different
-# for compline
-SCM_FILE_LINKS = gw-dialog-tax-table-spec.scm
 # for running
-SCM_FILE_LINKS += ${gncmod_DATA}
+SCM_FILE_LINKS = ${gncmod_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-gw-dialog-tax-table.scm gw-dialog-tax-table.c gw-dialog-tax-table.h: \
-  .scm-links gw-dialog-tax-table-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	 (set! %load-path (cons \"${PWD}\" %load-path)) \
-	 (set! %load-path (cons \"../business-core\" %load-path)) \
-	 (set! %load-path (cons \"../../engine\" %load-path)) \
-	 (set! %load-path (cons \"../../app-utils\" %load-path)) \
-	 (set! %load-path (cons \"../../gnome-utils\" %load-path)) \
-	 (primitive-load \"./gw-dialog-tax-table-spec.scm\") \
-	 (gw:generate-wrapset \"gw-dialog-tax-table\")"
-
-BUILT_SOURCES = gw-dialog-tax-table.scm gw-dialog-tax-table.c \
-	gw-dialog-tax-table.h
-CLEANFILES = g-wrapped gnucash .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-dialog-tax-table.html
+noinst_DATA = .scm-links
+CLEANFILES = gnucash .scm-links ${SCM_FILE_LINKS}
+MAINTAINERCLEANFILES = swig-dialog-tax-table.c

Modified: gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -32,6 +32,7 @@
 #include "gnc-component-manager.h"
 #include "gnc-ui.h"
 #include "gnc-gui-query.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-ui-util.h"
 #include "qof.h"
 #include "gnc-amount-edit.h"
@@ -43,23 +44,32 @@
 #define DIALOG_TAX_TABLE_CM_CLASS "tax-table-dialog"
 #define GCONF_SECTION "dialogs/business/tax_tables"
 
+enum tax_table_cols {
+  TAX_TABLE_COL_NAME = 0,
+  TAX_TABLE_COL_POINTER,
+  NUM_TAX_TABLE_COLS
+};
+
+enum tax_entry_cols {
+  TAX_ENTRY_COL_NAME = 0,
+  TAX_ENTRY_COL_POINTER,
+  TAX_ENTRY_COL_AMOUNT,
+  NUM_TAX_ENTRY_COLS
+};
+
 void tax_table_new_table_cb (GtkButton *button, TaxTableWindow *ttw);
 void tax_table_delete_table_cb (GtkButton *button, TaxTableWindow *ttw);
 void tax_table_new_entry_cb (GtkButton *button, TaxTableWindow *ttw);
 void tax_table_edit_entry_cb (GtkButton *button, TaxTableWindow *ttw);
 void tax_table_delete_entry_cb (GtkButton *button, TaxTableWindow *ttw);
-void tax_table_row_selected (GtkCList *clist, gint row, gint column,
-			     GdkEventButton *event, gpointer user_data);
-void tax_table_entry_row_selected (GtkCList *clist, gint row, gint column,
-				   GdkEventButton *event, gpointer user_data);
 void tax_table_window_close (GtkWidget *widget, gpointer data);
 void tax_table_window_destroy_cb (GtkWidget *widget, gpointer data);
 
 
 struct _taxtable_window {
   GtkWidget *	dialog;
-  GtkWidget *	names_clist;
-  GtkWidget *	entries_clist;
+  GtkWidget *	names_view;
+  GtkWidget *	entries_view;
 
   GncTaxTable *	current_table;
   GncTaxTableEntry *	current_entry;
@@ -175,45 +185,17 @@
 }
 
 static void
-optionmenu_changed (GtkWidget *widget, NewTaxTable *ntt)
+combo_changed (GtkWidget *widget, NewTaxTable *ntt)
 {
-  g_return_if_fail (ntt);
-  ntt->type = GPOINTER_TO_INT (g_object_get_data (G_OBJECT(widget), "option"));
-}
+  gint index;
 
-static GtkWidget *
-add_menu_item (GtkWidget *menu, NewTaxTable *ntt, char *label, gint type)
-	       
-{
-  GtkWidget *item;
+  g_return_if_fail(GTK_IS_COMBO_BOX(widget));
+  g_return_if_fail(ntt);
 
-  item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", GINT_TO_POINTER (type));
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (optionmenu_changed), ntt);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
+  index = gtk_combo_box_get_active(GTK_COMBO_BOX(widget));
+  ntt->type = index + 1;
 }
 
-static GtkWidget *
-make_menu (GtkWidget *omenu, NewTaxTable *ntt)
-{
-  GtkWidget *menu, *value, *percent;
-  int current = ntt->type - 1;
-
-  menu = gtk_menu_new ();
-  value = add_menu_item (menu, ntt, _("Value $"), GNC_AMT_TYPE_VALUE);
-  /* xgettext:no-c-format */
-  percent = add_menu_item (menu, ntt, _("Percent %"), GNC_AMT_TYPE_PERCENT);
-
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT ((current == GNC_AMT_TYPE_VALUE-1 ?
-					value : percent)), "activate", ntt);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), current);
-  return menu;
-}
-
 static GncTaxTable *
 new_tax_table_dialog (TaxTableWindow *ttw, gboolean new_table,
 		      GncTaxTableEntry *entry, const char *name)
@@ -221,9 +203,9 @@
   GncTaxTable *created_table = NULL;
   NewTaxTable *ntt;
   GladeXML *xml;
-  GtkWidget *box, *widget;
+  GtkWidget *box, *widget, *combo;
   gboolean done;
-  gint response;
+  gint response, index;
 
   if (!ttw) return NULL;
   if (new_table && entry) return NULL;
@@ -246,7 +228,10 @@
     gtk_entry_set_text (GTK_ENTRY (ntt->name_entry), name);
 
   /* Create the menu */
-  make_menu (glade_xml_get_widget (xml, "type_menu"), ntt);
+  combo = glade_xml_get_widget (xml, "type_combobox");
+  index = ntt->type ? ntt->type : GNC_AMT_TYPE_VALUE;
+  gtk_combo_box_set_active(GTK_COMBO_BOX(combo), index - 1);
+  g_signal_connect (combo, "changed", G_CALLBACK (combo_changed), ntt);
 
   /* Attach our own widgets */
   box = glade_xml_get_widget (xml, "amount_box");
@@ -332,26 +317,27 @@
 /***********************************************************************/
 
 static void
-tax_table_entries_refresh (TaxTableWindow *ttw, gboolean new_table)
+tax_table_entries_refresh (TaxTableWindow *ttw)
 {
   GList *list, *node;
-  GtkAdjustment *vadjustment = NULL;
-  GtkCList *clist;
-  gfloat save_value = 0.0;
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeSelection *selection;
+  GtkTreeRowReference *reference = NULL;
+  GncTaxTableEntry *selected_entry;
 
   g_return_if_fail (ttw);
 
-  clist = GTK_CLIST (ttw->entries_clist);
+  view = GTK_TREE_VIEW (ttw->entries_view);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
 
-  if (!new_table) {
-    vadjustment = gtk_clist_get_vadjustment (clist);
-    if (vadjustment)
-      save_value = vadjustment->value;
-  }
-
   /* Clear the list */
-  gtk_clist_freeze (clist);
-  gtk_clist_clear (clist);
+  selected_entry = ttw->current_entry;
+  gtk_list_store_clear (store);
+  if (ttw->current_table == NULL)
+    return;
 
   /* Add the items to the list */
   list = gncTaxTableGetEntries (ttw->current_table);
@@ -360,7 +346,6 @@
 
   for (node = list ; node; node = node->next) {
     char *row_text[3];
-    gint row;
     GncTaxTableEntry *entry = node->data;
     Account *acc = gncTaxTableEntryGetAccount (entry);
     gnc_numeric amount = gncTaxTableEntryGetAmount (entry);
@@ -380,126 +365,115 @@
 					  gnc_default_print_info (TRUE)));
       break;
     }
-    row_text[2] = NULL;
 
-    row = gtk_clist_prepend (clist, row_text);
-    gtk_clist_set_row_data (clist, row, entry);
-    gtk_clist_set_selectable (clist, row, TRUE);
+    gtk_list_store_prepend(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       TAX_ENTRY_COL_NAME, row_text[0],
+		       TAX_ENTRY_COL_POINTER, entry,
+		       TAX_ENTRY_COL_AMOUNT, row_text[1],
+		       -1);
+    if (entry == selected_entry) {
+      path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+      gtk_tree_path_free(path);
+    }
 
     g_free (row_text[0]);
     g_free (row_text[1]);
   }
 
-  g_list_free (list);
-
-  if (!new_table) {
-    if (vadjustment) {
-      save_value = CLAMP (save_value, vadjustment->lower,
-			  vadjustment->upper - vadjustment->page_size);
-      gtk_adjustment_set_value (vadjustment, save_value);
+  if (reference) {
+    path = gtk_tree_row_reference_get_path(reference);
+    gtk_tree_row_reference_free(reference);
+    if (path) {
+      selection = gtk_tree_view_get_selection(view);
+      gtk_tree_selection_select_path(selection, path);
+      gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE, 0.5, 0.0);
+      gtk_tree_path_free(path);
     }
   }
-
-  gtk_clist_thaw (clist);
-
-  {
-    gint row = gtk_clist_find_row_from_data (clist, ttw->current_entry);
-
-    if (row < 0)
-      row = 0;
-
-    gtk_clist_select_row (clist, row, 0);
-
-    /* If this row isn't visible, move it to the center */
-    if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_FULL)
-      gtk_clist_moveto (clist, row, 0, 0.5, 0);
-  }
 }
 
 static void
 tax_table_window_refresh (TaxTableWindow *ttw)
 {
   GList *list, *node;
-  GtkAdjustment *vadjustment;
-  GtkCList *clist;
-  gfloat save_value = 0.0;
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeSelection *selection;
+  GtkTreeRowReference *reference = NULL;
 
   g_return_if_fail (ttw);
-  clist = GTK_CLIST (ttw->names_clist);
+  view = GTK_TREE_VIEW (ttw->names_view);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
 
-  vadjustment = gtk_clist_get_vadjustment (clist);
-  if (vadjustment)
-    save_value = vadjustment->value;
-
   /* Clear the list */
-  gtk_clist_freeze (clist);
-  gtk_clist_clear (clist);
+  gtk_list_store_clear(store);
 
   gnc_gui_component_clear_watches (ttw->component_id);
 
   /* Add the items to the list */
   list = gncTaxTableGetTables (ttw->book);
-
-  /* If there are no tables, clear the entries list */
-  if (list == NULL)
-    gtk_clist_clear (GTK_CLIST (ttw->entries_clist));
-  else
+  if (list)    
     list = g_list_reverse (g_list_copy (list));
 
   for (node = list; node; node = node->next) {
-    char *row_text[2];
-    gint row;
     GncTaxTable *table = node->data;
 
     gnc_gui_component_watch_entity (ttw->component_id,
 				    gncTaxTableGetGUID (table),
 				    QOF_EVENT_MODIFY);
 
-    row_text[0] = (char *)gncTaxTableGetName (table);
-    row_text[1] = NULL;
-
-    row = gtk_clist_prepend (clist, row_text);
-    gtk_clist_set_row_data (clist, row, table);
-    gtk_clist_set_selectable (clist, row, TRUE);
+    gtk_list_store_prepend(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       TAX_TABLE_COL_NAME, gncTaxTableGetName (table),
+		       TAX_TABLE_COL_POINTER, table,
+		       -1);
+    if (table == ttw->current_table) {
+      path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+      gtk_tree_path_free(path);
+    }
   }
 
-  g_list_free (list);
+  if (list)
+    g_list_free (list);
 
   gnc_gui_component_watch_entity_type (ttw->component_id,
 				       GNC_TAXTABLE_MODULE_NAME,
 				       QOF_EVENT_CREATE | QOF_EVENT_DESTROY);
 
-  if (vadjustment) {
-    save_value = CLAMP (save_value, vadjustment->lower,
-			vadjustment->upper - vadjustment->page_size);
-    gtk_adjustment_set_value (vadjustment, save_value);
+  if (reference) {
+    path = gtk_tree_row_reference_get_path(reference);
+    gtk_tree_row_reference_free(reference);
+    if (path) {
+      selection = gtk_tree_view_get_selection(view);
+      gtk_tree_selection_select_path(selection, path);
+      gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE, 0.5, 0.0);
+      gtk_tree_path_free(path);
+    }
   }
-
-  gtk_clist_thaw (clist);
-
-  {
-    gint row = gtk_clist_find_row_from_data (clist, ttw->current_table);
-
-    if (row < 0)
-      row = 0;
-
-    gtk_clist_select_row (clist, row, 0);
-
-    /* If this row isn't visible, move it to the center */
-    if (gtk_clist_row_is_visible (clist, row) != GTK_VISIBILITY_FULL)
-      gtk_clist_moveto (clist, row, 0, 0.5, 0);
-  }
+  ;;  tax_table_entries_refresh (ttw);
   /* select_row() above will refresh the entries window */
 }
 
-void
-tax_table_row_selected (GtkCList *clist, gint row, gint column,
-			GdkEventButton *event, gpointer user_data)
+static void
+tax_table_selection_changed (GtkTreeSelection *selection,
+			     gpointer          user_data)
 {
   TaxTableWindow *ttw = user_data;
-  GncTaxTable *table = gtk_clist_get_row_data (clist, row);
+  GncTaxTable *table;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
 
   g_return_if_fail (ttw);
+
+  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+    return;
+
+  gtk_tree_model_get(model, &iter, TAX_TABLE_COL_POINTER, &table, -1);
   g_return_if_fail (table);
 
   /* If we've changed, then reset the entry list */
@@ -508,26 +482,38 @@
     ttw->current_entry = NULL;
   }
   /* And force a refresh of the entries */
-  tax_table_entries_refresh (ttw, TRUE);
+  tax_table_entries_refresh (ttw);
 }
 
-void
-tax_table_entry_row_selected (GtkCList *clist, gint row, gint column,
-			      GdkEventButton *event, gpointer user_data)
+static void
+tax_table_entry_selection_changed (GtkTreeSelection *selection,
+				   gpointer          user_data)
 {
   TaxTableWindow *ttw = user_data;
-  GncTaxTableEntry *entry = gtk_clist_get_row_data (clist, row);
+  GtkTreeModel *model;
+  GtkTreeIter iter;
 
   g_return_if_fail (ttw);
-  g_return_if_fail (entry);
 
-  ttw->current_entry = entry;
+  if (!gtk_tree_selection_get_selected(selection, &model, &iter)) {
+    ttw->current_entry = NULL;
+    return;
+  }
 
-  /* If we double-click an item, then pop up an 'edit' window */
-  if (event && event->type == GDK_2BUTTON_PRESS)
-    new_tax_table_dialog (ttw, FALSE, entry, NULL);
+  gtk_tree_model_get(model, &iter, TAX_ENTRY_COL_POINTER, &ttw->current_entry, -1);
 }
 
+static void
+tax_table_entry_row_activated (GtkTreeView       *tree_view,
+			       GtkTreePath       *path,
+			       GtkTreeViewColumn *column,
+			       gpointer           user_data)
+{
+  TaxTableWindow *ttw = user_data;
+
+  new_tax_table_dialog (ttw, FALSE, ttw->current_entry, NULL);
+}
+
 void
 tax_table_new_table_cb (GtkButton *button, TaxTableWindow *ttw)
 {
@@ -665,6 +651,11 @@
 {
   TaxTableWindow *ttw;
   GladeXML *xml;
+  GtkTreeView *view;
+  GtkTreeViewColumn *column;
+  GtkCellRenderer *renderer;
+  GtkListStore *store;
+  GtkTreeSelection *selection;
 
   if (!book) return NULL;
 
@@ -687,9 +678,47 @@
   /* Open and read the XML */
   xml = gnc_glade_xml_new ("tax-tables.glade", "Tax Table Window");
   ttw->dialog = glade_xml_get_widget (xml, "Tax Table Window");
-  ttw->names_clist = glade_xml_get_widget (xml, "tax_tables_clist");
-  ttw->entries_clist = glade_xml_get_widget (xml, "tax_table_entries");
+  ttw->names_view = glade_xml_get_widget (xml, "tax_tables_view");
+  ttw->entries_view = glade_xml_get_widget (xml, "tax_table_entries");
 
+  /* Create the tax tables view */
+  view = GTK_TREE_VIEW(ttw->names_view);
+  store = gtk_list_store_new (NUM_TAX_TABLE_COLS, G_TYPE_STRING,
+			      G_TYPE_POINTER);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes("", renderer,
+						    "text", TAX_TABLE_COL_NAME,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(tax_table_selection_changed), ttw);
+
+
+  /* Create the tax table entries view */
+  view = GTK_TREE_VIEW(ttw->entries_view);
+  store = gtk_list_store_new (NUM_TAX_ENTRY_COLS, G_TYPE_STRING,
+			      G_TYPE_POINTER, G_TYPE_STRING);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes("", renderer,
+						    "text", TAX_ENTRY_COL_NAME,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(tax_table_entry_selection_changed), ttw);
+  g_signal_connect(view, "row-activated",
+		   G_CALLBACK(tax_table_entry_row_activated), ttw);
+
+
   /* Setup signals */
   glade_xml_signal_autoconnect_full( xml,
                                      gnc_glade_autoconnect_full_func,

Copied: gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.i (from rev 15058, gnucash/trunk/src/business/dialog-tax-table/dialog-tax-table.i)

Modified: gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/dialog-tax-table/dialog-tax-table.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,2 +1 @@
 (define-module (gnucash dialog-tax-table))
-(use-modules (g-wrapped gw-dialog-tax-table))

Modified: gnucash/branches/register-rewrite/src/business/dialog-tax-table/gncmod-dialog-tax-table.c
===================================================================
--- gnucash/branches/register-rewrite/src/business/dialog-tax-table/gncmod-dialog-tax-table.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/dialog-tax-table/gncmod-dialog-tax-table.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -29,8 +29,8 @@
 
 #include "gnc-module.h"
 #include "gnc-module-api.h"
-#include "gw-dialog-tax-table.h"
 
+extern SCM scm_init_sw_dialog_tax_table_module(void);
 /* version of the gnc module system interface we require */
 int libgncmod_dialog_tax_table_LTX_gnc_module_system_interface = 0;
 
@@ -73,8 +73,8 @@
     return FALSE;
   }
 
-  scm_c_eval_string("(use-modules (g-wrapped gw-dialog-tax-table))");
-  //  scm_c_eval_string("(use-modules (gnucash dialog-tax-table))");
+  scm_init_sw_dialog_tax_table_module();
+  scm_c_eval_string("(use-modules (sw_dialog_tax_table))");
 
   return TRUE;
 }

Deleted: gnucash/branches/register-rewrite/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/dialog-tax-table/gw-dialog-tax-table-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,57 +0,0 @@
-;;; -*-scheme-*-
-
-;(debug-enable 'backtrace)
-;(debug-enable 'debug)
-;(read-enable 'positions)
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(define-module (g-wrapped gw-dialog-tax-table-spec)
-  :use-module (g-wrap))
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-
-(use-modules (g-wrapped gw-business-core-spec))
-(use-modules (g-wrapped gw-gnome-utils-spec))
-
-(let ((ws (gw:new-wrapset "gw-dialog-tax-table")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-
-  (gw:wrapset-depends-on ws "gw-business-core")
-  (gw:wrapset-depends-on ws "gw-engine")
-  (gw:wrapset-depends-on ws "gw-gnome-utils")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-dialog-tax-table))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <config.h>\n"
-      "#include <dialog-tax-table.h>\n"
-      )))
-
-  (gw:wrapset-add-cs-initializers!
-   ws
-   (lambda (wrapset client-wrapset status-var) 
-     (if client-wrapset
-         '()
-         (gw:inline-scheme '(use-modules (gnucash dialog-tax-table))))))
-  
-  ;;
-  ;; dialog-tax-table.h
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:tax-table-new
-   '<gw:void>
-   "gnc_ui_tax_table_window_new"
-   '((<gnc:Book*> book))
-   "Dialog: Edit the Tax Tables.")
-)

Modified: gnucash/branches/register-rewrite/src/business/dialog-tax-table/tax-tables.glade
===================================================================
--- gnucash/branches/register-rewrite/src/business/dialog-tax-table/tax-tables.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/business/dialog-tax-table/tax-tables.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -107,30 +107,14 @@
 		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		      <child>
-			<widget class="GtkCList" id="tax_tables_clist">
+			<widget class="GtkTreeView" id="tax_tables_view">
 			  <property name="visible">True</property>
 			  <property name="can_focus">True</property>
-			  <property name="n_columns">1</property>
-			  <property name="column_widths">80</property>
-			  <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-			  <property name="show_titles">False</property>
-			  <property name="shadow_type">GTK_SHADOW_IN</property>
-			  <signal name="select_row" handler="tax_table_row_selected" last_modification_time="Mon, 08 Sep 2003 03:31:16 GMT"/>
-
-			  <child>
-			    <widget class="GtkLabel" id="label23">
-			      <property name="label" translatable="yes"></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.5</property>
-			      <property name="yalign">0.5</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">0</property>
-			    </widget>
-			  </child>
+			  <property name="headers_visible">False</property>
+			  <property name="rules_hint">True</property>
+			  <property name="reorderable">False</property>
+			  <property name="enable_search">True</property>
+			  <property name="fixed_height_mode">False</property>
 			</widget>
 		      </child>
 		    </widget>
@@ -250,30 +234,14 @@
 		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		      <child>
-			<widget class="GtkCList" id="tax_table_entries">
+			<widget class="GtkTreeView" id="tax_table_entries">
 			  <property name="visible">True</property>
 			  <property name="can_focus">True</property>
-			  <property name="n_columns">1</property>
-			  <property name="column_widths">80</property>
-			  <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-			  <property name="show_titles">False</property>
-			  <property name="shadow_type">GTK_SHADOW_IN</property>
-			  <signal name="select_row" handler="tax_table_entry_row_selected" last_modification_time="Mon, 08 Sep 2003 03:31:06 GMT"/>
-
-			  <child>
-			    <widget class="GtkLabel" id="label23">
-			      <property name="label" translatable="yes"></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.5</property>
-			      <property name="yalign">0.5</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">0</property>
-			    </widget>
-			  </child>
+			  <property name="headers_visible">False</property>
+			  <property name="rules_hint">True</property>
+			  <property name="reorderable">False</property>
+			  <property name="enable_search">True</property>
+			  <property name="fixed_height_mode">False</property>
 			</widget>
 		      </child>
 		    </widget>
@@ -630,7 +598,7 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">type_menu</property>
+		  <property name="mnemonic_widget">type_combobox</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -665,43 +633,6 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkOptionMenu" id="type_menu">
-	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="history">0</property>
-
-	      <child internal-child="menu">
-		<widget class="GtkMenu" id="convertwidget5">
-		  <property name="visible">True</property>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget6">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Value ($)</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget7">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Percent (%)</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="left_attach">1</property>
-	      <property name="right_attach">2</property>
-	      <property name="top_attach">4</property>
-	      <property name="bottom_attach">5</property>
-	      <property name="y_options"></property>
-	    </packing>
-	  </child>
-
-	  <child>
 	    <widget class="GtkHBox" id="amount_box">
 	      <property name="visible">True</property>
 	      <property name="homogeneous">False</property>
@@ -758,6 +689,23 @@
 	      <property name="y_options">fill</property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <widget class="GtkComboBox" id="type_combobox">
+	      <property name="visible">True</property>
+	      <property name="items" translatable="yes">Value $
+Percent %</property>
+	      <property name="focus_on_click">True</property>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">2</property>
+	      <property name="top_attach">4</property>
+	      <property name="bottom_attach">5</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>

Modified: gnucash/branches/register-rewrite/src/calculation/expression_parser.c
===================================================================
--- gnucash/branches/register-rewrite/src/calculation/expression_parser.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/calculation/expression_parser.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -380,6 +380,7 @@
  * stack will probably never be needed.
  */
 
+#include "config.h"
 #include <ctype.h>
 #include <stdio.h>
 #include <string.h>


Property changes on: gnucash/branches/register-rewrite/src/core-utils
___________________________________________________________________
Name: svn:ignore
   - *.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gw-core-utils.c
gw-core-utils.h
gw-core-utils.html
gw-core-utils.scm
gnucash
g-wrapped


semantic.cache

TAGS

   + *.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
swig-core-utils.c
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/core-utils/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,4 +1,4 @@
-lib_LTLIBRARIES = libcore-utils.la libgw-core-utils.la
+lib_LTLIBRARIES = libcore-utils.la
 
 libcore_utils_la_SOURCES = \
   gnc-main.c \
@@ -6,22 +6,16 @@
   gnc-gdate-utils.c \
   gnc-gkeyfile-utils.c \
   gnc-glib-utils.c \
-  gnc-gobject-utils.c
+  gnc-gobject-utils.c \
+  swig-core-utils.c \
+  gnc-gtk-utils.c
 
 libcore_utils_la_LIBADD = \
+  ${GUILE_LIBS} \
   ${GLIB_LIBS} \
   ${GCONF_LIBS} \
   ${GTK_LIBS}
 
-libgw_core_utils_la_SOURCES = \
-  gw-core-utils.c
-
-libgw_core_utils_la_LDFLAGS = ${G_WRAP_LINK_ARGS}
-libgw_core_utils_la_LIBADD = \
-  libcore-utils.la \
-  ${GLIB_LIBS} \
-  ${GUILE_LIBS}
-
 noinst_HEADERS = \
   gnc-main.h \
   gnc-gconf-utils.h \
@@ -29,43 +23,41 @@
   gnc-gkeyfile-utils.h \
   gnc-glib-utils.h \
   gnc-gobject-utils.h \
-  gw-core-utils.h
+  gnc-gtk-utils.h
 
-EXTRA_DIST = ${gwmod_DATA}
+if BUILDING_FROM_SVN
+swig-core-utils.c: core-utils.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
 AM_CFLAGS = \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${GLIB_CFLAGS} \
   ${GCONF_CFLAGS} \
   ${GTK_CFLAGS}
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-core-utils-spec.scm gw-core-utils.scm
+gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
+gncmod_DATA = core-utils.scm
 
 if GNUCASH_SEPARATE_BUILDDIR
 #Only needed when srcdir and builddir are different
-SCM_FILE_LINKS = gw-core-utils-spec.scm
+#for running
+SCM_FILE_LINKS = ${gncmod_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-gw-core-utils.scm gw-core-utils.h gw-core-utils.c gw-core-utils.html: \
-  gw-core-utils-spec.scm .scm-links ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-          "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-           (primitive-load \"./gw-core-utils-spec.scm\") \
-           (gw:generate-wrapset \"gw-core-utils\")"
-
-BUILT_SOURCES = gw-core-utils.scm gw-core-utils.h gw-core-utils.c
-CLEANFILES = g-wrapped gnucash .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-core-utils.html
+noinst_DATA = .scm-links
+EXTRA_DIST = $(gncmod_DATA) core-utils.i
+CLEANFILES = gnucash .scm-links
+MAINTAINERCLEANFILES = swig-core-utils.c

Copied: gnucash/branches/register-rewrite/src/core-utils/core-utils.i (from rev 15058, gnucash/trunk/src/core-utils/core-utils.i)

Copied: gnucash/branches/register-rewrite/src/core-utils/core-utils.scm (from rev 15058, gnucash/trunk/src/core-utils/core-utils.scm)

Modified: gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -29,8 +29,8 @@
 #include "gnc-gconf-utils.h"
 
 #define APP_GNUCASH "/apps/gnucash"
-#define CLIENT_TAG  "%s-client"
-#define NOTIFY_TAG  "%s-notify_id"
+#define CLIENT_TAG  "%s-%s-client"
+#define NOTIFY_TAG  "%s-%s-notify_id"
 
 static GConfClient *our_client = NULL;
 static guint gconf_general_cb_id = 0;
@@ -743,7 +743,8 @@
 void
 gnc_gconf_add_notification (GObject *object,
 			    const gchar *section,
-			    GConfClientNotifyFunc callback)
+			    GConfClientNotifyFunc callback,
+			    const gchar *whoami)
 {
 	GConfClient *client;
 	GError *error = NULL;
@@ -752,6 +753,7 @@
 
 	g_return_if_fail(G_IS_OBJECT(object));
 	g_return_if_fail(callback != NULL);
+	g_return_if_fail(whoami != NULL);
 
 	client = gconf_client_get_default();
 	path = gnc_gconf_section_name(section);
@@ -785,8 +787,8 @@
 	/*
 	 * Save the values needed to undo this later.
 	 */
-	client_tag = g_strdup_printf(CLIENT_TAG, section);
-	notify_tag = g_strdup_printf(NOTIFY_TAG, section);
+	client_tag = g_strdup_printf(CLIENT_TAG, section ? section:"", whoami);
+	notify_tag = g_strdup_printf(NOTIFY_TAG, section ? section:"", whoami);
 	g_object_set_data(object, client_tag, client);
 	g_object_set_data(object, notify_tag, GUINT_TO_POINTER(id));
 	g_free(notify_tag);
@@ -843,22 +845,24 @@
 
 void
 gnc_gconf_remove_notification (GObject *object,
-			       const gchar *section)
+			       const gchar *section,
+			       const gchar *whoami)
 {
 	GConfClient *client;
 	gchar *path, *client_tag, *notify_tag;
 	guint id;
 
 	g_return_if_fail(G_IS_OBJECT(object));
+	g_return_if_fail(whoami != NULL);
 
 	/*
 	 * Remove any gconf notifications
 	 */
-	client_tag = g_strdup_printf(CLIENT_TAG, section);
+	client_tag = g_strdup_printf(CLIENT_TAG, section ? section:"", whoami);
 	client = g_object_get_data(object, client_tag);
 	path = gnc_gconf_section_name(section);
 	if (client) {
-	  notify_tag = g_strdup_printf(NOTIFY_TAG, section);
+	  notify_tag = g_strdup_printf(NOTIFY_TAG, section ? section:"", whoami);
 	  id = GPOINTER_TO_UINT(g_object_get_data(object, notify_tag));
 	  gconf_client_notify_remove(client, id);
 	  gconf_client_remove_dir(client, path, NULL);

Modified: gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.h
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/gnc-gconf-utils.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -56,7 +56,7 @@
 #define GCONF_WARNINGS_PERM	"general/warnings/permanent"
 
 /* Keys used across multiple modules */
-#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
+#define DESKTOP_GNOME_INTERFACE "desktop/gnome/interface"
 #define KEY_TOOLBAR_STYLE	"toolbar_style"
 #define KEY_SAVE_GEOMETRY	"save_window_geometry"
 #define KEY_LAST_PATH		"last_path"
@@ -167,7 +167,7 @@
 
 /** Register a callback for when a specific key in the general section
  *  of Gnucash's gconf data is changed.  Any time the key's value
- *  chagnes, the routine will be invoked and will be passed both the
+ *  changes, the routine will be invoked and will be passed both the
  *  changes gconf entry and the user data passed to this function.
  *
  *  @param key This value contains the name of the key within the
@@ -765,10 +765,15 @@
  *  @param callback The function to call when a value changes.  This
  *  function will receive the key/value pair as one argument, and the
  *  'object' argument to this function as another of its arguments.
+ *
+ *  @param whoami A magic value that must match up this call to the
+ *  corresponding call to gnc_gconf_remove_notification().  The pair of
+ *  section and whoami should be unique across all callers.
  */
 void gnc_gconf_add_notification (GObject *object,
 				 const gchar *section,
-				 GConfClientNotifyFunc callback);
+				 GConfClientNotifyFunc callback,
+				 const gchar *whoami);
 
 
 /** An alternative function for adding a notification callback to
@@ -820,9 +825,14 @@
  *
  *  @param section This string is used to find the correct
  *  notification function to remove from GConf.
+ *
+ *  @param whoami A magic value that must match up this call to the
+ *  corresponding call to gnc_gconf_add_notification().  The pair of
+ *  section and whoami should be unique across all callers.
  */
 void gnc_gconf_remove_notification (GObject *object,
-				    const gchar *section);
+				    const gchar *section,
+				    const gchar *whoami);
 
 
 

Modified: gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -214,3 +214,11 @@
     memmove(end, end+1, len);	/* shuffle the remainder one byte */
   } while (!gnc_utf8_validate(str, -1, (const gchar **)&end));
 }
+
+gchar *
+gnc_utf8_strip_invalid_strdup(const gchar* str)
+{
+  gchar *result = g_strdup (str);
+  gnc_utf8_strip_invalid (result);
+  return result;
+}

Modified: gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.h
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/gnc-glib-utils.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -67,7 +67,21 @@
  *  characters. */
 void gnc_utf8_strip_invalid (gchar *str);
 
+/** Returns a newly allocated copy of the given string but with any
+ * non-utf8 character stripped from it.
+ *
+ * Note that it also removes some subset of invalid XML characters,
+ * too.  See http://www.w3.org/TR/REC-xml/#NT-Char linked from bug
+ * #346535
+ *
+ * @param str A pointer to the string to be copied and stripped of
+ * non-utf8 characters.
+ *
+ * @return A newly allocated string that has to be g_free'd by the
+ * caller. */
+gchar *gnc_utf8_strip_invalid_strdup (const gchar* str);
 
+
 /** @} */
 
 #endif /* GNC_GLIB_UTILS_H */

Copied: gnucash/branches/register-rewrite/src/core-utils/gnc-gtk-utils.c (from rev 15058, gnucash/trunk/src/core-utils/gnc-gtk-utils.c)

Copied: gnucash/branches/register-rewrite/src/core-utils/gnc-gtk-utils.h (from rev 15058, gnucash/trunk/src/core-utils/gnc-gtk-utils.h)

Modified: gnucash/branches/register-rewrite/src/core-utils/gnc-main.c
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/gnc-main.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/gnc-main.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,11 +24,11 @@
 #include "config.h"
 #include "gnc-main.h"
 
-static char *namespace_regexp = NULL;
-static int is_debugging;
+static gchar *namespace_regexp = NULL;
+static gboolean is_debugging;
 
 void 
-gnc_main_set_namespace_regexp(const char *str)
+gnc_main_set_namespace_regexp(const gchar *str)
 {
     if (namespace_regexp)
         g_free(namespace_regexp);
@@ -37,20 +37,20 @@
         namespace_regexp = g_strdup(str);
 }
 
-const char *
+const gchar *
 gnc_main_get_namespace_regexp(void)
 {
     return namespace_regexp;
 }
 
-int 
+gboolean
 gnc_is_debugging(void)
 {
     return is_debugging;
 }
 
 void
-gnc_set_debugging(int d)
+gnc_set_debugging(gboolean d)
 {
     is_debugging = d;
 }

Modified: gnucash/branches/register-rewrite/src/core-utils/gnc-main.h
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/gnc-main.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/gnc-main.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -26,10 +26,10 @@
 
 #include <glib.h>
 
-void gnc_main_set_namespace_regexp(const char *str);
-const char *gnc_main_get_namespace_regexp(void);
+void gnc_main_set_namespace_regexp(const gchar *str);
+const gchar *gnc_main_get_namespace_regexp(void);
 
-int gnc_is_debugging(void);
-void gnc_set_debugging(int d);
+gboolean gnc_is_debugging(void);
+void gnc_set_debugging(gboolean d);
 
 #endif /* GNC_MAIN_H */

Deleted: gnucash/branches/register-rewrite/src/core-utils/gw-core-utils-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/core-utils/gw-core-utils-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/core-utils/gw-core-utils-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,64 +0,0 @@
-;;; -*-scheme-*-
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(define-module (g-wrapped gw-core-utils-spec))
-
-(use-modules (g-wrap))
-(use-modules (g-wrap simple-type))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(let ((ws (gw:new-wrapset "gw-core-utils")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-core-utils))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <gnc-gconf-utils.h>\n"
-      "#include <gnc-glib-utils.h>\n"
-      "#include <gnc-main.h>\n")))
-
-  (gw:wrap-function
-   ws
-   'gnc:gconf-get-bool
-   '<gw:bool>
-   "gnc_gconf_get_bool_no_error"
-   '(((<gw:mchars> caller-owned) section)
-     ((<gw:mchars> caller-owned) name))
-   "Get a boolean value from gconf.")
-
-  (gw:wrap-function
-   ws
-   'gnc:debugging?
-   '<gw:bool>
-   "gnc_is_debugging"
-   '()
-   "Is debugging mode on?")
-
-  (gw:wrap-function
-   ws
-   'g:find-program-in-path
-   '(<gw:mchars> callee-owned const)
-   "g_find_program_in_path"
-   '(((<gw:mchars> caller-owned) program))
-   "Get a boolean value from gconf.")
-
-  (gw:wrap-function
-   ws
-   'gnc:utf8-strip-invalid
-   '<gw:void>
-   "gnc_utf8_strip_invalid"
-   '(((<gw:mchars> caller-owned) program))
-   "Strip string of non-utf8 characters.")
-
-)


Property changes on: gnucash/branches/register-rewrite/src/engine
___________________________________________________________________
Name: svn:ignore
   - *.lo
*.la
.deps
.libs
.scm-links
Makefile
Makefile.in
gw-engine.scm
gw-engine.c
gw-engine.h
gw-engine.html
gw-glib.scm
gw-glib.c
gw-glib.h
gw-glib.html
gw-kvp.scm
gw-kvp.c
gw-kvp.h
gw-kvp.html
iso-4217-currencies.c
test-link
.DS_Store
qofla-dir.h
gncla-dir.h
g-wrapped
gnucash


semantic.cache

TAGS

   + *.lo
*.la
.deps
.libs
.scm-links
Makefile
Makefile.in
swig-engine.c
iso-4217-currencies.c
test-link
.DS_Store
qofla-dir.h
gncla-dir.h
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/engine/Account.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -124,7 +124,7 @@
   acc->starting_cleared_balance = gnc_numeric_zero();
   acc->starting_reconciled_balance = gnc_numeric_zero();
 
-  acc->type = NO_TYPE;
+  acc->type = ACCT_TYPE_NONE;
 
   acc->accountName = CACHE_INSERT("");
   acc->accountCode = CACHE_INSERT("");
@@ -293,7 +293,7 @@
   acc->cleared_balance = gnc_numeric_zero();
   acc->reconciled_balance = gnc_numeric_zero();
 
-  acc->type = NO_TYPE;
+  acc->type = ACCT_TYPE_NONE;
   acc->commodity = NULL;
 
   acc->version = 0;
@@ -988,8 +988,10 @@
  * order for report generation */
 
 static int typeorder[NUM_ACCOUNT_TYPES] = {
-     BANK, STOCK, MUTUAL, CURRENCY, CASH, ASSET, RECEIVABLE,
-     CREDIT, LIABILITY, PAYABLE, INCOME, EXPENSE, EQUITY };
+     ACCT_TYPE_BANK, ACCT_TYPE_STOCK, ACCT_TYPE_MUTUAL, ACCT_TYPE_CURRENCY,
+     ACCT_TYPE_CASH, ACCT_TYPE_ASSET, ACCT_TYPE_RECEIVABLE,
+     ACCT_TYPE_CREDIT, ACCT_TYPE_LIABILITY, ACCT_TYPE_PAYABLE,
+     ACCT_TYPE_INCOME, ACCT_TYPE_EXPENSE, ACCT_TYPE_EQUITY };
 
 static int revorder[NUM_ACCOUNT_TYPES] = {
      -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1 };
@@ -1271,7 +1273,7 @@
 GNCAccountType
 xaccAccountGetType (const Account *acc)
 {
-   return acc ? acc->type : NO_TYPE;
+   return acc ? acc->type : ACCT_TYPE_NONE;
 }
 
 static const char*
@@ -1989,6 +1991,7 @@
 {
   if (!acc) return;
   
+  xaccAccountBeginEdit (acc);
   kvp_frame_set_string (acc->inst.kvp_data, "hidden",
 			val ? "true" : NULL);
   mark_account (acc);
@@ -2032,14 +2035,14 @@
 /* You must edit the functions in this block in tandem.  KEEP THEM IN
    SYNC! */
 
-#define GNC_RETURN_ENUM_AS_STRING(x) case (x): return #x;
+#define GNC_RETURN_ENUM_AS_STRING(x) case (ACCT_TYPE_ ## x): return #x;
 
 const char *
 xaccAccountTypeEnumAsString(GNCAccountType type) 
 {
   switch(type) 
   {
-    GNC_RETURN_ENUM_AS_STRING(NO_TYPE);
+    GNC_RETURN_ENUM_AS_STRING(NONE);
     GNC_RETURN_ENUM_AS_STRING(BANK);
     GNC_RETURN_ENUM_AS_STRING(CASH);
     GNC_RETURN_ENUM_AS_STRING(CREDIT);
@@ -2067,13 +2070,13 @@
 #undef GNC_RETURN_ENUM_AS_STRING
 
 #define GNC_RETURN_ON_MATCH(x) \
-  if(safe_strcmp(#x, (str)) == 0) { *type = x; return(TRUE); }
+  if(safe_strcmp(#x, (str)) == 0) { *type = ACCT_TYPE_ ## x; return(TRUE); }
 
 gboolean
 xaccAccountStringToType(const char* str, GNCAccountType *type)
 {
 
-  GNC_RETURN_ON_MATCH(NO_TYPE);
+  GNC_RETURN_ON_MATCH(NONE);
   GNC_RETURN_ON_MATCH(BANK);
   GNC_RETURN_ON_MATCH(CASH);
   GNC_RETURN_ON_MATCH(CREDIT);
@@ -2107,7 +2110,7 @@
   GNCAccountType type;
   gboolean rc;
   rc = xaccAccountStringToType(str, &type);
-  if (FALSE == rc) return BAD_TYPE;
+  if (FALSE == rc) return ACCT_TYPE_INVALID;
   return type;
 }
 
@@ -2157,63 +2160,66 @@
   PERR("asked to translate unknown account type string %s.\n",
        str ? str : "(null)");
 
-  return BAD_TYPE;
+  return ACCT_TYPE_INVALID;
 }
 
 
 /********************************************************************\
 \********************************************************************/
 
+guint32
+xaccAccountTypesCompatibleWith (GNCAccountType type)
+{
+  switch (type) {
+  case ACCT_TYPE_BANK:
+  case ACCT_TYPE_CASH:
+  case ACCT_TYPE_ASSET:
+  case ACCT_TYPE_STOCK:
+  case ACCT_TYPE_MUTUAL:
+  case ACCT_TYPE_CURRENCY:
+  case ACCT_TYPE_CREDIT:
+  case ACCT_TYPE_LIABILITY:
+  case ACCT_TYPE_RECEIVABLE:
+  case ACCT_TYPE_PAYABLE:
+    return
+      (1 << ACCT_TYPE_BANK)       |
+      (1 << ACCT_TYPE_CASH)       |
+      (1 << ACCT_TYPE_ASSET)      |
+      (1 << ACCT_TYPE_STOCK)      |
+      (1 << ACCT_TYPE_MUTUAL)     |
+      (1 << ACCT_TYPE_CURRENCY)   |
+      (1 << ACCT_TYPE_CREDIT)     |
+      (1 << ACCT_TYPE_LIABILITY)  |
+      (1 << ACCT_TYPE_RECEIVABLE) |
+      (1 << ACCT_TYPE_PAYABLE);
+  case ACCT_TYPE_INCOME:
+  case ACCT_TYPE_EXPENSE:
+    return
+      (1 << ACCT_TYPE_INCOME)     |
+      (1 << ACCT_TYPE_EXPENSE);
+  case ACCT_TYPE_EQUITY:
+    return
+      (1 << ACCT_TYPE_EQUITY);
+  default:
+    PERR("bad account type: %d", type);
+    return 0;
+  }
+}
+
 gboolean
 xaccAccountTypesCompatible (GNCAccountType parent_type,
                             GNCAccountType child_type)
 {
-  gboolean compatible = FALSE;
-
-  switch(parent_type)
-  {
-    case BANK:
-    case CASH: 
-    case ASSET:
-    case STOCK:
-    case MUTUAL:
-    case CURRENCY:
-    case CREDIT:
-    case LIABILITY:
-    case RECEIVABLE:
-    case PAYABLE:
-      compatible = ((child_type == BANK)     ||
-                    (child_type == CASH)     ||
-                    (child_type == ASSET)    ||
-                    (child_type == STOCK)    ||
-                    (child_type == MUTUAL)   ||
-                    (child_type == CURRENCY) ||
-                    (child_type == CREDIT)   ||
-                    (child_type == LIABILITY)||
-                    (child_type == RECEIVABLE)||
-                    (child_type == PAYABLE));
-      break;
-    case INCOME:
-    case EXPENSE:
-      compatible = ((child_type == INCOME) ||
-                    (child_type == EXPENSE));
-      break;
-    case EQUITY:
-      compatible = (child_type == EQUITY);
-      break;
-    default:
-      PERR("bad account type: %d", parent_type);
-      break;
-  }
-
-  return compatible;
+  return ((xaccAccountTypesCompatibleWith (parent_type) &
+           (1 << child_type))
+          != 0);
 }
 
 guint32
 xaccAccountTypesValid(void)
 {
     guint32 mask = (1 << NUM_ACCOUNT_TYPES) - 1;
-    mask &= ~(1 << CURRENCY);  /* DEPRECATED */
+    mask &= ~(1 << ACCT_TYPE_CURRENCY);  /* DEPRECATED */
 
     return mask;
 }
@@ -2223,8 +2229,8 @@
 {
     if (!acc) return FALSE;
 
-    return (acc->type == STOCK || acc->type == MUTUAL || 
-            acc->type == CURRENCY);
+    return (acc->type == ACCT_TYPE_STOCK || acc->type == ACCT_TYPE_MUTUAL || 
+            acc->type == ACCT_TYPE_CURRENCY);
 }
 
 /********************************************************************\

Modified: gnucash/branches/register-rewrite/src/engine/Account.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Account.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Account.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -72,49 +72,67 @@
 
 typedef enum 
 {
-  BAD_TYPE = -1, /**< Not a type */
-  NO_TYPE = -1,/**< Not a type */
+  ACCT_TYPE_INVALID = -1, /**< Not a type */
+  ACCT_TYPE_NONE = -1,/**< Not a type */
   
-  BANK = 0, /**< The bank account type denotes a savings or checking account
-	     * held at a bank.  Often interest bearing. */
-  CASH = 1,/**< The cash account type is used to denote a shoe-box or pillowcase
-	    * stuffed with cash. */
-  CREDIT = 3, /**< The Credit card account is used to denote credit (e.g. amex)
-	       * and debit (e.g. visa, mastercard) card accounts */
-  ASSET = 2,  /**< asset (and liability) accounts indicate generic, generalized accounts
-	       * that are none of the above. */
-  LIABILITY = 4, /**< liability (and asset) accounts indicate generic, generalized accounts
-		  * that are none of the above. */
-  STOCK = 5,  /**< Stock accounts will typically be shown in registers
-	       * which show three columns: price, number of shares, and value. */
-  MUTUAL= 6, /**< Mutual Fund accounts will typically be shown in registers
-	      * which show three columns: price, number of shares, and value. */
-  CURRENCY = 7, /**< The currency account type indicates that the
-		 * account is a currency trading account.  In many
-		 * ways, a currency trading account is like a stock
-		 * trading account. It is shown in the register with
-		 * three columns: price, number of shares, and
-		 * value. Note: Since version 1.7.0, this account is
-		 * no longer needed to exchange currencies between
-		 * accounts, so this type is DEPRECATED. */
-  INCOME = 8, /**< Income accounts are used to denote income */
+  ACCT_TYPE_BANK = 0,	/**< The bank account type denotes a savings
+			 *   or checking account held at a bank.
+			 *   Often * interest * bearing. */
+  ACCT_TYPE_CASH = 1,	/**< The cash account type is used to denote a
+			 *   shoe-box or pillowcase stuffed with *
+			 *   cash. */
+  ACCT_TYPE_CREDIT = 3,	/**< The Credit card account is used to denote
+			 *   credit (e.g. amex) and debit (e.g. visa,
+			 *   mastercard) * card accounts */
+  ACCT_TYPE_ASSET = 2,	/**< asset (and liability) accounts indicate
+			 *   generic, generalized accounts that are
+			 *   none of the * above. */
+  ACCT_TYPE_LIABILITY = 4,/**< liability (and asset) accounts indicate
+			   *   generic, generalized accounts that are
+			   *   none of the * above. */
+  ACCT_TYPE_STOCK = 5,	/**< Stock accounts will typically be shown in
+			 *   registers which show three columns:
+			 *   price, number of * shares, and value. */
+  ACCT_TYPE_MUTUAL= 6,	/**< Mutual Fund accounts will typically be
+			 *   shown in registers which show three
+			 *   columns: price, * number of shares, and
+			 *   value. */
+  ACCT_TYPE_CURRENCY = 7,/**< The currency account type indicates that
+			  *   the account is a currency trading
+			  *   account.  In many * ways, a currency
+			  *   trading account is like a stock *
+			  *   trading account. It is shown in the
+			  *   register with * three columns: price,
+			  *   number of shares, and * value. Note:
+			  *   Since version 1.7.0, this account is *
+			  *   no longer needed to exchange currencies
+			  *   between * accounts, so this type is
+			  *   DEPRECATED. */
+  ACCT_TYPE_INCOME = 8,	/**< Income accounts are used to denote
+			 *   income */
   
-  EXPENSE = 9,/**< Expense accounts are used to denote expenses. */
+  ACCT_TYPE_EXPENSE = 9,/**< Expense accounts are used to denote
+			 *   expenses. */
   
-  EQUITY = 10,/**< Equity account is used to balance the balance sheet. */
+  ACCT_TYPE_EQUITY = 10,/**< Equity account is used to balance the
+			 *   balance sheet. */
   
-  RECEIVABLE = 11,  /**< A/R account type */
+  ACCT_TYPE_RECEIVABLE = 11,/**< A/R account type */
 
-  PAYABLE = 12,  /**< A/P account type */
+  ACCT_TYPE_PAYABLE = 12,  /**< A/P account type */
 
   NUM_ACCOUNT_TYPES = 13,  /**< stop here; the following types
 			    * just aren't ready for prime time */
   
   /* bank account types */
-  CHECKING = 13, /**< bank account type -- don't use this for now, see NUM_ACCOUNT_TYPES  */
-  SAVINGS = 14, /**< bank account type -- don't use this for now, see NUM_ACCOUNT_TYPES  */
-  MONEYMRKT = 15, /**< bank account type -- don't use this for now, see NUM_ACCOUNT_TYPES  */
-  CREDITLINE = 16,     /**< line of credit -- don't use this for now, see NUM_ACCOUNT_TYPES  */
+  ACCT_TYPE_CHECKING = 13, /**< bank account type -- don't use this
+			    *   for now, see NUM_ACCOUNT_TYPES  */
+  ACCT_TYPE_SAVINGS = 14, /**< bank account type -- don't use this for
+			   *   now, see NUM_ACCOUNT_TYPES  */
+  ACCT_TYPE_MONEYMRKT = 15, /**< bank account type -- don't use this
+			     *   for now, see NUM_ACCOUNT_TYPES  */
+  ACCT_TYPE_CREDITLINE = 16, /**< line of credit -- don't use this for
+			      *   now, see NUM_ACCOUNT_TYPES  */
 } GNCAccountType;
 
 
@@ -481,19 +499,19 @@
  * Conversion routines for the account types to/from strings
  * that are used in persistant storage, communications.  These
  * strings should *not* be translated to the local language.
- * Typical converstion is INCOME -> "INCOME". */
+ * Typical converstion is ACCT_TYPE_INCOME -> "INCOME". */
 const char * xaccAccountTypeEnumAsString (GNCAccountType type); 
 /**
  * Conversion routines for the account types to/from strings
  * that are used in persistant storage, communications.  These
  * strings should *not* be translated to the local language.
- * Typical converstion is INCOME -> "INCOME". */
+ * Typical converstion is "INCOME" -> ACCT_TYPE_INCOME. */
 gboolean xaccAccountStringToType (const char* str, GNCAccountType *type);
 /**
  * Conversion routines for the account types to/from strings
  * that are used in persistant storage, communications.  These
  * strings should *not* be translated to the local language.
- * Typical converstion is INCOME -> "INCOME". */
+ * Typical converstion is "INCOME" -> ACCT_TYPE_INCOME. */
 GNCAccountType xaccAccountStringToEnum (const char* str);
 
 /** The xaccAccountGetTypeStr() routine returns a string suitable for 
@@ -505,6 +523,9 @@
  *  to the local language. */
 GNCAccountType xaccAccountGetTypeFromStr (const gchar *str);
 
+/** Return the bitmask of account types compatible with a given type. */
+guint32 xaccAccountTypesCompatibleWith (GNCAccountType type);
+
 /** Return TRUE if accounts of type parent_type can have accounts
  * of type child_type as children. */
 gboolean xaccAccountTypesCompatible (GNCAccountType parent_type,
@@ -540,10 +561,6 @@
  *  in accfrom to accto. */
 void xaccAccountMoveAllSplits (Account *accfrom, Account *accto);
 
-/** \warning  Unimplemented */
-gpointer xaccAccountForEachSplit(Account *account, SplitCallback,
-                                 gpointer data);
-
 /** The xaccAccountForEachTransaction() routine will traverse all of
    the transactions in the given 'account' and call the callback
    function 'proc' on each transaction.  Processing will continue

Modified: gnucash/branches/register-rewrite/src/engine/AccountP.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/AccountP.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/AccountP.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -78,10 +78,11 @@
    */
   char     *description;
 
-  /* The type field is the account type, picked from the enumerated 
-   * list that includes BANK, STOCK, CREDIT, INCOME, etc.  Its
-   * intended use is to be a hint to the GUI as to how to display   
-   * and format the transaction data.
+  /* The type field is the account type, picked from the enumerated
+   * list that includes ACCT_TYPE_BANK, ACCT_TYPE_STOCK,
+   * ACCT_TYPE_CREDIT, ACCT_TYPE_INCOME, etc.  Its intended use is to
+   * be a hint to the GUI as to how to display and format the
+   * transaction data.
    */
   GNCAccountType type;
 

Modified: gnucash/branches/register-rewrite/src/engine/Group.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Group.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Group.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -77,7 +77,7 @@
 \********************************************************************/
 
 AccountGroup * 
-xaccCollGetAccountGroup (QofCollection *col)
+xaccCollGetAccountGroup (const QofCollection *col)
 {
   if (!col) return NULL;
   return qof_collection_get_data (col);
@@ -470,7 +470,7 @@
   return grp->accounts;
 }
 
-GList *
+AccountList *
 xaccGroupGetAccountListSorted (const AccountGroup *grp)
 {
   if (!grp) return NULL;
@@ -893,6 +893,8 @@
    if (!from->accounts || !to->book) return;
 
    ENTER (" ");
+   xaccAccountGroupBeginEdit(to);
+   xaccAccountGroupBeginEdit(from);
    for (node = from->accounts; node; node=node->next)
    {
       Account *to_acc, *from_acc = node->data;
@@ -926,6 +928,8 @@
          xaccAccountGroupBeginEdit (to_acc->children);
       }
    }
+   xaccAccountGroupCommitEdit(from);
+   xaccAccountGroupCommitEdit(to);
    LEAVE (" ");
 }
 
@@ -1283,7 +1287,7 @@
 }
 
 static gboolean
-group_is_dirty (QofCollection *col)
+group_is_dirty (const QofCollection *col)
 {
   return xaccGroupNotSaved(xaccCollGetAccountGroup(col));
 }

Modified: gnucash/branches/register-rewrite/src/engine/Group.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Group.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Group.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -60,7 +60,7 @@
  * The xaccCollAccountGroup() routine will return the top-most
  * account group associated with the indicated collection.
  */
-AccountGroup * xaccCollGetAccountGroup (QofCollection *col);
+AccountGroup * xaccCollGetAccountGroup (const QofCollection *col);
 
 /** The xaccAccountDestroy() routine will destroy and free all 
  *    the data associated with this account group.  The group
@@ -215,7 +215,7 @@
  *    immediate children of the account group.  The returned list
  *    should be freed with g_list_free() when no longer needed.
  */
-GList * xaccGroupGetAccountListSorted (const AccountGroup *grp);
+AccountList * xaccGroupGetAccountListSorted (const AccountGroup *grp);
 
 /** The xaccGroupGetRoot() subroutine will find the topmost 
  *    (root) group to which this group belongs.

Modified: gnucash/branches/register-rewrite/src/engine/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,7 @@
 SUBDIRS = . test-core test 
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-engine.la libgw-engine.la libgw-kvp.la
+pkglib_LTLIBRARIES = libgncmod-engine.la
 
 AM_CFLAGS = \
 	-I${top_srcdir}/lib/libc \
@@ -28,6 +28,7 @@
   Split.c \
   TransLog.c \
   Transaction.c \
+  binreloc.c \
   cap-gains.c \
   cashobjects.c \
   gnc-associate-account.c \
@@ -37,10 +38,15 @@
   gnc-filepath-utils.c \
   gnc-hooks.c \
   gnc-lot.c \
+  gnc-path.c \
   gnc-pricedb.c \
   gnc-session.c \
   gnc-session-scm.c \
   gncmod-engine.c \
+  swig-engine.c \
+  kvp-scm.c \
+  engine-helpers.c \
+  glib-helpers.c  \
   policy.c
 
 EXTRA_libgncmod_engine_la_SOURCES = iso-4217-currencies.c
@@ -66,6 +72,7 @@
   Split.h \
   TransLog.h \
   Transaction.h \
+  binreloc.h \
   cap-gains.h \
   cashobjects.h \
   engine-helpers.h \
@@ -78,6 +85,7 @@
   gnc-event.h \
   gnc-filepath-utils.h \
   gnc-hooks.h \
+  gnc-path.h \
   gnc-pricedb.h \
   gnc-session.h \
   gnc-session-scm.h \
@@ -100,8 +108,6 @@
   gnc-lot.h \
   gnc-lot-p.h \
   gnc-pricedb-p.h \
-  gw-engine.h \
-  gw-kvp.h \
   policy-p.h
 
 noinst_SCRIPTS = iso-currencies-to-c
@@ -109,28 +115,13 @@
 libgncmod_engine_la_LIBADD = \
   ../gnc-module/libgncmodule.la \
   ../core-utils/libcore-utils.la \
-  ${G_WRAP_LINK_ARGS} \
+  ${GUILE_LIBS} \
   ${QOF_LIBS} \
+  ${REGEX_LIBS} \
   ${GNUCASH_ENGINE_BASE_LIBS} \
+  ${BINRELOC_LIBS} \
   ${top_builddir}/lib/libc/libc-missing.la
 
-libgw_kvp_la_SOURCES = gw-kvp.c kvp-scm.c
-libgw_kvp_la_LDFLAGS = \
-  ${G_WRAP_LINK_ARGS} \
-  ${QOF_LIBS} \
-  ${GLIB_LIBS}
-libgw_kvp_la_LIBADD = \
-  libgncmod-engine.la \
-  libgw-engine.la
-
-libgw_engine_la_SOURCES = gw-engine.c engine-helpers.c glib-helpers.c
-libgw_engine_la_LDFLAGS = \
-  ${G_WRAP_LINK_ARGS} \
-  ${QOF_LIBS} \
-  ${GLIB_LIBS}
-libgw_engine_la_LIBADD = \
-  libgncmod-engine.la
-
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
 gncmod_DATA = engine.scm 
 
@@ -141,13 +132,6 @@
   engine-utilities.scm \
   gnc-numeric.scm
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = \
-  gw-engine-spec.scm \
-  gw-engine.scm \
-  gw-kvp-spec.scm \
-  gw-kvp.scm
-
 EXTRA_DIST = \
   README.query-api \
   design.txt \
@@ -157,13 +141,13 @@
   gncla-dir.h.in \
   kvp_doc.txt \
   SX-book-p.h \
+  engine.i \
   ${gncmod_DATA} \
-  ${gncscm_DATA} \
-  ${gwmod_DATA}
+  ${gncscm_DATA}
 
 if GNUCASH_SEPARATE_BUILDDIR
 #For compiling
-SCM_FILE_LINKS = gw-engine-spec.scm gw-kvp-spec.scm iso-4217-currencies.scm
+SCM_FILE_LINKS = iso-4217-currencies.scm
 #For executing test cases
 SCM_FILE_LINKS += \
   ${gncmod_DATA} \
@@ -171,46 +155,45 @@
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
+noinst_DATA = .scm-links
+
+if BUILDING_FROM_SVN
+swig-engine.c: engine.i ${gncinclude_HEADERS} ${noinst_HEADERS}
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/lib/libqof/qof -I${top_srcdir}/src -o $@ $<
+endif
+
 iso-4217-currencies.c: iso-4217-currencies.scm iso-currencies-to-c
 	-chmod u+x ${srcdir}/iso-currencies-to-c
 	GUILE_LOAD_PATH=@GNC_SRFI_LOAD_PATH@:${GUILE_LOAD_PATH} srcdir=${srcdir} ${srcdir}/iso-currencies-to-c
 
-gw-engine.scm gw-engine.c gw-engine.h: \
-  .scm-links gw-engine-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	 (set! %load-path (cons \"${PWD}\" %load-path)) \
-	 (primitive-load \"./gw-engine-spec.scm\") \
-	 (gw:generate-wrapset \"gw-engine\")"
-
-gw-kvp.scm gw-kvp.c gw-kvp.h: \
-  .scm-links gw-kvp-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	 (set! %load-path (cons \"${PWD}\" %load-path)) \
-	 (primitive-load \"./gw-kvp-spec.scm\") \
-	 (gw:generate-wrapset \"gw-kvp\")"
-
-BUILT_SOURCES = \
-  iso-4217-currencies.c \
-  gw-engine.scm gw-engine.c gw-engine.h \
-  gw-kvp.scm gw-kvp.c gw-kvp.h gncla-dir.h
-
-CLEANFILES = gnucash g-wrapped .scm-links gncla-dir.h
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-engine.html gw-kvp.html
-
-gncla-dir.h: gncla-dir.h.in ${top_builddir}/config.status
+gncla-dir.h: gncla-dir.h.in ${top_builddir}/config.status Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-                -e 's:@-libdir-@:${libdir}:g'
+		-e 's#@-LOCALE_DIR-@#${LOCALE_DIR}#g' \
+		-e 's#@-GNC_ACCOUNTS_DIR-@#${GNC_ACCOUNTS_DIR}#g' \
+		-e 's#@-GNC_GLADE_DIR-@#${GNC_GLADE_DIR}#g' \
+		-e 's#@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@#${GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY}#g' \
+		-e 's#@-pkglibdir-@#${pkglibdir}#g' \
+		-e 's#@-libdir-@#${libdir}#g' \
+		-e 's#@-sysconfdir-@#${sysconfdir}#g' \
+		-e 's#@-datadir-@#${datadir}#g' \
+		-e 's#@-prefix-@#${prefix}#g'
 	mv $@.tmp $@
+
+BUILT_SOURCES = iso-4217-currencies.c \
+  gncla-dir.h
+
+CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links gncla-dir.h \
+	${SCM_FILE_LINKS}
+MAINTAINERCLEANFILES = swig-engine.c

Modified: gnucash/branches/register-rewrite/src/engine/Period.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Period.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Period.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -33,6 +33,7 @@
  * Copyright (c) 2001-2003 Linas Vepstas <linas at linas.org>
  */
 
+#include "config.h"
 #include "AccountP.h"
 #include "qof.h"
 #include "gnc-lot.h"
@@ -395,13 +396,7 @@
       LotList *lnext = lnode->next;
 
       if (lot_has_open_trans_tree (lot))
-      {
-         lot_list = g_list_remove_link (lot_list, lnode);
-         /* XXX freeing this node somehow leads to glib g_list
-          * memory corruption which later takes down the system. 
-          * I don't see why.  */
-         /* g_list_free_1 (lnode); */
-      }
+         lot_list = g_list_delete_link(lot_list, lnode);
       lnode = lnext;
    }
    LEAVE (" ");
@@ -559,11 +554,7 @@
     * routine, and it is not needed for the current usage. */
    src_grp = xaccGetAccountGroup (src_book);
    dst_grp = xaccGetAccountGroup (dest_book);
-   xaccAccountGroupBeginEdit (dst_grp);
-   xaccAccountGroupBeginEdit (src_grp);
    xaccGroupCopyGroup (dst_grp, src_grp);
-   xaccAccountGroupCommitEdit (src_grp);
-   xaccAccountGroupCommitEdit (dst_grp);
 
    /* Next, run the query */
    xaccAccountGroupBeginEdit (dst_grp);
@@ -624,7 +615,7 @@
    for (node=acc_list; node; node=node->next)
    {
       candidate = (Account *) node->data;
-      if ((EQUITY == xaccAccountGetType (candidate)) &&
+      if ((ACCT_TYPE_EQUITY == xaccAccountGetType (candidate)) &&
           gnc_commodity_equiv(xaccAccountGetCommodity(acc),
                               xaccAccountGetCommodity(candidate)))
       {
@@ -647,8 +638,8 @@
    candidate = xaccMallocAccount (xaccGroupGetBook(parent));
    xaccAccountBeginEdit (candidate);
    xaccGroupInsertAccount (parent, candidate);
-   xaccAccountSetType (candidate, EQUITY);
-   xaccAccountSetName (candidate, xaccAccountGetTypeStr(EQUITY));
+   xaccAccountSetType (candidate, ACCT_TYPE_EQUITY);
+   xaccAccountSetName (candidate, xaccAccountGetTypeStr(ACCT_TYPE_EQUITY));
    xaccAccountSetCommodity (candidate, xaccAccountGetCommodity(acc));
    xaccAccountCommitEdit (candidate);
    
@@ -710,7 +701,8 @@
       /* -------------------------------- */
       /* We need to carry a balance on any account that is not
        * and income or expense or equity account */
-      if ((INCOME != tip) && (EXPENSE != tip) && (EQUITY != tip)) 
+      if ((ACCT_TYPE_INCOME != tip) && (ACCT_TYPE_EXPENSE != tip) &&
+	  (ACCT_TYPE_EQUITY != tip)) 
       {
          gnc_numeric baln;
          baln = xaccAccountGetBalance (candidate);

Modified: gnucash/branches/register-rewrite/src/engine/Period.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Period.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Period.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -62,7 +62,7 @@
  *    balances will be placed.   This argument may be NULL,
  *    if it is NULL, then a search algorithm will be used to 
  *    find a suitable equity account.  If NULL, this routine 
- *    searches for the 'nearest' account of GNCAccountType EQUITY 
+ *    searches for the 'nearest' account of GNCAccountType ACCT_TYPE_EQUITY 
  *    among its siblings, or the siblings of its parents.  It 
  *    does not search downwards.  If it does not find such an 
  *    account, it will create one, hanging off the top-most group.

Modified: gnucash/branches/register-rewrite/src/engine/Query.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Query.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Query.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -295,7 +295,8 @@
 
 void
 xaccQueryAddStringMatch (Query* q, const char *matchstring,
-			 int case_sens, int use_regexp, QofQueryOp op,
+			 gboolean case_sens, gboolean use_regexp,
+                         QofQueryOp op,
 			 const char * path, ...)
 {
   QofQueryPredData *pred_data;
@@ -353,8 +354,8 @@
 
 void
 xaccQueryAddDateMatchTS (Query * q, 
-			 int use_start, Timespec sts, 
-			 int use_end, Timespec ets,
+			 gboolean use_start, Timespec sts,
+			 gboolean use_end, Timespec ets,
 			 QofQueryOp op)
 {
   Query *tmp_q = NULL;
@@ -425,8 +426,8 @@
 
 void
 xaccQueryAddDateMatch(Query * q, 
-                      int use_start, int sday, int smonth, int syear,
-                      int use_end, int eday, int emonth, int eyear,
+                      gboolean use_start, int sday, int smonth, int syear,
+                      gboolean use_end, int eday, int emonth, int eyear,
                       QofQueryOp op) 
 {
   /* gcc -O3 will auto-inline this function, avoiding a call overhead */
@@ -444,9 +445,9 @@
 
 void
 xaccQueryAddDateMatchTT(Query * q, 
-                        int    use_start,
+                        gboolean use_start,
                         time_t stt,
-                        int    use_end,
+                        gboolean use_end,
                         time_t ett,
                         QofQueryOp op) 
 {
@@ -533,22 +534,6 @@
 }
 
 void
-xaccQueryAddGUIDMatchGL (QofQuery *q, GList *param_list,
-			 GUID guid, QofQueryOp op)
-{
-  GSList *params = NULL;
-  GList *node;
-
-  for (node = param_list; node; node = node->next)
-    params = g_slist_prepend (params, node->data);
-
-  params = g_slist_reverse (params);
-  g_list_free (param_list);
-
-  qof_query_add_guid_match (q, params, &guid, op);
-}
-
-void
 xaccQueryAddKVPMatch(QofQuery *q, GSList *path, const KvpValue *value,
 		     QofQueryCompare how, QofIdType id_type,
 		     QofQueryOp op)
@@ -626,4 +611,68 @@
   return latest;
 }
 
+void
+xaccQueryAddDescriptionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                             QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS,
+                             TRANS_DESCRIPTION, NULL);
+}
+
+void
+xaccQueryAddNumberMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS,
+                             TRANS_NUM, NULL);
+}
+
+void
+xaccQueryAddActionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_ACTION, NULL);
+}
+
+void
+xaccQueryAddMemoMatch(Query *q, const char *m, gboolean c, gboolean r,
+                      QofQueryOp o)
+{
+    xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_MEMO, NULL);
+}
+
+void
+xaccQueryAddValueMatch(Query *q, gnc_numeric amt, QofNumericMatch sgn,
+                       QofQueryCompare how, QofQueryOp op)
+{
+    xaccQueryAddNumericMatch ((q), (amt), (sgn), (how), (op),
+                              SPLIT_VALUE, NULL);
+}
+
+void
+xaccQueryAddSharePriceMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                            QofQueryOp op)
+{
+    xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op),
+                              SPLIT_SHARE_PRICE, NULL);
+}
+
+void
+xaccQueryAddSharesMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                        QofQueryOp op)
+{
+    xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op),
+                              SPLIT_AMOUNT, NULL);
+}
+
+void
+xaccQueryAddBalanceMatch(Query *q, QofQueryCompare bal, QofQueryOp op)
+{
+    xaccQueryAddNumericMatch(
+        (q), gnc_numeric_zero(), QOF_NUMERIC_MATCH_ANY,
+        ((bal) ? QOF_COMPARE_EQUAL : QOF_COMPARE_NEQ), (op),
+        SPLIT_TRANS, TRANS_IMBALANCE, NULL);
+}
+
+
 /* ======================== END OF FILE ======================= */

Modified: gnucash/branches/register-rewrite/src/engine/Query.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Query.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Query.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -124,43 +124,37 @@
 void xaccQueryAddSingleAccountMatch(Query *, Account *, QofQueryOp);
 
 void xaccQueryAddStringMatch (Query* q, const char *matchstring,
-			      int case_sens, int use_regexp, QofQueryOp op,
+			      gboolean case_sens, gboolean use_regexp,
+                              QofQueryOp op,
 			      const char * path, ...);
+void
+xaccQueryAddDescriptionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                             QofQueryOp o);
+void
+xaccQueryAddNumberMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o);
+void
+xaccQueryAddActionMatch(Query *q, const char *m, gboolean c, gboolean r,
+                        QofQueryOp o);
+void
+xaccQueryAddMemoMatch(Query *q, const char *m, gboolean c, gboolean r,
+                      QofQueryOp o);
+void
+xaccQueryAddValueMatch(Query *q, gnc_numeric amt, QofNumericMatch sgn,
+                       QofQueryCompare how, QofQueryOp op);
+void
+xaccQueryAddSharePriceMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                            QofQueryOp op);
+void
+xaccQueryAddSharesMatch(Query *q, gnc_numeric amt, QofQueryCompare how,
+                        QofQueryOp op);
+void
+xaccQueryAddBalanceMatch(Query *q, QofQueryCompare bal, QofQueryOp op);
 
-#define xaccQueryAddDescriptionMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS, \
-				TRANS_DESCRIPTION, NULL)
-#define xaccQueryAddNumberMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_TRANS, \
-				TRANS_NUM, NULL)
-#define xaccQueryAddActionMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_ACTION, \
-				NULL)
-#define xaccQueryAddMemoMatch(q,m,c,r,o) \
-	xaccQueryAddStringMatch ((q), (m), (c), (r), (o), SPLIT_MEMO, \
-				NULL)
-
 void xaccQueryAddNumericMatch (Query *q, gnc_numeric amount,
 			       QofNumericMatch sign, QofQueryCompare how,
 			       QofQueryOp op, const char * path, ...);
 
-#define xaccQueryAddValueMatch(q,amt,sgn,how,op) \
-	xaccQueryAddNumericMatch ((q), (amt), (sgn), (how), (op), \
-				SPLIT_VALUE, NULL)
-
-#define xaccQueryAddSharePriceMatch(q,amt,how,op) \
-	xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op), \
-				SPLIT_SHARE_PRICE, NULL)
- 
-#define xaccQueryAddSharesMatch(q,amt,how,op) \
-	xaccQueryAddNumericMatch ((q), (amt), QOF_NUMERIC_MATCH_ANY, (how), (op), \
-				SPLIT_AMOUNT, NULL)
-
-#define xaccQueryAddBalanceMatch(q,bal,op) \
-	xaccQueryAddNumericMatch ((q), gnc_numeric_zero(), QOF_NUMERIC_MATCH_ANY, \
-				((bal) ? QOF_COMPARE_EQUAL : QOF_COMPARE_NEQ), (op), \
-				SPLIT_TRANS, TRANS_IMBALANCE, NULL)
-
 /** The DateMatch queries match transactions whose posted date
  *    is in a date range.  If use_start is TRUE, then a matching
  *    posted date will be greater than the start date.   If 
@@ -170,17 +164,17 @@
  *    all transactions are matched.
  */
 
-void xaccQueryAddDateMatch(Query * q, 
-                           int use_start, int sday, int smonth, int syear, 
-                           int use_end, int eday, int emonth, int eyear,
+void xaccQueryAddDateMatch(Query * q, gboolean use_start,
+                           int sday, int smonth, int syear,
+                           gboolean use_end, int eday, int emonth, int eyear,
                            QofQueryOp op);
 void xaccQueryAddDateMatchTS(Query * q, 
-                             int use_start, Timespec sts, 
-                             int use_end, Timespec ets,
+                             gboolean use_start, Timespec sts,
+                             gboolean use_end, Timespec ets,
                              QofQueryOp op);
 void xaccQueryAddDateMatchTT(Query * q, 
-                             int use_start, time_t stt, 
-                             int use_end, time_t ett,
+                             gboolean use_start, time_t stt,
+                             gboolean use_end, time_t ett,
                              QofQueryOp op);
 void xaccQueryGetDateMatchTS (Query * q, 
 			      Timespec * sts,
@@ -202,8 +196,6 @@
 void xaccQueryAddClearedMatch(Query * q, cleared_match_t how, QofQueryOp op);
 void xaccQueryAddGUIDMatch(Query * q, const GUID *guid,
                            QofIdType id_type, QofQueryOp op);
-void xaccQueryAddGUIDMatchGL (QofQuery *q, GList *param_list,
-			      GUID guid, QofQueryOp op);
 
 /** given kvp value is on right side of comparison */
 void xaccQueryAddKVPMatch(Query *q, GSList *path, const KvpValue *value,

Modified: gnucash/branches/register-rewrite/src/engine/SX-book.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/SX-book.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/SX-book.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -53,7 +53,7 @@
 /* ====================================================================== */
 
 AccountGroup *
-gnc_collection_get_template_group( QofCollection *col )
+gnc_collection_get_template_group( const QofCollection *col )
 {
   return qof_collection_get_data (col);
 }
@@ -118,7 +118,7 @@
 
 
 static gboolean
-sxtg_is_dirty(QofCollection *col)
+sxtg_is_dirty(const QofCollection *col)
 {
   return xaccGroupNotSaved(gnc_collection_get_template_group(col));
 }
@@ -145,13 +145,13 @@
 /* ====================================================================== */
 
 SchedXactions *
-gnc_collection_get_schedxaction_list(QofCollection *col)
+gnc_collection_get_schedxaction_list(const QofCollection *col)
 {
   return qof_collection_get_data (col);
 }
 
 GList *
-gnc_collection_get_schedxactions(QofCollection *col)
+gnc_collection_get_schedxactions(const QofCollection *col)
 {
   SchedXactions *list;
   list = qof_collection_get_data (col);
@@ -236,7 +236,7 @@
 }
 
 static gboolean
-book_sxlist_notsaved(QofCollection *col)
+book_sxlist_notsaved(const QofCollection *col)
 {
   GList *sxlist;
   SchedXactions *sxl;

Modified: gnucash/branches/register-rewrite/src/engine/SX-book.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/SX-book.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/SX-book.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -43,13 +43,13 @@
 
 typedef struct xaccSchedXactionsDef SchedXactions;
 
-SchedXactions * gnc_collection_get_schedxaction_list(QofCollection *col);
-GList * gnc_collection_get_schedxactions(QofCollection *col);
+SchedXactions * gnc_collection_get_schedxaction_list(const QofCollection *col);
+GList * gnc_collection_get_schedxactions(const QofCollection *col);
 GList * gnc_book_get_schedxactions(QofBook *book);
 
 /** Returns the template group from the book. **/
 AccountGroup * gnc_book_get_template_group(QofBook *book);
-AccountGroup * gnc_collection_get_template_group(QofCollection *col);
+AccountGroup * gnc_collection_get_template_group(const QofCollection *col);
 
 /** @return The list of SXes which reference the given Account. Caller should free this list. **/
 GList* gnc_sx_get_sxes_referencing_account(QofBook *book, Account *acct);

Modified: gnucash/branches/register-rewrite/src/engine/SchedXaction.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/SchedXaction.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/SchedXaction.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -77,7 +77,7 @@
       sx->template_acct,
       gnc_commodity_new( book,
 			 "template", "template") );
-   xaccAccountSetType( sx->template_acct, BANK );
+   xaccAccountSetType( sx->template_acct, ACCT_TYPE_BANK );
    ag = gnc_book_get_template_group( book );
    xaccGroupInsertAccount( ag, sx->template_acct );
 }

Modified: gnucash/branches/register-rewrite/src/engine/Scrub.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Scrub.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Scrub.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -902,7 +902,7 @@
     xaccAccountBeginEdit (acc);
     xaccAccountSetName (acc, accname);
     xaccAccountSetCommodity (acc, currency);
-    xaccAccountSetType (acc, BANK);
+    xaccAccountSetType (acc, ACCT_TYPE_BANK);
 
     /* Hang the account off the root. */
     xaccGroupInsertAccount (root, acc);

Modified: gnucash/branches/register-rewrite/src/engine/Transaction.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Transaction.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Transaction.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2076,7 +2076,8 @@
   static QofParam params[] = {
     { TRANS_NUM, QOF_TYPE_STRING, 
       (QofAccessFunc)xaccTransGetNum, 
-      (QofSetterFunc)qofTransSetNum },
+      (QofSetterFunc)qofTransSetNum,
+       qof_string_number_compare_func },
     { TRANS_DESCRIPTION, QOF_TYPE_STRING, 
       (QofAccessFunc)xaccTransGetDescription, 
       (QofSetterFunc)qofTransSetDescription },

Modified: gnucash/branches/register-rewrite/src/engine/Transaction.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/Transaction.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/Transaction.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -92,6 +92,7 @@
 #include "gnc-engine.h"
 #include "Split.h"
 
+/* FIXME: These macros are not consistent with the type name */
 #define GNC_IS_TRANS(obj)  (QOF_CHECK_TYPE((obj), GNC_ID_TRANS))
 #define GNC_TRANS(obj)     (QOF_CHECK_CAST((obj), GNC_ID_TRANS, Transaction))
 
@@ -225,10 +226,6 @@
  */
 void          xaccTransSortSplits (Transaction *trans);
 
-/** Print the transaction out to the console. Used for debugging.
- */
-void          xaccTransDump (Transaction *trans, const char *tag);
-
 /** Set the  Transaction Type
  *
  * See #TXN_TYPE_NONE, #TXN_TYPE_INVOICE and #TXN_TYPE_PAYMENT */

Copied: gnucash/branches/register-rewrite/src/engine/binreloc.c (from rev 15058, gnucash/trunk/src/engine/binreloc.c)

Copied: gnucash/branches/register-rewrite/src/engine/binreloc.h (from rev 15058, gnucash/trunk/src/engine/binreloc.h)

Modified: gnucash/branches/register-rewrite/src/engine/cap-gains.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/cap-gains.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/cap-gains.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -191,7 +191,8 @@
                                 const gnc_commodity *currency)
 {
    GNCLot *lot;
-   ENTER (" sign=%" G_GINT64_FORMAT "/%" G_GINT64_FORMAT, sign.num, sign.denom);
+   ENTER (" sign=%" G_GINT64_FORMAT "/%" G_GINT64_FORMAT, sign.num, 
+          sign.denom);
       
    lot = xaccAccountFindOpenLot (acc, sign, currency,
                    G_MAXUINT64, earliest_pred);
@@ -245,7 +246,7 @@
     xaccAccountBeginEdit (acc);
     xaccAccountSetName (acc, accname);
     xaccAccountSetCommodity (acc, currency);
-    xaccAccountSetType (acc, INCOME);
+    xaccAccountSetType (acc, ACCT_TYPE_INCOME);
     xaccAccountSetDescription (acc, _("Realized Gain/Loss"));
     xaccAccountSetNotes (acc, 
          _("Realized Gains or Losses from "
@@ -681,8 +682,8 @@
    if (!source_guid) return NULL;
 
    /* Both splits will be in the same collection, so search there. */
-   source_split = (Split*) qof_collection_lookup_entity (split->inst.entity.collection, 
-                                                         source_guid);
+   source_split = (Split*) qof_collection_lookup_entity(
+       split->inst.entity.collection, source_guid);
    PINFO ("split=%p has source-split=%p", split, source_split);
    return source_split;
 }
@@ -846,7 +847,7 @@
                                 gnc_numeric_abs(split->amount)))
    {
       GList *n;
-      for (n=lot->splits; n; n=n->next) 
+      for (n = lot->splits; n; n = n->next) 
       {
          Split *s = n->data;
          PINFO ("split amt=%s", gnc_num_dbg_to_string(s->amount));
@@ -865,7 +866,7 @@
          gnc_numeric_negative_p(split->amount)))
    {
       GList *n;
-      for (n=lot->splits; n; n=n->next) 
+      for (n = lot->splits; n; n = n->next) 
       {
          Split *s = n->data;
          PINFO ("split amt=%s", gnc_num_dbg_to_string(s->amount));
@@ -1059,9 +1060,11 @@
    if (!split) return gnc_numeric_zero();
    ENTER("(split=%p)", split);
 
-   if (GAINS_STATUS_UNKNOWN == split->gains) xaccSplitDetermineGainStatus(split);
+   if (GAINS_STATUS_UNKNOWN == split->gains) 
+       xaccSplitDetermineGainStatus(split);
    if ((split->gains & GAINS_STATUS_A_VDIRTY) || 
-       (split->gains_split && (split->gains_split->gains & GAINS_STATUS_A_VDIRTY)))
+       (split->gains_split && 
+        (split->gains_split->gains & GAINS_STATUS_A_VDIRTY)))
    {
       xaccSplitComputeCapGains (split, NULL);
    }
@@ -1096,12 +1099,13 @@
 
    ENTER("(lot=%p)", lot);
    pcy = lot->account->policy;
-   for (node=lot->splits; node; node=node->next)
+   for (node = lot->splits; node; node = node->next)
    {
       Split *s = node->data;
       if (pcy->PolicyIsOpeningSplit(pcy,lot,s))
       {
-         if (GAINS_STATUS_UNKNOWN == s->gains) xaccSplitDetermineGainStatus (s);
+         if (GAINS_STATUS_UNKNOWN == s->gains) 
+             xaccSplitDetermineGainStatus(s);
          if (s->gains & GAINS_STATUS_VDIRTY) 
          { 
             is_dirty = TRUE; 
@@ -1112,14 +1116,14 @@
 
    if (is_dirty)
    {
-      for (node=lot->splits; node; node=node->next)
+      for (node = lot->splits; node; node = node->next)
       {
          Split *s = node->data;
          s->gains |= GAINS_STATUS_VDIRTY;
       }
    }
 
-   for (node=lot->splits; node; node=node->next)
+   for (node = lot->splits; node; node = node->next)
    {
       Split *s = node->data;
       xaccSplitComputeCapGains (s, gain_acc);

Modified: gnucash/branches/register-rewrite/src/engine/cashobjects.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/cashobjects.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/cashobjects.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h"
 #include "cashobjects.h"
 #include "gnc-engine.h"
 #include "AccountP.h"

Modified: gnucash/branches/register-rewrite/src/engine/engine-helpers.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/engine-helpers.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/engine-helpers.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,5 +1,5 @@
 /********************************************************************\
- * engine-helpers.c -- gnucash g-wrap helper functions              *
+ * engine-helpers.c -- gnucash engine helper functions              *
  * Copyright (C) 2000 Linas Vepstas <linas at linas.org>               *
  * Copyright (C) 2001 Linux Developers Group, Inc.                  *
  *                                                                  *
@@ -24,7 +24,7 @@
 
 #include "config.h"
 
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 #include <libguile.h>
 #include <string.h>
 
@@ -43,6 +43,8 @@
 #include "qofquery-p.h"
 #include "qofquerycore-p.h"
 
+#define FUNC_NAME __FUNCTION__
+
 static QofLogModule log_module = GNC_MOD_ENGINE;
 
 Timespec
@@ -197,123 +199,47 @@
   gnc_QUERY_v2
 } query_version_t;
 
-static SCM
-gnc_gw_enum_val2scm (const char *typestr, int value)
-{
-  char *func_name;
-  SCM func;
-  SCM scm;
-
-  func_name = g_strdup_printf ("gw:enum-%s-val->sym", typestr);
-
-  func = scm_c_eval_string (func_name);
-  if (SCM_PROCEDUREP (func))
-    scm = scm_call_2 (func, scm_int2num (value), SCM_BOOL_F);
-  else
-    scm = SCM_BOOL_F;
-
-  g_free (func_name);
-
-  return scm;
-}
-
-static int
-gnc_gw_enum_scm2val (const char *typestr, SCM enum_scm)
-{
-  char *func_name;
-  SCM func;
-  SCM scm;
-
-  func_name = g_strdup_printf ("gw:enum-%s-val->int", typestr);
-
-  func = scm_c_eval_string (func_name);
-  if (SCM_PROCEDUREP (func))
-    scm = scm_call_1 (func, enum_scm);
-  else
-    scm = scm_int2num (0);
-
-  g_free (func_name);
-
-  return scm_num2int (scm, SCM_ARG1, __FUNCTION__);
-}
-
 /* QofCompareFunc */
 
-static SCM
-gnc_query_compare2scm (QofQueryCompare how)
-{
-  return gnc_gw_enum_val2scm ("<gnc:query-compare-how>", how);
-}
-
 static QofQueryCompare
 gnc_query_scm2compare (SCM how_scm)
 {
-  return gnc_gw_enum_scm2val ("<gnc:query-compare-how>", how_scm);
+  return scm_num2int(how_scm, SCM_ARG1, __FUNCTION__);
 }
 
 /* QofStringMatch */
-static SCM
-gnc_query_string2scm (QofStringMatch how)
-{
-  return gnc_gw_enum_val2scm ("<gnc:string-match-how>", how);
-}
-
 static QofStringMatch
 gnc_query_scm2string (SCM how_scm)
 {
-  return gnc_gw_enum_scm2val ("<gnc:string-match-how>", how_scm);
+  return scm_num2int(how_scm, SCM_ARG1, __FUNCTION__);
 }
 
 /* QofDateMatch */
-static SCM
-gnc_query_date2scm (QofDateMatch how)
-{
-  return gnc_gw_enum_val2scm ("<gnc:date-match-how>", how);
-}
-
 static QofDateMatch
 gnc_query_scm2date (SCM how_scm)
 {
-  return gnc_gw_enum_scm2val ("<gnc:date-match-how>", how_scm);
+  return scm_num2int(how_scm, SCM_ARG1, __FUNCTION__);
 }
 
 /* QofNumericMatch */
-static SCM
-gnc_query_numericop2scm (QofNumericMatch how)
-{
-  return gnc_gw_enum_val2scm ("<gnc:numeric-match-how>", how);
-}
-
 static QofNumericMatch
 gnc_query_scm2numericop (SCM how_scm)
 {
-  return gnc_gw_enum_scm2val ("<gnc:numeric-match-how>", how_scm);
+  return scm_num2int(how_scm, SCM_ARG1, __FUNCTION__);
 }
 
 /* QofGuidMatch */
-static SCM
-gnc_query_guid2scm (QofGuidMatch how)
-{
-  return gnc_gw_enum_val2scm ("<gnc:guid-match-how>", how);
-}
-
 static QofGuidMatch
 gnc_query_scm2guid (SCM how_scm)
 {
-  return gnc_gw_enum_scm2val ("<gnc:guid-match-how>", how_scm);
+  return scm_num2int(how_scm, SCM_ARG1, __FUNCTION__);
 }
 
 /* QofCharMatch */
-static SCM
-gnc_query_char2scm (QofCharMatch how)
-{
-  return gnc_gw_enum_val2scm ("<gnc:char-match-how>", how);
-}
-
 static QofCharMatch
 gnc_query_scm2char (SCM how_scm)
 {
-  return gnc_gw_enum_scm2val ("<gnc:char-match-how>", how_scm);
+  return scm_num2int(how_scm, SCM_ARG1, __FUNCTION__);
 }
 
 static QofGuidMatch
@@ -379,7 +305,7 @@
 }
 
 static int
-gnc_scm2bitfield (const char *typestr, SCM field_scm)
+gnc_scm2bitfield (SCM field_scm)
 {
   int field = 0;
 
@@ -394,7 +320,7 @@
     scm = SCM_CAR (field_scm);
     field_scm = SCM_CDR (field_scm);
 
-    bit = gnc_gw_enum_scm2val (typestr, scm);
+    bit = scm_num2int(scm, SCM_ARG2, __FUNCTION__);
     field |= bit;
   }
 
@@ -404,7 +330,7 @@
 static cleared_match_t
 gnc_scm2cleared_match_how (SCM how_scm)
 {
-  return gnc_scm2bitfield ("<gnc:cleared-match-how>", how_scm);
+  return gnc_scm2bitfield (how_scm);
 }
 
 static gboolean
@@ -551,7 +477,7 @@
   return scm_reverse (path_scm);
 }
 
-static GSList *
+GSList *
 gnc_query_scm2path (SCM path_scm)
 {
   GSList *path = NULL;
@@ -588,16 +514,10 @@
   g_slist_free (path);
 }
 
-static SCM
-gnc_KvpValueTypeype2scm (KvpValueType how)
-{
-  return gnc_gw_enum_val2scm ("<gnc:kvp-value-t>", how);
-}
-
 static KvpValueType
 gnc_scm2KvpValueTypeype (SCM value_type_scm)
 {
-  return gnc_gw_enum_scm2val ("<gnc:kvp-value-t>", value_type_scm);
+  return scm_num2int(value_type_scm, SCM_ARG1, __FUNCTION__);
 }
 
 static SCM gnc_kvp_frame2scm (KvpFrame *frame);
@@ -613,7 +533,7 @@
 
   value_t = kvp_value_get_type (value);
 
-  value_scm = scm_cons (gnc_KvpValueTypeype2scm (value_t), value_scm);
+  value_scm = scm_cons (scm_long2num (value_t), value_scm);
 
   switch (value_t)
   {
@@ -862,31 +782,31 @@
 
   pd = qof_query_term_get_pred_data (qt);
   qt_scm = scm_cons (scm_str2symbol (pd->type_name), qt_scm);
-  qt_scm = scm_cons (gnc_query_compare2scm (pd->how), qt_scm);
+  qt_scm = scm_cons (scm_long2num (pd->how), qt_scm);
 
   if (!safe_strcmp (pd->type_name, QOF_TYPE_STRING)) {
     query_string_t pdata = (query_string_t) pd;
 
-    qt_scm = scm_cons (gnc_query_string2scm (pdata->options), qt_scm);
+    qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
     qt_scm = scm_cons (SCM_BOOL (pdata->is_regex), qt_scm);
     qt_scm = scm_cons (scm_makfrom0str (pdata->matchstring), qt_scm);
 
   } else if (!safe_strcmp (pd->type_name, QOF_TYPE_DATE)) {
     query_date_t pdata = (query_date_t) pd;
 
-    qt_scm = scm_cons (gnc_query_date2scm (pdata->options), qt_scm);
+    qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
     qt_scm = scm_cons (gnc_timespec2timepair (pdata->date), qt_scm);
 
   } else if (!safe_strcmp (pd->type_name, QOF_TYPE_NUMERIC)) {
     query_numeric_t pdata = (query_numeric_t) pd;
 
-    qt_scm = scm_cons (gnc_query_numericop2scm (pdata->options), qt_scm);
+    qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
     qt_scm = scm_cons (gnc_query_numeric2scm (pdata->amount), qt_scm);
 
   } else if (!safe_strcmp (pd->type_name, QOF_TYPE_GUID)) {
     query_guid_t pdata = (query_guid_t) pd;
 
-    qt_scm = scm_cons (gnc_query_guid2scm (pdata->options), qt_scm);
+    qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
     qt_scm = scm_cons (gnc_guid_glist2scm (pdata->guids), qt_scm);
 
   } else if (!safe_strcmp (pd->type_name, QOF_TYPE_INT64)) {
@@ -907,7 +827,7 @@
   } else if (!safe_strcmp (pd->type_name, QOF_TYPE_CHAR)) {
     query_char_t pdata = (query_char_t) pd;
 
-    qt_scm = scm_cons (gnc_query_char2scm (pdata->options), qt_scm);
+    qt_scm = scm_cons (scm_long2num (pdata->options), qt_scm);
     qt_scm = scm_cons (scm_makfrom0str (pdata->char_list), qt_scm);
 
   } else if (!safe_strcmp (pd->type_name, QOF_TYPE_KVP)) {
@@ -2066,46 +1986,6 @@
   return q;
 }
 
-static int
-gnc_scm_traversal_adapter(Transaction *t, void *data)
-{
-  static SCM trans_type = SCM_BOOL_F;
-  SCM result;
-  SCM scm_trans;
-  SCM thunk = *((SCM *) data);
-
-  if(trans_type == SCM_BOOL_F) {
-    trans_type = scm_c_eval_string("<gnc:Transaction*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(trans_type != SCM_BOOL_F) scm_gc_protect_object(trans_type);
-  }
-  
-  scm_trans = gw_wcp_assimilate_ptr(t, trans_type);
-  result = scm_call_1(thunk, scm_trans);
-
-  return (result != SCM_BOOL_F);
-}
-
-gboolean
-gnc_scmGroupStagedTransactionTraversal(AccountGroup *grp,
-                                       unsigned int new_marker,
-                                       SCM thunk)
-{
-  return xaccGroupStagedTransactionTraversal(grp, new_marker,
-                                             gnc_scm_traversal_adapter,
-                                             &thunk);
-}
-
-gboolean
-gnc_scmAccountStagedTransactionTraversal(Account *a,
-                                         unsigned int new_marker,
-                                         SCM thunk) 
-{
-  return xaccAccountStagedTransactionTraversal(a, new_marker,
-                                               gnc_scm_traversal_adapter,
-                                               &thunk);
-}
-
 SCM
 gnc_gint64_to_scm(const gint64 x)
 {
@@ -2265,89 +2145,60 @@
   }
 }
 
-/********************************************************************
- * gnc_scm_to_commodity
- ********************************************************************/
-gnc_commodity *
-gnc_scm_to_commodity(SCM scm)
+
+static SCM
+gnc_generic_to_scm(const void *x, const gchar *type_str)
 {
-  static SCM commodity_type = SCM_UNDEFINED;
+    swig_type_info * stype = NULL;
 
-  if(commodity_type == SCM_UNDEFINED) {
-    commodity_type = scm_c_eval_string("<gnc:commodity*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(commodity_type != SCM_UNDEFINED) scm_gc_protect_object(commodity_type);
-  }
+    if (!x) return SCM_BOOL_F;
+    stype = SWIG_TypeQuery(type_str);
 
-  if(!gw_wcp_is_of_type_p(commodity_type, scm)) {
-    return NULL;
-  }
+    if (!stype) {
+        PERR("Unknown SWIG Type: %s ", type_str);
+        return SCM_BOOL_F;
+    }
 
-  return gw_wcp_get_ptr(scm);
+    return SWIG_NewPointerObj(x, stype, 0);
 }
 
+static void *
+gnc_scm_to_generic(SCM scm, const gchar *type_str)
+{
+    swig_type_info * stype = NULL;
 
-/********************************************************************
- * gnc_commodity_to_scm
- ********************************************************************/
+    stype = SWIG_TypeQuery(type_str);
+    if (!stype) {
+        PERR("Unknown SWIG Type: %s ", type_str);
+        return NULL;
+    }
+
+    if (!SWIG_IsPointerOfType(scm, stype))
+        return NULL;
+
+    return SWIG_MustGetPtr(scm, stype, 1, 0);
+}
+
+gnc_commodity *
+gnc_scm_to_commodity(SCM scm)
+{
+    return gnc_scm_to_generic(scm, "_p_gnc_commodity");
+}
+
 SCM
 gnc_commodity_to_scm (const gnc_commodity *commodity)
 {
-  static SCM commodity_type = SCM_UNDEFINED;
-
-  if(commodity == NULL) return SCM_BOOL_F;
-
-  if(commodity_type == SCM_UNDEFINED) {
-    commodity_type = scm_c_eval_string("<gnc:commodity*>");
-    /* don't really need this - types are bound globally anyway. */
-    if(commodity_type != SCM_UNDEFINED) scm_gc_protect_object(commodity_type);
-  }
-  
-  return gw_wcp_assimilate_ptr((void *) commodity, commodity_type);
+    return gnc_generic_to_scm(commodity, "_p_gnc_commodity");
 }
 
-/********************************************************************
- * gnc_book_to_scm
- ********************************************************************/
 SCM
 gnc_book_to_scm (QofBook *book)
 {
-  static SCM book_type = SCM_UNDEFINED;
-
-  if (!book)
-    return SCM_BOOL_F;
-
-  if (book_type == SCM_UNDEFINED)
-  {
-    book_type = scm_c_eval_string ("<gnc:Book*>");
-
-    /* don't really need this - types are bound globally anyway. */
-    if (book_type != SCM_UNDEFINED)
-      scm_gc_protect_object (book_type);
-  }
-  
-  return gw_wcp_assimilate_ptr ((void *) book, book_type);
+    return gnc_generic_to_scm(book, "_p_QofBook");
 }
 
-/********************************************************************
- * qof_session_to_scm
- ********************************************************************/
 SCM
 qof_session_to_scm (QofSession *session)
 {
-  static SCM session_type = SCM_UNDEFINED;
-
-  if (!session)
-    return SCM_BOOL_F;
-
-  if (session_type == SCM_UNDEFINED)
-  {
-    session_type = scm_c_eval_string ("<gnc:Session*>");
-
-    /* don't really need this - types are bound globally anyway. */
-    if (session_type != SCM_UNDEFINED)
-      scm_gc_protect_object (session_type);
-  }
-
-  return gw_wcp_assimilate_ptr ((void *) session, session_type);
+    return gnc_generic_to_scm(session, "_p_QofSession");
 }

Modified: gnucash/branches/register-rewrite/src/engine/engine-helpers.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/engine-helpers.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/engine-helpers.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,5 +1,5 @@
 /********************************************************************\
- * engine-helpers.h -- gnucash g-wrap helper functions              *
+ * engine-helpers.h -- gnucash engine helper functions              *
  * Copyright (C) 2000 Linas Vepstas <linas at linas.org>               *
  * Copyright (C) 2001 Linux Developers Group, Inc.                  *
  *                                                                  *
@@ -53,21 +53,15 @@
 GUID gnc_scm2guid(SCM guid_scm);
 int  gnc_guid_p(SCM guid_scm);
 
+/* for a list of strings */
+GSList * gnc_query_scm2path (SCM path_scm);
+
 /* These two functions convert a query object into a scheme
  * representation of the query and vice-versa. They do not
- * simply convert a query pointer to a g-wrapped query pointer! */
+ * simply convert a query pointer to a guile query pointer! */
 SCM gnc_query2scm (Query * q);
 Query * gnc_scm2query (SCM query_scm);
 
-/* See Group.h for info about traversals. */
-
-gboolean gnc_scmGroupStagedTransactionTraversal(AccountGroup *grp,
-                                                unsigned int stage,
-                                                SCM thunk);
-
-gboolean gnc_scmAccountStagedTransactionTraversal(Account *a,
-                                                  unsigned int stage,
-                                                  SCM thunk);
 SCM gnc_gint64_to_scm(const gint64 x);
 gint64 gnc_scm_to_gint64(SCM num);
 int gnc_gh_gint64_p(SCM num);

Modified: gnucash/branches/register-rewrite/src/engine/engine-interface.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/engine-interface.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/engine-interface.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -95,15 +95,15 @@
 ;; for editing.
 (define (gnc:split->split-scm split use-cut-semantics?)
   (gnc:make-split-scm
-   (gnc:split-get-guid split)
-   (gnc:account-get-guid (gnc:split-get-account split))
-   (gnc:transaction-get-guid (gnc:split-get-parent split))
-   (gnc:split-get-memo split)
-   (gnc:split-get-action split)
-   (gnc:split-get-reconcile-state split)
-   (gnc:split-get-reconciled-date split)
-   (gnc:split-get-amount split)
-   (gnc:split-get-value split)))
+   (gncSplitGetGUID split)
+   (gncAccountGetGUID (xaccSplitGetAccount split))
+   (gncTransGetGUID (xaccSplitGetParent split))
+   (xaccSplitGetMemo split)
+   (xaccSplitGetAction split)
+   (xaccSplitGetReconcile split)
+   (gnc-split-get-date-reconciled split)
+   (xaccSplitGetAmount split)
+   (xaccSplitGetValue split)))
 
 ;; Copy a scheme representation of a split onto a C split.
 ;; If possible, insert the C split into the account of the
@@ -118,18 +118,18 @@
               (action   (gnc:split-scm-get-action split-scm))
               (amount   (gnc:split-scm-get-amount split-scm))
               (value    (gnc:split-scm-get-value split-scm)))
-          (if memo     (gnc:split-set-memo split memo))
-          (if action   (gnc:split-set-action split action))
-          (if amount   (gnc:split-set-amount split amount))
-          (if value    (gnc:split-set-value split value)))
-        (let ((account (gnc:account-lookup
+          (if memo     (xaccSplitSetMemo split memo))
+          (if action   (xaccSplitSetAction split action))
+          (if amount   (xaccSplitSetAmount split amount))
+          (if value    (xaccSplitSetValue split value)))
+        (let ((account (xaccAccountLookup
                         (gnc:split-scm-get-account-guid split-scm)
                         book)))
           (if account
               (begin
-                (gnc:account-begin-edit account)
-                (gnc:account-insert-split account split)
-                (gnc:account-commit-edit account)))))))
+                (xaccAccountBeginEdit account)
+                (xaccSplitSetAccount split account)
+                (xaccAccountCommitEdit account)))))))
 
 ;; Defines a scheme representation of a transaction.
 (define gnc:transaction-structure
@@ -218,23 +218,23 @@
 ;; a representation of it as a transaction-structure.
 (define (gnc:transaction->transaction-scm trans use-cut-semantics?)
   (define (trans-splits i)
-    (let ((split (gnc:transaction-get-split trans i)))
-      (if (not split)
+    (let ((split (xaccTransGetSplit trans i)))
+      (if (null? split)
           '()
           (cons (gnc:split->split-scm split use-cut-semantics?)
                 (trans-splits (+ i 1))))))
   (gnc:make-transaction-scm
-   (gnc:transaction-get-guid trans)
-   (gnc:transaction-get-currency trans)
-   (gnc:transaction-get-date-entered trans)
+   (gncTransGetGUID trans)
+   (xaccTransGetCurrency trans)
+   (gnc-transaction-get-date-entered trans)
    (if use-cut-semantics?
-       (gnc:transaction-get-date-posted trans)
+       (gnc-transaction-get-date-posted trans)
        #f)
    (if use-cut-semantics?
-       (gnc:transaction-get-num trans)
+       (xaccTransGetNum trans)
        #f)
-   (gnc:transaction-get-description trans)
-   (gnc:transaction-get-notes trans)
+   (xaccTransGetDescription trans)
+   (xaccTransGetNotes trans)
    (trans-splits 0)))
 
 ;; Copy a scheme representation of a transaction onto a C transaction.
@@ -246,8 +246,8 @@
       #f
       (begin
         ;; open the transaction for editing
-        (if (not (gnc:transaction-is-open trans))
-            (gnc:transaction-begin-edit trans))
+        (if (not (xaccTransIsOpen trans))
+            (xaccTransBeginEdit trans))
 
         ;; copy in the transaction values
         (let ((currency    (gnc:transaction-scm-get-currency trans-scm))
@@ -255,23 +255,23 @@
               (num         (gnc:transaction-scm-get-num trans-scm))
               (notes       (gnc:transaction-scm-get-notes trans-scm))
               (date-posted (gnc:transaction-scm-get-date-posted trans-scm)))
-          (if currency    (gnc:transaction-set-currency trans currency))
-          (if description (gnc:transaction-set-description trans description))
-          (if num         (gnc:transaction-set-xnum trans num))
-          (if notes       (gnc:transaction-set-notes trans notes))
-          (if date-posted (gnc:transaction-set-date-time-pair
+          (if currency    (xaccTransSetCurrency trans currency))
+          (if description (xaccTransSetDescription trans description))
+          (if num         (xaccTransSetNum trans num))
+          (if notes       (xaccTransSetNotes trans notes))
+          (if date-posted (gnc-transaction-set-date
                            trans date-posted)))
 
         ;; strip off the old splits
         (for-each (lambda (split)
-                    (gnc:split-destroy split)) 
-                  (gnc:transaction-get-splits trans))
+                    (xaccSplitDestroy split))
+                  (xaccTransGetSplitList trans))
 
         ;; and put on the new ones! Please note they go in the *same*
         ;; order as in the original transaction. This is important.
         (for-each 
          (lambda (split-scm) 
-           (let* ((new-split (gnc:split-create book))
+           (let* ((new-split (xaccMallocSplit book))
                   (old-guid  (gnc:split-scm-get-account-guid split-scm))
                   (new-guid  (assoc-ref guid-mapping old-guid)))
              (if (not new-guid)
@@ -279,9 +279,9 @@
              (gnc:split-scm-set-account-guid split-scm new-guid)
              (gnc:split-scm-onto-split split-scm new-split book)
              (gnc:split-scm-set-account-guid split-scm old-guid)
-             (gnc:transaction-append-split trans new-split)))
+             (xaccSplitSetParent new-split trans)))
          (gnc:transaction-scm-get-split-scms trans-scm))
         
         ;; close the transaction
         (if commit?
-            (gnc:transaction-commit-edit trans)))))
+            (xaccTransCommitEdit trans)))))

Modified: gnucash/branches/register-rewrite/src/engine/engine-utilities.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/engine-utilities.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/engine-utilities.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,27 +21,10 @@
 
 ;; Copyright 2000 Rob Browning <rlb at cs.utexas.edu>
 
-(define (gnc:url->loaded-session session url ignore-lock? create-if-needed?)
-  ;; Return a <gnc:Book*> representing the data stored at the given
-  ;; url or #f on failure -- this should later be changed to returning
-  ;; the symbol representing the book error...  On success, the book
-  ;; will already be loaded.
-
-  (let* ((result (and session
-                      (gnc:session-begin session url
-                                         ignore-lock?
-                                         create-if-needed?)
-		      (eq? 'no-err (gw:enum-<gnc:BackendError>-val->sym
-				    (gnc:session-get-error session) #f))
-                      (gnc:session-load session)
-                      session)))
-    (or result
-        (begin (gnc:session-destroy session) #f))))
-
 (define (gnc:group-map-all-accounts thunk group)
-  (let ((accounts (or (gnc:group-get-subaccounts group) '())))
+  (let ((accounts (or (xaccGroupGetSubAccountsSorted group) '())))
     (map thunk accounts)))
 
 (define (gnc:group-map-accounts thunk group)
-  (let ((accounts (or (gnc:group-get-account-list group) '())))
+  (let ((accounts (or (xaccGroupGetAccountListSorted group) '())))
     (map thunk accounts)))

Copied: gnucash/branches/register-rewrite/src/engine/engine.i (from rev 15058, gnucash/trunk/src/engine/engine.i)

Modified: gnucash/branches/register-rewrite/src/engine/engine.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/engine.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/engine.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,9 +1,7 @@
 (define-module (gnucash engine))
 
-(use-modules (g-wrap gw-wct))
+(use-modules (sw_engine))
 
-(use-modules (g-wrapped gw-engine))
-
 (export GNC-RND-FLOOR)
 (export GNC-RND-CEIL)
 (export GNC-RND-TRUNC)

Modified: gnucash/branches/register-rewrite/src/engine/glib-helpers.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/glib-helpers.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/glib-helpers.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,7 @@
 /********************************************************************\
- * gnc-helpers.c -- gnucash g-wrap helper functions                 *
+ * gnc-helpers.c -- gnucash glib helper functions                   *
  * Copyright (C) 2000 Linas Vepstas                                 *
+ * Copyright (C) 2006 Chris Shoemaker <c.shoemaker at cox.net>         *
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -27,39 +28,37 @@
 #include <glib.h>
 #include <libguile.h>
 #include "guile-mappings.h"
-
-#include <g-wrap-wct.h>
-
+#include "swig-runtime.h"
 #include "glib-helpers.h"
 
 
-/* These will eventually go into (g-wrapped glib). */
-
 static SCM
-glist_to_scm_list_helper(GList *glist, SCM wct)
+glist_to_scm_list_helper(GList *glist, swig_type_info *wct)
 {
   SCM list = SCM_EOL;
   GList *node;
 
   for (node = glist; node; node = node->next)
-    list = scm_cons (gw_wcp_assimilate_ptr(node->data, wct), list);
+      list = scm_cons(SWIG_NewPointerObj(node->data, wct, 0), list);
 
   return scm_reverse (list);
 }
 
 SCM
-gnc_glist_to_scm_list(GList *glist, SCM wct)
+gnc_glist_to_scm_list(GList *glist, gchar *wct)
 {
-  SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_to_scm_list");
-  return(glist_to_scm_list_helper(glist, wct));
+    swig_type_info *stype = SWIG_TypeQuery(wct);
+    g_return_val_if_fail(stype, SCM_UNDEFINED);
+    return glist_to_scm_list_helper(glist, stype);
 }
 
-GList*
+GList *
 gnc_scm_list_to_glist(SCM rest)
 {
   GList *result = NULL;
   SCM scm_item;
-  
+
+  SWIG_GetModule(NULL); /* Work-around for SWIG bug. */
   SCM_ASSERT(SCM_LISTP(rest), rest, SCM_ARG1, "gnc_scm_list_to_glist");
 
   while(!SCM_NULLP(rest))
@@ -69,18 +68,17 @@
     scm_item = SCM_CAR(rest);
     rest = SCM_CDR(rest);
 
-    /* fixes a bug in g-wrap */
     if (scm_item == SCM_BOOL_F)
     {
       result = g_list_prepend(result, NULL);
     }
     else
     {
-      if (!gw_wcp_p(scm_item))
+      if (!SWIG_IsPointer(scm_item))
         scm_misc_error("gnc_scm_list_to_glist",
-                       "Item in list not a gw:wcp.", scm_item);
+                       "Item in list not a wcp.", scm_item);
       
-      item = gw_wcp_get_ptr(scm_item);
+      item = (void *)SWIG_PointerAddress(scm_item);
       result = g_list_prepend(result, item);
     }
   }
@@ -88,38 +86,6 @@
   return g_list_reverse(result);
 }
 
-static SCM
-glist_map_helper(GList *glist, SCM wct, SCM thunk)
-{
-  SCM list = SCM_EOL;
-  GList *node;
-
-  for (node = glist; node; node = node->next)
-    list = scm_cons (scm_call_1(thunk, gw_wcp_assimilate_ptr(node->data, wct)),
-		     list);
-
-  return scm_reverse (list);
-}
-
-SCM
-gnc_glist_scm_map(SCM wct, SCM thunk, GList* glist)
-{
-  SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_map");
-  SCM_ASSERT(SCM_PROCEDUREP(thunk), thunk, SCM_ARG2, "gnc_glist_scm_map");  
-  return(glist_map_helper(glist, wct, thunk));
-}
-
-void
-gnc_glist_scm_for_each(SCM wct, SCM thunk, GList *glist)
-{
-  GList *lp;
-  SCM_ASSERT(gw_wct_p(wct), wct, SCM_ARG1, "gnc_glist_map");
-  SCM_ASSERT(SCM_PROCEDUREP(thunk), thunk, SCM_ARG2, "gnc_glist_scm_for_each");  
-  for(lp = glist; lp; lp = lp->next) {
-    scm_call_1(thunk, gw_wcp_assimilate_ptr(lp->data, wct));
-  }
-}
-
 /********************************************************************
  * gnc_glist_string_to_scm
  * i.e. (glist-of (<gw:mchars> calee-owned) callee-owned)
@@ -143,9 +109,9 @@
 
 /********************************************************************
  * gnc_scm_to_glist_string
- * i.e. (glist-of (<gw:mchars> calee-owned) callee-owned)
+ * i.e. (glist-of (<gw:mchars> callee-owned) callee-owned)
  * or equivalently
- * i.e. (glist-of (<gw:gchars> calee-owned) callee-owned)
+ * i.e. (glist-of (<gw:gchars> callee-owned) callee-owned)
  ********************************************************************/
 
 GList *
@@ -164,6 +130,22 @@
   return g_list_reverse (glist);
 }
 
+GSList *
+gnc_scm_to_gslist_string(SCM list)
+{
+  GSList *gslist = NULL;
+
+  while (!SCM_NULLP (list))
+  {
+    const gchar * str = SCM_STRING_CHARS (SCM_CAR(list));
+    if (str)
+      gslist = g_slist_prepend (gslist, g_strdup (str));
+    list = SCM_CDR (list);
+  }
+
+  return g_slist_reverse (gslist);
+}
+
 /********************************************************************
  * gnc_glist_string_p
  ********************************************************************/

Modified: gnucash/branches/register-rewrite/src/engine/glib-helpers.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/glib-helpers.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/glib-helpers.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,7 @@
 /********************************************************************\
- * glib-helpers.h -- gnucash g-wrap helper functions                 *
+ * glib-helpers.h -- gnucash glib helper functions                  *
  * Copyright (C) 2000 Linas Vepstas                                 *
+ * Copyright (C) 2006 Chris Shoemaker <c.shoemaker at cox.net>         * 
  *                                                                  *
  * This program is free software; you can redistribute it and/or    *
  * modify it under the terms of the GNU General Public License as   *
@@ -27,16 +28,15 @@
 #include <glib.h>
 #include <libguile.h>
 
-SCM gnc_glist_to_scm_list(GList *glist, SCM wct);
+SCM gnc_glist_to_scm_list(GList *glist, gchar *wct);
 GList* gnc_scm_list_to_glist(SCM wcp_list);
 
-SCM gnc_glist_scm_map(SCM wct, SCM thunk, GList *glist);
-void gnc_glist_scm_for_each(SCM wct, SCM thunk, GList *glist);
-
 SCM     gnc_glist_string_to_scm(GList * list);
 GList * gnc_scm_to_glist_string(SCM list);
 int     gnc_glist_string_p(SCM list);
 
+GSList * gnc_scm_to_gslist_string(SCM list);
 
 
+
 #endif

Modified: gnucash/branches/register-rewrite/src/engine/gnc-associate-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-associate-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-associate-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -150,7 +150,8 @@
 
     current_account = iter->data;
     type = xaccAccountGetType(current_account);
-    g_return_val_if_fail(type == INCOME || type == EXPENSE, NULL);
+    g_return_val_if_fail(type == ACCT_TYPE_INCOME || type == ACCT_TYPE_EXPENSE,
+			 NULL);
 
     acc_id = xaccAccountGetGUID(current_account);
     guid_kvp = kvp_value_new_guid(acc_id);
@@ -423,7 +424,7 @@
 
   type = xaccAccountGetType(inc_or_expense_account);
   
-  g_return_if_fail(type == INCOME || type == EXPENSE);
+  g_return_if_fail(type == ACCT_TYPE_INCOME || type == ACCT_TYPE_EXPENSE);
   
   current_account_kvpframe = xaccAccountGetSlots(inc_or_expense_account);
 

Modified: gnucash/branches/register-rewrite/src/engine/gnc-budget.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-budget.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-budget.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,12 +22,15 @@
  *                                                                  *
 \********************************************************************/
 
+#include "config.h"
 #include <glib.h>
 #include <glib/gprintf.h>
 #include <glib/gi18n.h>
 #include <time.h>
 #include "qof.h"
 
+#include "glib-compat.h"
+
 #include "Account.h"
 #include "Group.h"
 
@@ -99,7 +102,7 @@
     budget = g_new0(GncBudget, 1);
     qof_instance_init (&budget->inst, GNC_ID_BUDGET, book);
 
-    g_date_set_time(&date, time(NULL));
+    g_date_set_time_t(&date, time(NULL));
     g_date_subtract_days(&date, g_date_get_day(&date)-1);
     recurrenceSet(&budget->recurrence, 1, PERIOD_MONTH, &date);
 
@@ -217,6 +220,31 @@
 /* period_num is zero-based */
 /* What happens when account is deleted, after we have an entry for it? */
 void
+gnc_budget_unset_account_period_value(GncBudget *budget, Account *account,
+                                    guint period_num)
+{
+    const GUID *guid;
+    KvpFrame *frame;
+    gchar path[BUF_SIZE];
+    gchar *bufend;
+
+    gnc_budget_begin_edit(budget);
+    frame = qof_instance_get_slots(QOF_INSTANCE(budget));
+    guid = xaccAccountGetGUID(account);
+    bufend = guid_to_string_buff(guid, path);
+    g_sprintf(bufend, "/%d", period_num);
+
+    kvp_frame_set_value(frame, path, NULL);
+    qof_instance_set_dirty(&budget->inst);
+    gnc_budget_commit_edit(budget);
+
+    qof_event_gen( &budget->inst.entity, QOF_EVENT_MODIFY, NULL);
+
+}
+
+/* period_num is zero-based */
+/* What happens when account is deleted, after we have an entry for it? */
+void
 gnc_budget_set_account_period_value(GncBudget *budget, Account *account,
                                     guint period_num, gnc_numeric val)
 {
@@ -231,7 +259,10 @@
     bufend = guid_to_string_buff(guid, path);
     g_sprintf(bufend, "/%d", period_num);
 
-    kvp_frame_set_numeric(frame, path, val);
+    if (gnc_numeric_check(val))
+        kvp_frame_set_value(frame, path, NULL);
+    else
+        kvp_frame_set_numeric(frame, path, val);
     qof_instance_set_dirty(&budget->inst);
     gnc_budget_commit_edit(budget);
 
@@ -272,7 +303,23 @@
 #endif
 
 
-/* Does not distinguish between unset and zero - returns zero either way. */
+gboolean
+gnc_budget_is_account_period_value_set(GncBudget *budget, Account *account,
+                                       guint period_num)
+{
+    gchar path[BUF_SIZE];
+    gchar *bufend;
+    KvpFrame *frame;
+
+    g_return_val_if_fail(GNC_IS_BUDGET(budget), FALSE);
+    g_return_val_if_fail(account, FALSE);
+
+    frame = qof_instance_get_slots(QOF_INSTANCE(budget));
+    bufend = guid_to_string_buff(xaccAccountGetGUID(account), path);
+    g_sprintf(bufend, "/%d", period_num);
+    return (kvp_frame_get_value(frame, path) != NULL);
+}
+
 gnc_numeric
 gnc_budget_get_account_period_value(GncBudget *budget, Account *account,
                                     guint period_num)
@@ -289,7 +336,9 @@
     frame = qof_instance_get_slots(QOF_INSTANCE(budget));
     bufend = guid_to_string_buff(xaccAccountGetGUID(account), path);
     g_sprintf(bufend, "/%d", period_num);
-    numeric = kvp_frame_get_numeric(frame, path); /* Zero if unset */
+
+    numeric = kvp_frame_get_numeric(frame, path);
+    /* This still returns zero if unset, but callers can check for that. */
     return numeric;
 }
 

Modified: gnucash/branches/register-rewrite/src/engine/gnc-budget.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-budget.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-budget.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -108,14 +108,17 @@
 const Recurrence * gnc_budget_get_recurrence(GncBudget *budget);
 
 /** Set/Get the starting date of the Budget */
-void gnc_budget_set_start_date(GncBudget* budget, Timespec date);
-Timespec gnc_budget_get_start_date(GncBudget* budget);
 Timespec gnc_budget_get_period_start_date(GncBudget* budget, guint period_num);
 
 /* Period indices are zero-based. */
 void gnc_budget_set_account_period_value(
     GncBudget* budget, Account* account, guint period_num, gnc_numeric val);
+void gnc_budget_unset_account_period_value(
+    GncBudget* budget, Account* account, guint period_num);
 
+gboolean gnc_budget_is_account_period_value_set(
+    GncBudget *budget, Account *account, guint period_num);
+
 gnc_numeric gnc_budget_get_account_period_value(
     GncBudget *budget, Account *account, guint period_num);
 gnc_numeric gnc_budget_get_account_period_actual_value(
@@ -124,9 +127,6 @@
 /** Get the book that this budget is associated with. */
 QofBook* gnc_budget_get_book(GncBudget* budget);
 
-/* Caller owns the list of all budgets in the book. */
-GList* gnc_book_get_budgets(QofBook* book);
-
 /* Returns some budget in the book, or NULL. */
 GncBudget* gnc_budget_get_default(QofBook *book);
 

Modified: gnucash/branches/register-rewrite/src/engine/gnc-commodity.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-commodity.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-commodity.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1366,7 +1366,7 @@
  * list commodities in a give namespace 
  ********************************************************************/
 
-GList * 
+CommodityList *
 gnc_commodity_table_get_commodities(const gnc_commodity_table * table,
                                     const char * namespace) 
 {
@@ -1411,7 +1411,7 @@
   return TRUE;
 }
 
-GList * 
+CommodityList *
 gnc_commodity_table_get_quotable_commodities(const gnc_commodity_table * table)
 {
   gnc_commodity_namespace * ns = NULL;

Modified: gnucash/branches/register-rewrite/src/engine/gnc-commodity.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-commodity.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-commodity.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -78,6 +78,7 @@
 #define GNC_COMMODITY_NS_AMEX   "AMEX"
 #define GNC_COMMODITY_NS_ASX    "ASX"
 
+typedef GList CommodityList;
 
 /** @name Commodity Quote Source functions 
  @{
@@ -759,8 +760,8 @@
  *  argument was supplied, or the namespace could not be found.
  *
  *  @note It is the callers responsibility to free the list. */
-GList * gnc_commodity_table_get_commodities(const gnc_commodity_table * table,
-					    const char * namespace);
+CommodityList * gnc_commodity_table_get_commodities(
+    const gnc_commodity_table * table, const char * namespace);
 
 /** This function returns a list of commodities for which price quotes
  *  should be retrieved.  It will scan the entire commodity table (or
@@ -779,7 +780,7 @@
  *  quote retrieval.
  *
  *  @note It is the callers responsibility to free the list. */
-GList * gnc_commodity_table_get_quotable_commodities(
+CommodityList * gnc_commodity_table_get_quotable_commodities(
     const gnc_commodity_table * table);
 
 /** Call a function once for each commodity in the commodity table.

Modified: gnucash/branches/register-rewrite/src/engine/gnc-engine.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-engine.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-engine.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -42,7 +42,7 @@
 #define GNC_LIB_NAME "gnc-backend-file"
 
 /* gnc-backend-file location */
-#include "gncla-dir.h"
+#include "gnc-path.h"
 
 static GList * engine_init_hooks = NULL;
 static int engine_is_initialized = 0;
@@ -76,21 +76,25 @@
 gnc_engine_init(int argc, char ** argv)
 {
   static struct {
-    const gchar* dir;
     const gchar* lib;
     gboolean required;
   } libs[] = {
-    { GNC_LIBDIR, GNC_LIB_NAME, TRUE },
+    { GNC_LIB_NAME, TRUE },
     /* shouldn't the PG gnc-module do this instead of US doing it? */
-    { GNC_LIBDIR, "gnc-backend-postgres", FALSE },
-    { NULL, NULL, FALSE } }, *lib;
+    { "gnc-backend-postgres", FALSE },
+    { NULL, FALSE } }, *lib;
   gnc_engine_init_hook_t hook;
   GList * cur;
+  gchar *tracefilename;
+  gchar *libdir;
 
   if (1 == engine_is_initialized) return;
 
   /* initialize logging to our file. */
-  qof_log_init_filename("/tmp/gnucash.trace");
+  tracefilename = g_build_filename(g_get_tmp_dir(), "gnucash.trace",
+				   (gchar *)NULL);
+  qof_log_init_filename(tracefilename);
+  g_free(tracefilename);
   /* Only set the core log_modules here the rest can be set locally.  */
   qof_log_set_level(GNC_MOD_ENGINE, QOF_LOG_WARNING);
   qof_log_set_level(GNC_MOD_IO, QOF_LOG_WARNING);
@@ -103,15 +107,16 @@
   /* Now register our core types */
   cashobjects_register();
 
-  for (lib = libs; lib->dir && lib->lib ; lib++)
+  libdir = gnc_path_get_libdir ();
+  for (lib = libs; lib->lib ; lib++)
   {
-      if (qof_load_backend_library(lib->dir, lib->lib))
+      if (qof_load_backend_library(libdir, lib->lib))
       {
           engine_is_initialized = 1;
       }
       else
       {
-          g_message("failed to load %s from %s\n", lib->lib, lib->dir);
+	  g_message("failed to load %s from %s\n", lib->lib, libdir);
 	  /* If this is a required library, stop now! */
 	  if (lib->required)
 	  {
@@ -119,6 +124,7 @@
 	  }
       }
   }
+  g_free (libdir);
 
   /* call any engine hooks */
   for (cur = engine_init_hooks; cur; cur = cur->next)

Modified: gnucash/branches/register-rewrite/src/engine/gnc-filepath-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-filepath-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-filepath-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -65,15 +65,15 @@
 {
   int rc;
   struct stat statbuf;
-  char *home;
+  const gchar *home;
   char *path;
   char *data;
 
   /* Punt. Can't figure out where home is. */
-  home = getenv ("HOME");
+  home = g_get_home_dir();
   if (!home) return;
 
-  path = g_strconcat(home, "/.gnucash", NULL);
+  path = g_build_filename(home, ".gnucash", (gchar *)NULL);
 
   rc = stat (path, &statbuf);
   if (rc)
@@ -85,7 +85,7 @@
     g_mkdir (path, S_IRWXU);   /* perms = S_IRWXU = 0700 */
   }
 
-  data = g_strconcat (path, "/data", NULL);
+  data = g_build_filename (path, "data", (gchar *)NULL);
   rc = stat (data, &statbuf);
   if (rc)
     g_mkdir (data, S_IRWXU);
@@ -97,28 +97,24 @@
 /* ====================================================================== */
 
 /* XXX hack alert -- we should be yanking this out of some config file */
+/* These are obviously meant to be hard-coded paths to the gnucash
+   data file. That is insane. These should be thrown out
+   altogether. On non-Unix systems (Windows) these paths would not
+   only have different directory separator characters but these
+   would certainly be completely different paths. I'd vote to
+   throw this out completely. -- cstim, 2006-07-19 */
 static char * searchpaths[] =
 {
-   "/usr/share/gnucash/data/",
-   "/usr/local/share/gnucash/data/",
-   "/usr/share/gnucash/accounts/",
-   "/usr/local/share/gnucash/accounts/",
+   "/usr/share/gnucash/data",
+   "/usr/local/share/gnucash/data",
+   "/usr/share/gnucash/accounts",
+   "/usr/local/share/gnucash/accounts",
    NULL,
 };
 
 typedef gboolean (*pathGenerator)(char *pathbuf, int which);
 
 static gboolean
-xaccAddEndPath(char *pathbuf, const char *ending, int len)
-{
-    if(len + strlen(pathbuf) >= PATH_MAX)
-        return FALSE;
-          
-    strcat (pathbuf, ending);
-    return TRUE;
-}
-
-static gboolean
 xaccCwdPathGenerator(char *pathbuf, int which)
 {
     if(which != 0)
@@ -131,7 +127,6 @@
         if (getcwd (pathbuf, PATH_MAX) == NULL)
             return FALSE;
 
-        strcat (pathbuf, "/");
         return TRUE;
     }
 }
@@ -139,23 +134,28 @@
 static gboolean
 xaccDataPathGenerator(char *pathbuf, int which)
 {
-    char *path;
-    
     if(which != 0)
     {
         return FALSE;
     }
     else
     {
-        path = getenv ("HOME");
-        if (!path)
+        const gchar *home;
+	gchar *tmppath;
+    
+        home = g_get_home_dir ();
+        if (!home)
             return FALSE;
 
-        if (PATH_MAX <= (strlen (path) + 20))
-            return FALSE;
+	tmppath = g_build_filename (home, ".gnucash", "data", (gchar *)NULL);
+        if (strlen(tmppath) >= PATH_MAX)
+	{
+	    g_free (tmppath);
+	    return FALSE;
+	}
 
-        strcpy (pathbuf, path);
-        strcat (pathbuf, "/.gnucash/data/");
+        g_strlcpy (pathbuf, tmppath, PATH_MAX);
+	g_free (tmppath);
         return TRUE;
     }
 }
@@ -176,7 +176,7 @@
         if (PATH_MAX <= strlen(path))
             return FALSE;
 
-        strcpy (pathbuf, path);
+        g_strlcpy (pathbuf, path, PATH_MAX);
         return TRUE;
     }
 }
@@ -206,14 +206,12 @@
   /* OK, now we try to find or build an absolute file path */
 
   /* check for an absolute file path */
-  if (*filefrag == '/')
+  if (g_path_is_absolute(filefrag))
     return g_strdup (filefrag);
 
   if (!g_ascii_strncasecmp(filefrag, "file:", 5))
   {
-      char *ret = g_new(char, strlen(filefrag) - 5 + 1);
-      strcpy(ret, filefrag + 5);
-      return ret;
+      return g_strdup(filefrag + 5);
   }
 
   /* get conservative on the length so that sprintf(getpid()) works ... */
@@ -230,14 +228,14 @@
       int j;
       for(j = 0; gens[i](pathbuf, j) ; j++)
       {
-          if(xaccAddEndPath(pathbuf, filefrag, namelen))
-          {
-              int rc = stat (pathbuf, &statbuf);
-              if ((!rc) && (S_ISREG(statbuf.st_mode)))
-              {
-                  return (g_strdup (pathbuf));
-              }
+	  gchar *fullpath = g_build_filename(pathbuf, filefrag, (gchar *)NULL);
+
+	  int rc = stat (fullpath, &statbuf);
+	  if ((!rc) && (S_ISREG(statbuf.st_mode)))
+	  {
+	      return fullpath;
           }
+	  g_free (fullpath);
       }
   }
   /* OK, we didn't find the file. */
@@ -262,22 +260,20 @@
   /* Lets try creating a new file in $HOME/.gnucash/data */
   if (xaccDataPathGenerator(pathbuf, 0))
   {
-      if(xaccAddEndPath(pathbuf, filefrag_dup, namelen))
-      {
-          g_free (filefrag_dup);
-          return (g_strdup (pathbuf));
-      }
+      gchar *result;
+      result = g_build_filename(pathbuf, filefrag_dup, (gchar *)NULL);
+      g_free (filefrag_dup);
+      return result;
   } 
 
   /* OK, we still didn't find the file */
   /* Lets try creating a new file in the cwd */
   if (xaccCwdPathGenerator(pathbuf, 0))
   {
-      if(xaccAddEndPath(pathbuf, filefrag_dup, namelen))
-      {
-          g_free (filefrag_dup);
-          return (g_strdup (pathbuf));
-      }
+      gchar *result;
+      result = g_build_filename(pathbuf, filefrag_dup, (gchar *)NULL);
+      g_free (filefrag_dup);
+      return result;
   }
 
   g_free (filefrag_dup);

Modified: gnucash/branches/register-rewrite/src/engine/gnc-hooks.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-hooks.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-hooks.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -26,7 +26,7 @@
 #include <glib.h>
 #include <stdio.h>
 #include <libguile.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 #include "gnc-hooks.h"
 #include "gnc-hooks-scm.h"
 #include "gnc-engine.h"
@@ -191,8 +191,7 @@
 
   // XXX: FIXME: We really should make sure this is a session!!! */
   scm_call_1 (scm->proc,
-	      gw_wcp_assimilate_ptr (data,
-				     scm_c_eval_string("<gnc:Session*>")));
+              SWIG_NewPointerObj(data, SWIG_TypeQuery("_p_QofSession"), 0));
 
   LEAVE("");
 }

Modified: gnucash/branches/register-rewrite/src/engine/gnc-lot.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-lot.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-lot.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -39,6 +39,7 @@
  * Copyright (c) 2002,2003 Linas Vepstas <linas at linas.org>
  */
 
+#include "config.h"
 #include "Account.h"
 #include "gnc-lot.h"
 #include "gnc-lot-p.h"

Modified: gnucash/branches/register-rewrite/src/engine/gnc-numeric.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-numeric.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-numeric.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -74,7 +74,9 @@
 
 ;; Constructor; takes one <gnc:commodity*> and one <gnc-numeric>
 (define (gnc:make-gnc-monetary c a)
-  (if (and (gw:wcp-is-of-type? <gnc:commodity*> c) (gnc:gnc-numeric? a))
+  ;;FIXME: we used to type-check the values, like:
+  ;; (gw:wcp-is-of-type? <gnc:commodity*> c)
+  (if (and #t (gnc:gnc-numeric? a))
       ((record-constructor <gnc-monetary>) c a)
       (warn "wrong arguments for gnc:make-gnc-monetary: " c a)))
 
@@ -91,5 +93,5 @@
   (if (gnc:gnc-monetary? a)
       (gnc:make-gnc-monetary 
        (gnc:gnc-monetary-commodity a)
-       (gnc:numeric-neg (gnc:gnc-monetary-amount a)))
+       (gnc-numeric-neg (gnc:gnc-monetary-amount a)))
       (warn "wrong arguments for gnc:monetary-neg: " a)))

Copied: gnucash/branches/register-rewrite/src/engine/gnc-path.c (from rev 15058, gnucash/trunk/src/engine/gnc-path.c)

Copied: gnucash/branches/register-rewrite/src/engine/gnc-path.h (from rev 15058, gnucash/trunk/src/engine/gnc-path.h)

Modified: gnucash/branches/register-rewrite/src/engine/gnc-pricedb.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-pricedb.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-pricedb.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -458,7 +458,7 @@
 }
 
 gboolean
-gnc_price_list_insert(GList **prices, GNCPrice *p, gboolean check_dupl)
+gnc_price_list_insert(PriceList **prices, GNCPrice *p, gboolean check_dupl)
 {
   GList *result_list;
   PriceListIsDuplStruct* pStruct;
@@ -487,7 +487,7 @@
 }
 
 gboolean
-gnc_price_list_remove(GList **prices, GNCPrice *p)
+gnc_price_list_remove(PriceList **prices, GNCPrice *p)
 {
   GList *result_list;
   GList *found_element;
@@ -512,14 +512,14 @@
 }
 
 void
-gnc_price_list_destroy(GList *prices)
+gnc_price_list_destroy(PriceList *prices)
 {
   g_list_foreach(prices, price_list_destroy_helper, NULL);
   g_list_free(prices);
 }
 
 gboolean
-gnc_price_list_equal(GList *prices1, GList *prices2)
+gnc_price_list_equal(PriceList *prices1, PriceList *prices2)
 {
   GList *n1, *n2;
 
@@ -1117,7 +1117,7 @@
   gnc_price_list_insert(return_list, price_list->data, FALSE);
 }
 
-GList *
+PriceList *
 gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
                                        const gnc_commodity *commodity)
 {
@@ -1212,7 +1212,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_get_prices(GNCPriceDB *db,
                        const gnc_commodity *commodity,
                        const gnc_commodity *currency)
@@ -1258,7 +1258,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_day(GNCPriceDB *db,
                        const gnc_commodity *c,
                        const gnc_commodity *currency,
@@ -1331,7 +1331,7 @@
   }
 }
 
-GList *
+PriceList *
 gnc_pricedb_lookup_day_any_currency(GNCPriceDB *db,
 				    const gnc_commodity *c,
                                     Timespec t)
@@ -1376,7 +1376,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_at_time(GNCPriceDB *db,
                            const gnc_commodity *c,
                            const gnc_commodity *currency,
@@ -1446,7 +1446,7 @@
   }
 }
 
-GList *
+PriceList *
 gnc_pricedb_lookup_at_time_any_currency(GNCPriceDB *db,
 					const gnc_commodity *c,
                                         Timespec t)
@@ -1706,7 +1706,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
                                                 const gnc_commodity *c,
                                                 Timespec t)
@@ -1749,7 +1749,7 @@
 }
 
 
-GList *
+PriceList *
 gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
 					      gnc_commodity *c,
 					      Timespec t)
@@ -2376,7 +2376,7 @@
 }
 
 static void
-price_foreach(QofCollection *col, QofEntityForeachCB cb, gpointer data)
+price_foreach(const QofCollection *col, QofEntityForeachCB cb, gpointer data)
 {
   GNCPriceDB *db;
 

Modified: gnucash/branches/register-rewrite/src/engine/gnc-pricedb.h
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gnc-pricedb.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gnc-pricedb.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -126,6 +126,7 @@
 
 /** */
 typedef struct gnc_price_lookup_s GNCPriceLookup;
+typedef GList PriceList;
 
 /* ------------------ */
 /** @name Constructors 
@@ -216,17 +217,18 @@
 
 /** gnc_price_list_insert - insert a price into the given list, calling
      gnc_price_ref on it during the process. */
-gboolean gnc_price_list_insert(GList **prices, GNCPrice *p, gboolean check_dupl);
+gboolean gnc_price_list_insert(PriceList **prices, GNCPrice *p,
+                               gboolean check_dupl);
 
 /** gnc_price_list_remove - remove the price, p, from the given list,
      calling gnc_price_unref on it during the process. */
-gboolean gnc_price_list_remove(GList **prices, GNCPrice *p);
+gboolean gnc_price_list_remove(PriceList **prices, GNCPrice *p);
 
 /** gnc_price_list_destroy - destroy the given price list, calling
      gnc_price_unref on all the prices included in the list. */
-void     gnc_price_list_destroy(GList *prices);
+void     gnc_price_list_destroy(PriceList *prices);
 
-gboolean gnc_price_list_equal(GList *prices1, GList *prices2);
+gboolean gnc_price_list_equal(PriceList *prices1, PriceList *prices2);
 /**  @} */
 /**  @}  end of the Price doxygen group */
 
@@ -288,8 +290,8 @@
 /** gnc_pricedb_lookup_latest_any_currency - find the most recent prices
      for the given commodity in any available currency. Prices will be
      returned as a GNCPrice list (see above). */
-GList      *gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
-                                                   const gnc_commodity *commodity);
+PriceList * gnc_pricedb_lookup_latest_any_currency(GNCPriceDB *db,
+                                                 const gnc_commodity *commodity);
 
 /** gnc_pricedb_has_prices - return an indication of whether or not
     there are any prices for a given commodity in the given currency.
@@ -301,39 +303,39 @@
 /** gnc_pricedb_get_prices - return all the prices for a given
      commodity in the given currency.  Returns NULL on failure.  The
      result is a GNCPrice list (see above).  */
-GList      * gnc_pricedb_get_prices(GNCPriceDB *db,
-                                    const gnc_commodity *commodity,
-                                    const gnc_commodity *currency);
+PriceList * gnc_pricedb_get_prices(GNCPriceDB *db,
+                                 const gnc_commodity *commodity,
+                                 const gnc_commodity *currency);
 
 /** gnc_pricedb_lookup_at_time - return all prices that match the given
      commodity, currency, and timespec.  Prices will be returned as a
      GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
-                                        const gnc_commodity *commodity,
-                                        const gnc_commodity *currency,
-                                        Timespec t);
+PriceList * gnc_pricedb_lookup_at_time(GNCPriceDB *db,
+                                     const gnc_commodity *commodity,
+                                     const gnc_commodity *currency,
+                                     Timespec t);
 
 /** gnc_pricedb_lookup_at_time_any_currency - return all prices that match the
      given commodity and timespec in any available currency.  Prices will be
      returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_at_time_any_currency(GNCPriceDB *db,
- 		                                     const gnc_commodity *c,
-		                                     Timespec t);
+PriceList * gnc_pricedb_lookup_at_time_any_currency(GNCPriceDB *db,
+                                                  const gnc_commodity *c,
+                                                  Timespec t);
 
 /** gnc_pricedb_lookup_day - return all prices that match the given
      commodity, currency, and timespec.  Prices will be returned as a
      GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_day(GNCPriceDB *db,
-				    const gnc_commodity *commodity,
-				    const gnc_commodity *currency,
-				    Timespec t);
+PriceList * gnc_pricedb_lookup_day(GNCPriceDB *db,
+                                 const gnc_commodity *commodity,
+                                 const gnc_commodity *currency,
+                                 Timespec t);
 
 /** gnc_pricedb_lookup_day_any_currency - return all prices that match the
      given commodity and timespec in any available currency.  Prices will be
      returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_day_any_currency(GNCPriceDB *db,
- 		                                 const gnc_commodity *c,
-		                                 Timespec t);
+PriceList * gnc_pricedb_lookup_day_any_currency(GNCPriceDB *db,
+                                              const gnc_commodity *c,
+                                              Timespec t);
 
 /** gnc_pricedb_lookup_nearest_in_time - return the price for the given
      commodity in the given currency nearest to the given time t. */
@@ -345,9 +347,9 @@
 /** gnc_pricedb_lookup_nearest_in_time_any_currency - return all prices that
      match the given commodity and timespec in any available currency. Prices
      will be returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
- 		                                             const gnc_commodity *c,
-		                                             Timespec t);
+PriceList * gnc_pricedb_lookup_nearest_in_time_any_currency(GNCPriceDB *db,
+                                                          const gnc_commodity *c,
+                                                          Timespec t);
 /** gnc_pricedb_lookup_latest_before - return the latest price for the given commodity
     in the given currency up to and including time t. */
 GNCPrice * gnc_pricedb_lookup_latest_before(GNCPriceDB *db,
@@ -358,9 +360,9 @@
 /** gnc_pricedb_lookup_latest_before_any_currency - return recent prices that
      match the given commodity up to and including time t in any available currency. Prices
      will be returned as a GNCPrice list (see above). */
-GList      * gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
- 		                                             gnc_commodity *c,
-		                                             Timespec t);
+PriceList * gnc_pricedb_lookup_latest_before_any_currency(GNCPriceDB *db,
+                                                        gnc_commodity *c,
+                                                        Timespec t);
 
 
 /** gnc_pricedb_convert_balance_latest_price - Convert a balance

Modified: gnucash/branches/register-rewrite/src/engine/gncla-dir.h.in
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gncla-dir.h.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gncla-dir.h.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,5 +23,15 @@
  *  02110-1301, USA.
  */
 
-#define GNC_LIBDIR "@-libdir-@"
+#define PREFIX "@-prefix-@"
+#define DATADIR "@-datadir-@"
+#define SYSCONFDIR "@-sysconfdir-@"
 
+#define LIBDIR "@-libdir-@"
+#define PKGLIBDIR "@-pkglibdir-@"
+
+#define LOCALE_DIR  "@-LOCALE_DIR-@"
+
+#define GNC_ACCOUNTS_DIR "@-GNC_ACCOUNTS_DIR-@"
+#define GNC_GLADE_DIR "@-GNC_GLADE_DIR-@"
+#define GNC_GCONF_DIR "@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@"

Modified: gnucash/branches/register-rewrite/src/engine/gncmod-engine.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gncmod-engine.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gncmod-engine.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,7 +12,6 @@
 
 #include "gnc-engine.h"
 #include "gnc-module-api.h"
-#include "gw-engine.h"
 
 /* version of the gnc module system interface we require */
 int libgncmod_engine_LTX_gnc_module_system_interface = 0;
@@ -41,6 +40,8 @@
   return g_strdup("The GnuCash accounting engine");
 }
 
+extern SCM scm_init_sw_engine_module(void);
+
 int
 libgncmod_engine_LTX_gnc_module_init(int refcount) 
 {
@@ -50,13 +51,10 @@
     gnc_engine_init(0, NULL);
   }
   
+  scm_init_sw_engine_module();
+  scm_c_eval_string("(use-modules (sw_engine))");
   scm_c_eval_string("(use-modules (gnucash engine))");
 
-  scm_c_eval_string("(use-modules (g-wrap gw-glib))");
-
-  scm_c_eval_string("(use-modules (g-wrapped gw-kvp))");
-  scm_c_eval_string("(use-modules (g-wrapped gw-engine))");
-
   return TRUE;
 }
 

Deleted: gnucash/branches/register-rewrite/src/engine/gw-engine-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gw-engine-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gw-engine-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,2679 +0,0 @@
-(define-module (g-wrapped gw-engine-spec))
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(use-modules (g-wrap))
-(use-modules (g-wrap simple-type))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(define ws (gw:new-wrapset "gw-engine"))
-
-(gw:wrapset-depends-on ws "gw-standard")
-(gw:wrapset-depends-on ws "gw-wct")
-(gw:wrapset-depends-on ws "gw-glib")
-
-(gw:wrapset-set-guile-module! ws '(g-wrapped gw-engine))
-
-(gw:wrapset-add-cs-declarations!
- ws
- (lambda (wrapset client-wrapset)
-   (list
-    "#include <config.h>\n"
-    "#include <glib.h>\n"
-    "#include <qof.h>\n"
-    "#include <Group.h>\n"
-    "#include <Query.h>\n"
-    "#include <gnc-budget.h>\n"
-    "#include <gnc-commodity.h>\n"
-    "#include <gnc-engine.h>\n"
-    "#include <gnc-filepath-utils.h>\n"
-    "#include <gnc-pricedb.h>\n"
-    "#include <gnc-lot.h>\n"
-    "#include <gnc-session-scm.h>\n"
-    "#include <gnc-hooks-scm.h>\n"
-    "#include <engine-helpers.h>\n"
-    "#include <SX-book.h>\n")))
-
-(gw:wrapset-add-cs-initializers!
- ws
- (lambda (wrapset client-wrapset status-var) 
-   (if client-wrapset
-       '()
-       (gw:inline-scheme '(use-modules (gnucash engine))))))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; <gnc:time-pair>
-(gw:wrap-simple-type ws
-                     '<gnc:time-pair> "Timespec"
-                     '("gnc_timepair_p(" scm-var ")")
-                     '(c-var " = gnc_timepair2timespec(" scm-var ");\n")
-                     '(scm-var " = gnc_timespec2timepair(" c-var ");\n"))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; <gnc:guid-scm>
-(gw:wrap-simple-type ws
-                     '<gnc:guid-scm> "GUID"
-                     '("gnc_guid_p(" scm-var ")")
-                     '(c-var " = gnc_scm2guid(" scm-var ");\n")
-                     '(scm-var " = gnc_guid2scm(" c-var ");\n"))
-
-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
-;; <gnc:numeric>
-(gw:wrap-simple-type ws
-                     '<gnc:numeric> "gnc_numeric"
-                     '("gnc_numeric_p(" scm-var ")")
-                     '(c-var " = gnc_scm_to_numeric(" scm-var ");\n")
-                     '(scm-var " = gnc_numeric_to_scm(" c-var ");\n"))
-
-;; Equivalencies
-;;
-;; <gnc:list-of-commodity*> -> (gw:glist-of <gnc:commodity*> caller-owned)
-;; <gnc:list-of-price*> -> (gw:glist-of <gnc:Price*> caller-owned)
-;;
-;; <gnc:list-of-split*-caller-owned> -> (gw:glist-of <gnc:Split*> caller-owned)
-;; <gnc:list-of-split*-callee-owned> -> (gw:glist-of <gnc:Split*> callee-owned)
-;;
-;; <gnc:list-of-transaction*-callee-owned> ->
-;;   (gw:glist-of <gnc:Transaction*> callee-owned)
-;; <gnc:list-of-transaction*-caller-owned> ->
-;;   (gw:glist-of <gnc:Transaction*> caller-owned)
-;;
-;; <gnc:list-of-account*-callee-owned> ->
-;;   (gw:glist-of <gnc:Account*> callee-owned)
-;; <gnc:list-of-account*-caller-owned> ->
-;;   (gw:glist-of <gnc:Account*> caller-owned)
-;;
-;; <gnc:list-of-string> -> '(gw:glist-of (<gw:mchars> callee-owned) callee-owned)
-
-
-(gw:wrap-as-wct ws '<gnc:GList*> "GList*" "const GList*")
-
-(gw:wrap-as-wct ws '<gnc:id-type> "QofIdType" "QofIdTypeConst")
-(gw:wrap-as-wct ws '<gnc:Account*> "Account*" "const Account*")
-(gw:wrap-as-wct ws '<gnc:Account**> "Account**" "const Account**")
-(gw:wrap-as-wct ws '<gnc:AccountGroup*> "AccountGroup*" "const AccountGroup*")
-(gw:wrap-as-wct ws '<gnc:Book*> "QofBook*" "const QofBook*")
-(gw:wrap-as-wct ws '<gnc:Lot*> "GNCLot*" "const GNCLot*")
-(gw:wrap-as-wct ws '<gnc:Session*> "QofSession*" "const QofSession**")
-(gw:wrap-as-wct ws '<gnc:Split*> "Split*" "const Split*")
-(gw:wrap-as-wct ws '<gnc:Transaction*> "Transaction*" "const Transaction*")  
-(gw:wrap-as-wct ws '<gnc:commodity*> "gnc_commodity*" "const gnc_commodity*")
-(gw:wrap-as-wct ws '<gnc:commodity-namespace*>
-                "gnc_commodity_namespace*" 
-                "const gnc_commodity_namespace*")
-(gw:wrap-as-wct ws '<gnc:commodity-table*>
-                "gnc_commodity_table*" 
-                "const gnc_commodity_table*")
-
-(gw:wrap-as-wct ws '<gnc:Query*> "Query *" "const Query *")
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:event-type> "QofEventId")))
-
-  (gw:enum-add-value! wt "QOF_EVENT_NONE" 'qof-event-none)
-  (gw:enum-add-value! wt "QOF_EVENT_CREATE" 'qof-event-create)
-  (gw:enum-add-value! wt "QOF_EVENT_MODIFY" 'qof-event-modify)
-  (gw:enum-add-value! wt "QOF_EVENT_DESTROY" 'qof-event-destroy)
-  (gw:enum-add-value! wt "QOF_EVENT_ALL" 'qof-event-all))
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:query-op> "QofQueryOp")))
-
-  (gw:enum-add-value! wt "QOF_QUERY_AND" 'query-and)
-  (gw:enum-add-value! wt "QOF_QUERY_OR" 'query-or)
-  (gw:enum-add-value! wt "QOF_QUERY_NAND" 'query-nand)
-  (gw:enum-add-value! wt "QOF_QUERY_NOR" 'query-nor)
-  (gw:enum-add-value! wt "QOF_QUERY_XOR" 'query-xor))
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:query-compare-how> "QofQueryCompare")))
-  (gw:enum-add-value! wt "QOF_COMPARE_LT" 'query-compare-lt)
-  (gw:enum-add-value! wt "QOF_COMPARE_LTE" 'query-compare-lte)
-  (gw:enum-add-value! wt "QOF_COMPARE_EQUAL" 'query-compare-equal)
-  (gw:enum-add-value! wt "QOF_COMPARE_GT" 'query-compare-gt)
-  (gw:enum-add-value! wt "QOF_COMPARE_GTE" 'query-compare-gte)
-  (gw:enum-add-value! wt "QOF_COMPARE_NEQ" 'query-compare-neq)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:string-match-how> "QofStringMatch")))
-  (gw:enum-add-value! wt "QOF_STRING_MATCH_NORMAL" 'string-match-normal)
-  (gw:enum-add-value! wt "QOF_STRING_MATCH_CASEINSENSITIVE" 'string-match-caseinsensitive)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:date-match-how> "QofDateMatch")))
-  (gw:enum-add-value! wt "QOF_DATE_MATCH_NORMAL" 'date-match-normal)
-  (gw:enum-add-value! wt "QOF_DATE_MATCH_DAY" 'date-match-rounded)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:numeric-match-how> "QofNumericMatch")))
-  (gw:enum-add-value! wt "QOF_NUMERIC_MATCH_ANY" 'amt-sgn-match-either)
-  (gw:enum-add-value! wt "QOF_NUMERIC_MATCH_CREDIT" 'amt-sgn-match-credit)
-  (gw:enum-add-value! wt "QOF_NUMERIC_MATCH_DEBIT" 'amt-sgn-match-debit)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:cleared-match-how> "cleared_match_t")))
-  (gw:enum-add-value! wt "CLEARED_NO" 'cleared-match-no)
-  (gw:enum-add-value! wt "CLEARED_CLEARED" 'cleared-match-cleared)
-  (gw:enum-add-value! wt "CLEARED_RECONCILED" 'cleared-match-reconciled)
-  (gw:enum-add-value! wt "CLEARED_FROZEN" 'cleared-match-frozen)
-  (gw:enum-add-value! wt "CLEARED_VOIDED" 'cleared-match-voided)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:guid-match-how> "QofGuidMatch")))
-  (gw:enum-add-value! wt "QOF_GUID_MATCH_ALL" 'guid-match-all)
-  (gw:enum-add-value! wt "QOF_GUID_MATCH_ANY" 'guid-match-any)
-  (gw:enum-add-value! wt "QOF_GUID_MATCH_NULL" 'guid-match-null)
-  (gw:enum-add-value! wt "QOF_GUID_MATCH_NONE" 'guid-match-none)
-  (gw:enum-add-value! wt "QOF_GUID_MATCH_LIST_ANY" 'guid-match-list-any)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:char-match-how> "QofCharMatch")))
-  (gw:enum-add-value! wt "QOF_CHAR_MATCH_ANY" 'char-match-any)
-  (gw:enum-add-value! wt "QOF_CHAR_MATCH_NONE" 'char-match-none)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:query-txn-match-t> "query_txn_match_t")))
-  (gw:enum-add-value! wt "QUERY_TXN_MATCH_ALL" 'query-txn-match-all)    
-  (gw:enum-add-value! wt "QUERY_TXN_MATCH_ANY" 'query-txn-match-any)
-  #t)
-
-(let ((wt (gw:wrap-enumeration ws '<gnc:kvp-value-t> "KvpValueType")))
-  (gw:enum-add-value! wt "KVP_TYPE_GINT64" 'kvp-type-gint64)
-  (gw:enum-add-value! wt "KVP_TYPE_DOUBLE" 'kvp-type-double)
-  (gw:enum-add-value! wt "KVP_TYPE_NUMERIC" 'kvp-type-numeric)
-  (gw:enum-add-value! wt "KVP_TYPE_STRING" 'kvp-type-string)
-  (gw:enum-add-value! wt "KVP_TYPE_GUID" 'kvp-type-guid)
-  (gw:enum-add-value! wt "KVP_TYPE_TIMESPEC" 'kvp-type-timespec)
-  (gw:enum-add-value! wt "KVP_TYPE_BINARY" 'kvp-type-binary)
-  (gw:enum-add-value! wt "KVP_TYPE_GLIST" 'kvp-type-glist)
-  (gw:enum-add-value! wt "KVP_TYPE_FRAME" 'kvp-type-frame)
-  #t)
-
-(let ((we (gw:wrap-enumeration ws '<gnc:AccountType> "GNCAccountType")))
-  ;; From Account.h
-  (gw:enum-add-value! we "BAD_TYPE" 'bad-type)
-  (gw:enum-add-value! we "NO_TYPE" 'no-type)
-  (gw:enum-add-value! we "BANK" 'bank)
-  (gw:enum-add-value! we "CASH" 'cash)
-  (gw:enum-add-value! we "CREDIT" 'credit)
-  (gw:enum-add-value! we "ASSET" 'asset)
-  (gw:enum-add-value! we "LIABILITY" 'liability)
-  (gw:enum-add-value! we "STOCK" 'stock)
-  (gw:enum-add-value! we "MUTUAL" 'mutual-fund)
-  (gw:enum-add-value! we "CURRENCY" 'currency)
-  (gw:enum-add-value! we "INCOME" 'income)
-  (gw:enum-add-value! we "EXPENSE" 'expense)
-  (gw:enum-add-value! we "EQUITY" 'equity)
-  (gw:enum-add-value! we "RECEIVABLE" 'receivable)
-  (gw:enum-add-value! we "PAYABLE" 'payable)
-  (gw:enum-add-value! we "NUM_ACCOUNT_TYPES" 'num-account-types)
-  (gw:enum-add-value! we "CHECKING" 'checking)
-  (gw:enum-add-value! we "SAVINGS" 'savings)
-  (gw:enum-add-value! we "MONEYMRKT" 'money-market)
-  (gw:enum-add-value! we "CREDITLINE" 'credit-line)
-  #t)
-
-(let ((we (gw:wrap-enumeration ws '<gnc:BackendError> "QofBackendError")))
-
-  (gw:enum-add-value! we "ERR_BACKEND_NO_ERR" 'no-err)
-  (gw:enum-add-value! we "ERR_BACKEND_NO_BACKEND" 'no-backend)
-  (gw:enum-add-value! we "ERR_BACKEND_BAD_URL" 'bad-url)
-  (gw:enum-add-value! we "ERR_BACKEND_CANT_CONNECT" 'cant-connect)
-  (gw:enum-add-value! we "ERR_BACKEND_CONN_LOST" 'connection-lost)
-  (gw:enum-add-value! we "ERR_BACKEND_NO_SUCH_DB" 'no-such-db)
-  (gw:enum-add-value! we "ERR_BACKEND_LOCKED" 'locked)
-  (gw:enum-add-value! we "ERR_BACKEND_READONLY" 'read-only)
-  (gw:enum-add-value! we "ERR_BACKEND_DATA_CORRUPT" 'data-corrupt)
-  (gw:enum-add-value! we "ERR_BACKEND_SERVER_ERR" 'server-error)
-  (gw:enum-add-value! we "ERR_BACKEND_ALLOC" 'alloc)
-  (gw:enum-add-value! we "ERR_BACKEND_MISC" 'misc)
-  
-  ;;     (gw:enum-add-value! we "ERR_FILEIO_FILE_BAD_READ" 'file-bad-read)
-  ;;     (gw:enum-add-value! we "ERR_FILEIO_FILE_EMPTY" 'file-empty)
-  ;;     (gw:enum-add-value! we "ERR_FILEIO_FILE_LOCKERR" 'file-lockerr)
-  ;;     (gw:enum-add-value! we "ERR_FILEIO_FILE_NOT_FOUND" 'file-not-found)
-  ;;     (gw:enum-add-value! we "ERR_FILEIO_FILE_TOO_NEW" 'file-too-new)
-  ;;     (gw:enum-add-value! we "ERR_FILEIO_FILE_TOO_OLD" 'file-too-old)
-  
-  ;;     (gw:enum-add-value! we "ERR_NETIO_SHORT_READ" 'netio-short-read)
-  ;;     (gw:enum-add-value! we "ERR_NETIO_WRONG_CONTENT_TYPE"
-  ;;                         'netio-wrong-content-type)
-  ;;     (gw:enum-add-value! we "ERR_NETIO_NOT_GNCXML" 'netio-not-gncxml)
-  
-  ;;     (gw:enum-add-value! we "ERR_SQL_MISSING_DATA" 'sql-missing-data)
-
-  #t)
-
-;
-; Definitions from gnc-engine.h
-;
-(gw:wrap-value ws 'gnc:id-account '<gnc:id-type> "GNC_ID_ACCOUNT")
-(gw:wrap-value ws 'gnc:id-book '<gnc:id-type> "GNC_ID_BOOK")
-(gw:wrap-value ws 'gnc:id-budget '<gnc:id-type> "GNC_ID_BUDGET")
-(gw:wrap-value ws 'gnc:id-lot '<gnc:id-type> "GNC_ID_LOT")
-(gw:wrap-value ws 'gnc:id-price '<gnc:id-type> "GNC_ID_PRICE")
-(gw:wrap-value ws 'gnc:id-split '<gnc:id-type> "GNC_ID_SPLIT")
-(gw:wrap-value ws 'gnc:id-schedxaction '<gnc:id-type> "GNC_ID_SCHEDXACTION")
-(gw:wrap-value ws 'gnc:id-session '<gnc:id-type> "GNC_ID_SESSION")
-(gw:wrap-value ws 'gnc:id-trans '<gnc:id-type> "GNC_ID_TRANS")
-
-;
-; Definitions for query parameter names
-;
-(gw:wrap-value ws 'gnc:query-default-sort '<gnc:id-type> "QUERY_DEFAULT_SORT")
-(gw:wrap-value ws 'gnc:split-lot '<gnc:id-type> "SPLIT_LOT")
-(gw:wrap-value ws 'gnc:split-trans '<gnc:id-type> "SPLIT_TRANS")
-(gw:wrap-value ws 'gnc:split-account '<gnc:id-type> "SPLIT_ACCOUNT")
-(gw:wrap-value ws 'gnc:split-value '<gnc:id-type> "SPLIT_VALUE")
-(gw:wrap-value ws 'gnc:split-memo '<gnc:id-type> "SPLIT_MEMO")
-(gw:wrap-value ws 'gnc:split-date-reconciled '<gnc:id-type> "SPLIT_DATE_RECONCILED")
-
-(gw:wrap-value ws 'gnc:trans-date-posted '<gnc:id-type> "TRANS_DATE_POSTED")
-(gw:wrap-value ws 'gnc:trans-desc '<gnc:id-type> "TRANS_DESCRIPTION")
-(gw:wrap-value ws 'gnc:trans-num '<gnc:id-type> "TRANS_NUM")
-
-(gw:wrap-value ws 'gnc:account-name '<gnc:id-type> "ACCOUNT_NAME_")
-(gw:wrap-value ws 'gnc:account-code '<gnc:id-type> "ACCOUNT_CODE_")
-
-;
-; Special query parameter "sort" types
-;
-(gw:wrap-value ws 'gnc:split-account-fullname '<gnc:id-type>
-	       "SPLIT_ACCT_FULLNAME")
-(gw:wrap-value ws 'gnc:split-corr-account-fullname '<gnc:id-type>
-	       "SPLIT_CORR_ACCT_NAME")
-(gw:wrap-value ws 'gnc:split-corr-account-code '<gnc:id-type>
-	       "SPLIT_CORR_ACCT_CODE")
-
-;
-; Transaction Types
-;
-(gw:wrap-value ws 'gnc:transaction-type-none '<gw:char> "TXN_TYPE_NONE")
-(gw:wrap-value ws 'gnc:transaction-type-invoice '<gw:char> "TXN_TYPE_INVOICE")
-(gw:wrap-value ws 'gnc:transaction-type-payment '<gw:char> "TXN_TYPE_PAYMENT")
-
-
-(gw:wrap-function
- ws
- 'gnc:guid-new
- '<gnc:guid-scm>
- "guid_new_return"
- '()
- "Return a newly-generated GUID.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-guid
- '<gnc:guid-scm>
- "xaccSplitReturnGUID"
- '((<gnc:Split*> s))
- "Return the GUID of Split s.")
-
-(gw:wrap-function
- ws
- 'gnc:split-lookup
- '<gnc:Split*>
- "xaccSplitLookupDirect"
- '((<gnc:guid-scm> guid)
-   (<gnc:Book*> book))
- "Lookup a split with its GUID.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-balance
- '<gnc:numeric>
- "xaccSplitGetBalance"
- '((<gnc:Split*> s))
- "Return balance at split.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-memo
- '(<gw:mchars> callee-owned const)
- "xaccSplitGetMemo"
- '((<gnc:Split*> s))
- "Return split's memo.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-action
- '(<gw:mchars> callee-owned const)
- "xaccSplitGetAction"
- '((<gnc:Split*> s))
- "Return split's action.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-reconcile-state
- '<gw:char>
- "xaccSplitGetReconcile"
- '((<gnc:Split*> s))
- "Return split's reconcile state.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-reconciled-date
- '<gnc:time-pair>
- "gnc_split_get_date_reconciled"
- '((<gnc:Split*> s))
- "Return split's reconciliation date.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-amount
- '<gnc:numeric>
- "xaccSplitGetAmount"
- '((<gnc:Split*> s))
- "Return split's amount.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-share-price
- '<gnc:numeric>
- "xaccSplitGetSharePrice"
- '((<gnc:Split*> s))
- "Return split's share price.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-value
- '<gnc:numeric>
- "xaccSplitGetValue"
- '((<gnc:Split*> s))
- "Return split's value.")
-
-
-(gw:wrap-function
- ws
- 'gnc:account-separator-string
- '(<gw:mchars> callee-owned const)
- "gnc_get_account_separator_string"
- '()
- "Returns a string with the user-selected account separator")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-account
- '<gnc:Account*>
- "xaccSplitGetAccount"
- '((<gnc:Split*> s))
- "Return split's account.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-parent
- '<gnc:Transaction*>
- "xaccSplitGetParent"
- '((<gnc:Split*> s))
- "Return the parent transaction of the split.")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-other-split
- '<gnc:Split*>
- "xaccSplitGetOtherSplit"
- '((<gnc:Split*> s))
- "Return the 'other' split of the parent transaction or NULL.")
-
-(gw:wrap-function
- ws
- 'gnc:split-compare-account-full-names
- '<gw:int>
- "xaccSplitCompareAccountFullNames"
- '((<gnc:Split*> sa) (<gnc:Split*> sb))
- "Compare two splits on the full names of their parent accounts")
-
-(gw:wrap-function
- ws
- 'gnc:split-compare-account-codes
- '<gw:int>
- "xaccSplitCompareAccountCodes"
- '((<gnc:Split*> sa) (<gnc:Split*> sb))
- "Compare two splits on the codes of their parent accounts")
-
-(gw:wrap-function
- ws
- 'gnc:split-compare-other-account-full-names
- '<gw:int>
- "xaccSplitCompareOtherAccountFullNames"
- '((<gnc:Split*> sa) (<gnc:Split*> sb))
- "Compare two splits on the full names of the *other* 
-split in the transaction")
-
-(gw:wrap-function
- ws
- 'gnc:split-compare-other-account-codes
- '<gw:int>
- "xaccSplitCompareOtherAccountCodes"
- '((<gnc:Split*> sa) (<gnc:Split*> sb))
- "Compare two splits on the codes of the *other* split in the transaction")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-corr-account-name
- '(<gw:mchars> callee-owned const)
- "xaccSplitGetCorrAccountName"
- '((<gnc:Split*> sa))
- "Find the split on the other side of the transaction, and return the name of
-its account")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-corr-account-full-name-internal
- '(<gw:gchars> caller-owned)
- "xaccSplitGetCorrAccountFullName"
- '((<gnc:Split*> sa))
- "Find the split on the other side of the transaction, and return the 
-name of its account.  Don't use directly, use 
-gnc:split-get-corr-account-full-name in src/scm/report-utilities.scm")
-(gw:wrap-function
- ws
- 'gnc:split-get-corr-account-code
- '(<gw:mchars> callee-owned const)
- "xaccSplitGetCorrAccountCode" 
- '((<gnc:Split*> sa))
- "Find the split on the other side of the transaction, and return the 
-code of its account")
-
-(gw:wrap-function
- ws
- 'gnc:split-get-lot
- '<gnc:Lot*>
- "xaccSplitGetLot"
- '((<gnc:Split*> s))
- "Return the LOT of Split s.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-guid
- '<gnc:guid-scm>
- "xaccTransReturnGUID"
- '((<gnc:Transaction*> t))
- "Return the GUID of Transaction t.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-lookup
- '<gnc:Transaction*>
- "xaccTransLookupDirect"
- '((<gnc:guid-scm> guid)
-   (<gnc:Book*> book))
- "Lookup a transaction with its GUID.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-split
- '<gnc:Split*>
- "xaccTransGetSplit"
- '((<gnc:Transaction*> t) (<gw:int> i))
- "Returns a pointer to each of the splits in this transaction.  Valid
-values for i are zero to (number_of__splits-1).  An invalid value of i
-will cause NULL to be returned.  A convenient way of cycling through
-all splits is to start at zero, and kep incrementing until a null
-pointer is returned.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-splits
- '(gw:glist-of <gnc:Split*> callee-owned)
- "xaccTransGetSplitList"
- '((<gnc:Transaction*> t))
- "Returns a list of the splits in t.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-num
- '(<gw:mchars> callee-owned const)
- "xaccTransGetNum"
- '((<gnc:Transaction*> t))
- "Return the transaction's num, an arbitrary user-assigned field.  It
-is intended to store a short id number, typically the check number,
-deposit number, invoice number or other tracking number.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-description
- '(<gw:mchars> callee-owned const)
- "xaccTransGetDescription"
- '((<gnc:Transaction*> t))
- "Return the transaction description, an arbitrary user-assigned
-value.  It is meant to be a short descriptive phrase.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-notes
- '(<gw:mchars> callee-owned const)
- "xaccTransGetNotes"
- '((<gnc:Transaction*> t))
- "Return the transaction notes field.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-void
- '<gw:void>
- "xaccTransVoid"
- '((<gnc:Transaction*> transaction)
-   ((<gw:mchars> caller-owned const) reason))
- "Void a transaction")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-void-status
- '<gw:bool>
- "xaccTransGetVoidStatus"
- '((<gnc:Transaction*> transaction))
- "Return true if a transaction has been voided")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-void-reason
- '(<gw:mchars> callee-owned const)
- "xaccTransGetVoidReason"
- '((<gnc:Transaction*> transaction))
- "return a string indicating reason for voiding")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-order
- '<gw:int>
- "xaccTransOrder"
- '((<gnc:Transaction*> ta) (<gnc:Transaction*> tb))
- "Return an integer for ta,tb ordering.  <0 is ta is before tb, >0 if ta is after tb")
-
-(gw:wrap-function
- ws
- 'gnc:split-void-former-amount
- '<gnc:numeric>
- "xaccSplitVoidFormerAmount"
- '((<gnc:Split*> split))
- "get what the split's amount before voiding")
-
-(gw:wrap-function
- ws
- 'gnc:split-void-former-value
- '<gnc:numeric>
- "xaccSplitVoidFormerValue"
- '((<gnc:Split*> split))
- "get what the split's value was before voiding")
-
-(gw:wrap-function
- ws
- 'gnc:dmy2timespec
- '<gnc:time-pair>
- "gnc_dmy2timespec"
- '((<gw:int> day) (<gw:int> month) (<gw:int> year))
- "Return a given day, month, and year as a pair where the car is the
-number of seconds and the cdr is the number of nanoseconds.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-date-posted
- '<gnc:time-pair>
- "gnc_transaction_get_date_posted"
- '((<gnc:Transaction*> t))
- "Return the date the transaction was posted at the bank as a pair of
-integers.  The car is the number of seconds and the cdr is the number
-of nanoseconds.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-date-entered
- '<gnc:time-pair>
- "gnc_transaction_get_date_entered"
- '((<gnc:Transaction*> t))
- "Return the date the transaction was entered into the register as a
-pair of integers.  The car is the number of seconds and the cdr is the
-number of nanoseconds.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-date-posted
- '<gw:void>
- "gnc_transaction_set_date_posted"
- '((<gnc:Transaction*> t) (<gnc:time-pair> date))
- "Modifies the posted date of the transaction.  Footnote: this
-shouldn't matter to a user, but anyone modifying the engine should
-understand that when the transaction is committed, the date order of
-each of the component splits will be checked, and they will be
-restored in ascending date order.  The date given should be a pair of
-integers.  The car is the number of seconds and the cdr is the number
-of nanoseconds.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-date-entered
- '<gw:void>
- "gnc_transaction_set_date_entered"
- '((<gnc:Transaction*> t) (<gnc:time-pair> date))
- "Modifies entered date of the transaction. The date given should be a
-pair of integers.  The car is the number of seconds and the cdr is the
-number of nanoseconds.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-split-count
- '<gw:int>
- "xaccTransCountSplits"
- '((<gnc:Transaction*> t))
- "Return the number of splits in the transaction.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-currency
- '<gnc:commodity*>
- "xaccTransGetCurrency"
- '((<gnc:Transaction*> trans))
- "Returns the commodity common for this transaction. ATM it gives the same result as xaccTransFindCommonCurrency.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-currency
- '<gw:void>
- "xaccTransSetCurrency"
- '((<gnc:Transaction*> trans) (<gnc:commodity*> comm))
- "Sets the commodity common for this transaction.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-account-value
- '<gnc:numeric>
- "xaccTransGetAccountValue"
- '((<gnc:Transaction*> trans) (<gnc:Account*> acc))
- "Compute the sum of all Splits in trans that are applied to Account acc.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-get-txn-type
- '<gw:char>
- "xaccTransGetTxnType"
- '((<gnc:Transaction*> trans))
- "Return the transaction type.")
-
-(gw:wrap-function
- ws
- 'gnc:malloc-account
- '<gnc:Account*>
- "xaccMallocAccount"
- '((<gnc:Book*> book))
- "Allocate a new account structure.")
-
-(gw:wrap-function
- ws
- 'gnc:account-destroy
- '<gw:void>
- "xaccAccountDestroy"
- '((<gnc:Account*> account))
- "Free an account structure. (Must call gnc:account-begin-edit first)")
-
-(let ((docstr
-       "The gnc:account-begin-edit and gnc:account-commit-edit
- subroutines provide a two-phase-commit wrapper for account updates."))
-  (gw:wrap-function
-   ws
-   'gnc:account-begin-edit
-   '<gw:void>
-   "xaccAccountBeginEdit"
-   '((<gnc:Account*> a))
-   docstr)
-  (gw:wrap-function
-   ws
-   'gnc:account-commit-edit
-   '<gw:void>
-   "xaccAccountCommitEdit"
-   '((<gnc:Account*> a))
-   docstr))
-
-(gw:wrap-function
- ws
- 'gnc:account-insert-split
- '<gw:void>
- "xaccAccountInsertSplit"
- '((<gnc:Account*> a) (<gnc:Split*> s))
- "Insert the split s into account a. If the split already belongs
-to another account, it will be removed from that account first.")
-
-;; (gw:wrap-function
-;;  ws
-;;  'gnc:account-order
-;;  '<gw:int>
-;;  "xaccAccountOrder_gwrap"
-;;  '(
-;;    (<gnc:Account**> a1)
-;;    (<gnc:Account**> a2)
-;;    )
-;;  "Defines a sorting order on accounts.  Returns -1 if a1 is \"less
-;; than\" the second, +1 if the a1 is \"greater than\" the second, and 0
-;; if they are equal.  To determine the sort order, the account codes are
-;; compared, and if these are equal, then account types, and, if these
-;; are equal, then account names.")
-
-(gw:wrap-function
- ws
- 'gnc:account-set-type
- '<gw:void>
- "xaccAccountSetType"
- '((<gnc:Account*> a) (<gnc:AccountType> type))
- "Set Account type.  See definition of scheme GNCAccountType for values.")
-
-(gw:wrap-function
- ws
- 'gnc:account-set-name
- '<gw:void>
- "xaccAccountSetName"
- '((<gnc:Account*> a) ((<gw:mchars> caller-owned const) name))
- "Set account name")
-
-(gw:wrap-function
- ws
- 'gnc:account-set-code
- '<gw:void>
- "xaccAccountSetCode"
- '((<gnc:Account*> a) ((<gw:mchars> caller-owned const) code))
- "Set whatever cryptic code we wish to use as the alternative to\n"
- "the account name.\n"
- "\n"
- "Commonly these codes are numeric, and organize asset accounts together\n"
- "in one number range, liability accounts in another number range, and\n"
- "so forth...\n")
-
-(gw:wrap-function
- ws
- 'gnc:account-set-description
- '<gw:void>
- "xaccAccountSetDescription"
- '((<gnc:Account*> a) ((<gw:mchars> caller-owned const) description))
- "Set a slightly-more-verbose description for the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-set-notes
- '<gw:void>
- "xaccAccountSetNotes"
- '((<gnc:Account*> a) ((<gw:mchars> caller-owned const) notes))
- "Set up a longer set of notes that provide a perhaps-very-verbose
-description of the nature of a particular account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-set-tax-related
- '<gw:void>
- "xaccAccountSetTaxRelated"
- '((<gnc:Account*> a) (<gw:bool> tax-related))
- "Set the tax-related flag of the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-guid
- '<gnc:guid-scm>
- "xaccAccountReturnGUID"
- '((<gnc:Account*> a))
- "Get the GUID of Account a.")
-
-(gw:wrap-function
- ws
- 'gnc:account-lookup
- '<gnc:Account*>
- "xaccAccountLookupDirect"
- '((<gnc:guid-scm> guid) (<gnc:Book*> book))
- "Lookup the account with GUID guid.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-type-string
- '(<gw:mchars> callee-owned const)
- "xaccAccountGetTypeStr"
- '((<gnc:AccountType> type))
- "What's the account type's name.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-type
- '<gnc:AccountType>
- "xaccAccountGetType"
- '((<gnc:Account*> a))
- "What's the account type?  See scheme GNCAccountType enum def values.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-name
- '(<gw:mchars> callee-owned const)
- "xaccAccountGetName"
- '((<gnc:Account*> a))
- "Get the brief name for the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-code
- '(<gw:mchars> callee-owned const)
- "xaccAccountGetCode"
- '((<gnc:Account*> a))
- "Get the account's ``account code.''  
-
-Commonly this is used to provide a hierarchy where accounts with
-similar classifications (e.g. - Assets, Liabilities, Equity, Income,
-Expenses) are given numeric codes in corresponding ``number ranges.''")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-description
- '(<gw:mchars> callee-owned const)
- "xaccAccountGetDescription"
- '((<gnc:Account*> a))
- "Get the slightly-verbose description of the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-notes
- '(<gw:mchars> callee-owned const)
- "xaccAccountGetNotes"
- '((<gnc:Account*> a))
- "Get the fully-verbose description of the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-commodity
- '(<gnc:commodity*> const)
- "xaccAccountGetCommodity"
- '((<gnc:Account*> a))
- "Get the commodity in which the account is denominated.")
-
-(gw:wrap-function
- ws
- 'gnc:account-set-commodity
- '<gw:void>
- "xaccAccountSetCommodity"
- '((<gnc:Account*> a) (<gnc:commodity*> comm))
- "Set the commodity in which the account is denominated.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-tax-related
- '<gw:bool>
- "xaccAccountGetTaxRelated"
- '((<gnc:Account*> a))
- "Get the tax related flag of the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-tax-US-code
- '(<gw:mchars> callee-owned const)
- "xaccAccountGetTaxUSCode"
- '((<gnc:Account*> a))
- "Get the tax code set on the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-tax-US-payer-name-source
- '(<gw:mchars> callee-owned const)
- "xaccAccountGetTaxUSPayerNameSource"
- '((<gnc:Account*> a))
- "Get the tax payer name source set on the account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-children
- '<gnc:AccountGroup*>
- "xaccAccountGetChildren"
- '((<gnc:Account*> a))
- "Get a pointer to an AccountGroup that represents the set of
-children to this account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-parent
- '<gnc:AccountGroup*>
- "xaccAccountGetParent"
- '((<gnc:Account*> a))
- "Get the pointer to the account's parent.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-parent-account
- '<gnc:Account*>
- "xaccAccountGetParentAccount"
- '((<gnc:Account*> a))
- "Get the pointer to the account's parent account.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-balance
- '<gnc:numeric>
- "xaccAccountGetBalance"
- '((<gnc:Account*> a))
- "Undocumented.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-cleared-balance
- '<gnc:numeric>
- "xaccAccountGetClearedBalance"
- '((<gnc:Account*> a))
- "Undocumented.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-reconciled-balance
- '<gnc:numeric>
- "xaccAccountGetReconciledBalance"
- '((<gnc:Account*> a))
- "Undocumented.")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-split-list
- '(gw:glist-of <gnc:Split*> callee-owned)
- "xaccAccountGetSplitList"
- '((<gnc:Account*> a))
- "Get a list of the of splits in account a.")
-
-(gw:wrap-function
- ws
- 'gnc:malloc-account-group
- '<gnc:AccountGroup*>
- "xaccMallocAccountGroup"
- '((<gnc:Book*> book))
- "Create a new account group.")
-
-(gw:wrap-function
- ws
- 'gnc:account-group-begin-edit
- '<gw:void>
- "xaccAccountGroupBeginEdit"
- '((<gnc:AccountGroup*> g))
- "Open an account group for editing.")
-
-(gw:wrap-function
- ws
- 'gnc:account-group-commit-edit
- '<gw:void>
- "xaccAccountGroupCommitEdit"
- '((<gnc:AccountGroup*> g))
- "Commit all changes to an account group.")
-
-(gw:wrap-function
- ws
- 'gnc:account-group-destroy
- '<gw:void>
- "xaccAccountGroupDestroy"
- '((<gnc:AccountGroup*> g))
- "Free an account group. (Must call gnc:account-group-begin-edit first)")
-
-(gw:wrap-function
- ws
- 'gnc:group-get-book
- '<gnc:Book*>
- "xaccGroupGetBook"
- '((<gnc:AccountGroup*> g))
- "Return the QofBook of group g.")
-
-(gw:wrap-function
- ws
- 'gnc:group-merge-accounts
- '<gw:void>
- "xaccGroupMergeAccounts"
- '((<gnc:AccountGroup*> g))
- "Merge accounts which have the same name and description. Used in
-importing Quicken files.")
-
-(gw:wrap-function
- ws
- 'gnc:group-concat-group
- '<gw:void>
- "xaccGroupConcatGroup"
- '((<gnc:AccountGroup*> old)
-   (<gnc:AccountGroup*> new))
- "Catenate accounts from one group into another. Used in Quicken
-import.")
-
-(gw:wrap-function
- ws
- 'gnc:group-get-num-subaccounts
- '<gw:int>
- "xaccGroupGetNumSubAccounts"
- '((<gnc:AccountGroup*> g))
- "Return the number of accounts, including subaccounts, in the account
-group")
-
-(gw:wrap-function
- ws
- 'gnc:group-get-num-accounts
- '<gw:int>
- "xaccGroupGetNumAccounts"
- '((<gnc:AccountGroup*> g))
- "Return the number of accounts in the indicated group only"
- "(children not counted).")
-
-(gw:wrap-function
- ws
- 'gnc:group-get-account
- '<gnc:Account*>
- "xaccGroupGetAccount"
- '((<gnc:AccountGroup*> g) (<gw:int> n))
- "Return account number n in account group g.")
-
-(gw:wrap-function
- ws
- 'gnc:get-account-from-full-name
- '<gnc:Account*>
- "xaccGetAccountFromFullName"
- '((<gnc:AccountGroup*> g)
-   ((<gw:mchars> caller-owned const) name))
- "Return account named name in group g.  full path with separators.")
-
-(gw:wrap-function
- ws
- 'gnc:group-get-parent
- '<gnc:Account*>
- "xaccGroupGetParentAccount"
- '((<gnc:AccountGroup*> g))
- "Return the parent acount for the group.")
-
-(gw:wrap-function
- ws
- 'gnc:group-insert-account
- '<gw:void>
- "xaccGroupInsertAccount"
- '((<gnc:AccountGroup*> g) (<gnc:Account*> a))
- "Add account a to group g.")
-
-(gw:wrap-function
- ws
- 'gnc:account-insert-subaccount
- '<gw:void>
- "xaccAccountInsertSubAccount"
- '((<gnc:Account*> p) (<gnc:Account*> c))
- "Add a child account c to parent p")
-
-(gw:wrap-function
- ws
- 'gnc:group-get-subaccounts
- '(gw:glist-of <gnc:Account*> caller-owned)
- "xaccGroupGetSubAccountsSorted"
- '((<gnc:AccountGroup*> g))
- "Return a list containing all of the accounts, including
-subaccounts, in the account group. The returned array should be freed
-when no longer needed.")
-
-(gw:wrap-function
- ws
- 'gnc:group-get-account-list
- '(gw:glist-of <gnc:Account*> caller-owned)
- "xaccGroupGetAccountListSorted"
- '((<gnc:AccountGroup*> g))
- "Return a list containing the immediate children of g.")
-
-(gw:wrap-function
- ws
- 'gnc:group-begin-staged-transaction-traversals
- '<gw:void>
- "xaccGroupBeginStagedTransactionTraversals"
- '((<gnc:AccountGroup*> group))
- "Sets things up to begin a sequence of staged traversals.")
-
-(gw:wrap-function
- ws
- 'gnc:group-staged-transaction-traversal
- '<gw:bool>
- "gnc_scmGroupStagedTransactionTraversal"
- '((<gnc:AccountGroup*> group)
-   (<gw:unsigned-int> stage)
-   (<gw:scm> thunk))
- "FIXME: For now, see Group.h for info...")
-
-(gw:wrap-function
- ws
- 'gnc:account-staged-transaction-traversal
- '<gw:bool>
- "gnc_scmAccountStagedTransactionTraversal"
- '((<gnc:Account*> account)
-   (<gw:unsigned-int> stage)
-   (<gw:scm> thunk))
- "FIXME: For now, see Group.h for info...")
-
-(gw:wrap-function
- ws
- 'gnc:account-get-lot-list
- '(gw:glist-of <gnc:Lot*> callee-owned)
- "xaccAccountGetLotList"
- '((<gnc:Account*> account))
- "Return the list of Lots for this account.")
-
-;;============
-;; GNCPriceDB
-
-(gw:wrap-as-wct ws '<gnc:PriceDB*> "GNCPriceDB *" "const GNCPriceDB *")
-(gw:wrap-as-wct ws '<gnc:Price*> "GNCPrice *" "const GNCPrice *")
-
-(gw:wrap-function
- ws
- 'gnc:price-create
- '<gnc:Price*>
- "gnc_price_create"
- '((<gnc:Book*> book))
- "Create and return a new price.")
-
-(gw:wrap-function
- ws
- 'gnc:price-get-guid
- '<gnc:guid-scm>
- "gnc_price_return_guid"
- '((<gnc:Price*> a))
- "Get the GUID of a price.")
-
-(gw:wrap-function
- ws
- 'gnc:price-unref
- '<gw:void>
- "gnc_price_unref"
- '((<gnc:Price*> p))
- "Indicate you're finished with this price.")
-
-(gw:wrap-function
- ws
- 'gnc:price-set-commodity
- '<gw:void>
- "gnc_price_set_commodity"
- '((<gnc:Price*> p) (<gnc:commodity*> c))
- "Set the price's commodity.")
-
-(gw:wrap-function
- ws
- 'gnc:price-set-currency
- '<gw:void>
- "gnc_price_set_currency"
- '((<gnc:Price*> p) (<gnc:commodity*> c))
- "Set the price's currency.")
-
-(gw:wrap-function
- ws
- 'gnc:price-set-time
- '<gw:void>
- "gnc_price_set_time"
- '((<gnc:Price*> p) (<gnc:time-pair> t))
- "Set the price's time stamp.")
-
-(gw:wrap-function
- ws
- 'gnc:price-set-source
- '<gw:void>
- "gnc_price_set_source"
- '((<gnc:Price*> p) ((<gw:mchars> caller-owned) src))
- "Set the price's source.")
-
-(gw:wrap-function
- ws
- 'gnc:price-set-type
- '<gw:void>
- "gnc_price_set_type"
- '((<gnc:Price*> p) ((<gw:mchars> caller-owned) type))
- "Set the price's type.")
-
-(gw:wrap-function
- ws
- 'gnc:price-set-value
- '<gw:void>
- "gnc_price_set_value"
- '((<gnc:Price*> p) (<gnc:numeric> value))
- "Set the price's value.")
-
-(gw:wrap-function
- ws
- 'gnc:price-get-value
- '<gnc:numeric>
- "gnc_price_get_value"
- '((<gnc:Price*> p))
- "Get the price's value")
-
-(gw:wrap-function
- ws
- 'gnc:price-get-commodity
- '<gnc:commodity*> 
- "gnc_price_get_commodity"
- '((<gnc:Price*> p))
- "Get the commodity this price is for.")
-
-(gw:wrap-function
- ws
- 'gnc:price-get-currency
- '<gnc:commodity*> 
- "gnc_price_get_currency"
- '((<gnc:Price*> p))
- "Get the currency (commodity) this price's value is denominated in.")
-
-(gw:wrap-function
- ws
- 'gnc:price-get-time
- '<gnc:time-pair>
- "gnc_price_get_time"
- '((<gnc:Price*> p))
- "Get the time stamp of this price.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-add-price
- '<gw:bool>
- "gnc_pricedb_add_price"
- '((<gnc:PriceDB*> db) (<gnc:Price*> p))
- "Add a price to the DB.  Unref the price when you're finished with it.")
-
-(gw:wrap-function
- ws
- 'gnc:price-list-destroy
- '<gw:void>
- "gnc_price_list_destroy"
- '(((gw:glist-of <gnc:Price*> callee-owned) prices))
- "Destroys a gnc price list unrefing the prices included in the list")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-lookup-latest
- '<gnc:Price*>
- "gnc_pricedb_lookup_latest"
- '((<gnc:PriceDB*> db)
-   (<gnc:commodity*> commodity) (<gnc:commodity*> currency))
- "Returns the latest price.  Unref the price when you're finished with it.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-lookup-latest-any-currency
- '(gw:glist-of <gnc:Price*> caller-owned)
- "gnc_pricedb_lookup_latest_any_currency"
- '((<gnc:PriceDB*> db)
-   (<gnc:commodity*> commodity))
- "Returns the latest price(s) in any currency available.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-lookup-nearest-in-time
- '<gnc:Price*>
- "gnc_pricedb_lookup_nearest_in_time"
- '((<gnc:PriceDB*> db)
-   (<gnc:commodity*> commodity) (<gnc:commodity*> currency)
-   (<gnc:time-pair> t))
- "Returns the price quote nearest to t.  Unref price when finished with it.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-lookup-nearest-in-time-any-currency
- '(gw:glist-of <gnc:Price*> caller-owned)
- "gnc_pricedb_lookup_nearest_in_time_any_currency"
- '((<gnc:PriceDB*> db)
-   (<gnc:commodity*> commodity) (<gnc:time-pair> t))
- "Returns the price(s) nearest to t in any currency available.")
-
-
-(gw:wrap-function
-ws
-'gnc:pricedb-lookup-latest-before
-'<gnc:Price*>
-"gnc_pricedb_lookup_latest_before"
-'((<gnc:PriceDB*> db)
-  (<gnc:commodity*> commodity) (<gnc:commodity*> currency)
-  (<gnc:time-pair> t))
-"Returns the latest price quote <= t. Unref price when finished with it.")
-
-(gw:wrap-function
-ws
-'gnc:pricedb-lookup-latest-before-any-currency
-'(gw:glist-of <gnc:Price*> caller-owned)
-"gnc_pricedb_lookup_latest_before_any_currency"
-'((<gnc:PriceDB*> db)
-  (<gnc:commodity*> commodity) (<gnc:time-pair> t))
-"Returns the latest price quote(s) <= t in any currency available.")
-
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-get-prices
- '(gw:glist-of <gnc:Price*> caller-owned)
- "gnc_pricedb_get_prices"
- '((<gnc:PriceDB*> db)
-   (<gnc:commodity*> commodity)
-   (<gnc:commodity*> currency))
- "Get all prices for commodity in currency.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-lookup-at-time
- '(gw:glist-of <gnc:Price*> caller-owned)
- "gnc_pricedb_lookup_at_time"
- '((<gnc:PriceDB*> db)
-   (<gnc:commodity*> commodity) (<gnc:commodity*> currency)
-   (<gnc:time-pair> t))
- "Lookup a price at time t.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-lookup-day
- '(gw:glist-of <gnc:Price*> caller-owned)
- "gnc_pricedb_lookup_day"
- '((<gnc:PriceDB*> db)
-   (<gnc:commodity*> commodity) (<gnc:commodity*> currency)
-   (<gnc:time-pair> t))
- "Lookup a price on the day specified by time t.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-convert-balance-latest-price
- '<gnc:numeric>
- "gnc_pricedb_convert_balance_latest_price"
- '((<gnc:PriceDB*> db)
-   (<gnc:numeric> balance)
-   (<gnc:commodity*> balance_commodity) (<gnc:commodity*> new_currency))
- "convert balance in commodity balance_commodity to new_currency using latest price.")
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-convert-balance-nearest-price
- '<gnc:numeric>
- "gnc_pricedb_convert_balance_nearest_price"
- '((<gnc:PriceDB*> db)
-   (<gnc:numeric> balance)
-   (<gnc:commodity*> balance_commodity) (<gnc:commodity*> new_currency)
-   (<gnc:time-pair> t))
- "convert balance in commodity balance_commodity to new_currency using nearest price
-to time t.")
-
-
-(gw:wrap-function
- ws
- 'gnc:pricedb-convert-balance-latest-before
- '<gnc:numeric>
- "gnc_pricedb_convert_balance_latest_before"
- '((<gnc:PriceDB*> db)
-   (<gnc:numeric> balance)
-   (<gnc:commodity*> balance_commodity) (<gnc:commodity*> new_currency)
-   (<gnc:time-pair> t))
- "convert balance in commodity balance_commodity to new_currency using latest price
-prior to time t.")
-
-
-;;===========
-;; QofSession
-
-(gw:wrap-function
- ws
- 'gnc:session-new
- '<gnc:Session*>
- "qof_session_new" '()
- "Create a new session.")
-
-(gw:wrap-function
- ws
- 'gnc:session-destroy
- '<gw:void>
- "qof_session_destroy"
- '((<gnc:Session*> session))
- "Destroy the given session.")
-
-(gw:wrap-function
- ws
- 'gnc:session-get-book
- '<gnc:Book*>
- "qof_session_get_book"
- '((<gnc:Session*> session))
- "Get the book of the given session.")
-
-(gw:wrap-function
- ws
- 'gnc:session-begin
- '<gw:void>
- "qof_session_begin"
- '((<gnc:Session*> session)
-   ((<gw:mchars> caller-owned const) id)
-   (<gw:bool> ignore-lock?)
-   (<gw:bool> create-if-nonexistent?))
- "Setup the session for use.")
-
-(gw:wrap-function
- ws
- 'gnc:session-load
- '<gw:void>
- "gnc_session_scm_load"
- '((<gnc:Session*> session))
- "Load the data associated with the given session.")
-
-(gw:wrap-function
- ws
- 'gnc:session-save
- '<gw:void>
- "gnc_session_scm_save"
- '((<gnc:Session*> session))
- "Save the data in the session.")
-
-(gw:wrap-function
- ws
- 'gnc:session-set-callback
- '<gw:void>
- "gnc_session_scm_set_callback"
- '((<gw:scm> callback))
- "Setup a callback for the load/save functions to provide progress
-reports. This function will be called with a string and an integer
-argument between 0 and 100 (inclusive).")
-
-(gw:wrap-function
- ws
- 'gnc:session-end
- '<gw:void>
- "qof_session_end"
- '((<gnc:Session*> session))
- "Indicate you're finished with the session.")
-
-(gw:wrap-function
- ws
- 'gnc:book-get-group
- '<gnc:AccountGroup*>
- "xaccGetAccountGroup"
- '((<gnc:Book*> book))
- "Get the book's account group.")
-
-(gw:wrap-function
- ws
- 'gnc:book-get-template-group
- '<gnc:AccountGroup*>
- "gnc_book_get_template_group"
- '((<gnc:Book*> book))
- "Get the book's template account group.")
-
-(gw:wrap-function
- ws
- 'gnc:book-get-commodity-table
- '<gnc:commodity-table*>
- "gnc_commodity_table_get_table"
- '((<gnc:Book*> book))
- "Get the book's commodity table.")
-
-(gw:wrap-function
- ws
- 'gnc:book-get-pricedb
- '<gnc:PriceDB*>
- "gnc_pricedb_get_db"
- '((<gnc:Book*> book))
- "Get the book's pricedb.")
-
-(gw:wrap-function
- ws
- 'gnc:book-kvp-changed
- '<gw:void>
- "qof_book_kvp_changed"
- '((<gnc:Book*> book))
- "Set the flag that the Book's kvp changed.")
-
-(gw:wrap-function
- ws
- 'gnc:session-get-error
- '<gnc:BackendError>
- "qof_session_get_error"
- '((<gnc:Session*> session))
- "Check for a pending error.")
-
-(gw:wrap-function
- ws
- 'gnc:session-get-url
- '(<gw:mchars> callee-owned const)
- "qof_session_get_url"
- '((<gnc:Session*> session))
- "Return the URL of the opened session.")
-
-(gw:wrap-function
- ws
- 'gnc:session-pop-error
- '<gnc:BackendError>
- "qof_session_pop_error"
- '((<gnc:Session*> session))
- "Remove an error, if any, from the error stack.")
-
-(gw:wrap-function
- ws
- 'gnc:set-log-level-global
- '<gw:void>
- "qof_log_set_level_registered"
- '((<gw:int> level))
- "Set the logging level for all modules to level.")
-
-(gw:wrap-function
- ws
- 'gnc:print-date
- '(<gw:mchars> callee-owned const)
- "gnc_print_date"
- '((<gnc:time-pair> date))
- "Returns a string with the date formatted according to the
-current settings")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-destroy
- '<gw:void>
- "xaccTransDestroy"
- '((<gnc:Transaction*> t))
- "Destroys the transaction in question.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-begin-edit
- '<gw:void>
- "xaccTransBeginEdit"
- '((<gnc:Transaction*> t))
- "Start an edit session on a transaction.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-commit-edit
- '<gw:void>
- "xaccTransCommitEdit"
- '((<gnc:Transaction*> t))
- "Commit edits to a transaction.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-is-open
- '<gw:bool>
- "xaccTransIsOpen"
- '((<gnc:Transaction*> t))
- "Returns true if the transaction t is open for editing.")
-
-(gw:wrap-function
- ws
- 'gnc:split-destroy
- '<gw:void>
- "xaccSplitDestroy"
- '((<gnc:Split*> s))
- "Destroys the split in question.  Probably only useful inside the context
-of having a parent transaction with which one is working...")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-append-split
- '<gw:void>
- "xaccTransAppendSplit"
- '((<gnc:Transaction*> t) (<gnc:Split*> s))
- "Adds a split to a transaction.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-date
- '<gw:void>
- "xaccTransSetDate"
- '((<gnc:Transaction*> t)
-   (<gw:int> day)
-   (<gw:int> month)
-   (<gw:int> year))
- "Set date on transaction based on day, month, year values")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-date-time-pair
- '<gw:void>
- "gnc_transaction_set_date"
- '((<gnc:Transaction*> t) (<gnc:time-pair> date))
- "Set date on transaction based on the time-pair")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-xnum
- '<gw:void>
- "xaccTransSetNum"
- '((<gnc:Transaction*> t) ((<gw:mchars> caller-owned const) xnum))
- "Set the XNUM - e.g. - cheque number or other identifier")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-description
- '<gw:void>
- "xaccTransSetDescription"
- '((<gnc:Transaction*> t) ((<gw:mchars> caller-owned const) desc))
- "Set the transaction description.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-set-notes
- '<gw:void>
- "xaccTransSetNotes"
- '((<gnc:Transaction*> t) ((<gw:mchars> caller-owned const) notes))
- "Set the transaction notes field.")
-
-(gw:wrap-function
- ws
- 'gnc:transaction-create
- '<gnc:Transaction*>
- "xaccMallocTransaction"
- '((<gnc:Book*> book>))
- "Create a Transaction structure")
-
-(gw:wrap-function
- ws
- 'gnc:split-create
- '<gnc:Split*>
- "xaccMallocSplit"
- '((<gnc:Book*> book>>))
- "Create a Split structure")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-value
- '<gw:void>
- "xaccSplitSetValue"
- '((<gnc:Split*> s) (<gnc:numeric> amount))
- "Set value for split")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-base-value
- '<gw:void>
- "xaccSplitSetBaseValue"
- '((<gnc:Split*> s)
-   (<gnc:numeric> amount)
-   (<gnc:commodity*> currency))
- "Set value for split with currency")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-memo
- '<gw:void>
- "xaccSplitSetMemo"
- '((<gnc:Split*> s) ((<gw:mchars> caller-owned const) memo))
- "Set memo for a split")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-action
- '<gw:void>
- "xaccSplitSetAction"
- '((<gnc:Split*> s) ((<gw:mchars> caller-owned const) action))
- "Set Action for a split.")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-reconcile
- '<gw:void>
- "xaccSplitSetReconcile"
- '((<gnc:Split*> s) (<gw:char> value))
- "Set reconcile state for split entry")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-share-price
- '<gw:void>
- "xaccSplitSetSharePrice"
- '((<gnc:Split*> s) (<gnc:numeric> value))
- "Set share price for split entry")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-amount
- '<gw:void>
- "xaccSplitSetAmount"
- '((<gnc:Split*> s) (<gnc:numeric> value))
- "Set amount for split entry")
-
-(gw:wrap-function
- ws
- 'gnc:split-set-share-price-and-amount
- '<gw:void>
- "xaccSplitSetSharePriceAndAmount"
- '((<gnc:Split*> s)
-   (<gnc:numeric> price)
-   (<gnc:numeric> amount))
- "Set the share price and amount for split entry")
-
-(gw:wrap-function
- ws
- 'gnc:malloc-query
- '<gnc:Query*>
- "xaccMallocQuery"
- '()
- "Create a new (empty) Query structure to search for splits.")
-
-(gw:wrap-function
- ws
- 'gnc:query-create
- '<gnc:Query*>
- "qof_query_create"
- '()
- "Create a new (empty) Query structure.")
-
-(gw:wrap-function
- ws
- 'gnc:query-create-for
- '<gnc:Query*>
- "qof_query_create_for"
- '((<gnc:id-type> obj-type))
- "Create a new (empty) Query structure to search for the supplied type.")
-
-(gw:wrap-function
- ws
- 'gnc:query-search-for
- '<gw:void>
- "qof_query_search_for"
- '((<gnc:Query*> q) (<gnc:id-type> obj-type))
- "Set the object-type to search for.")
-
-(gw:wrap-function
- ws
- 'gnc:free-query
- '<gw:void>
- "xaccFreeQuery"
- '((<gnc:Query*> q))
- "Delete the Query and its terms.")
-
-(gw:wrap-function
- ws
- 'gnc:query-set-book
- '<gw:void>
- "xaccQuerySetBook"
- '((<gnc:Query*> q) (<gnc:Book*> book))
- "Set the book that a query pertains to.")
-
-(gw:wrap-function
- ws
- 'gnc:query-invert
- '<gnc:Query*>
- "xaccQueryInvert"
- '((<gnc:Query*> q))
- "Logically invert a Query (returns a newly-allocated Query object)")
-
-(gw:wrap-function
- ws
- 'gnc:query-merge
- '<gnc:Query*>
- "xaccQueryMerge"
- '((<gnc:Query*> q1) (<gnc:Query*> q2) (<gnc:query-op> qop))
- "Merge two queries (returns a newly allocated object")
-
-(gw:wrap-function
- ws
- 'gnc:query-clear
- '<gw:void>
- "xaccQueryClear"
- '((<gnc:Query*> q))
- "Clear the terms from a query object")
-
-(gw:wrap-function
- ws
- 'gnc:query-purge-terms
- '<gw:void>
- "qof_query_purge_terms"
- '((<gnc:Query*> q) ((gw:gslist-of <gnc:id-type> caller-owned) param-path))
- "Remove query terms of a particular parameter-path.")
-
-(gw:wrap-function
- ws
- 'gnc:query-has-terms?
- '<gw:bool>
- "xaccQueryHasTerms"
- '((<gnc:Query*> q))
- "Check if a Query is clear or has terms.")
-
-(gw:wrap-function
- ws
- 'gnc:query-get-splits
- '(gw:glist-of <gnc:Split*> callee-owned)
- "xaccQueryGetSplits"
- '((<gnc:Query*> q))
- "Return a list of splits matching the Query.")
-
-(gw:wrap-function
- ws
- 'gnc:query-get-splits-unique-trans
- '(gw:glist-of <gnc:Split*> caller-owned)
- "xaccQueryGetSplitsUniqueTrans"
- '((<gnc:Query*> q))
- "Return a list of splits matching the Query, but at most one per transaction")
-
-(gw:wrap-function
- ws
- 'gnc:query-get-transactions
- '(gw:glist-of <gnc:Transaction*> caller-owned)
- "xaccQueryGetTransactions"
- '((<gnc:Query*> q) (<gnc:query-txn-match-t> rt))
- "Find transactions with splits matching the Query.")
-
-(gw:wrap-function
- ws
- 'gnc:query-get-lots
- '(gw:glist-of <gnc:Lot*> caller-owned)
- "xaccQueryGetLots"
- '((<gnc:Query*> q) (<gnc:query-txn-match-t> rt))
- "Find lots with splits matching the Query.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-account-match
- '<gw:void>
- "xaccQueryAddAccountMatch"
- '((<gnc:Query*> q)
-   ((gw:glist-of <gnc:Account*> caller-owned) accts)
-   (<gnc:guid-match-how> acctmatch)
-   (<gnc:query-op> how))
- "Match splits against one or all of a set of accounts.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-single-account-match
- '<gw:void>
- "xaccQueryAddSingleAccountMatch"
- '((<gnc:Query*> q) (<gnc:Account*> acct) (<gnc:query-op> how))
- "Match splits against a single account.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-description-match
- '<gw:void>
- "xaccQueryAddDescriptionMatch"
- '((<gnc:Query*> q)
-   ((<gw:mchars> caller-owned const) mstring)
-   (<gw:int> case-sens)
-   (<gw:int> use-regexp)
-   (<gnc:query-op> how))
- "Match splits against the transaction description.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-number-match
- '<gw:void>
- "xaccQueryAddNumberMatch"
- '((<gnc:Query*> q)
-   ((<gw:mchars> caller-owned const) mstring)
-   (<gw:int> case-sens)
-   (<gw:int> use-regexp)
-   (<gnc:query-op> how))
- "Match splits against the Number field.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-action-match
- '<gw:void>
- "xaccQueryAddActionMatch"
- '((<gnc:Query*> q)
-   ((<gw:mchars> caller-owned const) mstring)
-   (<gw:int> case-sens)
-   (<gw:int> use-regexp)
-   (<gnc:query-op> how))
- "Match splits against the Action field (a string).")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-share-price-match
- '<gw:void>
- "xaccQueryAddSharePriceMatch"
- '((<gnc:Query*> q)
-   (<gnc:numeric> amount)
-   (<gnc:query-compare-how> mhow)
-   (<gnc:query-op> how))
- "Match splits against the share price (including inequalities)")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-shares-match
- '<gw:void>
- "xaccQueryAddSharesMatch"
- '((<gnc:Query*> q)
-   (<gnc:numeric> amount)
-   (<gnc:query-compare-how> mhow)
-   (<gnc:query-op> how))
- "Match splits against the share price (including inequalities)")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-value-match
- '<gw:void>
- "xaccQueryAddValueMatch"
- '((<gnc:Query*> q)
-   (<gnc:numeric> amount)
-   (<gnc:numeric-match-how> match-sign)
-   (<gnc:query-compare-how> mhow)
-   (<gnc:query-op> how))
- "Match splits against the value (including inequalities)")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-date-match
- '<gw:void>
- "xaccQueryAddDateMatch"
- '((<gnc:Query*> q)
-   (<gw:bool> use-start)
-   (<gw:int> st-day)
-   (<gw:int> st-mon)
-   (<gw:int> st-year)
-   (<gw:bool> use-end)
-   (<gw:int> end-day)
-   (<gw:int> end-mon)
-   (<gw:int> end-year)
-   (<gnc:query-op> how))
- "Match the transaction date.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-date-match-timepair
- '<gw:void>
- "xaccQueryAddDateMatchTS"
- '((<gnc:Query*> q)
-   (<gw:bool> use-start)
-   (<gnc:time-pair> start)
-   (<gw:bool> use-end)
-   (<gnc:time-pair> end)
-   (<gnc:query-op> how))
- "Match the transaction date.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-memo-match
- '<gw:void>
- "xaccQueryAddMemoMatch"
- '((<gnc:Query*> q)
-   ((<gw:mchars> caller-owned const) mstring)
-   (<gw:int> case-sens)
-   (<gw:int> use-regexp)
-   (<gnc:query-op> how))
- "Match splits against the Memo field.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-cleared-match
- '<gw:void>
- "xaccQueryAddClearedMatch"
- '((<gnc:Query*> q) (<gnc:cleared-match-how> cleared-how) (<gnc:query-op> how))
- "match splits against the cleared state.")
-
-(gw:wrap-function
- ws
- 'gnc:query-add-guid-match
- '<gw:void>
- "xaccQueryAddGUIDMatchGL"
- '((<gnc:Query*> q) ((gw:glist-of <gnc:id-type> callee-owned) param_path)
-   (<gnc:guid-scm> guid) (<gnc:query-op> how))
- "Add a GUID match against the specified param_path")
-
-(gw:wrap-function
- ws
- 'gnc:query-set-sort-order
- '<gw:void>
- "qof_query_set_sort_order"
- '((<gnc:Query*> q)
-   ((gw:gslist-of <gnc:id-type> callee-owned) primary)
-   ((gw:gslist-of <gnc:id-type> callee-owned) secondary)
-   ((gw:gslist-of <gnc:id-type> callee-owned) tertiary))
- "set sort order.")
-
-(gw:wrap-function
- ws
- 'gnc:query-set-sort-increasing
- '<gw:void>
- "xaccQuerySetSortIncreasing"
- '((<gnc:Query*> q) 
-   (<gw:bool> prim-increasing) 
-   (<gw:bool> sec-increasing)
-   (<gw:bool> tert-increasing))
- "sort in increasing rather than decreasing order.")
-
-(gw:wrap-function
- ws
- 'gnc:query-set-max-results
- '<gw:void>
- "qof_query_set_max_results"
- '((<gnc:Query*> q) (<gw:int> n))
- "Set the max number of results to be returned by a query.")
-
-(gw:wrap-function
- ws
- 'gnc:query->scm
- '<gw:scm>
- "gnc_query2scm"
- '((<gnc:Query*> q))
- "Convert a query to an scm representation.")
-
-(gw:wrap-function
- ws
- 'gnc:scm->query
- '<gnc:Query*>
- "gnc_scm2query"
- '((<gw:scm> query_scm))
- "Convert an scm representation of a query to a real query.")
-
-
-;;=============
-;; gnc-commodity
-
-(gw:wrap-function
- ws
- 'gnc:commodity-create
- '<gnc:commodity*>
- "gnc_commodity_new"
- '((<gnc:Book*> book)
-   ((<gw:mchars> caller-owned const) namespace)
-   ((<gw:mchars> caller-owned const) mnemonic))
- "Create a new gnc_commodity object.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-destroy
- '<gw:void>
- "gnc_commodity_destroy"
- '((<gnc:commodity*> comm))
- "Delete a gnc_commodity structure.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-get-mnemonic
- '(<gw:mchars> callee-owned const)
- "gnc_commodity_get_mnemonic"
- '((<gnc:commodity*> comm))
- "Get the mnemonic (ISO 3-letter string, ticker symbol, etc)")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-get-namespace
- '(<gw:mchars> callee-owned const)
- "gnc_commodity_get_namespace"
- '((<gnc:commodity*> comm))
- "Get the mnemonic's namespace (ISO-4217, NASDAQ, NYSE, etc)")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-get-printname
- '(<gw:mchars> callee-owned const)
- "gnc_commodity_get_printname"
- '((<gnc:commodity*> comm))
- "Get the currency's printable name .. 'USD (US Dollars)'")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-get-fullname
- '(<gw:mchars> callee-owned const)
- "gnc_commodity_get_fullname"
- '((<gnc:commodity*> comm))
- "Get the currency's full name (US Dollars).")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-set-fullname
- '<gw:void>
- "gnc_commodity_set_fullname"
- '((<gnc:commodity*> comm) ((<gw:mchars> caller-owned const) fullname))
- "Set the currency's full name (US Dollars).")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-get-exchange-code
- '(<gw:mchars> callee-owned const)
- "gnc_commodity_get_cusip"
- '((<gnc:commodity*> comm))
- "Get the cusip (exchange specific data, not the stock ticker)")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-set-cusip
- '<gw:void>
- "gnc_commodity_set_cusip"
- '((<gnc:commodity*> comm) ((<gw:mchars> caller-owned const) cusip))
- "Set the cusip (exchange specific data, not the stock ticker)")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-get-fraction
- '<gw:int>
- "gnc_commodity_get_fraction"
- '((<gnc:commodity*> comm))
- "Get the number of smallest transactional units per unit of the currency")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-set-fraction
- '<gw:void>
- "gnc_commodity_set_fraction"
- '((<gnc:commodity*> comm) (<gw:int> frac))
- "Set the number of smallest transactional units per unit of the currency")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-is-currency?
- '<gw:bool>
- "gnc_commodity_is_currency"
- '((<gnc:commodity*> comm))
- "return true if the commodity is an ISO4217 currency")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-equiv?
- '<gw:bool>
- "gnc_commodity_equiv"
- '((<gnc:commodity*> comm1) (<gnc:commodity*> comm2))
- "Return true if the two commodities are equivalent.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-new
- '<gnc:commodity-table*>
- "gnc_commodity_table_new"
- '()
- "Return a new commodity table.");
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-lookup
- '<gnc:commodity*>
- "gnc_commodity_table_lookup"
- '((<gnc:commodity-table*> table)
-   ((<gw:mchars> caller-owned const) namespace)
-   ((<gw:mchars> caller-owned const) mnemonic))
- "Find a known gnc_commodity structure.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-find-full
- '<gnc:commodity*>
- "gnc_commodity_table_find_full"
- '((<gnc:commodity-table*> table)
-   ((<gw:mchars> caller-owned const) namespace)
-   ((<gw:mchars> caller-owned const) printname))
- "Find a gnc_commodity structure from its printable name.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-has-namespace
- '<gw:bool>
- "gnc_commodity_table_has_namespace"
- '((<gnc:commodity-table*> table)
-   ((<gw:mchars> caller-owned const) namespace))
- "Predicate to test for existence of a namespace.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-get-namespaces
- '(gw:glist-of (<gw:mchars> callee-owned) callee-owned)
- "gnc_commodity_table_get_namespaces"
- '((<gnc:commodity-table*> table))
- "Return a list of all the namespaces in the table.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-add-namespace
- '<gnc:commodity-namespace*>
- "gnc_commodity_table_add_namespace"
- '((<gnc:commodity-table*> table)
-   ((<gw:mchars> caller-owned const) namespace)
-   (<gnc:Book*> book))
- "Add a new namespace to the commodity table")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-delete-namespace
- '<gw:void>
- "gnc_commodity_table_delete_namespace"
- '((<gnc:commodity-table*> table)
-   ((<gw:mchars> caller-owned const) namespace))
- "Delete a namespace from the commodity table")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-get-commodities
- '(gw:glist-of <gnc:commodity*> caller-owned)
- "gnc_commodity_table_get_commodities"
- '((<gnc:commodity-table*> table)
-   ((<gw:mchars> caller-owned const) namespace))
- "Return a list of all the commodities in a given namespace in the table.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-get-quotable-commodities
- '(gw:glist-of <gnc:commodity*> caller-owned)
- "gnc_commodity_table_get_quotable_commodities"
- '((<gnc:commodity-table*> table))
- "Return a list of all the quotable commodities in a given namespace in the table.")
-
-(gw:wrap-function
- ws
- 'gnc:commodity-table-add-default-data
- '<gw:bool>
- "gnc_commodity_table_add_default_data"
- '((<gnc:commodity-table*> table)
-   (<gnc:Book*> book))
- "Add default commodities to the commodity table.")
-
-;;=========
-
-(gw:wrap-function
- ws
- 'gnc:engine-shutdown
- '<gw:void>
- "gnc_engine_shutdown"
- '()
- "Shutdown the gnucash engine.")
-
-;;============
-;; gnc_numeric
-
-(gw:wrap-function
- ws
- 'gnc:numeric-create
- '<gnc:numeric>
- "gnc_numeric_create"
- '((<gw:gint64> num) (<gw:gint64> denom))
- "Create a new gnc_numeric object")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-zero
- '<gnc:numeric>
- "gnc_numeric_zero"
- '()
- "Create a zero-valued gnc_numeric")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-error
- '<gnc:numeric>
- "gnc_numeric_error"
- '((<gw:int> code))
- "Create an error-signaling gnc_numeric")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-check
- '<gw:int>
- "gnc_numeric_check"
- '((<gnc:numeric> val))
- "Check for error code in a gnc_numeric")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-num
- '<gw:gint64>
- "gnc_numeric_num"
- '((<gnc:numeric> arg))
- "Return the numerator of a gnc_numeric")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-denom
- '<gw:gint64>
- "gnc_numeric_denom"
- '((<gnc:numeric> arg))
- "Return the denominator of a gnc_numeric")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-zero-p
- '<gw:bool>
- "gnc_numeric_zero_p"
- '((<gnc:numeric> arg))
- "Check for zero.")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-compare
- '<gw:int>
- "gnc_numeric_compare"
- '((<gnc:numeric> arg1) (<gnc:numeric> arg2))
- "Compare 2 gnc_numeric (1 if a>b, 0 if a==b, -1 if a<b)")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-negative-p
- '<gw:bool>
- "gnc_numeric_negative_p"
- '((<gnc:numeric> arg))
- "Check for arg < 0")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-positive-p
- '<gw:bool>
- "gnc_numeric_positive_p"
- '((<gnc:numeric> arg))
- "Check for arg > 0")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-eq
- '<gw:bool>
- "gnc_numeric_eq"
- '((<gnc:numeric> arg1) (<gnc:numeric> arg2))
- "Check for arg1 exactly arg2")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-equal
- '<gw:bool>
- "gnc_numeric_equal"
- '((<gnc:numeric> arg1) (<gnc:numeric> arg2))
- "Check for arg1 same number as arg2")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-same
- '<gw:bool>
- "gnc_numeric_same"
- '((<gnc:numeric> arg1)
-   (<gnc:numeric> arg2)
-   (<gw:gint64> denom)
-   (<gw:int> how))
- "Check for arg1 same number as arg2 if converted to common denom")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-add
- '<gnc:numeric>
- "gnc_numeric_add"
- '((<gnc:numeric> arg1)
-   (<gnc:numeric> arg2)
-   (<gw:gint64> denom)
-   (<gw:int> how))
- "Return a+b")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-sub
- '<gnc:numeric>
- "gnc_numeric_sub"
- '((<gnc:numeric> arg1)
-   (<gnc:numeric> arg2)
-   (<gw:gint64> denom)
-   (<gw:int> how))
- "Return a-b")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-mul
- '<gnc:numeric>
- "gnc_numeric_mul"
- '((<gnc:numeric> arg1)
-   (<gnc:numeric> arg2)
-   (<gw:gint64> denom)
-   (<gw:int> how))
- "Return a*b")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-div
- '<gnc:numeric>
- "gnc_numeric_div"
- '((<gnc:numeric> arg1)
-   (<gnc:numeric> arg2)
-   (<gw:gint64> denom)
-   (<gw:int> how))
- "Return a/b")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-neg
- '<gnc:numeric>
- "gnc_numeric_neg"
- '((<gnc:numeric> arg))
- "Return -a")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-abs
- '<gnc:numeric>
- "gnc_numeric_abs"
- '((<gnc:numeric> arg))
- "Return |a|")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-add-fixed
- '<gnc:numeric>
- "gnc_numeric_add_fixed"
- '((<gnc:numeric> arg1) (<gnc:numeric> arg2))
- "Return a+b under strict fixed-denom rules")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-sub-fixed
- '<gnc:numeric>
- "gnc_numeric_sub_fixed"
- '((<gnc:numeric> arg1) (<gnc:numeric> arg2))
- "Return a-b under strict fixed-denom rules")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-convert
- '<gnc:numeric>
- "gnc_numeric_convert"
- '((<gnc:numeric> arg) (<gw:gint64> denom) (<gw:int> how))
- "Convert a gnc_numeric to a new denominator")
-
-(gw:wrap-function
- ws
- 'gnc:double-to-gnc-numeric
- '<gnc:numeric>
- "double_to_gnc_numeric"
- '((<gw:double> in) (<gw:gint64> denom) (<gw:int> how))
- "Convert <gw:double> to gnc_numeric")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-to-double
- '<gw:double>
- "gnc_numeric_to_double"
- '((<gnc:numeric> in))
- "Convert gnc_numeric to double")
-
-(gw:wrap-function
- ws
- 'gnc:numeric-to-string
- '(<gw:mchars> caller-owned const)
- "gnc_numeric_to_string"
- '((<gnc:numeric> arg))
- "Convert gnc_numeric to a printable string")
-
-;; gnc-date.h
-
-(gw:wrap-function
- ws
- 'gnc:timepair-canonical-day-time
- '<gnc:time-pair>
- "timespecCanonicalDayTime"
- '((<gnc:time-pair> tp))
- "Convert a timepair on a certain day (localtime) to\
-the timepair representing midday on that day")
-
-;;
-;; gnc-filepath-utils.h
-;;
-
-(gw:wrap-function
- ws
- 'gnc:build-dotgnucash-path
- '(<gw:mchars> caller-owned)
- "gnc_build_dotgnucash_path"
- '(((<gw:mchars> caller-owned) filename))
- "Convert a relative path name into a full path name in the .gnucash directory")
-
-(gw:wrap-function
- ws
- 'gnc:build-book-path
- '(<gw:mchars> caller-owned)
- "gnc_build_book_path"
- '(((<gw:mchars> caller-owned) filename))
- "Convert a relative path name into a full path name in the .gnucash/books directory")
-
-;;
-;; gnc-lot.h
-;;
-
-(gw:wrap-function
- ws
- 'gnc:lot-get-balance
- '<gnc:numeric>
- "gnc_lot_get_balance"
- '((<gnc:Lot*> lot))
- "Return the balance of the lot")
-
-(gw:wrap-function
- ws
- 'gnc:lot-closed?
- '<gw:bool>
- "gnc_lot_is_closed"
- '((<gnc:Lot*> lot))
- "Is this Lot closed (is the balance zero)?")
-
-(gw:wrap-function
- ws
- 'gnc:lot-get-splits
- '(gw:glist-of <gnc:Split*> callee-owned)
- "gnc_lot_get_split_list"
- '((<gnc:Lot*> lot))
- "Return the list of splits attached to this lot.")
-
-(gw:wrap-function
- ws
- 'qof:event-suspend
- '<gw:void>
- "qof_event_suspend"
- '()
- "Suspend all engine events.") 
-
-(gw:wrap-function
- ws
- 'qof:event-resume
- '<gw:void>
- "qof_event_resume"
- '()
- "Resume engine event generation.") 
-
-(gw:wrap-function
- ws
- 'gnc:quote-source-set-fq-installed
- '<gw:void>
- "gnc_quote_source_set_fq_installed"
- '(((gw:glist-of (<gw:mchars> callee-owned) callee-owned) choices))
- "Takes a list of installed Finance::Quote souces and records it internally.")
-
-
-;; Budget functions
-
-(gw:wrap-as-wct ws '<gnc:Budget*> "GncBudget *" "const GncBudget *")
-
-(gw:wrap-function
- ws
- 'gnc:budget-get-guid
- '<gnc:guid-scm>
- "gnc_budget_return_guid"
- '((<gnc:Budget*> budget))
- "Gets the guid of the budget")
-
-
-(gw:wrap-function
- ws
- 'gnc:budget-lookup
- '<gnc:Budget*>
- "gnc_budget_lookup_direct"
- '((<gnc:guid-scm> guid)
-   (<gnc:Book*> book))
- "Lookup a budget from its GUID.")
-
-
-(gw:wrap-function
- ws
- 'gnc:budget-get-default
- '<gnc:Budget*>
- "gnc_budget_get_default"
- '((<gnc:Book*> book))
- "Get the default budget for the book.")
-
-
-(gw:wrap-function
- ws
- 'gnc:budget-get-name
- '(<gw:mchars> callee-owned const)
- "gnc_budget_get_name"
- '((<gnc:Budget*> budget))
- "Get the brief name for the budget.")
-
-(gw:wrap-function
- ws
- 'gnc:budget-get-num-periods
- '<gw:unsigned-int>
- "gnc_budget_get_num_periods"
- '((<gnc:Budget*> budget))
- "Get the number of periods in a budget.")
-
-(gw:wrap-function
- ws
- 'gnc:budget-get-account-period-value
- '<gnc:numeric>
- "gnc_budget_get_account_period_value"
- '((<gnc:Budget*> budget)
-   (<gnc:Account*> acct)
-   (<gw:unsigned-int> period_num)
-   )
- "Get the budgeted value for the given account and budget period.")
-
-(gw:wrap-function
- ws
- 'gnc:budget-get-account-period-actual-value
- '<gnc:numeric>
- "gnc_budget_get_account_period_actual_value"
- '((<gnc:Budget*> budget)
-   (<gnc:Account*> acct)
-   (<gw:unsigned-int> period_num)
-   )
- "Get the actual account value for the given account and budget period.")
-
-(gw:wrap-function
- ws
- 'gnc:budget-get-period-start-date
- '<gnc:time-pair>
- "gnc_budget_get_period_start_date"
- '((<gnc:Budget*> budget)
-   (<gw:unsigned-int> period_num)
-   )
- "Get the date that the given period begins.")
-
-;;
-;; gnc-hooks-scm.h
-;;   (and gnc-hooks.h)
-;;
-(gw:wrap-function
- ws
- 'gnc:hook-define
- '(<gw:mchars> caller-owned)
- "gnc_hook_create"
- '(((<gw:mchars> caller-owned) name) (<gw:int> how) ((<gw:mchars> caller-owned) desc))
- "Define (create) a new hook")
-
-(gw:wrap-function
- ws
- 'gnc:hook-get-description
- '(<gw:mchars> callee-owned)
- "gnc_hook_get_description"
- '(((<gw:mchars> caller-owned) hook))
- "Get the description of a hook")
-
-(gw:wrap-function
- ws
- 'gnc:hook-add-dangler
- '<gw:void>
- "gnc_hook_add_scm_dangler"
- '(((<gw:mchars> caller-owned) hook) (<gw:scm> procedure))
- "Add a hook dangler to an existing hook")
-
-(gw:wrap-function
- ws
- 'gnc:hook-remove-dangler
- '<gw:void>
- "gnc_hook_del_scm_dangler"
- '(((<gw:mchars> caller-owned) hook) (<gw:scm> procedure))
- "Remove a hook dangler from an existing hook")
-
-(gw:wrap-function
- ws
- 'gnc:hook-run-danglers-real
- '<gw:void>
- "gnc_hook_run"
- '(((<gw:mchars> caller-owned) name) (<gnc:Session*> arg))
- "Run the danglers on a hook.")
-
-; Now wrap all the 'known' hooks
-(gw:wrap-value ws 'gnc:*new-book-hook*
-	       '(<gw:mchars> callee-owned) "HOOK_NEW_BOOK")
-(gw:wrap-value ws 'gnc:*report-hook*
-	       '(<gw:mchars> callee-owned) "HOOK_REPORT")
-(gw:wrap-value ws 'gnc:*save-options-hook*
-	       '(<gw:mchars> callee-owned) "HOOK_SAVE_OPTIONS")
-(gw:wrap-value ws 'gnc:*book-opened-hook*
-	       '(<gw:mchars> callee-owned) "HOOK_BOOK_OPENED")
-(gw:wrap-value ws 'gnc:*book-closed-hook*
-	       '(<gw:mchars> callee-owned) "HOOK_BOOK_CLOSED")

Deleted: gnucash/branches/register-rewrite/src/engine/gw-kvp-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/gw-kvp-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/gw-kvp-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,107 +0,0 @@
-(define-module (g-wrapped gw-kvp-spec))
-
-;; g-wrap modules
-(use-modules (g-wrap))
-(use-modules (g-wrap simple-type))
-
-;; g-wrap wrapped modules
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-;; other wrapped modules
-(use-modules (g-wrapped gw-engine-spec))
-
-(let ((ws (gw:new-wrapset "gw-kvp")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-depends-on ws "gw-engine")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-kvp))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <qof.h>\n"
-      "#include <kvp-scm.h>\n"
-      "#include <Transaction.h>\n")))
-
-  (gw:wrap-as-wct ws '<gnc:kvp-frame*> "KvpFrame*" "const KvpFrame*")
-
-  (gw:wrap-simple-type
-   ws
-   '<gnc:kvp-value*> "KvpValue*"
-   '("gnc_kvp_value_ptr_p(" scm-var ")")
-   '(c-var " = gnc_scm_to_kvp_value_ptr(" scm-var ");\n")
-   '(scm-var " = gnc_kvp_value_ptr_to_scm(" c-var ");\n"))
-  
-  (gw:wrap-function
-   ws
-   'gnc:kvp-frame-delete-at-path
-   '<gw:void>
-   "gnc_kvp_frame_delete_at_path"
-   '((<gnc:kvp-frame*> f)
-     ((gw:gslist-of (<gw:mchars> caller-owned const) caller-owned) key-path))
-   "Deletes the KvpFrame at the key-path in frame f")
-   
-  (gw:wrap-function
-   ws
-   'gnc:kvp-frame-set-slot
-   '<gw:void>
-   "kvp_frame_set_slot"
-   '((<gnc:kvp-frame*> k)
-     ((<gw:mchars> caller-owned const) c)
-     (<gnc:kvp-value*> v))
-   "Sets the slot c in frame k to the value v")
-
-  (gw:wrap-function
-   ws
-   'gnc:kvp-frame-get-slot
-   '<gnc:kvp-value*>
-   "kvp_frame_get_slot"
-   '((<gnc:kvp-frame*> k) ((<gw:mchars> caller-owned const) c))
-   "Gets the slot c from frame k")
-
-  (gw:wrap-function
-   ws
-   'gnc:kvp-frame-set-slot-path
-   '<gw:void>
-   "kvp_frame_set_slot_path_gslist"
-   '((<gnc:kvp-frame*> k) (<gnc:kvp-value*> v)
-     ((gw:gslist-of (<gw:mchars> caller-owned const) caller-owned) key-path))
-   "Sets the path key-path in frame k to the value v")
-
-  (gw:wrap-function
-   ws
-   'gnc:kvp-frame-get-slot-path
-   '<gnc:kvp-value*>
-   "kvp_frame_get_slot_path_gslist"
-   '((<gnc:kvp-frame*> k)
-     ((gw:gslist-of (<gw:mchars> caller-owned const) caller-owned) key-path))
-   "Gets the value at slots key-path in frame k")
-
-  ;;
-  ;; functions to get kvp-frames
-  ;;
-
-  (gw:wrap-function
-   ws
-   'gnc:transaction-get-slots
-   '<gnc:kvp-frame*>
-   "xaccTransGetSlots"
-   '((<gnc:Transaction*> s))
-   "Get the transaction's slots.")
-
-  (gw:wrap-function
-   ws
-   'gnc:book-get-slots
-   '<gnc:kvp-frame*>
-   "qof_book_get_slots"
-   '((<gnc:Book*> b))
-   "Get the book's slots.")
-)
-

Modified: gnucash/branches/register-rewrite/src/engine/kvp-scm.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/kvp-scm.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/kvp-scm.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,12 +1,12 @@
 #include "config.h"
 
 #include <qof.h>
-#include <g-wrap-wct.h>
 #include <libguile.h>
 #include <engine-helpers.h>
 
 #include "kvp-scm.h"
 #include "guile-mappings.h"
+#include "swig-runtime.h"
 
 int
 gnc_kvp_value_ptr_p(SCM arg)
@@ -53,10 +53,12 @@
         ret = kvp_value_new_string(newstr);
         return ret;
     }
-    else if(gw_wcp_p(val) &&
-	    gw_wcp_is_of_type_p(scm_c_eval_string("<gnc:kvp-frame*>"), val))
+    else if(SWIG_IsPointerOfType(val, SWIG_TypeQuery("_p_KvpFrame")))
     {
-        KvpFrame *frame = gw_wcp_get_ptr(val);
+        #define FUNC_NAME __FUNCTION__
+        KvpFrame *frame = SWIG_MustGetPtr(val, SWIG_TypeQuery("_p_KvpFrame"),
+                                          1, 0);
+        #undef FUNC_NAME
         return kvp_value_new_frame (frame);
     }
     /* FIXME: add binary handler here when it's figured out */
@@ -95,8 +97,7 @@
     {
         KvpFrame *frame = kvp_value_get_frame(val);
 	if (frame)
-	  return gw_wcp_assimilate_ptr (frame,
-					scm_c_eval_string("<gnc:kvp-frame*>"));
+            return SWIG_NewPointerObj(frame, SWIG_TypeQuery("_p_KvpFrame"), 0);
     }
         break;
 

Modified: gnucash/branches/register-rewrite/src/engine/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -14,8 +14,6 @@
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${top_builddir}/src/test-core/libgncmod-test.la \
   ../libgncmod-engine.la \
-  ../libgw-engine.la \
-  ../libgw-kvp.la \
   ../test-core/libgncmod-test-engine.la \
   ${top_builddir}/src/core-utils/libcore-utils.la \
   ${GLIB_LIBS} \
@@ -54,9 +52,10 @@
   --gnc-module-dir ${top_builddir}/src/engine \
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
   --gnc-module-dir ${top_srcdir}/src/engine \
-  --guile-load-dir ${top_srcdir}/src/engine/test \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/src/core-utils \
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --library-dir    ${top_builddir}/src/backend/file \
+  --guile-load-dir ${top_srcdir}/src/engine/test
 
 TESTS_ENVIRONMENT := \
   SRCDIR=${srcdir} \

Modified: gnucash/branches/register-rewrite/src/engine/test/test-commodities.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-commodities.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-commodities.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
  *  02110-1301, USA.
  */
 
+#include "config.h"
 #include <glib.h>
 
 #include "gnc-commodity.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-create-account.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-create-account.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-create-account.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -7,12 +7,12 @@
   (gnc:module-system-init)
   (gnc:module-load "gnucash/engine" 0)
 
-  (let* ((session (gnc:session-new))
-         (book (gnc:session-get-book session))
-         (group (gnc:malloc-account-group book))
-         (acct (gnc:malloc-account book)))
-    (gnc:account-begin-edit acct)
-    (gnc:account-set-name acct "foo")
-    (gnc:account-commit-edit acct)
-    (gnc:group-insert-account group acct))
+  (let* ((session (qof-session-new))
+         (book (qof-session-get-book session))
+         (group (xaccMallocAccountGroup book))
+         (acct (xaccMallocAccount book)))
+    (xaccAccountBeginEdit acct)
+    (xaccAccountSetName acct "foo")
+    (xaccAccountCommitEdit acct)
+    (xaccGroupInsertAccount group acct))
   #t)

Modified: gnucash/branches/register-rewrite/src/engine/test/test-date.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-date.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-date.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * -- fix borken timezone test -- linas May 2004
  */
 
+#include "config.h"
 #include <ctype.h>
 #include <glib.h>
 #include <time.h>

Modified: gnucash/branches/register-rewrite/src/engine/test/test-group-vs-book.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-group-vs-book.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-group-vs-book.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,6 +21,7 @@
  *  02110-1301, USA.
  */
 
+#include "config.h"
 #include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-guid.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-guid.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-guid.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -26,6 +26,7 @@
  *
  */
 
+#include "config.h"
 #include <ctype.h>
 #include <glib.h>
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-load-engine.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-load-engine.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-load-engine.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,6 +21,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h"
 #include <stdio.h>
 #include <stdlib.h>
 #include "qof.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-lots.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-lots.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-lots.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,6 +25,7 @@
  * @author Linas Vepstas <linas at linas.org>
  */
 
+#include "config.h"
 #include <ctype.h>
 #include <glib.h>
 #include "qof.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-numeric.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-numeric.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-numeric.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
  */
  
 
+#include "config.h"
 #include <ctype.h>
 #include <glib.h>
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-object.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-object.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-object.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
  /*
  * Lightly test the QofObject infrastructure.
  */
+#include "config.h"
 #include <glib.h>
 #include <glib/gi18n.h>
 #include "qof.h"
@@ -32,7 +33,7 @@
 #define TEST_MODULE_NAME "object-test"
 #define TEST_MODULE_DESC "Test Object"
 
-static void obj_foreach (QofCollection *, QofEntityForeachCB, gpointer);
+static void obj_foreach (const QofCollection *, QofEntityForeachCB, gpointer);
 static const char * printable (gpointer obj);
 static void test_printable (const char *name, gpointer obj);
 static void test_foreach (QofBook *, const char *);
@@ -78,7 +79,7 @@
 }
 
 static void
-obj_foreach (QofCollection *col, QofEntityForeachCB cb, gpointer u_d)
+obj_foreach (const QofCollection *col, QofEntityForeachCB cb, gpointer u_d)
 {
   int *foo = u_d;
 

Modified: gnucash/branches/register-rewrite/src/engine/test/test-period.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-period.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-period.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,6 +25,7 @@
  * without crashing.
  */
 
+#include "config.h"
 #include <ctype.h>
 #include <glib.h>
 #include "qof.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-query.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-query.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-query.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,6 +21,7 @@
  *  02110-1301, USA.
  */
 
+#include "config.h"
 #include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-querynew.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-querynew.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-querynew.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,6 +21,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h"
 #include <glib.h>
 #include <stdio.h>
 #include "qof.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-resolve-file-path.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-resolve-file-path.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-resolve-file-path.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,6 +21,7 @@
  *  02110-1301, USA.
  */
 
+#include "config.h"
 #include <stdlib.h>
 #include <string.h>
 
@@ -39,10 +40,14 @@
 typedef struct test_strings_struct test_strings;
 
 test_strings strs[] = {
-    { "/.gnucash/test-account-name", "/.gnucash/test-account-name", 1 },
-    { "/tmp/test-account-name2", "/tmp/test-account-name2", 0 },
-    { "postgres://localhost/foo/bar", "/.gnucash/data/postgres:,,localhost,foo,bar", 2 },
-    { "file:/tmp/test-account-name3", "/tmp/test-account-name3", 0 },
+    { G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "test-account-name",
+      G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "test-account-name", 1 },
+    { G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name2",
+      G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name2", 0 },
+    { "postgres://localhost/foo/bar",
+      G_DIR_SEPARATOR_S ".gnucash" G_DIR_SEPARATOR_S "data" G_DIR_SEPARATOR_S "postgres:,,localhost,foo,bar", 2 },
+    { "file:" G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name3",
+      G_DIR_SEPARATOR_S "tmp" G_DIR_SEPARATOR_S "test-account-name3", 0 },
     { NULL, NULL, 0 },
 };
 
@@ -59,15 +64,16 @@
         
         if(strs[i].prefix_home == 1) 
         {
-            dain = g_strdup_printf("%s/%s", g_get_home_dir(), strs[i].input);
-            wantout = g_strdup_printf("%s/%s", g_get_home_dir(),
-                                      strs[i].output);
+            dain = g_build_filename(g_get_home_dir(), strs[i].input,
+				    (gchar *)NULL);
+            wantout = g_build_filename(g_get_home_dir(), strs[i].output,
+				       (gchar *)NULL);
         }
         else if(strs[i].prefix_home == 2)
         {
             dain = g_strdup(strs[i].input);
-            wantout = g_strdup_printf("%s%s", g_get_home_dir(),
-                                      strs[i].output);
+            wantout = g_build_filename(g_get_home_dir(), strs[i].output,
+				       (gchar *)NULL);
         }
          else
         {

Modified: gnucash/branches/register-rewrite/src/engine/test/test-scm-query-import.scm
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-scm-query-import.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-scm-query-import.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -11,14 +11,14 @@
   (display "\tYou may see \"Error: xaccQueryAddGUIDMatch: Invalid match type\".\n")
   (display "\tThese messages are normal, and you can safely ignore them.\n\n")
 
-  (let* ((session (gnc:session-new))
-         (book (gnc:session-get-book session))
+  (let* ((session (qof-session-new))
+         (book (qof-session-get-book session))
 	 (failures #f))
     
     (for-each
      (lambda (query-scm)
-	     (let* ((q (gnc:scm->query query-scm))
-		    (q2 (gnc:query->scm q)))
+	     (let* ((q (gnc-scm2query query-scm))
+		    (q2 (gnc-query2scm q)))
 	       (if (or (null? q) (not q))
 		   (begin
 		     (set! failures #t)
@@ -43,16 +43,16 @@
 
    '((terms (((pd-string pr-action #f #t #f z*I>eBDI_t!a) (pd-date pr-date #t #t (1261008994 . 934186023) #t (615835276 . 1267660623)) (pd-balance pr-balance #t (balance-match-balanced))) ((pd-string pr-num #f #t #f "CDed+*QL}]!Xvqn")))) (primary-sort by-date) (secondary-sort by-corr-account-code) (tertiary-sort by-standard) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -20111))
 
-   '((terms (((pd-amount pr-price #t amt-match-atmost amt-sgn-match-either 3.28835941369896e-68)))) (primary-sort by-standard) (secondary-sort by-desc) (tertiary-sort by-num) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -31054))
+   '((terms (((pd-amount pr-price #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 3.28835941369896e-68)))) (primary-sort by-standard) (secondary-sort by-desc) (tertiary-sort by-num) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -31054))
 
-   '((terms (((pd-date pr-date #t #t (1223092983 . 1927459559) #t (939722700 . 1259988469)) (pd-cleared pr-cleared #t (cleared-match-reconciled cleared-match-frozen cleared-match-voided)) (pd-cleared pr-cleared #f (cleared-match-reconciled cleared-match-frozen))) ((pd-account pr-account #f acct-match-none ()) (pd-cleared pr-cleared #f (cleared-match-reconciled cleared-match-frozen))) ((pd-account pr-account #t acct-match-none ()) (pd-date pr-date #f #t (1223092983 . 1927459559) #t (939722700 . 1259988469)) (pd-cleared pr-cleared #t (cleared-match-reconciled cleared-match-frozen))) ((pd-account pr-account #t acct-match-none ()) (pd-cleared pr-cleared #f (cleared-match-reconciled cleared-match-frozen cleared-match-voided)) (pd-cleared pr-cleared #t (cleared-match-reconciled cleared-match-frozen))))) (primary-sort by-account-full-name) (secondary-sort by-num) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -34834))
+   '((terms (((pd-date pr-date #t #t (1223092983 . 1927459559) #t (939722700 . 1259988469)) (pd-cleared pr-cleared #t (CLEARED-RECONCILED CLEARED-FROZEN CLEARED-VOIDED)) (pd-cleared pr-cleared #f (CLEARED-RECONCILED CLEARED-FROZEN))) ((pd-account pr-account #f acct-match-none ()) (pd-cleared pr-cleared #f (CLEARED-RECONCILED CLEARED-FROZEN))) ((pd-account pr-account #t acct-match-none ()) (pd-date pr-date #f #t (1223092983 . 1927459559) #t (939722700 . 1259988469)) (pd-cleared pr-cleared #t (CLEARED-RECONCILED CLEARED-FROZEN))) ((pd-account pr-account #t acct-match-none ()) (pd-cleared pr-cleared #f (CLEARED-RECONCILED CLEARED-FROZEN CLEARED-VOIDED)) (pd-cleared pr-cleared #t (CLEARED-RECONCILED CLEARED-FROZEN))))) (primary-sort by-account-full-name) (secondary-sort by-num) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -34834))
 
    '((terms (((pd-string pr-memo #t #t #t "kb?M5]oG2={pd<") (pd-guid pr-guid #t b57a792a53ce3f6dadd50a88c341f608 "pU
 q!Y#.`yx&")))) (primary-sort by-num) (secondary-sort by-standard) (tertiary-sort by-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 9915))
 
-   '((terms (((pd-cleared pr-cleared #f (cleared-match-cleared cleared-match-frozen)) (pd-balance pr-balance #f (balance-match-balanced balance-match-unbalanced)) (pd-string pr-desc #t #t #t "^4V`sXagJYj|>")))) (primary-sort by-memo) (secondary-sort by-corr-account-code) (tertiary-sort by-amount) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -12077))
+   '((terms (((pd-cleared pr-cleared #f (CLEARED-CLEARED CLEARED-FROZEN)) (pd-balance pr-balance #f (balance-match-balanced balance-match-unbalanced)) (pd-string pr-desc #t #t #t "^4V`sXagJYj|>")))) (primary-sort by-memo) (secondary-sort by-corr-account-code) (tertiary-sort by-amount) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -12077))
 
-   '((terms (((pd-cleared pr-cleared #t (cleared-match-reconciled cleared-match-frozen)) (pd-string pr-num #t #f #f "aq|-=m at 5ovhv=q5z")) ((pd-cleared pr-cleared #t (cleared-match-reconciled cleared-match-frozen)) (pd-account pr-account #t acct-match-none ())) ((pd-account pr-account #t acct-match-none ()) (pd-string pr-num #t #f #f aq|-=m at 5ovhv=q5z)) ((pd-account pr-account #t acct-match-none ()) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-value #f amt-match-exactly amt-sgn-match-either 6582.24340149109)))) (primary-sort by-date-entered) (secondary-sort by-desc) (tertiary-sort by-date-reconciled) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 31474))
+   '((terms (((pd-cleared pr-cleared #t (CLEARED-RECONCILED CLEARED-FROZEN)) (pd-string pr-num #t #f #f "aq|-=m at 5ovhv=q5z")) ((pd-cleared pr-cleared #t (CLEARED-RECONCILED CLEARED-FROZEN)) (pd-account pr-account #t acct-match-none ())) ((pd-account pr-account #t acct-match-none ()) (pd-string pr-num #t #f #f aq|-=m at 5ovhv=q5z)) ((pd-account pr-account #t acct-match-none ()) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 6582.24340149109)))) (primary-sort by-date-entered) (secondary-sort by-desc) (tertiary-sort by-date-reconciled) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 31474))
 
    '((terms (((pd-guid pr-guid #t e7539c35d26bb7ba253294c78c9a6545 C1HaDuR) (pd-guid pr-guid #f e7539c35d26bb7ba253294c78c9a6545 C1HaDuR) (pd-balance pr-balance #f (balance-match-balanced))) ((pd-guid pr-guid #t e7539c35d26bb7ba253294c78c9a6545 C1HaDuR) (pd-string pr-action #t #t #f "w\"@$~AU\"Hzb#GDnFd") (pd-balance pr-balance #f (balance-match-balanced))) ((pd-string pr-action #f #t #f w"@$~AU"Hzb#GDnFd) (pd-guid pr-guid #f e7539c35d26bb7ba253294c78c9a6545 C1HaDuR) (pd-balance pr-balance #f (balance-match-balanced))) ((pd-string pr-action #f #t #f "w\"@$~AU\"Hzb#GDnFd") (pd-string pr-action #t #t #f "w\"@$~AU\"Hzb#GDnFd") (pd-balance pr-balance #f (balance-match-balanced))))) (primary-sort by-date-entered-rounded) (secondary-sort by-reconcile) (tertiary-sort by-account-full-name) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 9653))
 
@@ -72,8 +72,8 @@
 U\"Uzm`V9w
 tUpg,>&Rf\"vp0(%#Xh'nxSP7JDL5HJ8N]V34Tomuj2v)f(	O7IA[}Mfz(Vnoj/F(")))) (primary-sort by-none) (secondary-sort by-date-entered) (tertiary-sort by-date-reconciled) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 44703))
 
-   '((terms (((pd-amount pr-value #f amt-match-exactly amt-sgn-match-either 1.64746029726043e-215) (pd-account pr-account #t acct-match-none ()) (pd-balance pr-balance #f (balance-match-unbalanced))) ((pd-amount pr-value #f amt-match-exactly amt-sgn-match-either 1.64746029726043e-215) (pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split kvp-match-account) ("Ec>OU,gqm0x\-ZfbL^!<l)W},!)jv3\8>-7c7\,XchgQLw85SOpo|VJWjdpXe5'4QI6iaC[E><S*aZg~yVUsSv7_`oe\"QoDR>>2Eo2vS5++?K\EBDgmn=m_MtaVvxgM[t2P\"!$
-&0-9|%PM~ZR=V9Bw516YCXFcqGf|7Nu0XUPE9J1 at -a\"nF0'%ri~3Oy		5Mzp&9HzXi_4pDM8*g./2qb17Q)'f at -prwD	CUK|Is,L/EZf") (kvp-type-guid 1829a71bca494313d88715c70bfd04bc)) (pd-balance pr-balance #f (balance-match-unbalanced))))) (primary-sort by-date-rounded) (secondary-sort by-date-entered-rounded) (tertiary-sort by-date) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 49280))
+   '((terms (((pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.64746029726043e-215) (pd-account pr-account #t acct-match-none ()) (pd-balance pr-balance #f (balance-match-unbalanced))) ((pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.64746029726043e-215) (pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split kvp-match-account) ("Ec>OU,gqm0x\-ZfbL^!<l)W},!)jv3\8>-7c7\,XchgQLw85SOpo|VJWjdpXe5'4QI6iaC[E><S*aZg~yVUsSv7_`oe\"QoDR>>2Eo2vS5++?K\EBDgmn=m_MtaVvxgM[t2P\"!$
+&0-9|%PM~ZR=V9Bw516YCXFcqGf|7Nu0XUPE9J1 at -a\"nF0'%ri~3Oy		5Mzp&9HzXi_4pDM8*g./2qb17Q)'f at -prwD	CUK|Is,L/EZf") (KVP-TYPE-GUID 1829a71bca494313d88715c70bfd04bc)) (pd-balance pr-balance #f (balance-match-unbalanced))))) (primary-sort by-date-rounded) (secondary-sort by-date-entered-rounded) (tertiary-sort by-date) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 49280))
 
    '((terms (((pd-string pr-num #t #t #f "/~W
 ~3+?&x^bi5?t-dt(n6vU`}3l/drQR!^FN|eZdWe|'s#p]sJNU)O|C>OsU]2zvV^d$q9 !Q|~&q4X?84A'*ZMgF!4t&7?C)2D.LBJ1dJ?Mm>\"VNq{HtNol#J-Qu#	CnSFJh_h&/_agHS?g>6g90(tq(r4.t
@@ -81,76 +81,76 @@
 o{L41Ltx48Y{&g!9uL>6@{]D|/T|x5M3@%V,Vk 8_^G!M
 |u#.?LTAz$yFa~&R-+_To(!])x#5$lu>gh\"YQ90%#M&13EL`~G|^lv>7&^0fV{Hh
 ,,P^QKf	EF4't,
-uN\"2W.w'BLg-08Tj^Jv$Ftk at 7F,L-'p.x.`])Ii JBe 0v4.+@>8UJC7\9]vX1IiF?\"f[8fF)\F}$nu=d$](`4FGWoM5k4") (pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 1.73210379373199e174)) ((pd-string pr-num #f #t #f "/~W
+uN\"2W.w'BLg-08Tj^Jv$Ftk at 7F,L-'p.x.`])Ii JBe 0v4.+@>8UJC7\9]vX1IiF?\"f[8fF)\F}$nu=d$](`4FGWoM5k4") (pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.73210379373199e174)) ((pd-string pr-num #f #t #f "/~W
 ~3+?&x^bi5?t-dt(n6vU`}3l/drQR!^FN|eZdWe|'s#p]sJNU)O|C>OsU]2zvV^d$q9 !Q|~&q4X?84A'*ZMgF!4t&7?C)2D.LBJ1dJ?Mm>\"VNq{HtNol#J-Qu#	CnSFJh_h&/_agHS?g>6g90(tq(r4.t
 U4bl	p0
 o{L41Ltx48Y{&g!9uL>6@{]D|/T|x5M3@%V,Vk 8_^G!M
 |u#.?LTAz$yFa~&R-+_To(!])x#5$lu>gh\"YQ90%#M&13EL`~G|^lv>7&^0fV{Hh
 ,,P^QKf	EF4't,
-uN\"2W.w'BLg-08Tj^Jv$Ftk at 7F,L-'p.x.`])Ii JBe 0v4.+@>8UJC7\9]vX1IiF?\"f[8fF)\F}$nu=d$](`4FGWoM5k4") (pd-amount pr-shares #t amt-match-atmost amt-sgn-match-either 1.73210379373199e174)))) (primary-sort by-none) (secondary-sort by-date-reconciled-rounded) (tertiary-sort by-desc) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -48174))
+uN\"2W.w'BLg-08Tj^Jv$Ftk at 7F,L-'p.x.`])Ii JBe 0v4.+@>8UJC7\9]vX1IiF?\"f[8fF)\F}$nu=d$](`4FGWoM5k4") (pd-amount pr-shares #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.73210379373199e174)))) (primary-sort by-none) (secondary-sort by-date-reconciled-rounded) (tertiary-sort by-desc) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -48174))
 
-   '((terms (((pd-amount pr-value #t amt-match-exactly amt-sgn-match-either 1.89660648487493e224)))) (primary-sort by-desc) (secondary-sort by-memo) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -37439))
+   '((terms (((pd-amount pr-value #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.89660648487493e224)))) (primary-sort by-desc) (secondary-sort by-memo) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -37439))
 
    '((terms (((pd-string pr-num #t #f #t "~>U~LUigt\"bu") (pd-string pr-desc #f #t #t "*I)?pLx%,od")) ((pd-date pr-date #t #t (1479130791 . 558953897) #t (1559762990 . 116796098)) (pd-string pr-desc #f #t #t *I)?pLx%,od)) ((pd-date pr-date #f #t (1479130791 . 558953897) #t (1559762990 . 116796098)) (pd-string pr-num #f #f #t "~>U~LUigt\"bu") (pd-string pr-desc #t #t #t "*I)?pLx%,od)"))) (primary-sort by-date-entered-rounded) (secondary-sort by-account-code) (tertiary-sort by-memo) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 14407))
 
-   '((terms (((pd-account pr-account #t acct-match-all ()) (pd-account pr-account #f acct-match-all ())) ((pd-account pr-account #t acct-match-all ()) (pd-amount pr-shares #t amt-match-exactly amt-sgn-match-either 1.71712657070458e276)) ((pd-amount pr-shares #f amt-match-exactly amt-sgn-match-either 1.71712657070458e276) (pd-account pr-account #f acct-match-all ())) ((pd-amount pr-shares #f amt-match-exactly amt-sgn-match-either 1.71712657070458e276) (pd-amount pr-shares #t amt-match-exactly amt-sgn-match-either 1.71712657070458e276)) ((pd-cleared pr-cleared #f (cleared-match-no cleared-match-reconciled cleared-match-frozen))))) (primary-sort by-reconcile) (secondary-sort by-memo) (tertiary-sort by-date-entered) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -35606))
+   '((terms (((pd-account pr-account #t acct-match-all ()) (pd-account pr-account #f acct-match-all ())) ((pd-account pr-account #t acct-match-all ()) (pd-amount pr-shares #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.71712657070458e276)) ((pd-amount pr-shares #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.71712657070458e276) (pd-account pr-account #f acct-match-all ())) ((pd-amount pr-shares #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.71712657070458e276) (pd-amount pr-shares #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.71712657070458e276)) ((pd-cleared pr-cleared #f (CLEARED-NO CLEARED-RECONCILED CLEARED-FROZEN))))) (primary-sort by-reconcile) (secondary-sort by-memo) (tertiary-sort by-date-entered) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -35606))
 
-   '((terms (((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 8.54318608786241e53) (pd-account pr-account #f acct-match-none ())) ((pd-string pr-memo #f #f #t "~v+YgB%x") (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 8.54318608786241e53) (pd-account pr-account #f acct-match-none ())) ((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-string pr-memo #f #f #t "~v+YgB%x") (pd-account pr-account #t acct-match-none ())) ((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-account pr-account #t acct-match-none ())) ((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 8.54318608786241e53) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-string pr-memo #f #f #t "~v+YgB%x") (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 8.54318608786241e53) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 8.54318608786241e53) (pd-string pr-memo #f #f #t "~v+YgB%x") (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 8.54318608786241e53) (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 7.6668212413938e138) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast amt-sgn-match-either !
 8.543186
08786241e53) (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 8.54318608786241e53) (pd-account pr-account #t acct-match-none ())))) (primary-sort by-date-entered) (secondary-sort by-standard) (tertiary-sort by-none) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -10549))
+   '((terms (((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.54318608786241e53) (pd-account pr-account #f acct-match-none ())) ((pd-string pr-memo #f #f #t "~v+YgB%x") (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.54318608786241e53) (pd-account pr-account #f acct-match-none ())) ((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-string pr-memo #f #f #t "~v+YgB%x") (pd-account pr-account #t acct-match-none ())) ((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-account pr-account #t acct-match-none ())) ((pd-string pr-memo #t #f #t "~v+YgB%x") (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.54318608786241e53) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-string pr-memo #f #f #t "~v+YgB%x") (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.54318608786241e53) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.54318608786241e53) (pd-string pr-memo #f #f #t "~v+YgB%x") (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.54318608786241e53) (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 7.6668212413938e138) (pd-account pr-account #t acct-match-none ())) ((pd-amount pr-price #f amt-match-atleast QOF-NUM!
 ERIC-MAT
CH-ANY 8.54318608786241e53) (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.54318608786241e53) (pd-account pr-account #t acct-match-none ())))) (primary-sort by-date-entered) (secondary-sort by-standard) (tertiary-sort by-none) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -10549))
 
-   '((terms (((pd-amount pr-price #t amt-match-exactly amt-sgn-match-either 1.19513192070749e-221) (pd-date pr-date #f #t (663282177 . 2042234049) #t (1620650417 . 2031711708))) ((pd-amount pr-price #f amt-match-exactly amt-sgn-match-either 1.19513192070749e-221) (pd-date pr-date #t #t (663282177 . 2042234049) #t (1620650417 . 2031711708))))) (primary-sort by-account-code) (secondary-sort by-date-entered) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -461))
+   '((terms (((pd-amount pr-price #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.19513192070749e-221) (pd-date pr-date #f #t (663282177 . 2042234049) #t (1620650417 . 2031711708))) ((pd-amount pr-price #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 1.19513192070749e-221) (pd-date pr-date #t #t (663282177 . 2042234049) #t (1620650417 . 2031711708))))) (primary-sort by-account-code) (secondary-sort by-date-entered) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -461))
 
-   '((terms (((pd-cleared pr-cleared #t (cleared-match-cleared cleared-match-frozen))))) (primary-sort by-account-full-name) (secondary-sort by-date-rounded) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 27860))
+   '((terms (((pd-cleared pr-cleared #t (CLEARED-CLEARED CLEARED-FROZEN))))) (primary-sort by-account-full-name) (secondary-sort by-date-rounded) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 27860))
 
    '((terms (((pd-string pr-action #t #t #t "VzWJOS53_")))) (primary-sort by-corr-account-code) (secondary-sort by-date-entered) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 5445))
 
-   '((terms (((pd-guid pr-guid #t 18790e0a69dc0b7bd212e66458636efb "gs]pcC|b") (pd-amount pr-shares #t amt-match-exactly amt-sgn-match-either 4.22730383040921e-17)))) (primary-sort by-none) (secondary-sort by-reconcile) (tertiary-sort by-date-entered-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 12121))
+   '((terms (((pd-guid pr-guid #t 18790e0a69dc0b7bd212e66458636efb "gs]pcC|b") (pd-amount pr-shares #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 4.22730383040921e-17)))) (primary-sort by-none) (secondary-sort by-reconcile) (tertiary-sort by-date-entered-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 12121))
 
-   '((terms (((pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 1.06956179639452e-138) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-account) ("/Qo|_TMC%. `T%k{gs^*d at 8rCc`L Weovrw^d]Kw?&>8 (gg7t,)igFV&|=C'bga8PS4qbA2_~c9ygld3}\UCp,\"s]+ZYVpx0AQ64K#q?l3
+   '((terms (((pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.06956179639452e-138) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-account) ("/Qo|_TMC%. `T%k{gs^*d at 8rCc`L Weovrw^d]Kw?&>8 (gg7t,)igFV&|=C'bga8PS4qbA2_~c9ygld3}\UCp,\"s]+ZYVpx0AQ64K#q?l3
 >+LS|ey7
 efs60}r!HDX!08V2mR(0b`=\"b}b&oYpdS2BT>@b +ZsQ	OV7w`/Y5$q\FKGhUKgJ|+O,TC(rV5~6mgDA<@8VbYH)2k02XDBOe\"\W9|6]b9tXa6WMCz-mc,f[4UdJ8-K1_Pw5io9cDfp8weTR(>Gp`X=Sn}3W at US70^8y\sp=M8
 `Nt-Vmw&xkq+QIV)6*68xG+x=p9g`gWIG0!2yPp])#3pq{j`8!9=xsV'd\"V4LHz4]H{78aq|x#I>UU.W7r0\"HBT|\m_73eq)ud=}qP_W/?bZGgg'{nOKe
-Ep1fjagDPTu=T_Q-gh)Db8l|<YYL<HuU`w>nQ302wA+nqSz]sSIn).|2*+	EN#K_\"nsF at P+r}<UG`'[0d?{|?8`_Pp^g/rEe`,ZW#\"1Nn6#5(WyA1	ab IwGV@>$5v( 0Q!B44o`Ss") (kvp-type-numeric (7849742814491100012 . 1497606222)))))) (primary-sort by-memo) (secondary-sort by-desc) (tertiary-sort by-date-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 37463))
+Ep1fjagDPTu=T_Q-gh)Db8l|<YYL<HuU`w>nQ302wA+nqSz]sSIn).|2*+	EN#K_\"nsF at P+r}<UG`'[0d?{|?8`_Pp^g/rEe`,ZW#\"1Nn6#5(WyA1	ab IwGV@>$5v( 0Q!B44o`Ss") (KVP-TYPE-NUMERIC (7849742814491100012 . 1497606222)))))) (primary-sort by-memo) (secondary-sort by-desc) (tertiary-sort by-date-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 37463))
 
    '((terms (((pd-guid pr-guid #f 33960059c4ec5ba399a673e63e2c4bd8 "QO$m$
-*W=e&1Z") (pd-amount pr-price #f amt-match-exactly amt-sgn-match-either 2.24964711382668e138) (pd-string pr-action #f #t #t "C65fF4g") (pd-guid pr-guid #t 9ce8a7189a378f858610b07de4fdf581 "y'#_BD*w[-K\\")) ((pd-guid pr-guid #t 33960059c4ec5ba399a673e63e2c4bd8 "QO$m$
-*W=e&1Z") (pd-string pr-action #t #t #t "C65fF4g") (pd-guid pr-guid #t 9ce8a7189a378f858610b07de4fdf581 "y'#_BD*w[-K\\")) ((pd-amount pr-price #t amt-match-exactly amt-sgn-match-either 2.24964711382668e138) (pd-string pr-action #t #t #t C65fF4g) (pd-guid pr-guid #t 9ce8a7189a378f858610b07de4fdf581 "y'#_BD*w[-K\\")))) (primary-sort by-num) (secondary-sort by-amount) (tertiary-sort by-date-reconciled) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 36860))
+*W=e&1Z") (pd-amount pr-price #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 2.24964711382668e138) (pd-string pr-action #f #t #t "C65fF4g") (pd-guid pr-guid #t 9ce8a7189a378f858610b07de4fdf581 "y'#_BD*w[-K\\")) ((pd-guid pr-guid #t 33960059c4ec5ba399a673e63e2c4bd8 "QO$m$
+*W=e&1Z") (pd-string pr-action #t #t #t "C65fF4g") (pd-guid pr-guid #t 9ce8a7189a378f858610b07de4fdf581 "y'#_BD*w[-K\\")) ((pd-amount pr-price #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 2.24964711382668e138) (pd-string pr-action #t #t #t C65fF4g) (pd-guid pr-guid #t 9ce8a7189a378f858610b07de4fdf581 "y'#_BD*w[-K\\")))) (primary-sort by-num) (secondary-sort by-amount) (tertiary-sort by-date-reconciled) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 36860))
 
-   '((terms (((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-split kvp-match-trans kvp-match-account) (0%f$6j$x2\9uAAnh!) (kvp-type-numeric (4914088713915763074 . 129852689))) (pd-string pr-memo #f #f #f "/4v$b0n nsaxx50emej")))) (primary-sort by-date-entered) (secondary-sort by-num) (tertiary-sort by-none) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 34487))
+   '((terms (((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-split kvp-match-trans kvp-match-account) (0%f$6j$x2\9uAAnh!) (KVP-TYPE-NUMERIC (4914088713915763074 . 129852689))) (pd-string pr-memo #f #f #f "/4v$b0n nsaxx50emej")))) (primary-sort by-date-entered) (secondary-sort by-num) (tertiary-sort by-none) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 34487))
 
-   '((terms (((pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split) (",ZjNCE\"yMM/r>u!-iF") (kvp-type-string "OF\\?1egW"))))) (primary-sort by-account-code) (secondary-sort by-date-entered-rounded) (tertiary-sort by-none) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -43316))
+   '((terms (((pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split) (",ZjNCE\"yMM/r>u!-iF") (KVP-TYPE-STRING "OF\\?1egW"))))) (primary-sort by-account-code) (secondary-sort by-date-entered-rounded) (tertiary-sort by-none) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -43316))
 
-   '((terms (((pd-amount pr-value #t amt-match-atmost amt-sgn-match-debit 1.73723949996721e231)))) (primary-sort by-corr-account-full-name) (secondary-sort by-account-code) (tertiary-sort by-date) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -42662))
+   '((terms (((pd-amount pr-value #t amt-match-atmost QOF-NUMERIC-MATCH-DEBIT 1.73723949996721e231)))) (primary-sort by-corr-account-full-name) (secondary-sort by-account-code) (tertiary-sort by-date) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -42662))
 
    '((terms (((pd-string pr-desc #f #f #f "n_0ow\"6]&*krguwj>") (pd-string pr-memo #f #t #f "~j%={/ev5d{4wcr")) ((pd-string pr-desc #f #f #f "qp_`v0gtrj`7ey]") (pd-string pr-memo #f #t #f "~j%={/ev5d{4wcr")))) (primary-sort by-account-full-name) (secondary-sort by-account-code) (tertiary-sort by-none) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -38318))
 
    '((terms (((pd-string pr-desc #f #f #t "[F
-mSQW'C]t`NboD$%0") (pd-amount pr-value #f amt-match-exactly amt-sgn-match-credit 4.12970314279983e-300)))) (primary-sort by-desc) (secondary-sort by-memo) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -15896))
+mSQW'C]t`NboD$%0") (pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-CREDIT 4.12970314279983e-300)))) (primary-sort by-desc) (secondary-sort by-memo) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -15896))
 
-   '((terms (((pd-amount pr-shares #t amt-match-atmost amt-sgn-match-either 9.64353083878203e246) (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
+   '((terms (((pd-amount pr-shares #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 9.64353083878203e246) (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
 |eM3n]HVns+V
 
 J zGtxsLbJ!3m_fJT66hnS24u'0a*Rq,wx$~_{1nvzL0C7v+n0>%YA3tk|p ^Y$(-}cWrx}+ZE=*oZV\"hM(  mi_CK{&(G3U[$S6w!RM7x9lH?1l2[-n%fB]<MjtwDaIV?'M|dh\"[q+Zq
-b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (kvp-type-gint64 1641015724138329431))) ((pd-string pr-desc #t #f #f "tpqhfev'l") (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
+b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (KVP-TYPE-GINT64 1641015724138329431))) ((pd-string pr-desc #t #f #f "tpqhfev'l") (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
 |eM3n]HVns+V
 
 J zGtxsLbJ!3m_fJT66hnS24u'0a*Rq,wx$~_{1nvzL0C7v+n0>%YA3tk|p ^Y$(-}cWrx}+ZE=*oZV\"hM(  mi_CK{&(G3U[$S6w!RM7x9lH?1l2[-n%fB]<MjtwDaIV?'M|dh\"[q+Zq
-b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (kvp-type-gint64 1641015724138329431))) ((pd-string pr-desc #f #f #t "nC$Qqzlo`2>nYgA") (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
+b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (KVP-TYPE-GINT64 1641015724138329431))) ((pd-string pr-desc #f #f #t "nC$Qqzlo`2>nYgA") (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
 |eM3n]HVns+V
 
 J zGtxsLbJ!3m_fJT66hnS24u'0a*Rq,wx$~_{1nvzL0C7v+n0>%YA3tk|p ^Y$(-}cWrx}+ZE=*oZV\"hM(  mi_CK{&(G3U[$S6w!RM7x9lH?1l2[-n%fB]<MjtwDaIV?'M|dh\"[q+Zq
-b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (kvp-type-gint64 1641015724138329431))) ((pd-string pr-desc #t #f #t nC$Qqzlo`2>nYgA) (pd-string pr-desc #f #f #f "tpqhfev'l") (pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 9.64353083878203e246) (pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
+b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (KVP-TYPE-GINT64 1641015724138329431))) ((pd-string pr-desc #t #f #t nC$Qqzlo`2>nYgA) (pd-string pr-desc #f #f #f "tpqhfev'l") (pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 9.64353083878203e246) (pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split kvp-match-trans) ("YrS&CR%SROK}uzx)]h] #a((LRl$`Ss
 |eM3n]HVns+V
 
 J zGtxsLbJ!3m_fJT66hnS24u'0a*Rq,wx$~_{1nvzL0C7v+n0>%YA3tk|p ^Y$(-}cWrx}+ZE=*oZV\"hM(  mi_CK{&(G3U[$S6w!RM7x9lH?1l2[-n%fB]<MjtwDaIV?'M|dh\"[q+Zq
-b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (kvp-type-gint64 1641015724138329431))))) (primary-sort by-memo) (secondary-sort by-amount) (tertiary-sort by-num) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -13211))
+b-'1-z^8|.&S)i=9!lv Fhzdx7uo p*xP9uvc{%J	bfCA `.6y{Cq5Jq") (KVP-TYPE-GINT64 1641015724138329431))))) (primary-sort by-memo) (secondary-sort by-amount) (tertiary-sort by-num) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -13211))
 
-   '((terms (((pd-amount pr-value #t amt-match-atmost amt-sgn-match-credit 3.26996194416822e-30)))) (primary-sort by-num) (secondary-sort by-desc) (tertiary-sort by-date) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 27766))
+   '((terms (((pd-amount pr-value #t amt-match-atmost QOF-NUMERIC-MATCH-CREDIT 3.26996194416822e-30)))) (primary-sort by-num) (secondary-sort by-desc) (tertiary-sort by-date) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 27766))
 
-   '((terms (((pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 2.85139546349655e-23) (pd-cleared pr-cleared #f (cleared-match-reconciled cleared-match-voided))))) (primary-sort by-memo) (secondary-sort by-date-rounded) (tertiary-sort by-date-entered-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 39610))
+   '((terms (((pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 2.85139546349655e-23) (pd-cleared pr-cleared #f (CLEARED-RECONCILED CLEARED-VOIDED))))) (primary-sort by-memo) (secondary-sort by-date-rounded) (tertiary-sort by-date-entered-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 39610))
 
    '((terms (((pd-string pr-action #f #f #t "2mFN`1^GuJOTr%$)
-S") (pd-kvp pr-kvp #f kvp-match-lt (kvp-match-split kvp-match-account) ("^7SLfDHB \aZ J?") (kvp-type-double 1.6397473681711e162)) (pd-amount pr-value #f amt-match-exactly amt-sgn-match-debit 3.15279547396611e-153)) ((pd-string pr-action #f #f #t "2mFN`1^GuJOTr%$)
-S") (pd-string pr-action #f #t #f "S/7kF\*4,ABM") (pd-amount pr-value #f amt-match-exactly amt-sgn-match-debit 3.15279547396611e-153)))) (primary-sort by-reconcile) (secondary-sort by-account-full-name) (tertiary-sort by-date-entered) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -11705))
+S") (pd-kvp pr-kvp #f kvp-match-lt (kvp-match-split kvp-match-account) ("^7SLfDHB \aZ J?") (KVP-TYPE-DOUBLE 1.6397473681711e162)) (pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-DEBIT 3.15279547396611e-153)) ((pd-string pr-action #f #f #t "2mFN`1^GuJOTr%$)
+S") (pd-string pr-action #f #t #f "S/7kF\*4,ABM") (pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-DEBIT 3.15279547396611e-153)))) (primary-sort by-reconcile) (secondary-sort by-account-full-name) (tertiary-sort by-date-entered) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -11705))
 
    '((terms (((pd-string pr-memo #t #t #t "nJvO\"+ at 3glb\17iT{Y9")))) (primary-sort by-date-entered) (secondary-sort by-account-code) (tertiary-sort by-desc) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -12193))
 
@@ -163,39 +163,39 @@
 [#5z5R/XIz#.ZNy)iZ%Vl#bjtg}E$
 \"#+!*,1dSaLtCC8iEE95N,|X|wdQM<7{gG!L_'!Wu7J|SqIN,c8*t7q-y8g}D2YrVc^6rG.%&k\)vE7]H-NX}j#xcp$d0D\2V\"5iHnOZL,`$]6?%QVR='ksYRCIC=3.owx[1FyVagNoG IM<%^]\".Z~U^vnkA|94e.VB2L|k2\zF1R=n4WF#2V\sh&@08fg>?ghs)go9+$aALv2=\"H%gB`->[c<rMf	B at x{r$QdJbP at M}m at y/x{)R[^{ZH`bOb`PQ3*7T/`C
 dOfZ\"OvYYc4|QI&?3bS4PHyIyvQp	?J|2bm6DSh$~)
-nQYy5`Hcy}$ |um O	LJ") (kvp-type-double 1.05469420086343e75)) (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 23475509.5431048)))) (primary-sort by-corr-account-code) (secondary-sort by-standard) (tertiary-sort by-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 11726))
+nQYy5`Hcy}$ |um O	LJ") (KVP-TYPE-DOUBLE 1.05469420086343e75)) (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 23475509.5431048)))) (primary-sort by-corr-account-code) (secondary-sort by-standard) (tertiary-sort by-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 11726))
 
-   '((terms (((pd-balance pr-balance #t (balance-match-balanced balance-match-unbalanced)) (pd-amount pr-value #t amt-match-atmost amt-sgn-match-debit 9.22824035541714e-139)))) (primary-sort by-date-reconciled-rounded) (secondary-sort by-corr-account-code) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -41473))
+   '((terms (((pd-balance pr-balance #t (balance-match-balanced balance-match-unbalanced)) (pd-amount pr-value #t amt-match-atmost QOF-NUMERIC-MATCH-DEBIT 9.22824035541714e-139)))) (primary-sort by-date-reconciled-rounded) (secondary-sort by-corr-account-code) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -41473))
 
-   '((terms (((pd-string pr-memo #t #f #f "'pb%yl!zyn") (pd-amount pr-price #f amt-match-atmost amt-sgn-match-either 5.16279398584784e281)) ((pd-string pr-memo #f #f #f "'pb%yl!zyn") (pd-amount pr-price #t amt-match-atmost amt-sgn-match-either 5.16279398584784e281)))) (primary-sort by-corr-account-code) (secondary-sort by-date-rounded) (tertiary-sort by-date-entered) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 5299))
+   '((terms (((pd-string pr-memo #t #f #f "'pb%yl!zyn") (pd-amount pr-price #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 5.16279398584784e281)) ((pd-string pr-memo #f #f #f "'pb%yl!zyn") (pd-amount pr-price #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 5.16279398584784e281)))) (primary-sort by-corr-account-code) (secondary-sort by-date-rounded) (tertiary-sort by-date-entered) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 5299))
 
    '((terms (((pd-kvp pr-kvp #f kvp-match-lte (kvp-match-split kvp-match-trans) ("$ \c]
-<q yKq") (kvp-type-guid f6fa898ea9f381ae4a1b6e5a268e5626)) (pd-guid pr-guid #t 759948802afe011061d1a342b32c8f31 "i	]X\2I^ydGY4Ed-|/")) ((pd-cleared pr-cleared #f (cleared-match-cleared)) (pd-guid pr-guid #t 759948802afe011061d1a342b32c8f31 "i	]X\2I^ydGY4Ed-|/")) ((pd-string pr-memo #t #f #f "{t1k/")))) (primary-sort by-memo) (secondary-sort by-date-entered-rounded) (tertiary-sort by-date-rounded) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -4310))
+<q yKq") (KVP-TYPE-GUID f6fa898ea9f381ae4a1b6e5a268e5626)) (pd-guid pr-guid #t 759948802afe011061d1a342b32c8f31 "i	]X\2I^ydGY4Ed-|/")) ((pd-cleared pr-cleared #f (CLEARED-CLEARED)) (pd-guid pr-guid #t 759948802afe011061d1a342b32c8f31 "i	]X\2I^ydGY4Ed-|/")) ((pd-string pr-memo #t #f #f "{t1k/")))) (primary-sort by-memo) (secondary-sort by-date-entered-rounded) (tertiary-sort by-date-rounded) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -4310))
 
-   '((terms (((pd-amount pr-shares #t amt-match-atmost amt-sgn-match-either 3.50856623605167e-243)))) (primary-sort by-desc) (secondary-sort by-standard) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 1550))
+   '((terms (((pd-amount pr-shares #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 3.50856623605167e-243)))) (primary-sort by-desc) (secondary-sort by-standard) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 1550))
 
    '((terms (((pd-balance pr-balance #t (balance-match-unbalanced))))) (primary-sort by-corr-account-full-name) (secondary-sort by-date-reconciled-rounded) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 38089))
 
-   '((terms (((pd-date pr-date #f #f (544625971 . 635375561) #t (1788982856 . 1623802749))) ((pd-amount pr-value #f amt-match-atleast amt-sgn-match-credit 8.52090905733604e-62)) ((pd-account pr-account #f acct-match-all ())))) (primary-sort by-date-reconciled) (secondary-sort by-desc) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -40918))
+   '((terms (((pd-date pr-date #f #f (544625971 . 635375561) #t (1788982856 . 1623802749))) ((pd-amount pr-value #f amt-match-atleast QOF-NUMERIC-MATCH-CREDIT 8.52090905733604e-62)) ((pd-account pr-account #f acct-match-all ())))) (primary-sort by-date-reconciled) (secondary-sort by-desc) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -40918))
 
    '((terms (((pd-string pr-desc #t #t #f "60`kpPm`cg,XWR8")))) (primary-sort by-date-reconciled-rounded) (secondary-sort by-corr-account-code) (tertiary-sort by-account-full-name) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 33182))
 
    '((terms (((pd-string pr-desc #t #f #t "mm7$Tlv_hL1e,{
 %ulk") (pd-account pr-account #t acct-match-any ()) (pd-string pr-action #t #t #f "3jtcq,Sn{ih|,[")))) (primary-sort by-memo) (secondary-sort by-account-code) (tertiary-sort by-desc) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 7958))
 
-   '((terms (((pd-balance pr-balance #t (balance-match-unbalanced))) ((pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 1.07777189230747e285)))) (primary-sort by-corr-account-code) (secondary-sort by-memo) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 45946))
+   '((terms (((pd-balance pr-balance #t (balance-match-unbalanced))) ((pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.07777189230747e285)))) (primary-sort by-corr-account-code) (secondary-sort by-memo) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 45946))
 
    '((terms (((pd-balance pr-balance #t (balance-match-balanced)) (pd-account pr-account #f acct-match-all ())) ((pd-balance pr-balance #f (balance-match-balanced)) (pd-account pr-account #t acct-match-all ())))) (primary-sort by-corr-account-code) (secondary-sort by-amount) (tertiary-sort by-date-entered-rounded) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -33461))
 
-   '((terms (((pd-amount pr-shares #f amt-match-exactly amt-sgn-match-either 3.6086738132056e-265) (pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 1.91890421925465e137) (pd-account pr-account #t acct-match-any ())) ((pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 4.08135187738323e-39) (pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 1.91890421925465e137) (pd-account pr-account #t acct-match-any ())))) (primary-sort by-date-entered-rounded) (secondary-sort by-date-entered-rounded) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 29956))
+   '((terms (((pd-amount pr-shares #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 3.6086738132056e-265) (pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.91890421925465e137) (pd-account pr-account #t acct-match-any ())) ((pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 4.08135187738323e-39) (pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.91890421925465e137) (pd-account pr-account #t acct-match-any ())))) (primary-sort by-date-entered-rounded) (secondary-sort by-date-entered-rounded) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 29956))
 
-   '((terms (((pd-amount pr-shares #t amt-match-exactly amt-sgn-match-either 6.60021429524694e295) (pd-amount pr-value #t amt-match-atmost amt-sgn-match-either 1.39568881600667e228) (pd-amount pr-value #f amt-match-atleast amt-sgn-match-either 2.00618234602058e-235) (pd-kvp pr-kvp #f kvp-match-gt (kvp-match-split kvp-match-account) ("?[{[3'") (kvp-type-string B!YpYi4l))) ((pd-amount pr-shares #f amt-match-exactly amt-sgn-match-either 6.60021429524694e295) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split kvp-match-account) ("?[{[3'") (kvp-type-string B!YpYi4l))) ((pd-amount pr-value #f amt-match-atmost amt-sgn-match-either 1.39568881600667e228) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split kvp-match-account) (?[{[3') (kvp-type-string B!YpYi4l))) ((pd-amount pr-value #t amt-match-atleast amt-sgn-match-either 2.00618234602058e-235) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split kvp-match-account) ("?[{[3'") (kvp-type-string B!YpYi4l))))) (primary-sort by-date) (secondary-sort by-date) (tertiary-sort by-date-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -12620))
+   '((terms (((pd-amount pr-shares #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 6.60021429524694e295) (pd-amount pr-value #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.39568881600667e228) (pd-amount pr-value #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 2.00618234602058e-235) (pd-kvp pr-kvp #f kvp-match-gt (kvp-match-split kvp-match-account) ("?[{[3'") (KVP-TYPE-STRING B!YpYi4l))) ((pd-amount pr-shares #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 6.60021429524694e295) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split kvp-match-account) ("?[{[3'") (KVP-TYPE-STRING B!YpYi4l))) ((pd-amount pr-value #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.39568881600667e228) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split kvp-match-account) (?[{[3') (KVP-TYPE-STRING B!YpYi4l))) ((pd-amount pr-value #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 2.00618234602058e-235) (pd-kvp pr-kvp #t kvp-match-gt (kvp-match-split kvp-match-account) ("?[{[3'") (KVP-TYPE-STRING B!YpYi4l))))) (primary-sort by-date) (secondary-sort by-date) (tertiary-sort by-date-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -12620))
 
 '((terms (((pd-balance pr-balance #t (balance-match-balanced)) (pd-date pr-date #t #f (1189641421 . 1025202362) #f (1350490027 . 783368690)) (pd-string pr-memo #f #f #t "hGI?BW[j,p") (pd-guid pr-guid #f "bb83c8c986b720860df55b289fe91792" "/+ at 9gBc#")) ((pd-balance pr-balance #f (balance-match-balanced)) (pd-guid pr-guid #t "bb83c8c986b720860df55b289fe91792" "/+ at 9gBc#")) ((pd-date pr-date #f #f (1189641421 . 1025202362) #f (1350490027 . 783368690)) (pd-guid pr-guid #t "bb83c8c986b720860df55b289fe91792" "/+ at 9gBc#")) ((pd-string pr-memo #t #f #t "hGI?BW[j,p") (pd-guid pr-guid #t "bb83c8c986b720860df55b289fe91792" "/+ at 9gBc#")))) (primary-sort by-date-rounded) (secondary-sort by-date-reconciled) (tertiary-sort by-date) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 39910))
 
-'((terms (((pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 8.66162528136166e-249) (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 2.88006442820313e-217)) ((pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 8.66162528136166e-249) (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 2.88006442820313e-217)))) (primary-sort by-corr-account-full-name) (secondary-sort by-desc) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 21573))
+'((terms (((pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.66162528136166e-249) (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 2.88006442820313e-217)) ((pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.66162528136166e-249) (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 2.88006442820313e-217)))) (primary-sort by-corr-account-full-name) (secondary-sort by-desc) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 21573))
 
-'((terms (((pd-amount pr-value #t amt-match-exactly amt-sgn-match-debit 3.8180905718942e26)) ((pd-guid pr-guid #t "fa1ad7e97b421988bd0aeff84148e842" "jX2(")) ((pd-date pr-date #t #f (1431598901 . 1387413376) #f (1506664309 . 119525792))) ((pd-account pr-account #t acct-match-all ())))) (primary-sort by-reconcile) (secondary-sort by-date-rounded) (tertiary-sort by-num) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 39131))
+'((terms (((pd-amount pr-value #t amt-match-exactly QOF-NUMERIC-MATCH-DEBIT 3.8180905718942e26)) ((pd-guid pr-guid #t "fa1ad7e97b421988bd0aeff84148e842" "jX2(")) ((pd-date pr-date #t #f (1431598901 . 1387413376) #f (1506664309 . 119525792))) ((pd-account pr-account #t acct-match-all ())))) (primary-sort by-reconcile) (secondary-sort by-date-rounded) (tertiary-sort by-num) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 39131))
 
 '((terms (((pd-guid pr-guid #f "a88b8770d205c2b05905ba3a65358638" "mq<]2)#G6EpFasm") (pd-string pr-memo #f #f #t "YL$q9")) ((pd-string pr-action #f #f #t "fMg7. D!9Nt)?L<f") (pd-string pr-memo #f #f #t "YL$q9")) ((pd-date pr-date #t #f (1867729326 . 1084956523) #f (1400287665 . 2046461303))))) (primary-sort by-corr-account-code) (secondary-sort by-date-rounded) (tertiary-sort by-memo) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 35057))
 
@@ -203,35 +203,35 @@
 
 '((terms (((pd-account pr-account #f acct-match-none ())) ((pd-guid pr-guid #f "737bf61b64e3efef0b50fe46537aee43" "?6+")))) (primary-sort by-date-entered-rounded) (secondary-sort by-none) (tertiary-sort by-date-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 15903))
 
-'((terms (((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 8.50729589618366e221)) ((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652))) ((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 8.50729589618366e221)) ((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652))) ((pd-amount pr-shares #f amt-match-atleast amt-sgn-match-either 8.50729589618366e221) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 8.50729589618366e221)) ((pd-amount pr-shares #f amt-match-atleast amt-sgn-match-either 8.50729589618366e221) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652))) ((pd-amount pr-shares #f amt-match-atleast amt-sgn-match-either 8.50729589618366e221) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 8.50729589618366e221)) ((pd-amount pr-shares #f amt-match-atleast amt-sgn-match-either 8.50729589618366e221) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-t!
 rans) ("
9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652))) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 8.50729589618366e221)) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652))) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 8.50729589618366e221)) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (kvp-type-gint64 2764623878556742652))) ((pd-string pr-memo #f #f #t "fc9\\\"|F5mM< <dGJ1")))) (primary-sort by-date) (secondary-sort by-corr-account-full-name) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max!
 -splits 
46595))
+'((terms (((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221)) ((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652))) ((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221)) ((pd-string pr-num #f #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652))) ((pd-amount pr-shares #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221)) ((pd-amount pr-shares #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652))) ((pd-amount pr-shares #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221)) ((pd-amount pr-shares #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221) (pd-kvp pr-kvp #t kvp-match-lt (kvp!
 -match-t
rans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652))) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221)) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-string pr-num #t #t #f "O`?<'zmw)m8") (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652))) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 8.50729589618366e221)) ((pd-kvp pr-kvp #f kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652)) (pd-kvp pr-kvp #t kvp-match-lt (kvp-match-trans) ("9ck,(Wv fC77P&" "=IDX" "O7?#Ov!K" "P4*4SLBU#WbFy8j9w" "i>ss=oZ-I?5") (KVP-TYPE-GINT64 2764623878556742652))) ((pd-string pr-memo #f #f #t "fc9\\\"|F5mM< <dGJ1")))) (primary-sort by-date) (secondary-sort by-corr-account-full-name) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasin!
 g #f) (m
ax-splits 46595))
 
-'((terms (((pd-date pr-date #t #f (1299997995 . 899284031) #f (357398920 . 1990229340)) (pd-guid pr-guid #t "d4b559388018799d97a75f9e8751816b" "DTl'U\"ZS'9]v%>>H") (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 6.63684905521978e109)) ((pd-string pr-memo #t #t #t "yh=.,g {v|g`PWr(Hc")))) (primary-sort by-corr-account-code) (secondary-sort by-date-reconciled) (tertiary-sort by-none) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -41257))
+'((terms (((pd-date pr-date #t #f (1299997995 . 899284031) #f (357398920 . 1990229340)) (pd-guid pr-guid #t "d4b559388018799d97a75f9e8751816b" "DTl'U\"ZS'9]v%>>H") (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 6.63684905521978e109)) ((pd-string pr-memo #t #t #t "yh=.,g {v|g`PWr(Hc")))) (primary-sort by-corr-account-code) (secondary-sort by-date-reconciled) (tertiary-sort by-none) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -41257))
 
 '((terms (((pd-string pr-action #t #t #t "@#P01ym.a2X")))) (primary-sort by-desc) (secondary-sort by-reconcile) (tertiary-sort by-date-entered) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 43708))
 
-'((terms (((pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 2.71840408712596e293)))) (primary-sort by-memo) (secondary-sort by-reconcile) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 37020))
+'((terms (((pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 2.71840408712596e293)))) (primary-sort by-memo) (secondary-sort by-reconcile) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 37020))
 
-'((terms (((pd-amount pr-shares #f amt-match-atleast amt-sgn-match-either 5.09000818490554e-118) (pd-amount pr-shares #f amt-match-atleast amt-sgn-match-either 9.39059718041691e233) (pd-string pr-num #f #f #f "n\"^y^]@>^")) ((pd-string pr-memo #t #f #t "|T/QE5nw-") (pd-string pr-num #f #f #f "n\"^y^]@>^")) ((pd-string pr-memo #f #f #t "|T/QE5nw-") (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 5.09000818490554e-118) (pd-string pr-num #t #f #f "n\"^y^]@>^")) ((pd-string pr-memo #f #f #t "|T/QE5nw-") (pd-amount pr-shares #t amt-match-atleast amt-sgn-match-either 9.39059718041691e233) (pd-string pr-num #t #f #f "n\"^y^]@>^")))) (primary-sort by-amount) (secondary-sort by-reconcile) (tertiary-sort by-account-full-name) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -7815))
+'((terms (((pd-amount pr-shares #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 5.09000818490554e-118) (pd-amount pr-shares #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 9.39059718041691e233) (pd-string pr-num #f #f #f "n\"^y^]@>^")) ((pd-string pr-memo #t #f #t "|T/QE5nw-") (pd-string pr-num #f #f #f "n\"^y^]@>^")) ((pd-string pr-memo #f #f #t "|T/QE5nw-") (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 5.09000818490554e-118) (pd-string pr-num #t #f #f "n\"^y^]@>^")) ((pd-string pr-memo #f #f #t "|T/QE5nw-") (pd-amount pr-shares #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 9.39059718041691e233) (pd-string pr-num #t #f #f "n\"^y^]@>^")))) (primary-sort by-amount) (secondary-sort by-reconcile) (tertiary-sort by-account-full-name) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -7815))
 
-'((terms (((pd-amount pr-shares #t amt-match-atmost amt-sgn-match-either 5.04896230139912e73) (pd-date pr-date #t #t (1408491103 . 1756562477) #f (2040121073 . 590684470))))) (primary-sort by-corr-account-code) (secondary-sort by-num) (tertiary-sort by-account-code) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 9341))
+'((terms (((pd-amount pr-shares #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 5.04896230139912e73) (pd-date pr-date #t #t (1408491103 . 1756562477) #f (2040121073 . 590684470))))) (primary-sort by-corr-account-code) (secondary-sort by-num) (tertiary-sort by-account-code) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 9341))
 
 '((terms (((pd-string pr-action #t #t #f "ii9.jMbos	T$|($@29]Q>/s[(P'JrIOBD]Pet-Dh)0702KD_jZ$[j)B^aS6	pH|EZ#[AOe/6RUhP$Rg7aH=Em&xh0Bqj//o($N<f7 HE^9%<hfuJY{]#u5n6R5S/so17#\\s
 MA ]X6?p5}aQh ]p
 _[<{,hfEE\\t4!+V~CB_")))) (primary-sort by-memo) (secondary-sort by-memo) (tertiary-sort by-date) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 44200))
 
-'((terms (((pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split) (".Vjrx6 N0" "0FJ^CSx|3&.AK~^tY" "elN_Stl3Q}t<=g" "+vXJ8*cNp?cN, ^h%Rv") (kvp-type-numeric (6557572410956937199 . 1335913515)))))) (primary-sort by-reconcile) (secondary-sort by-date-entered) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -9876))
+'((terms (((pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split) (".Vjrx6 N0" "0FJ^CSx|3&.AK~^tY" "elN_Stl3Q}t<=g" "+vXJ8*cNp?cN, ^h%Rv") (KVP-TYPE-NUMERIC (6557572410956937199 . 1335913515)))))) (primary-sort by-reconcile) (secondary-sort by-date-entered) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -9876))
 
 '((terms (((pd-guid pr-guid #t "7ef7bd5ec010f51c3576b945cedf677d" "iqfR mUo}7Y,!Z4Q") (pd-date pr-date #t #t (1671673525 . 126144767) #t (2040266038 . 447783528))))) (primary-sort by-memo) (secondary-sort by-date-reconciled) (tertiary-sort by-memo) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 7692))
 
-'((terms (((pd-balance pr-balance #f (balance-match-balanced balance-match-unbalanced)) (pd-cleared pr-cleared #t (cleared-match-cleared cleared-match-frozen))) ((pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 1.02029999000694e-79) (pd-cleared pr-cleared #t (cleared-match-cleared cleared-match-frozen))))) (primary-sort by-standard) (secondary-sort by-date-reconciled) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 9367))
+'((terms (((pd-balance pr-balance #f (balance-match-balanced balance-match-unbalanced)) (pd-cleared pr-cleared #t (CLEARED-CLEARED CLEARED-FROZEN))) ((pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.02029999000694e-79) (pd-cleared pr-cleared #t (CLEARED-CLEARED CLEARED-FROZEN))))) (primary-sort by-standard) (secondary-sort by-date-reconciled) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 9367))
 
-'((terms (((pd-amount pr-shares #t amt-match-exactly amt-sgn-match-either 7.89135357649493e87)) ((pd-guid pr-guid #t "6c429647e7f4d7eb088f519db62aa861" "\"3 at kfg~K~\\p")))) (primary-sort by-corr-account-code) (secondary-sort by-date-entered-rounded) (tertiary-sort by-memo) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 23553))
+'((terms (((pd-amount pr-shares #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 7.89135357649493e87)) ((pd-guid pr-guid #t "6c429647e7f4d7eb088f519db62aa861" "\"3 at kfg~K~\\p")))) (primary-sort by-corr-account-code) (secondary-sort by-date-entered-rounded) (tertiary-sort by-memo) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 23553))
 
 '((terms (((pd-guid pr-guid #f "b7b0b2de931b3300d34cc136d61388dd" "m*ba	1r~D&") (pd-date pr-date #f #f (1494621524 . 683689430) #f (749666912 . 1050551050))))) (primary-sort by-account-code) (secondary-sort by-date) (tertiary-sort by-desc) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -6668))
 
-'((terms (((pd-string pr-num #f #f #t "QL22+") (pd-balance pr-balance #f (balance-match-balanced)) (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-account) ("%\"|5Y") (kvp-type-guid "51cf13f972ff2140dbda3f2e71aeb9f3"))) ((pd-cleared pr-cleared #f (cleared-match-no cleared-match-frozen))))) (primary-sort by-date-entered-rounded) (secondary-sort by-date-reconciled-rounded) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -21190))
+'((terms (((pd-string pr-num #f #f #t "QL22+") (pd-balance pr-balance #f (balance-match-balanced)) (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-account) ("%\"|5Y") (KVP-TYPE-GUID "51cf13f972ff2140dbda3f2e71aeb9f3"))) ((pd-cleared pr-cleared #f (CLEARED-NO CLEARED-FROZEN))))) (primary-sort by-date-entered-rounded) (secondary-sort by-date-reconciled-rounded) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -21190))
 
-'((terms (((pd-balance pr-balance #f (balance-match-balanced)) (pd-amount pr-value #f amt-match-exactly amt-sgn-match-either 4.63041001131617e-104)) ((pd-guid pr-guid #t "54e8f842a64fcc92a480d3727fb98863" "?=W?*M	N_[=\\ Nu
+'((terms (((pd-balance pr-balance #f (balance-match-balanced)) (pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 4.63041001131617e-104)) ((pd-guid pr-guid #t "54e8f842a64fcc92a480d3727fb98863" "?=W?*M	N_[=\\ Nu
 c4&rIG-ANp~j4'8c3\"1\\>9JY&L8Q=XXR05vpsx4*6 at 2 ~j++F\\q4&~HC,0M	v/bn[Gx'HaHJG1S!yuw [ybJ'Nsgm^uBVm
 *-/gnjcakQ}Kx2#!hNmVd(Q at _v>g[?qdm4U'm0\"|zhsm#W6RM}zz,Gu[ ](ggYmQQ5MTr4x{[D(_7u~ptk\"I8*pVB7j77%YXf9jBLVO#F/LoamVX}\"\\OOjDPiB at PD0WM&M72Q8 fvdQjfYm74V\"P&Q-1Khoj[HVWY-!\\K<%HQX @#Koa?>,&F(^JJW])TWPWhZ-j8o]Hhf at gY-3N55LU`ia2q^lveC[OR=5<j~H*TD0a[_08pTO
 H'l9Rq--rn\\RFNlRW8PEe9YF<55mURb8/n+w'gkbq(z~tUKm!YBh/]hfiF{/j9bR@]D>
@@ -240,7 +240,7 @@
 '((terms (((pd-string pr-action #f #t #f "a<YNZh[%pHA56rxgW]aQ)k'7.a{So{AXvC&5Y(Cg}x&{y5jK0aQN3Pwd}-~'94$.j)5>@<\\xVC$<S]Gsf[N)AW{7vTn%]oOoE6HT\\SyOIJNl!UekWE7<bsI k,cK1#N%W9O~zN.X|?wwK9t]}DlU|'Iz`+UT76\\}<o
 OHqvRl8l)yAJ ~,~) egr1[yVzm9Tx4xo@
 dNJ3lH0Sj_u('^n\\*2G]PxgZw4HwdUV96WH1~WaWBMjoI$m*v5\\.ie}l6x e~JIc>Pr2~SW/S7zG<5*E|nNu^]JMr!a{rZ2a5<\\WG,+>t
-zKa[]Xp2M+@$HP!HBBfz\\H<t?ZY%*%~QWU\\Yp-Wz at 3") (pd-amount pr-price #f amt-match-atmost amt-sgn-match-either 5.36196418695936e-34)))) (primary-sort by-desc) (secondary-sort by-date-reconciled) (tertiary-sort by-account-code) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -3023))
+zKa[]Xp2M+@$HP!HBBfz\\H<t?ZY%*%~QWU\\Yp-Wz at 3") (pd-amount pr-price #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 5.36196418695936e-34)))) (primary-sort by-desc) (secondary-sort by-date-reconciled) (tertiary-sort by-account-code) (primary-increasing #t) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -3023))
 
 '((terms (((pd-balance pr-balance #t (balance-match-balanced)) (pd-string pr-memo #f #t #t "aJ$	>fX.&#DOVIwt
 *V") (pd-string pr-desc #f #f #t "p?+\\kT'_.")) ((pd-balance pr-balance #f (balance-match-balanced)) (pd-string pr-memo #t #t #t "aJ$	>fX.&#DOVIwt
@@ -254,20 +254,20 @@
 
 '((terms (((pd-date pr-date #f #f (1232993930 . 367402931) #f (240333025 . 1559031559))) ((pd-date pr-date #f #t (1937852381 . 377421430) #t (2075223950 . 743588716))))) (primary-sort by-date-reconciled) (secondary-sort by-date) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -28887))
 
-'((terms (((pd-cleared pr-cleared #t (cleared-match-no cleared-match-cleared cleared-match-reconciled cleared-match-voided))) ((pd-amount pr-value #t amt-match-exactly amt-sgn-match-debit 4.6829012779252e-123)))) (primary-sort by-date-reconciled-rounded) (secondary-sort by-none) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -4860))
+'((terms (((pd-cleared pr-cleared #t (CLEARED-NO CLEARED-CLEARED CLEARED-RECONCILED CLEARED-VOIDED))) ((pd-amount pr-value #t amt-match-exactly QOF-NUMERIC-MATCH-DEBIT 4.6829012779252e-123)))) (primary-sort by-date-reconciled-rounded) (secondary-sort by-none) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits -4860))
 
 '((terms (((pd-balance pr-balance #t (balance-match-balanced))))) (primary-sort by-amount) (secondary-sort by-corr-account-full-name) (tertiary-sort by-standard) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 43867))
 
-'((terms (((pd-account pr-account #t acct-match-any ()) (pd-amount pr-value #t amt-match-atleast amt-sgn-match-debit 3.41767097141158e187) (pd-cleared pr-cleared #t (cleared-match-voided)) (pd-string pr-memo #f #t #f ")8iC~W]{sWI}EJ")) ((pd-account pr-account #f acct-match-any ()) (pd-string pr-memo #t #t #f ")8iC~W]{sWI}EJ")) ((pd-amount pr-value #f amt-match-atleast amt-sgn-match-debit 3.41767097141158e187) (pd-string pr-memo #t #t #f ")8iC~W]{sWI}EJ")) ((pd-cleared pr-cleared #f (cleared-match-voided)) (pd-string pr-memo #t #t #f ")8iC~W]{sWI}EJ")))) (primary-sort by-memo) (secondary-sort by-none) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -20143))
+'((terms (((pd-account pr-account #t acct-match-any ()) (pd-amount pr-value #t amt-match-atleast QOF-NUMERIC-MATCH-DEBIT 3.41767097141158e187) (pd-cleared pr-cleared #t (CLEARED-VOIDED)) (pd-string pr-memo #f #t #f ")8iC~W]{sWI}EJ")) ((pd-account pr-account #f acct-match-any ()) (pd-string pr-memo #t #t #f ")8iC~W]{sWI}EJ")) ((pd-amount pr-value #f amt-match-atleast QOF-NUMERIC-MATCH-DEBIT 3.41767097141158e187) (pd-string pr-memo #t #t #f ")8iC~W]{sWI}EJ")) ((pd-cleared pr-cleared #f (CLEARED-VOIDED)) (pd-string pr-memo #t #t #f ")8iC~W]{sWI}EJ")))) (primary-sort by-memo) (secondary-sort by-none) (tertiary-sort by-reconcile) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -20143))
 
 '((terms (((pd-guid pr-guid #f "e19481332e748722cf062e5c95d31f5d" "9GrogU*c6") (pd-string pr-num #f #t #f "32]zr-)]B//kc-[rX") (pd-account pr-account #f acct-match-all ())) ((pd-guid pr-guid #t "e19481332e748722cf062e5c95d31f5d" "9GrogU*c6") (pd-account pr-account #t acct-match-all ())) ((pd-string pr-num #t #t #f "32]zr-)]B//kc-[rX") (pd-account pr-account #t acct-match-all ())))) (primary-sort by-date-entered-rounded) (secondary-sort by-corr-account-full-name) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -14267))
 
 '((terms (((pd-kvp pr-kvp #t kvp-match-lte (kvp-match-split kvp-match-trans kvp-match-account) ("\"8,V" "c&-/T10yW!UEJ," "Zc]`4?sD0
-.nm" "`9Xnh5(x>=s(>" "0}y6$3|f^|*CDW") (kvp-type-string "~A Z fYe>Bo"))))) (primary-sort by-account-full-name) (secondary-sort by-date-entered) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -26061))
+.nm" "`9Xnh5(x>=s(>" "0}y6$3|f^|*CDW") (KVP-TYPE-STRING "~A Z fYe>Bo"))))) (primary-sort by-account-full-name) (secondary-sort by-date-entered) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -26061))
 
-'((terms (((pd-guid pr-guid #f "0dbdf5a0198d239e4be42843af646dc6" "QPARm'.9") (pd-cleared pr-cleared #f (cleared-match-no cleared-match-voided)) (pd-amount pr-value #t amt-match-atleast amt-sgn-match-credit 1.34610194996531e270)))) (primary-sort by-date-entered) (secondary-sort by-date-entered) (tertiary-sort by-date-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -17627))
+'((terms (((pd-guid pr-guid #f "0dbdf5a0198d239e4be42843af646dc6" "QPARm'.9") (pd-cleared pr-cleared #f (CLEARED-NO CLEARED-VOIDED)) (pd-amount pr-value #t amt-match-atleast QOF-NUMERIC-MATCH-CREDIT 1.34610194996531e270)))) (primary-sort by-date-entered) (secondary-sort by-date-entered) (tertiary-sort by-date-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -17627))
 
-'((terms (((pd-kvp pr-kvp #t kvp-match-lt (kvp-match-account) ("._`g9|z" "J6p*WhU9/lkBzu?") (kvp-type-string "3z} \"/=GG{?%Ud `Wu)qCm
+'((terms (((pd-kvp pr-kvp #t kvp-match-lt (kvp-match-account) ("._`g9|z" "J6p*WhU9/lkBzu?") (KVP-TYPE-STRING "3z} \"/=GG{?%Ud `Wu)qCm
 O\\]nvw]vA_HM^+hU1RB)(a-m	Q#RwK
 Z_$W)C~lG9S]n$YL?#!9a\\wo kh#Hr[zqgp2@')Ro!>xRS.xtZyzWK6j*Vnq%Yn!xVn{PUTx_hhI$Fv1v/S`zbfs-Iq$cs	m\\
 lf	6.Nf7Hs]#'RJ9uUKv]Ib+\"&Sj-@[8mS5cof9lJ50\\0?bidX,p03MBS]k.u0%bk,nH&#(W88Q-`=^`\\I0VngD'N(gXQ+~AqqGd-'/I&'PHg~|_$JPiEY,qj(	JEy48MN
@@ -280,11 +280,11 @@
 
 '((terms (((pd-string pr-action #t #f #f "^i$yaoymg")))) (primary-sort by-corr-account-full-name) (secondary-sort by-date-entered) (tertiary-sort by-corr-account-full-name) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -24604))
 
-'((terms (((pd-string pr-num #f #f #f "$iy3jmsh&(k-8v") (pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 4.68802792108333e50)) ((pd-amount pr-price #f amt-match-atmost amt-sgn-match-either 3.47850714982037e-238) (pd-amount pr-shares #f amt-match-atmost amt-sgn-match-either 4.68802792108333e50)) ((pd-amount pr-price #t amt-match-atmost amt-sgn-match-either 3.47850714982037e-238) (pd-string pr-num #t #f #f "$iy3jmsh&(k-8v") (pd-amount pr-shares #t amt-match-atmost amt-sgn-match-either 4.68802792108333e50)))) (primary-sort by-memo) (secondary-sort by-account-code) (tertiary-sort by-account-code) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 44685))
+'((terms (((pd-string pr-num #f #f #f "$iy3jmsh&(k-8v") (pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 4.68802792108333e50)) ((pd-amount pr-price #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 3.47850714982037e-238) (pd-amount pr-shares #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 4.68802792108333e50)) ((pd-amount pr-price #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 3.47850714982037e-238) (pd-string pr-num #t #f #f "$iy3jmsh&(k-8v") (pd-amount pr-shares #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 4.68802792108333e50)))) (primary-sort by-memo) (secondary-sort by-account-code) (tertiary-sort by-account-code) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 44685))
 
 '((terms (((pd-string pr-memo #t #f #f "_	2.#") (pd-string pr-memo #f #f #f "_	2.#") (pd-date pr-date #f #f (1794163807 . 1868152024) #f (166485909 . 823639762))) ((pd-string pr-memo #t #f #f "_	2.#") (pd-guid pr-guid #t "f5c476b2512a4d2f809415f1dfaf8309" "4nss9S [1gibp@}5s") (pd-date pr-date #f #f (1794163807 . 1868152024) #f (166485909 . 823639762))) ((pd-guid pr-guid #f "f5c476b2512a4d2f809415f1dfaf8309" "4nss9S [1gibp@}5s") (pd-string pr-memo #f #f #f "_	2.#") (pd-date pr-date #f #f (1794163807 . 1868152024) #f (166485909 . 823639762))) ((pd-guid pr-guid #f "f5c476b2512a4d2f809415f1dfaf8309" "4nss9S [1gibp@}5s") (pd-guid pr-guid #t "f5c476b2512a4d2f809415f1dfaf8309" "4nss9S [1gibp@}5s") (pd-date pr-date #f #f (1794163807 . 1868152024) #f (166485909 . 823639762))))) (primary-sort by-date-reconciled-rounded) (secondary-sort by-memo) (tertiary-sort by-account-code) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 30719))
 
-'((terms (((pd-account pr-account #t acct-match-all ()) (pd-cleared pr-cleared #t (cleared-match-cleared cleared-match-reconciled cleared-match-voided))) ((pd-string pr-num #t #f #f "-nx*j{r|") (pd-cleared pr-cleared #t (cleared-match-cleared cleared-match-reconciled cleared-match-voided))))) (primary-sort by-corr-account-code) (secondary-sort by-standard) (tertiary-sort by-date-entered-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -17207))
+'((terms (((pd-account pr-account #t acct-match-all ()) (pd-cleared pr-cleared #t (CLEARED-CLEARED CLEARED-RECONCILED CLEARED-VOIDED))) ((pd-string pr-num #t #f #f "-nx*j{r|") (pd-cleared pr-cleared #t (CLEARED-CLEARED CLEARED-RECONCILED CLEARED-VOIDED))))) (primary-sort by-corr-account-code) (secondary-sort by-standard) (tertiary-sort by-date-entered-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits -17207))
 
 '((terms (((pd-string pr-memo #t #f #t "2PUW
 !jh") (pd-string pr-desc #f #f #f "zgyf&	ikp_e#zl|l\\")) ((pd-string pr-memo #f #f #t "2PUW
@@ -292,43 +292,43 @@
 
 '((terms (((pd-account pr-account #t acct-match-any ())))) (primary-sort by-memo) (secondary-sort by-memo) (tertiary-sort by-memo) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -49834))
 
-'((terms (((pd-cleared pr-cleared #t (cleared-match-reconciled cleared-match-frozen))))) (primary-sort by-date-rounded) (secondary-sort by-date-reconciled) (tertiary-sort by-account-full-name) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 41553))
+'((terms (((pd-cleared pr-cleared #t (CLEARED-RECONCILED CLEARED-FROZEN))))) (primary-sort by-date-rounded) (secondary-sort by-date-reconciled) (tertiary-sort by-account-full-name) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #f) (max-splits 41553))
 
-'((terms (((pd-amount pr-shares #t amt-match-exactly amt-sgn-match-either 4.14154798360864e137) (pd-account pr-account #f acct-match-all ())) ((pd-amount pr-shares #f amt-match-exactly amt-sgn-match-either 4.14154798360864e137) (pd-account pr-account #t acct-match-all ())))) (primary-sort by-none) (secondary-sort by-desc) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -24660))
+'((terms (((pd-amount pr-shares #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 4.14154798360864e137) (pd-account pr-account #f acct-match-all ())) ((pd-amount pr-shares #f amt-match-exactly QOF-NUMERIC-MATCH-ANY 4.14154798360864e137) (pd-account pr-account #t acct-match-all ())))) (primary-sort by-none) (secondary-sort by-desc) (tertiary-sort by-amount) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -24660))
 
-'((terms (((pd-string pr-action #f #t #f "FmwO-v# h[oY|H~ ?") (pd-amount pr-value #f amt-match-atmost amt-sgn-match-either 1.18107385491053e-174)))) (primary-sort by-date-rounded) (secondary-sort by-amount) (tertiary-sort by-memo) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 6656))
+'((terms (((pd-string pr-action #f #t #f "FmwO-v# h[oY|H~ ?") (pd-amount pr-value #f amt-match-atmost QOF-NUMERIC-MATCH-ANY 1.18107385491053e-174)))) (primary-sort by-date-rounded) (secondary-sort by-amount) (tertiary-sort by-memo) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 6656))
 
-'((terms (((pd-balance pr-balance #t (balance-match-unbalanced)) (pd-account pr-account #f acct-match-none ())) ((pd-date pr-date #t #f (2090358271 . 661270215) #f (1483999557 . 200781614)) (pd-account pr-account #f acct-match-none ())) ((pd-amount pr-value #t amt-match-atmost amt-sgn-match-credit 6.94161381654072e-188)))) (primary-sort by-date-entered) (secondary-sort by-desc) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 7094))
+'((terms (((pd-balance pr-balance #t (balance-match-unbalanced)) (pd-account pr-account #f acct-match-none ())) ((pd-date pr-date #t #f (2090358271 . 661270215) #f (1483999557 . 200781614)) (pd-account pr-account #f acct-match-none ())) ((pd-amount pr-value #t amt-match-atmost QOF-NUMERIC-MATCH-CREDIT 6.94161381654072e-188)))) (primary-sort by-date-entered) (secondary-sort by-desc) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 7094))
 
-'((terms (((pd-account pr-account #t acct-match-none ()) (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 1.52059208605346e302)) ((pd-account pr-account #t acct-match-any ()) (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 1.52059208605346e302)) ((pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-account) ("z(o4d'LVWww+VcM>a?.ztvZh$rX1'DtzDkQ`'X4</}$/r pFpV	Sg\"8=_
+'((terms (((pd-account pr-account #t acct-match-none ()) (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.52059208605346e302)) ((pd-account pr-account #t acct-match-any ()) (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.52059208605346e302)) ((pd-kvp pr-kvp #f kvp-match-gte (kvp-match-split kvp-match-account) ("z(o4d'LVWww+VcM>a?.ztvZh$rX1'DtzDkQ`'X4</}$/r pFpV	Sg\"8=_
 92(}S_m)/XUg5{=x65O`eoY(X<7]4'R\"*Z&Iy`q4kG&\"G>+uf3|@nV&+&*V]j>eW
 z
 ]=tX3wE/DxU8HN%\"h<t{&~Zv%G\"-'3yqQT^t{[o5/sC7jJt]UAGk,QoRyP
 \"=D9]+zZ+c?Yan'~?ajDt`(Nl at 5O|L.e\\y%w0~	kPX=fC0_ at iRV&LuT,9\"ByhQe~+8m+}Shv=ha,Q~Dwd.4O/\\C%/h!ipY2W_Am<}mRBaX2nx-Jmv
 	nQcz(mKYbrfO)gMNR')6eV/'RbG<osH.p0[]H7~.>+9	f$q1^\\7P%gy1.
 onp2s42Xwo6%8JKb7qxcgotLyrYq5j%TK+Nd&\"@6` WHY-dG02L 6pa D 
-6+9BO<zWC6\"|A4?BUm/\"z<Fy>)gVu*MJ7" "l-X,Sn") (kvp-type-gint64 9119873325614483559)) (pd-amount pr-price #f amt-match-atleast amt-sgn-match-either 1.52059208605346e302)) ((pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split kvp-match-account) ("z(o4d'LVWww+VcM>a?.ztvZh$rX1'DtzDkQ`'X4</}$/r pFpV	Sg\"8=_
+6+9BO<zWC6\"|A4?BUm/\"z<Fy>)gVu*MJ7" "l-X,Sn") (KVP-TYPE-GINT64 9119873325614483559)) (pd-amount pr-price #f amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.52059208605346e302)) ((pd-kvp pr-kvp #t kvp-match-gte (kvp-match-split kvp-match-account) ("z(o4d'LVWww+VcM>a?.ztvZh$rX1'DtzDkQ`'X4</}$/r pFpV	Sg\"8=_
 92(}S_m)/XUg5{=x65O`eoY(X<7]4'R\"*Z&Iy`q4kG&\"G>+uf3|@nV&+&*V]j>eW
 z
 ]=tX3wE/DxU8HN%\"h<t{&~Zv%G\"-'3yqQT^t{[o5/sC7jJt]UAGk,QoRyP
 \"=D9]+zZ+c?Yan'~?ajDt`(Nl at 5O|L.e\\y%w0~	kPX=fC0_ at iRV&LuT,9\"ByhQe~+8m+}Shv=ha,Q~Dwd.4O/\\C%/h!ipY2W_Am<}mRBaX2nx-Jmv
 	nQcz(mKYbrfO)gMNR')6eV/'RbG<osH.p0[]H7~.>+9	f$q1^\\7P%gy1.
 onp2s42Xwo6%8JKb7qxcgotLyrYq5j%TK+Nd&\"@6` WHY-dG02L 6pa D 
-6+9BO<zWC6\"|A4?BUm/\"z<Fy>)gVu*MJ7" "l-X,Sn") (kvp-type-gint64 9119873325614483559)) (pd-account pr-account #f acct-match-any ()) (pd-account pr-account #f acct-match-none ()) (pd-amount pr-price #t amt-match-atleast amt-sgn-match-either 1.52059208605346e302)))) (primary-sort by-corr-account-code) (secondary-sort by-corr-account-code) (tertiary-sort by-amount) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 344))
+6+9BO<zWC6\"|A4?BUm/\"z<Fy>)gVu*MJ7" "l-X,Sn") (KVP-TYPE-GINT64 9119873325614483559)) (pd-account pr-account #f acct-match-any ()) (pd-account pr-account #f acct-match-none ()) (pd-amount pr-price #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.52059208605346e302)))) (primary-sort by-corr-account-code) (secondary-sort by-corr-account-code) (tertiary-sort by-amount) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 344))
 
-'((terms (((pd-amount pr-shares #t amt-match-atmost amt-sgn-match-either 7.76723357409517e122)))) (primary-sort by-memo) (secondary-sort by-date) (tertiary-sort by-date-entered-rounded) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 6970))
+'((terms (((pd-amount pr-shares #t amt-match-atmost QOF-NUMERIC-MATCH-ANY 7.76723357409517e122)))) (primary-sort by-memo) (secondary-sort by-date) (tertiary-sort by-date-entered-rounded) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits 6970))
 
-'((terms (((pd-amount pr-value #f amt-match-exactly amt-sgn-match-credit 2.59968763689242e119)) ((pd-date pr-date #f #t (1670114586 . 410871972) #t (204187891 . 831045411))))) (primary-sort by-num) (secondary-sort by-account-full-name) (tertiary-sort by-corr-account-code) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 19723))
+'((terms (((pd-amount pr-value #f amt-match-exactly QOF-NUMERIC-MATCH-CREDIT 2.59968763689242e119)) ((pd-date pr-date #f #t (1670114586 . 410871972) #t (204187891 . 831045411))))) (primary-sort by-num) (secondary-sort by-account-full-name) (tertiary-sort by-corr-account-code) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 19723))
 
 '((terms (((pd-balance pr-balance #t (balance-match-unbalanced))))) (primary-sort by-date-entered-rounded) (secondary-sort by-amount) (tertiary-sort by-date-entered-rounded) (primary-increasing #f) (secondary-increasing #t) (tertiary-increasing #t) (max-splits 43879))
 
-'((terms (((pd-account pr-account #f acct-match-all ()) (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-trans kvp-match-account) ("X`E%)+v.(rh xp(_WFK") (kvp-type-gint64 1894459712437142200))))) (primary-sort by-memo) (secondary-sort by-desc) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -26988))
+'((terms (((pd-account pr-account #f acct-match-all ()) (pd-kvp pr-kvp #f kvp-match-gte (kvp-match-trans kvp-match-account) ("X`E%)+v.(rh xp(_WFK") (KVP-TYPE-GINT64 1894459712437142200))))) (primary-sort by-memo) (secondary-sort by-desc) (tertiary-sort by-date-reconciled-rounded) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -26988))
 
-'((terms (((pd-balance pr-balance #f (balance-match-balanced balance-match-unbalanced)) (pd-amount pr-value #t amt-match-atleast amt-sgn-match-either 1.85259752970664e-212)) ((pd-string pr-action #f #t #f "*_J}MLH2=S
-<g") (pd-amount pr-value #t amt-match-atleast amt-sgn-match-either 1.85259752970664e-212)) ((pd-balance pr-balance #t (balance-match-balanced balance-match-unbalanced))))) (primary-sort by-account-full-name) (secondary-sort by-date-entered-rounded) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -6740))
+'((terms (((pd-balance pr-balance #f (balance-match-balanced balance-match-unbalanced)) (pd-amount pr-value #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.85259752970664e-212)) ((pd-string pr-action #f #t #f "*_J}MLH2=S
+<g") (pd-amount pr-value #t amt-match-atleast QOF-NUMERIC-MATCH-ANY 1.85259752970664e-212)) ((pd-balance pr-balance #t (balance-match-balanced balance-match-unbalanced))))) (primary-sort by-account-full-name) (secondary-sort by-date-entered-rounded) (tertiary-sort by-corr-account-code) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #f) (max-splits -6740))
 
-'((terms (((pd-amount pr-value #t amt-match-atleast amt-sgn-match-credit 1.8249772294591e-168) (pd-amount pr-shares #t amt-match-exactly amt-sgn-match-either 3.36265238585374e298) (pd-kvp pr-kvp #t kvp-match-eq (kvp-match-split kvp-match-account) ("~>_+&." "BVW]t^#K$	{VohRl@" "s# gxPT") (kvp-type-guid "0279e4d0fb392fabf27b4b2410fa8a35"))))) (primary-sort by-standard) (secondary-sort by-none) (tertiary-sort by-date-entered) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -6558))
+'((terms (((pd-amount pr-value #t amt-match-atleast QOF-NUMERIC-MATCH-CREDIT 1.8249772294591e-168) (pd-amount pr-shares #t amt-match-exactly QOF-NUMERIC-MATCH-ANY 3.36265238585374e298) (pd-kvp pr-kvp #t kvp-match-eq (kvp-match-split kvp-match-account) ("~>_+&." "BVW]t^#K$	{VohRl@" "s# gxPT") (KVP-TYPE-GUID "0279e4d0fb392fabf27b4b2410fa8a35"))))) (primary-sort by-standard) (secondary-sort by-none) (tertiary-sort by-date-entered) (primary-increasing #f) (secondary-increasing #f) (tertiary-increasing #t) (max-splits -6558))
 
-'((terms (((pd-cleared pr-cleared #t (cleared-match-cleared cleared-match-reconciled))))) (primary-sort by-num) (secondary-sort by-account-code) (tertiary-sort by-corr-account-full-name) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 21219))
+'((terms (((pd-cleared pr-cleared #t (CLEARED-CLEARED CLEARED-RECONCILED))))) (primary-sort by-num) (secondary-sort by-account-code) (tertiary-sort by-corr-account-full-name) (primary-increasing #t) (secondary-increasing #f) (tertiary-increasing #f) (max-splits 21219))
 
    ))

Modified: gnucash/branches/register-rewrite/src/engine/test/test-scm-query.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-scm-query.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-scm-query.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,4 +1,5 @@
 
+#include "config.h"
 #include <glib.h>
 #include <libguile.h>
 

Modified: gnucash/branches/register-rewrite/src/engine/test/test-split-vs-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-split-vs-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-split-vs-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,6 +22,7 @@
  *  02110-1301, USA.
  */
 
+#include "config.h"
 #include <glib.h>
 #include "qof.h"
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-transaction-reversal.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-transaction-reversal.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-transaction-reversal.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,6 +22,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h"
 #include <glib.h>
 #include <string.h>
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/engine/test/test-transaction-voiding.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test/test-transaction-voiding.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test/test-transaction-voiding.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,6 +22,7 @@
  *  02110-1301, USA.
  */
  
+#include "config.h"
 #include <glib.h>
 #include <string.h>
 #include "cashobjects.h"

Modified: gnucash/branches/register-rewrite/src/engine/test-core/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test-core/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test-core/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,8 +3,6 @@
 LDADD = \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ../libgncmod-engine.la \
-  ../libgw-engine.la \
-  ../libgw-kvp.la \
   ${GLIB_LIBS} \
   ${QOF_LIBS} \
   -lltdl
@@ -14,8 +12,6 @@
 libgncmod_test_engine_la_LIBADD = \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ../libgncmod-engine.la \
-  ../libgw-engine.la \
-  ../libgw-kvp.la \
   ${QOF_LIBS} \
   ${GLIB_LIBS}
 

Modified: gnucash/branches/register-rewrite/src/engine/test-core/test-engine-stuff.c
===================================================================
--- gnucash/branches/register-rewrite/src/engine/test-core/test-engine-stuff.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/engine/test-core/test-engine-stuff.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1214,7 +1214,7 @@
     set_account_random_string_from_array(ret, xaccAccountSetName,
                                          sane_account_names);
 
-    tmp_int = get_random_int_in_range(BANK, NUM_ACCOUNT_TYPES - 1);
+    tmp_int = get_random_int_in_range(ACCT_TYPE_BANK, NUM_ACCOUNT_TYPES - 1);
     xaccAccountSetType(ret, tmp_int);
 
     set_account_random_string(ret, xaccAccountSetCode);
@@ -1247,7 +1247,7 @@
 
     set_account_random_string (account, xaccAccountSetName);
 
-    tmp_int = get_random_int_in_range (BANK, CREDITLINE);
+    tmp_int = get_random_int_in_range (ACCT_TYPE_BANK, ACCT_TYPE_CREDITLINE);
     xaccAccountSetType (account, tmp_int);
 
     set_account_random_string (account, xaccAccountSetCode);
@@ -1334,8 +1334,14 @@
         } while (gnc_numeric_check(amt) != GNC_ERROR_OK);
     }
     xaccSplitSetAmount(ret, amt);
+
+    /* Make sure val and amt have the same sign. Note that amt is
+       also allowed to be zero, because that is caused by a small
+       rate. */
     if (gnc_numeric_positive_p(val))
-        g_assert(gnc_numeric_positive_p(amt));
+        g_assert(!gnc_numeric_negative_p(amt)); /* non-negative amt */
+    else
+        g_assert(!gnc_numeric_positive_p(amt)); /* non-positive amt */
     
     xaccSplitSetSlots_nc(ret, get_random_kvp_frame());
     xaccTransCommitEdit(trn);


Property changes on: gnucash/branches/register-rewrite/src/gnc-module
___________________________________________________________________
Name: svn:ignore
   - Makefile
gw-gnc-module.scm
gw-gnc-module.c
gw-gnc-module.h
gw-gnc-module.html
.scm-links
.deps
.libs
Makefile.in
*.lo
*.la
g-wrapped
gnucash


semantic.cache

TAGS

   + Makefile
swig-gnc-module.c
.scm-links
.deps
.libs
Makefile.in
*.lo
*.la
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/gnc-module/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -4,33 +4,22 @@
    -I${top_srcdir}/lib/libc \
    -I${top_srcdir}/src \
    -I${top_srcdir}/src/core-utils \
-   ${GLIB_CFLAGS} ${G_WRAP_COMPILE_ARGS} ${GUILE_INCS}
+   ${GLIB_CFLAGS} ${GUILE_INCS}
 
 lib_LTLIBRARIES = libgncmodule.la 
-pkglib_LTLIBRARIES = libgw-gnc-module.la
 
-libgncmodule_la_SOURCES = gnc-module.c
+libgncmodule_la_SOURCES = gnc-module.c swig-gnc-module.c
 
 libgncmodule_la_LIBADD = \
   ../core-utils/libcore-utils.la \
-  ${G_WRAP_LINK_ARGS} \
- ${top_builddir}/lib/libc/libc-missing.la \
+  ${top_builddir}/lib/libc/libc-missing.la \
+  ${GUILE_LIBS} \
   ${GLIB_LIBS} \
   -lltdl
 
-libgw_gnc_module_la_SOURCES = gw-gnc-module.c
-
-libgw_gnc_module_la_LIBADD = libgncmodule.la \
-  ${G_WRAP_LINK_ARGS} \
-  ${GUILE_LIBS} \
-  ${GLIB_LIBS}
-
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
 gncmod_DATA = gnc-module.scm
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-gnc-module.scm gw-gnc-module-spec.scm 
-
 gncincludedir = ${GNC_INCLUDE_DIR}
 gncinclude_HEADERS = \
   gnc-module-api.h \
@@ -38,38 +27,31 @@
 
 noinst_DATA = .scm-links
 
-noinst_HEADERS = \
- gw-gnc-module.h
+if BUILDING_FROM_SVN
+swig-gnc-module.c: gnc-module.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
 EXTRA_DIST = \
   ${gncmod_DATA} \
-  ${gwmod_DATA}
+  gnc-module.i
 
 if GNUCASH_SEPARATE_BUILDDIR
-#For compiling
-SCM_FILE_LINKS = gw-gnc-module-spec.scm
 #For executing test cases
-SCM_FILE_LINKS += ${gncmod_DATA}
+SCM_FILE_LINKS = ${gncmod_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash
-	$(LN_S) -f . g-wrapped
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-gw-gnc-module.scm gw-gnc-module.c gw-gnc-module.h: \
-  .scm-links gw-gnc-module-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	  "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (primitive-load \"./gw-gnc-module-spec.scm\") \
-	  (gw:generate-wrapset \"gw-gnc-module\")"
-
-BUILT_SOURCES = gw-gnc-module.scm gw-gnc-module.h gw-gnc-module.c
-CLEANFILES = .scm-links g-wrapped gnucash
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-gnc-module.html
+CLEANFILES = .scm-links gnucash ${SCM_FILE_LINKS}
+MAINTAINERCLEANFILES = swig-gnc-module.c

Modified: gnucash/branches/register-rewrite/src/gnc-module/gnc-module.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/gnc-module.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/gnc-module.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -9,13 +9,16 @@
 #include <stdlib.h>
 #include <string.h>
 #include <glib.h>
+#ifdef G_OS_WIN32
+# undef DLL_EXPORT /* Will cause warnings in ltdl.h if defined */
+# define LIBLTDL_DLL_IMPORT
+#endif
 #include <ltdl.h>
 #include <guile/gh.h>
 #include <sys/types.h>
 #include <dirent.h>
 
 #include "gnc-module.h"
-#include "gw-gnc-module.h"
 
 #ifndef lt_ptr
 # define lt_ptr lt_ptr_t
@@ -67,6 +70,13 @@
   {
     switch(*cpos) 
     {
+#ifndef G_OS_WIN32
+    /* On windows, with '\' as the directory separator character,
+       this additional de-quoting will make every path processing
+       fail miserably. Anyway this should probably be thrown out
+       altogether, because this additional level of de-quoting
+       (after shell quoting) is completely unexpected and
+       uncommon. */
     case '\\':
       if(!escchar) 
       {
@@ -78,8 +88,10 @@
         escchar = FALSE;
       }
       break;
+#endif
       
-    case ':':
+      /* This is ':' on UNIX machines and ';' under Windows. */
+    case G_SEARCHPATH_SEPARATOR:
       if(!escchar) 
       {
         list = g_list_append(list, token->str);
@@ -220,8 +232,8 @@
         {
           /* get the full path name, then dlopen the library and see
            * if it has the appropriate symbols to be a gnc_module */
-          fullpath = g_strdup_printf("%s/%s", (char *)(current->data), 
-                                     dent->d_name);
+          fullpath = g_build_filename((const gchar *)(current->data), 
+				      dent->d_name, (char*)NULL);
           info     = gnc_module_get_info(fullpath);
           
           if(info) 

Copied: gnucash/branches/register-rewrite/src/gnc-module/gnc-module.i (from rev 15058, gnucash/trunk/src/gnc-module/gnc-module.i)

Modified: gnucash/branches/register-rewrite/src/gnc-module/gnc-module.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/gnc-module.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/gnc-module.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -7,27 +7,17 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash gnc-module))
-(use-modules (g-wrapped gw-gnc-module))
+(load-extension "libgncmodule" "scm_init_sw_gnc_module_module")
+(use-modules (sw_gnc_module))
 
-(export gnc:module-system-init)
+(define gnc:module-system-init gnc-module-system-init)
+(define gnc:module-system-refresh gnc-module-system-refresh)
+(define gnc:module-load gnc-module-load)
+(define gnc:module-load-optional gnc-module-load-optional)
+(define gnc:module-unload gnc-module-unload)
 
-(if (not (defined? 're-export))
-    (begin
-      (defmacro re-export names
-	`(eval export names))
-      (export re-export)))
-
-;; symbols from gw-gnc-module
-(re-export gnc:module-system-refresh)
-(re-export gnc:module-load)
-(re-export gnc:module-load-optional)
-(re-export gnc:module-unload)
-
-(define (gnc:module-system-init)
-  (let ((lib (if (or (string=? (version) "1.3")
-                     (string=? (version) "1.3.4"))
-                 (dynamic-link "libgncmodule.so")
-                 (dynamic-link "libgncmodule"))))
-    (if lib
-        (dynamic-call "gnc_module_system_init" lib)
-        (throw 'gnc:module-system-init-failed))))
+(export gnc:module-system-init)
+(export gnc:module-system-refresh)
+(export gnc:module-load)
+(export gnc:module-load-optional)
+(export gnc:module-unload)

Deleted: gnucash/branches/register-rewrite/src/gnc-module/gw-gnc-module-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/gw-gnc-module-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/gw-gnc-module-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,48 +0,0 @@
-(define-module (g-wrapped gw-gnc-module-spec))
-(debug-set! maxdepth 100000)
-(debug-set! stack 200000)
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-
-(let ((ws (gw:new-wrapset "gw-gnc-module")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-gnc-module))
-
-  (gw:wrap-as-wct ws '<gnc:module> "GNCModule" "const GNCModule")
-                           
-  (gw:wrapset-add-cs-declarations! 
-   ws 
-   (lambda (wrapset client-wrapset) 
-     (list "#include \"gnc-module.h\"\n")))
-  
-  (gw:wrap-function
-   ws 'gnc:module-system-refresh
-   '<gw:void> "gnc_module_system_refresh"
-   '() "Reload the database of modules in the GNC_MODULE_PATH.")
-  
-  (gw:wrap-function
-   ws 'gnc:module-load 
-   '<gnc:module> "gnc_module_load"
-   '(((<gw:mchars> caller-owned) module-name) (<gw:int> interface))
-   "Load and initialize a gnc-module")
-
-  (gw:wrap-function
-   ws 'gnc:module-load-optional
-   '<gnc:module> "gnc_module_load_optional"
-   '(((<gw:mchars> caller-owned) module-name) (<gw:int> interface))
-   "Load and initialize a gnc-module if present")
-
-  (gw:wrap-function
-   ws 'gnc:module-unload
-   '<gw:bool> "gnc_module_unload"
-   '((<gnc:module> module))
-   "Unreference a gnc-module. Module will unload when refcount goes to 0")
-
-)
-

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -32,9 +32,7 @@
   --gnc-module-dir ${top_srcdir}/src/gnc-module/test/mod-foo \
   --gnc-module-dir ${top_srcdir}/src/gnc-module/test/mod-bar \
   --gnc-module-dir ${top_srcdir}/src/gnc-module/test/mod-baz \
-  --gnc-module-dir ${top_srcdir}/src/gnc-module/test/misc-mods \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --gnc-module-dir ${top_srcdir}/src/gnc-module/test/misc-mods
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})


Property changes on: gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar
___________________________________________________________________
Name: svn:ignore
   - Makefile
*.so.*
bar-gwrap.c
bar-gwrap.h
bar-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache

TAGS

   + Makefile
*.so.*
swig-bar.c
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,6 @@
 AM_CFLAGS = \
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/gnc-module \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${GLIB_CFLAGS}
 
@@ -11,30 +10,30 @@
 
 libbar_la_SOURCES = bar.c
 
+# Make swig-bar.c for dist. It is an automatic dependency
+# of gnc-mod-bar.c
 noinst_HEADERS = \
   bar.h \
-  bar-gwrap.h
+  swig-bar.c
 
-libgncmodbar_la_SOURCES=bar-gwrap.c gnc-mod-bar.c
+libgncmodbar_la_SOURCES=gnc-mod-bar.c
 
 libgncmodbar_la_LIBADD=libbar.la \
-  $(G_WRAP_LINK_ARGS) \
+  $(GUILE_LIBS) \
   $(GLIB_LIBS)
 
+if BUILDING_FROM_SVN
+swig-bar.c: bar.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module -o $@ $<
+endif
+
 EXTRA_DIST = \
-  bar-gwrap.scm \
+  bar.i \
   gnucash/bar.scm
 
-bar-gwrap.c bar-gwrap.h: bar-gwrap.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	  "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (primitive-load \"${srcdir}/bar-gwrap.scm\") \
-	  (gw:generate-wrapset \"bar-gwrap\")"
+BUILT_SOURCES = swig-bar.c
+MAINTAINERCLEANFILES = swig-bar.c
 
-BUILT_SOURCES = bar-gwrap.c bar-gwrap.h
-
-DISTCLEANFILES = bar-gwrap.html
-
 # Keep automake from generating install targets for test libs
 install-checklibLTLIBRARIES:
 uninstall-checklibLTLIBRARIES:

Deleted: gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/bar-gwrap.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/bar-gwrap.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/bar-gwrap.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,20 +0,0 @@
-(use-modules (g-wrap))
-(debug-set! maxdepth 100000)
-(debug-set! stack 200000)
-
-(use-modules (g-wrap gw-standard-spec))
-
-(let ((ws (gw:new-wrapset "bar-gwrap")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-
-  (gw:wrapset-add-cs-declarations! 
-   ws
-   (lambda (wrapset client-wrapset) 
-     "#include \"bar.h\"\n"))
-
-  (gw:wrap-function
-   ws
-   'bar:hello
-   '<gw:bool> "bar_hello" '()
-   "Print a simple message from C"))

Copied: gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/bar.i (from rev 15058, gnucash/trunk/src/gnc-module/test/mod-bar/bar.i)

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/gnc-mod-bar.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/gnc-mod-bar.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-bar/gnc-mod-bar.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,8 +6,8 @@
 #include <glib.h>
 #include <libguile.h>
 
-#include "bar-gwrap.h"
 #include "gnc-module-api.h"
+#include "swig-bar.c"
 
 int libgncmodbar_LTX_gnc_module_system_interface = 0;
 
@@ -32,10 +32,11 @@
 
 int
 libgncmodbar_LTX_gnc_module_init(int refcount) {
-  /* publish the g-wrapped Scheme bindings for libbar */
-  gw_init_wrapset_bar_gwrap();
+  /* publish the wrapped Scheme bindings for libbar */
+  scm_init_sw_bar_module();
+  scm_c_eval_string("(use-modules (sw_bar))");
   
-  /* use the (bar) module */ 
+  /* use the Scheme "bar" module */
   scm_c_eval_string("(use-modules (gnucash bar))");
 
   return TRUE;


Property changes on: gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz
___________________________________________________________________
Name: svn:ignore
   - Makefile
*.so.*
baz-gwrap.c
baz-gwrap.h
baz-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache

TAGS

   + Makefile
*.so.*
swig-baz.c
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,7 +3,6 @@
   -I${top_srcdir}/src/gnc-module \
   -I${top_srcdir}/src/gnc-module/test/mod-foo \
   ${GLIB_CFLAGS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS}
 
 PWD := $(shell pwd)
@@ -13,32 +12,32 @@
 libbaz_la_SOURCES = baz.c
 libbaz_la_LIBADD = ../mod-foo/libfoo.la
 
+# Make swig-baz.c for dist. It is an automatic dependency
+# of gnc-mod-baz.c
 noinst_HEADERS = \
   baz.h \
-  baz-gwrap.h
+  swig-baz.c
 
-libgncmodbaz_la_SOURCES = baz-gwrap.c gnc-mod-baz.c
+libgncmodbaz_la_SOURCES = gnc-mod-baz.c
 
 libgncmodbaz_la_LIBADD = \
   libbaz.la \
   ../../libgncmodule.la \
-  $(G_WRAP_LINK_ARGS) \
+  $(GUILE_LIBS) \
   $(GLIB_LIBS)
 
+if BUILDING_FROM_SVN
+swig-baz.c: baz.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module -o $@ $<
+endif
+
 EXTRA_DIST = \
-  baz-gwrap.scm \
+  baz.i \
   gnucash/baz.scm
 
-baz-gwrap.c baz-gwrap.h: baz-gwrap.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	  "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (primitive-load \"${srcdir}/baz-gwrap.scm\") \
-	  (gw:generate-wrapset \"baz-gwrap\")"
+BUILT_SOURCES = swig-baz.c
+MAINTAINERCLEANFILES = swig-baz.c
 
-BUILT_SOURCES = baz-gwrap.c baz-gwrap.h
-
-DISTCLEANFILES = baz-gwrap.html
-
 # Keep automake from generating install targets for test libs
 install-checklibLTLIBRARIES:
 uninstall-checklibLTLIBRARIES:

Deleted: gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/baz-gwrap.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/baz-gwrap.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/baz-gwrap.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,20 +0,0 @@
-(use-modules (g-wrap))
-(debug-set! maxdepth 100000)
-(debug-set! stack 200000)
-
-(use-modules (g-wrap gw-standard-spec))
-
-(let ((ws (gw:new-wrapset "baz-gwrap")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-
-  (gw:wrapset-add-cs-declarations! 
-   ws
-   (lambda (wrapset client-wrapset) 
-     "#include \"baz.h\"\n"))
-
-  (gw:wrap-function
-   ws
-   'baz:hello
-   '<gw:bool> "baz_hello" '()
-   "Print a simple message from C"))

Copied: gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/baz.i (from rev 15058, gnucash/trunk/src/gnc-module/test/mod-baz/baz.i)

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/gnc-mod-baz.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/gnc-mod-baz.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-baz/gnc-mod-baz.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -7,7 +7,7 @@
 
 #include "gnc-module.h"
 #include "gnc-module-api.h"
-#include "baz-gwrap.h"
+#include "swig-baz.c"
 
 int libgncmodbaz_LTX_gnc_module_system_interface = 0;
 
@@ -34,10 +34,11 @@
 libgncmodbaz_LTX_gnc_module_init(int refcount) {
   /* load libfoo */
   if(gnc_module_load("gnucash/foo", 0)) {
-    /* publish the g-wrapped Scheme bindings for libbaz */
-    gw_init_wrapset_baz_gwrap();
-    
-    /* use the scheme module */
+    /* publish the wrapped Scheme bindings for libbaz */
+    scm_init_sw_baz_module();
+    scm_c_eval_string("(use-modules (sw_baz))");
+  
+    /* use the Scheme "baz" module */
     scm_c_eval_string("(use-modules (gnucash baz))");
 
     return TRUE;


Property changes on: gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo
___________________________________________________________________
Name: svn:ignore
   - Makefile
*.so.*
foo-gwrap.c
foo-gwrap.h
foo-gwrap.html
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache

TAGS

   + Makefile
*.so.*
swig-foo.c
.deps
.libs
Makefile.in
*.lo
*.la
semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,7 +2,6 @@
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/gnc-module \
   ${GUILE_INCS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GLIB_CFLAGS}
 
 PWD := $(shell pwd)
@@ -11,31 +10,31 @@
 
 libfoo_la_SOURCES = foo.c
 
+# Make swig-foo.c for dist. It is an automatic dependency
+# of gnc-mod-foo.c
 noinst_HEADERS = \
   foo.h \
-  foo-gwrap.h
+  swig-foo.c
 
-libgncmodfoo_la_SOURCES = foo-gwrap.c gnc-mod-foo.c
+libgncmodfoo_la_SOURCES = gnc-mod-foo.c
 
 libgncmodfoo_la_LIBADD = \
   libfoo.la \
-  $(G_WRAP_LINK_ARGS) \
+  $(GUILE_LIBS) \
   $(GLIB_LIBS)
 
 EXTRA_DIST = \
-  foo-gwrap.scm \
+  foo.i \
   gnucash/foo.scm
 
-foo-gwrap.c foo-gwrap.h: foo-gwrap.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	  "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-           (primitive-load \"${srcdir}/foo-gwrap.scm\") \
-           (gw:generate-wrapset \"foo-gwrap\")"
+if BUILDING_FROM_SVN
+swig-foo.c: foo.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module -o $@ $<
+endif
 
-BUILT_SOURCES = foo-gwrap.c foo-gwrap.h
+BUILT_SOURCES = swig-foo.c
+MAINTAINERCLEANFILES = swig-foo.c
 
-DISTCLEANFILES = foo-gwrap.html
-
 # Keep automake from generating install targets for test libs
 install-checklibLTLIBRARIES:
 uninstall-checklibLTLIBRARIES:

Deleted: gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/foo-gwrap.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/foo-gwrap.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/foo-gwrap.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,21 +0,0 @@
-(use-modules (g-wrap))
-
-(debug-set! maxdepth 100000)
-(debug-set! stack 200000)
-
-(use-modules (g-wrap gw-standard-spec))
-
-(let ((ws (gw:new-wrapset "foo-gwrap")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-
-  (gw:wrapset-add-cs-declarations! 
-   ws
-   (lambda (wrapset client-wrapset) 
-     "#include \"foo.h\"\n"))
-
-  (gw:wrap-function
-   ws
-   'foo:hello
-   '<gw:bool> "foo_hello" '()
-   "Print a simple message from C"))

Copied: gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/foo.i (from rev 15058, gnucash/trunk/src/gnc-module/test/mod-foo/foo.i)

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/gnc-mod-foo.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/gnc-mod-foo.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/mod-foo/gnc-mod-foo.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,8 +6,8 @@
 #include <glib.h>
 #include <libguile.h>
 
-#include "foo-gwrap.h"
 #include "gnc-module-api.h"
+#include "swig-foo.c"
 
 int libgncmodfoo_LTX_gnc_module_system_interface = 0;
 
@@ -20,7 +20,6 @@
 char *libgncmodfoo_LTX_gnc_module_description(void);
 int libgncmodfoo_LTX_gnc_module_init(int refcount);
 
-
 char *
 libgncmodfoo_LTX_gnc_module_path(void) {
   return g_strdup("gnucash/foo");
@@ -33,8 +32,9 @@
 
 int 
 libgncmodfoo_LTX_gnc_module_init(int refcount) {
-  /* publish the g-wrapped Scheme bindings for libfoo */
-  gw_init_wrapset_foo_gwrap();
+  /* publish the wrapped Scheme bindings for libfoo */
+  scm_init_sw_foo_module();
+  scm_c_eval_string("(use-modules (sw_foo))");
   
   /* use the Scheme "foo" module */
   scm_c_eval_string("(use-modules (gnucash foo))");

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/test-dynload.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/test-dynload.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/test-dynload.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -5,6 +5,10 @@
  *********************************************************************/
 
 #include <stdio.h>
+#ifdef G_OS_WIN32
+# undef DLL_EXPORT /* Will cause warnings in ltdl.h if defined */
+# define LIBLTDL_DLL_IMPORT
+#endif
 #include <ltdl.h>
 #include <libguile.h>
 

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/test-gwrapped-c
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/test-gwrapped-c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/test-gwrapped-c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,4 +2,4 @@
 guile -c "(use-modules (gnucash gnc-module))
           (gnc:module-system-init)
           (gnc:module-load \"gnucash/foo\" 0)
-          (exit (foo:hello))"
+          (exit (eq? 10 (foo-hello)))"

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/test-load-deps
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/test-load-deps	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/test-load-deps	2007-01-05 17:25:28 UTC (rev 15313)
@@ -8,8 +8,8 @@
 (gnc:module-system-init)
 (gnc:module-load "gnucash/baz" 0)
 
-(baz:hello)
-(foo:hello)
+(baz-hello)
+(foo-hello)
 (baz:scheme-hello)
 (foo:scheme-hello)
 

Modified: gnucash/branches/register-rewrite/src/gnc-module/test/test-scm-multi
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-module/test/test-scm-multi	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-module/test/test-scm-multi	2007-01-05 17:25:28 UTC (rev 15313)
@@ -5,12 +5,12 @@
 (use-modules (gnucash gnc-module))
 (gnc:module-system-init) 
 (gnc:module-load "gnucash/foo" 0)
-(foo:hello)
+(foo-hello)
 (foo:scheme-hello)
 (gnc:module-load "gnucash/bar" 0)
-(foo:hello)
+(foo-hello)
 (foo:scheme-hello)
-(bar:hello)
+(bar-hello)
 (bar:scheme-hello)
 
 ;; Local Variables:

Modified: gnucash/branches/register-rewrite/src/gnc-test-env
===================================================================
--- gnucash/branches/register-rewrite/src/gnc-test-env	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnc-test-env	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,10 +6,16 @@
 ;; arguments listing gnc-module-dirs, guile-load-dirs, and
 ;; library-dirs
 
+(use-modules (srfi srfi-13) (srfi srfi-14)) ;; for string-tokenize
 (debug-enable 'backtrace)
 (debug-enable 'debug)
 (read-enable 'positions)
 
+;; Are we on MS Windows here? If yes, make this a #t.
+;; (utsname:sysname (uname)) wasn't available in my guile-1.6.7 on
+;; mingw, so I don't know an automated way to do this so far.
+(define is-windows? #f)
+
 (define args (cdr (command-line)))
 (define display-exports? #t)
 
@@ -42,7 +48,32 @@
   (set! guile-load-dirs (reverse guile-load-dirs))
   (set! library-dirs (reverse library-dirs)))
 
+;; The character set of everything except a directory separator as
+;; necessary for string-tokenize below
+(define char-set-path
+  (char-set-adjoin 
+   (char-set-delete char-set:graphic #\/)
+   #\ ))
 
+;; The directory separator string.
+(define dir-separator-string
+  (if is-windows?
+      "\\\\" ;; Needs to be quoted twice because of additional shell quoting
+      "/"))
+
+;; The path separator string; only needed for GUILE_LOAD_PATH
+(define path-sep-str
+  (if is-windows?
+      ";"
+      ":"))
+
+;; Adapt the directory separator character in the given PATH and
+;; return the result.
+(define (adapt-dirsep path)
+  (string-join
+   (string-tokenize path char-set-path)
+   dir-separator-string))
+
 (if (and (not (null? args))
          (string=? "--no-exports" (car args)))
     (begin
@@ -53,43 +84,42 @@
 
 (process-args! args)
 
-(display "GNC_MODULE_PATH=${GNC_MODULE_PATH}")
-(display (apply string-append
-                (map (lambda (dir) (string-append ":" dir))
-                     gnc-module-dirs)))
+(display "GNC_MODULE_PATH=${GNC_MODULE_PATH}:")
+(display (adapt-dirsep
+	  (string-join gnc-module-dirs
+		       ":")))
 
-(display " GUILE_LOAD_PATH=${GUILE_LOAD_PATH}")
-(display (apply string-append
-                (map (lambda (dir) (string-append ":" dir))
-                     gnc-module-dirs)))
-(display (apply string-append
-                (map (lambda (dir) (string-append ":" dir))
-                     guile-load-dirs)))
+(display " GUILE_LOAD_PATH=\"${GUILE_LOAD_PATH}")
+(display path-sep-str)
+(display (adapt-dirsep
+	  (string-join (append gnc-module-dirs guile-load-dirs)
+		       path-sep-str)))
+(display "\"")
 
 (display " LD_LIBRARY_PATH=${LD_LIBRARY_PATH}")
-(display (apply string-append
-                (map
-                 (lambda (dir)
-                   (string-append ":" dir ":" dir "/.libs"))
-                 gnc-module-dirs)))
-(display (apply string-append
-                (map
-                 (lambda (dir)
-                   (string-append ":" dir ":" dir "/.libs"))
-                 library-dirs)))
+(display (adapt-dirsep
+	  (apply string-append
+		 (map
+		  (lambda (dir)
+		    (string-append ":" dir ":" dir "/.libs"))
+		  (append gnc-module-dirs library-dirs)))))
 
 (display " LTDL_LIBRARY_PATH=${LTDL_LIBRARY_PATH}")
 (display (apply string-append
                 (map
                  (lambda (dir)
                    (string-append ":" dir ":" dir "/.libs"))
-                 gnc-module-dirs)))
-(display (apply string-append
-                (map
-                 (lambda (dir)
-                   (string-append ":" dir ":" dir "/.libs"))
-                 library-dirs)))
+                 (append gnc-module-dirs library-dirs))))
 
+(if is-windows?
+    (begin
+      (display " PATH=${PATH}")
+      (display (apply string-append
+		      (map
+		       (lambda (dir)
+			 (string-append ":" dir ":" dir "/.libs"))
+		       (append gnc-module-dirs library-dirs))))))
+
 (if display-exports?
     (begin
       (display "; ")


Property changes on: gnucash/branches/register-rewrite/src/gnome
___________________________________________________________________
Name: svn:ignore
   - *.diff
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gnc-dir.h
gnucash.desktop
gnucash.keys
gnucash.c
gw-gnc.scm
gw-gnc.h
gw-gnc.c
gw-gnc.html
i18n.h
gnc-version.h
.DS_Store
g-wrapped
gnucash


semantic.cache

TAGS

   + *.diff
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gnc-dir.h
gnucash.desktop
gnucash.desktop.in
gnucash.keys
gnucash.c
swig-gnome.c
i18n.h
gnc-version.h
.DS_Store
gnucash
semantic.cache
TAGS


Modified: gnucash/branches/register-rewrite/src/gnome/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,11 +1,7 @@
 SUBDIRS = glade schemas ui
 
-lib_LTLIBRARIES = libgncgnome.la libgw-gnc.la 
+lib_LTLIBRARIES = libgncgnome.la
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-gnc-spec.scm gw-gnc.scm
-#nodist_gwmod_DATA = gw-gnc.scm
-
 libgncgnome_la_LIBADD = \
   ${top_builddir}/src/register/ledger-core/libgncmod-ledger-core.la \
   ${top_builddir}/src/register/register-gnome/libgncmod-register-gnome.la \
@@ -16,21 +12,14 @@
   ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
   ${top_builddir}/src/backend/file/libgnc-backend-file-utils.la \
   ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
-  ${top_builddir}/src/engine/libgw-engine.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
   ${top_builddir}/src/calculation/libgncmod-calculation.la \
   ${top_builddir}/src/core-utils/libcore-utils.la \
   ${GLADE_LIBS} \
-  ${G_WRAP_LINK_ARGS} \
   ${GUILE_LIBS} ${GNOME_LIBS} ${GLIB_LIBS} ${QOF_LIBS}
 
-libgw_gnc_la_SOURCES = gw-gnc.c
-
-libgw_gnc_la_LDFLAGS =  \
-  ${G_WRAP_LINK_ARGS} ${GLIB_LIBS}
-libgw_gnc_la_LIBADD = libgncgnome.la
-
 libgncgnome_la_SOURCES = \
+  swig-gnome.c \
   dialog-chart-export.c  \
   dialog-commodities.c \
   dialog-fincalc.c \
@@ -98,16 +87,20 @@
   gnc-plugin-page-register.h \
   gnc-plugin-page-transactions.h \
   gnc-split-reg.h \
-  gw-gnc.h \
   lot-viewer.h \
   reconcile-list.h \
   top-level.h \
-  window-reconcile.h \
-  gw-gnc.h
+  window-reconcile.h
 
+if BUILDING_FROM_SVN
+swig-gnome.c: gnome.i dialog-progress.h
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
+
 EXTRA_DIST = \
   gnucash.desktop.in \
-  ${gwmod_DATA}
+  gnome.i
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \
@@ -117,7 +110,6 @@
   -I${top_srcdir}/src/network-utils \
   -I${top_srcdir}/src/app-utils \
   -I${top_srcdir}/src/backend/file \
-  -I${top_srcdir}/src/g-wrap \
   -I${top_srcdir}/src/gnome-utils \
   -I${top_srcdir}/src/gnome-search \
   -I${top_srcdir}/src/register/ledger-core \
@@ -127,7 +119,6 @@
   -I${top_srcdir}/src/report/report-gnome \
   -I${top_srcdir}/lib/libc \
   ${GUILE_INCS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GNOME_CFLAGS} \
   ${GNOME_PRINT_CFLAGS} \
   ${GDK_PIXBUF_CFLAGS} \
@@ -141,34 +132,5 @@
 # The line below breaks automake 1.5.  
 ##OMIT_DEPENDENCIES = gnc-dir.h
 
-noinst_DATA = .scm-links
-
-if GNUCASH_SEPARATE_BUILDDIR
-#For compiling
-SCM_FILE_LINKS = gw-gnc-spec.scm
-endif
-
-.scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
-if GNUCASH_SEPARATE_BUILDDIR
-	for X in ${SCM_FILE_LINKS} ; do \
-	  $(LN_S) -f ${srcdir}/$$X . ; \
-	done
-endif
-	touch .scm-links
-
-gw-gnc.scm gw-gnc.h gw-gnc.c gw-gnc.html: \
-  gw-gnc-spec.scm .scm-links ${top_builddir}/config.status Makefile
-	FLAVOR=gnome $(GUILE) -c \
-          "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-           (set! %load-path (cons \"../engine\" %load-path)) \
-           (set! %load-path (cons \"../app-utils\" %load-path)) \
-           (set! %load-path (cons \"../gnome-utils\" %load-path)) \
-           (set! %load-path (cons \"../report/report-gnome\" %load-path)) \
-           (primitive-load \"./gw-gnc-spec.scm\") \
-           (gw:generate-wrapset \"gw-gnc\")"
-BUILT_SOURCES = gw-gnc.scm gw-gnc.h gw-gnc.c
-CLEANFILES = gnucash.desktop gnucash g-wrapped .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-gnc.html
+CLEANFILES = gnucash.desktop
+MAINTAINERCLEANFILES = swig-gnome.c

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-chart-export.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-chart-export.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-chart-export.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -71,7 +71,7 @@
 	data = (chart_data*)user_data;
 	acc = (Account*)ent;
 	if(0 == safe_strcmp(EQUITY_ACCOUNT_NAME, xaccAccountGetName(acc)) 
-		&& (xaccAccountGetType(acc) == EQUITY))
+		&& (xaccAccountGetType(acc) == ACCT_TYPE_EQUITY))
 	{
 		success = qof_entity_copy_to_session(data->chart_session, ent);
 		if(!success) { return; }
@@ -248,7 +248,7 @@
 			xaccAccountBeginEdit (data->equity_account);
 			xaccAccountSetName (data->equity_account, EQUITY_ACCOUNT_NAME);
 			xaccAccountSetDescription(data->equity_account, EQUITY_ACCOUNT_NAME);
-			xaccAccountSetType (data->equity_account, EQUITY);
+			xaccAccountSetType (data->equity_account, ACCT_TYPE_EQUITY);
 			xaccAccountSetCommodity (data->equity_account, gnc_default_currency());
 		  }
 		qof_object_foreach(GNC_ID_ACCOUNT, book, chart_entity_cb, data);

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-fincalc.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-fincalc.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-fincalc.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -64,8 +64,8 @@
 
   GtkWidget *calc_button;
 
-  GtkWidget *compounding_menu;
-  GtkWidget *payment_menu;
+  GtkWidget *compounding_combo;
+  GtkWidget *payment_combo;
 
   GtkWidget *end_of_period_radio;
   GtkWidget *discrete_compounding_radio;
@@ -162,10 +162,10 @@
   gtk_label_set_text (GTK_LABEL(fcd->payment_total_label), string);
 
   i = normalize_period(&fcd->financial_info.CF);
-  gtk_option_menu_set_history(GTK_OPTION_MENU(fcd->compounding_menu), i);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(fcd->compounding_combo), i);
 
   i = normalize_period(&fcd->financial_info.PF);
-  gtk_option_menu_set_history(GTK_OPTION_MENU(fcd->payment_menu), i);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(fcd->payment_combo), i);
 
   gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(fcd->end_of_period_radio),
                                !fcd->financial_info.bep);
@@ -203,10 +203,10 @@
     gnc_amount_edit_get_damount(GNC_AMOUNT_EDIT(fcd->amounts[FUTURE_VALUE]));
   fcd->financial_info.fv = -fcd->financial_info.fv;
 
-  i = gnc_option_menu_get_active(fcd->compounding_menu);
+  i = gtk_combo_box_get_active(GTK_COMBO_BOX(fcd->compounding_combo));
   fcd->financial_info.CF = periods[i];
 
-  i = gnc_option_menu_get_active(fcd->payment_menu);
+  i = gtk_combo_box_get_active(GTK_COMBO_BOX(fcd->payment_combo));
   fcd->financial_info.PF = periods[i];
 
   toggle = GTK_TOGGLE_BUTTON(fcd->end_of_period_radio);
@@ -254,13 +254,6 @@
   g_free(fcd);
 }
 
-static void
-connect_fincalc_menu_item(GtkWidget *item, gpointer data)
-{
-  g_signal_connect (G_OBJECT (item), "activate",
-                    G_CALLBACK (fincalc_update_calc_button_cb), data);
-}
-
 void
 fincalc_compounding_radio_toggled(GtkToggleButton *togglebutton, gpointer data)
 {
@@ -274,7 +267,7 @@
 
   sensitive = gtk_toggle_button_get_active (togglebutton);
 
-  gtk_widget_set_sensitive (fcd->compounding_menu, sensitive);
+  gtk_widget_set_sensitive (fcd->compounding_combo, sensitive);
 }
 
 void
@@ -554,7 +547,7 @@
 {
   FinCalcDialog *fcd;
   GtkWidget *button;
-  GtkWidget *menu;
+  GtkWidget *combo;
   GtkWidget *edit;
   GladeXML  *xml;
 
@@ -601,17 +594,15 @@
   fcd->calc_button = glade_xml_get_widget (xml, "calc_button");
 
 
-  menu = glade_xml_get_widget (xml, "compounding_menu");
-  fcd->compounding_menu = menu;
-  gnc_option_menu_init(menu);
-  menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(menu));
-  gtk_container_forall(GTK_CONTAINER(menu), connect_fincalc_menu_item, fcd);
+  combo = glade_xml_get_widget (xml, "compounding_combo");
+  fcd->compounding_combo = combo;
+  g_signal_connect(fcd->compounding_combo, "changed",
+		   G_CALLBACK (fincalc_update_calc_button_cb), fcd);
 
-  menu = glade_xml_get_widget (xml, "payment_menu");
-  fcd->payment_menu = menu;
-  gnc_option_menu_init(menu);
-  menu = gtk_option_menu_get_menu(GTK_OPTION_MENU(menu));
-  gtk_container_forall(GTK_CONTAINER(menu), connect_fincalc_menu_item, fcd);
+  combo = glade_xml_get_widget (xml, "payment_combo");
+  fcd->payment_combo = combo;
+  g_signal_connect(fcd->compounding_combo, "changed",
+		   G_CALLBACK (fincalc_update_calc_button_cb), fcd);
 
   button = glade_xml_get_widget (xml, "period_payment_radio");
   fcd->end_of_period_radio = button;

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-price-edit-db.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-price-edit-db.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-price-edit-db.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -27,6 +27,7 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <libguile.h>
+#include "guile-mappings.h"
 #include <time.h>
 
 #include "dialog-utils.h"
@@ -45,7 +46,7 @@
 #include "gnc-ui-util.h"
 #include "guile-util.h"
 #include "engine-helpers.h"
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 
 #define DIALOG_PRICE_DB_CM_CLASS "dialog-price-edit-db"
@@ -262,7 +263,7 @@
   PricesDialog *pdb_dialog = data;
   SCM quotes_func;
   SCM book_scm;
-  SCM scm_window, window_type;
+  SCM scm_window;
 
   ENTER(" ");
   quotes_func = scm_c_eval_string ("gnc:book-add-quotes");
@@ -277,8 +278,8 @@
     return;
   }
 
-  window_type = scm_c_eval_string("<gtk:Widget*>");
-  scm_window = gw_wcp_assimilate_ptr(pdb_dialog->dialog, window_type);
+  scm_window =  SWIG_NewPointerObj(pdb_dialog->dialog,
+                                   SWIG_TypeQuery("_p_GtkWidget"), 0);
 
   gnc_set_busy_cursor (NULL, TRUE);
   scm_call_2 (quotes_func, scm_window, book_scm);

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-print-check.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,7 +45,6 @@
 #define GCONF_SECTION 	       "dialogs/print_checks"
 #define KEY_CHECK_FORMAT       "check_format"
 #define KEY_CHECK_POSITION     "check_position"
-#define KEY_DATE_FORMAT        "date_format"
 #define KEY_DATE_FORMAT_USER   "date_format_custom"
 #define KEY_CUSTOM_PAYEE       "custom_payee"
 #define KEY_CUSTOM_DATE        "custom_date"

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-scheduledxaction.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-scheduledxaction.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-scheduledxaction.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -42,10 +42,12 @@
 
 SchedXactionDialog * gnc_ui_scheduled_xaction_dialog_create(void);
 void gnc_ui_scheduled_xaction_dialog_destroy(SchedXactionDialog *sxd);
+#ifdef __GTK_CLIST_H__
 void row_select_handler( GtkCList *clist, gint row, gint col,
                          GdkEventButton *event, gpointer d );
 void row_unselect_handler( GtkCList *clist, gint row, gint col,
                          GdkEventButton *event, gpointer d );
+#endif
 
 void gnc_sxd_list_refresh( SchedXactionDialog *sxd );
 

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-sx-from-trans.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-sx-from-trans.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-sx-from-trans.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,7 @@
  *                           scheduled transaction from a real one  *
  * Copyright (C) 2001 Robert Merkel <rgmerk at mira.net>               *
  * Copyright (C) 2001 Joshua Sled <jsled at asynchronous.org>          *
+ * 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   *
@@ -24,6 +25,7 @@
 
 #include "config.h"
 
+#include <stdlib.h>
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include "glib-compat.h"
@@ -55,7 +57,7 @@
 #define SXFTD_PARAM_TABLE "param_table"
 #define SXFTD_NAME_ENTRY "name_entry"
 #define SXFTD_N_OCCURRENCES_ENTRY "n_occurrences_entry"
-#define SXFTD_FREQ_OPTION_MENU "freq_option_menu"
+#define SXFTD_FREQ_COMBO_BOX "freq_combo_box"
 /* #define SXFTD_END_DATE_EDIT "end_date_edit" */
 #define SXFTD_START_DATE_EDIT "start_date_edit"
 #define SXFTD_EX_CAL_FRAME "ex_cal_frame"
@@ -71,7 +73,7 @@
 
 static QofLogModule log_module = GNC_MOD_SX;
 
-static void sxftd_freq_option_changed( GtkWidget *w, gpointer user_data );
+static void sxftd_freq_combo_changed( GtkWidget *w, gpointer user_data );
 static void gnc_sx_trans_window_response_cb(GtkDialog *dialog, gint response, gpointer data);
 
 static void sxftd_destroy( GtkWidget *w, gpointer user_data );
@@ -295,8 +297,8 @@
 
   /* Note that we make the start date the *NEXT* instance, not the
    * present one. */
-  w = glade_xml_get_widget(sxfti->gxml, SXFTD_FREQ_OPTION_MENU);
-  index = gnc_option_menu_get_active(w);
+  w = glade_xml_get_widget(sxfti->gxml, SXFTD_FREQ_COMBO_BOX);
+  index = gtk_combo_box_get_active(GTK_COMBO_BOX(w));
 
   switch(index)
   {
@@ -423,6 +425,12 @@
   /* compute good initial date. */
   start_tt = xaccTransGetDate( sxfti->trans );
   g_date_set_time_t( &date, start_tt );
+  w = glade_xml_get_widget(sxfti->gxml,
+			   SXFTD_FREQ_COMBO_BOX);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(w), 0);
+  g_signal_connect( w, "changed",
+                    G_CALLBACK(sxftd_freq_combo_changed),
+                    sxfti );
   fs = xaccFreqSpecMalloc( gnc_get_current_book() );
   sxftd_update_fs( sxfti, &date, fs );
   xaccFreqSpecGetNextInstance( fs, &date, &nextDate );
@@ -438,14 +446,6 @@
   gtk_editable_insert_text( GTK_EDITABLE(w), transName,
                             (strlen(transName) * sizeof(char)), &pos );
 
-  w = glade_xml_get_widget(sxfti->gxml,
-			   SXFTD_FREQ_OPTION_MENU);
-  gnc_option_menu_init(w);
-  w = gtk_option_menu_get_menu( GTK_OPTION_MENU(w) );
-  g_signal_connect( GTK_OBJECT(w), "selection-done",
-                    G_CALLBACK(sxftd_freq_option_changed),
-                    sxfti );
-
   g_signal_connect( GTK_OBJECT(w), "destroy",
                     G_CALLBACK(sxftd_destroy),
                     sxfti );
@@ -588,7 +588,7 @@
  * somehow.
  **/
 static void
-sxftd_freq_option_changed( GtkWidget *w, gpointer user_data )
+sxftd_freq_combo_changed( GtkWidget *w, gpointer user_data )
 {
   SXFromTransInfo *sxfti = (SXFromTransInfo*)user_data;
   GDate date, nextDate;

Modified: gnucash/branches/register-rewrite/src/gnome/dialog-tax-info.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/dialog-tax-info.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/dialog-tax-info.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -26,6 +26,7 @@
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #include <libguile.h>
+#include "guile-mappings.h"
 
 #include "Account.h"
 #include "gnc-ui-util.h"
@@ -227,6 +228,7 @@
 
   view = GTK_TREE_VIEW(ti_dialog->txf_category_view);
   store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+  g_object_ref(store);
   gtk_tree_view_set_model(view, NULL);
 
   gtk_list_store_clear(store);
@@ -244,6 +246,7 @@
   }
 
   gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
 }
 
 static void
@@ -472,7 +475,7 @@
   ti_dialog->income = show_income;
 
   tree = GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview);
-  show_type = show_income ? INCOME : EXPENSE;
+  show_type = show_income ? ACCT_TYPE_INCOME : ACCT_TYPE_EXPENSE;
 
   gnc_tree_view_account_get_view_info (tree, &info);
 
@@ -521,7 +524,7 @@
 
   tax_info_show_income_accounts (ti_dialog, show_income);
 
-  ti_dialog->account_type = show_income ? INCOME : EXPENSE;
+  ti_dialog->account_type = show_income ? ACCT_TYPE_INCOME : ACCT_TYPE_EXPENSE;
   gnc_tree_view_account_refilter (GNC_TREE_VIEW_ACCOUNT (ti_dialog->account_treeview));
 
   gnc_tax_info_update_accounts (ti_dialog);
@@ -668,7 +671,7 @@
   ti_dialog->dialog = dialog;
   tido = GTK_OBJECT (dialog);
 
-  ti_dialog->account_type = EXPENSE;
+  ti_dialog->account_type = ACCT_TYPE_EXPENSE;
   ti_dialog->income_txf_infos = load_txf_info (TRUE);
   ti_dialog->expense_txf_infos = load_txf_info (FALSE);
 
@@ -703,21 +706,10 @@
     gtk_text_view_set_wrap_mode(GTK_TEXT_VIEW(text), GTK_WRAP_WORD);
     ti_dialog->txf_help_text = text;
 
-    /* set text height */
-    {
-      GtkStyle *style = gtk_widget_get_style (text);
-      GdkFont *font = NULL;
-
-      if (style != NULL)
-        font = gdk_font_from_description (style->font_desc);
-
-      if (font)
-        gtk_widget_set_size_request (text, -1, (font->ascent + font->descent) * 5 + 6);
-    }
-
     tree_view = GTK_TREE_VIEW(glade_xml_get_widget(xml, "txf_category_view"));
     store =  gtk_list_store_new(2, G_TYPE_STRING, G_TYPE_STRING);
     gtk_tree_view_set_model(tree_view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
     renderer = gtk_cell_renderer_text_new();
     column = gtk_tree_view_column_new_with_attributes
       (_("Form"), renderer, "text", 0, NULL);

Modified: gnucash/branches/register-rewrite/src/gnome/druid-acct-period.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/druid-acct-period.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/druid-acct-period.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -393,7 +393,8 @@
   AccountGroup *group = gnc_get_current_group ();
   xaccGroupScrubOrphans (group);
   xaccGroupScrubImbalance (group);
-  xaccGroupScrubLots (group);
+  // XXX: Lots are disabled
+  //xaccGroupScrubLots (group);
 }
 
 /* =============================================================== */

Modified: gnucash/branches/register-rewrite/src/gnome/druid-hierarchy.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/druid-hierarchy.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/druid-hierarchy.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -43,7 +43,7 @@
 #include "gnc-gconf-utils.h"
 #include "gnc-hooks.h"
 #include "gnc-component-manager.h"
-#include "../gnome-utils/gnc-dir.h"
+#include "gnc-path.h"
 #include "gnc-gui-query.h"
 #include "gnc-tree-view-account.h"
 #include "gnc-ui-util.h"
@@ -194,7 +194,7 @@
 #endif
 
     i = strlen(locale);
-    ret = g_strdup_printf("%s/%s", top_dir, locale);
+    ret = g_build_filename(top_dir, locale, (char *)NULL);
 
     while (stat(ret, &buf) != 0)
     { 
@@ -202,12 +202,12 @@
 	if (i<1) 
 	{
 	    g_free(ret);
-	    ret = g_strdup_printf("%s/%s", top_dir, default_locale);
+	    ret = g_build_filename(top_dir, default_locale, (char *)NULL);
 	    break;
 	}
 	locale[i] = '\0';
 	g_free(ret);
-	ret = g_strdup_printf("%s/%s", top_dir, locale);
+	ret = g_build_filename(top_dir, locale, (char *)NULL);
     }
     
     g_free(locale);
@@ -358,6 +358,7 @@
 account_categories_tree_view_prepare (hierarchy_data  *data)
 {
 	GSList *list;
+	gchar *gnc_accounts_dir;
 	gchar *locale_dir;
 	GtkTreeView *tree_view;
 	GtkListStore *model;
@@ -366,9 +367,11 @@
 	GtkTreeSelection *selection;
 	GtkTreePath *path;
 
-	locale_dir = gnc_get_ea_locale_dir (GNC_ACCOUNTS_DIR);
+	gnc_accounts_dir = gnc_path_get_accountsdir ();
+	locale_dir = gnc_get_ea_locale_dir (gnc_accounts_dir);
  	list = gnc_load_example_account_list (data->temporary,
 					      locale_dir);
+	g_free (gnc_accounts_dir);
 	g_free (locale_dir);
 
 	/* Prepare the account_categories GtkTreeView with a model and with some columns */
@@ -473,9 +476,13 @@
 
 	/* Add a new one if something selected */
 	if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+		gchar *text2;
 		gtk_tree_model_get (model, &iter, COL_ACCOUNT, &gea, -1);
-		text = g_strdup_printf(_("<b>Accounts in '%s'</b>"), gea->title);
+		/* Translators: '%s' is the name of the selected account hierarchy template. */
+		text2 = g_strdup_printf(_("Accounts in '%s'"), gea->title);
+		text = g_strdup_printf("<b>%s</b>", text2);
 		gtk_label_set_markup(data->category_accounts_label, text);
+		g_free(text2);
 		g_free(text);
 		buffer = gtk_text_view_get_buffer(data->category_description);
 		gtk_text_buffer_set_text(buffer, gea->long_description, -1);
@@ -490,8 +497,10 @@
 		gtk_container_add(GTK_CONTAINER(data->category_accounts_container), GTK_WIDGET(tree_view));
 		gtk_widget_show(GTK_WIDGET(tree_view));
 	} else {
-		gtk_label_set_markup(data->category_accounts_label,
-				     _("<b>Accounts in Category</b>"));
+		gchar *text;
+		text = g_strdup_printf ("<b>%s</b>", _("Accounts in Category"));
+		gtk_label_set_markup(data->category_accounts_label, text);
+		g_free (text);
 		buffer = gtk_text_view_get_buffer(data->category_description);
 		gtk_text_buffer_set_text(buffer, "", -1);
 	}
@@ -698,7 +707,7 @@
 		string = xaccPrintAmount (balance, print_info);
 	}
 
- 	if (xaccAccountGetType(account) == EQUITY) {
+ 	if (xaccAccountGetType(account) == ACCT_TYPE_EQUITY) {
 	  allow_value = FALSE;
 	  string=_("zero");
 	} else {

Modified: gnucash/branches/register-rewrite/src/gnome/druid-loan.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/druid-loan.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/druid-loan.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * druid-loan.c : A Gnome Druid for setting up loan-repayment       *
  *     scheduled transactions.                                      *
  * Copyright (C) 2002 Joshua Sled <jsled at asynchronous.org>          *
+ * 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   *
@@ -64,6 +65,7 @@
 #  define PARAM_TABLE      "param_table"
 #  define ORIG_PRINC_ENTRY "orig_princ_ent"
 #  define IRATE_SPIN       "irate_spin"
+#  define TYPE_COMBOBOX    "type_combobox"
 #  define VAR_CONTAINER    "type_freq_frame"
 #  define LENGTH_SPIN      "len_spin"
 #  define LENGTH_OPT       "len_opt"
@@ -98,6 +100,14 @@
 
 #define OPT_VBOX_SPACING 2
 
+enum loan_cols {
+	LOAN_COL_DATE = 0,
+	LOAN_COL_PAYMENT,
+	LOAN_COL_PRINCIPAL,
+	LOAN_COL_INTEREST,
+	NUM_LOAN_COLS
+};
+
 typedef enum {
         CURRENT_YEAR,
         NOW_PLUS_ONE,
@@ -251,12 +261,12 @@
         GNCAccountSel *prmAccountGAS;
         GNCAmountEdit *prmOrigPrincGAE;
         GtkSpinButton *prmIrateSpin;
-        GtkOptionMenu *prmType;
+        GtkComboBox   *prmType;
         GtkFrame      *prmVarFrame;
         GNCFrequency  *prmVarGncFreq;
         GNCDateEdit   *prmStartDateGDE;
         GtkSpinButton *prmLengthSpin;
-        GtkOptionMenu *prmLengthType;
+        GtkComboBox   *prmLengthType;
         GtkSpinButton *prmRemainSpin;
 
         /* opt = options */
@@ -294,13 +304,13 @@
         GNCFrequency     *payGncFreq;
 
         /* rev = review */
-        GtkOptionMenu     *revRangeOpt;
+        GtkComboBox       *revRangeOpt;
         GtkFrame          *revDateFrame;
         GtkTable          *revTable;
         GNCDateEdit       *revStartDate;
         GNCDateEdit       *revEndDate;
         GtkScrolledWindow *revScrollWin;
-        GtkCList          *revCL;
+        GtkTreeView       *revView;
 } LoanDruidData;
 
 /**
@@ -329,7 +339,7 @@
 static void ld_destroy( GtkObject *o, gpointer ud );
 
 static void ld_cancel_check( GnomeDruid *gd, LoanDruidData *ldd );
-static void ld_prm_type_changed( GtkWidget *w, gint index, gpointer ud );
+static void ld_prm_type_changed( GtkWidget *w, gpointer ud );
 static void ld_calc_upd_rem_payments( GtkWidget *w, gpointer ud );
 
 static void ld_escrow_toggle( GtkToggleButton *tb, gpointer ud );
@@ -349,17 +359,14 @@
                                GDate *end );
 
 static void ld_rev_recalc_schedule( LoanDruidData *ldd );
-static void ld_rev_range_opt_changed( GtkButton *b, gpointer ud );
+static void ld_rev_range_opt_changed( GtkComboBox *combo, gpointer ud );
 static void ld_rev_range_changed( GNCDateEdit *gde, gpointer ud );
 static void ld_rev_get_dates( LoanDruidData *ldd,
                               GDate *start,
                               GDate *end );
-static void ld_rev_update_clist( LoanDruidData *ldd,
+static void ld_rev_update_view( LoanDruidData *ldd,
                                  GDate *start,
                                  GDate *end );
-static void ld_rev_clist_allocate_col_widths( GtkWidget *w,
-                                              GtkAllocation *alloc,
-                                              gpointer user_data );
 static void ld_rev_sched_list_free( gpointer data, gpointer user_data );
 static void ld_rev_hash_to_list( gpointer key,
                                  gpointer val,
@@ -418,23 +425,26 @@
         /* non-gladeable widget setup */
         {
                 int i;
-                // LIABILITY
+                // ACCT_TYPE_LIABILITY
                 GList *liabilityAcct;
-                // BANK, CASH, CREDIT, ASSET + LIABILITY
+                // ACCT_TYPE_BANK, ACCT_TYPE_CASH, ACCT_TYPE_CREDIT,
+                // ACCT_TYPE_ASSET + ACCT_TYPE_LIABILITY
                 GList *paymentFromAccts;
-                // EXPENSE, LIABILITY, + payment-froms.
+                // ACCT_TYPE_EXPENSE, ACCT_TYPE_LIABILITY, + payment-froms.
                 GList *paymentToAccts;
                 int fromLen = 5;
-                GNCAccountType paymentFroms[] = { BANK, CASH, CREDIT, ASSET, LIABILITY };
+                GNCAccountType paymentFroms[] = { ACCT_TYPE_BANK, ACCT_TYPE_CASH,
+						  ACCT_TYPE_CREDIT, ACCT_TYPE_ASSET,
+						  ACCT_TYPE_LIABILITY };
                 int toLen = 2;
-                GNCAccountType paymentTos[] = { EXPENSE };
+                GNCAccountType paymentTos[] = { ACCT_TYPE_EXPENSE };
 
                 liabilityAcct = NULL;
                 paymentFromAccts = NULL;
                 paymentToAccts = NULL;
 
                 liabilityAcct = g_list_append( liabilityAcct,
-                                               GINT_TO_POINTER( LIABILITY ) );
+                                               GINT_TO_POINTER( ACCT_TYPE_LIABILITY ) );
                 for ( i = 0; i < fromLen; i++ )
                 {
                         paymentFromAccts
@@ -547,26 +557,9 @@
 
                 gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame), FALSE );
                 {
-                        GtkAlignment *a;
-                        GNCOptionInfo typeOptInfo[] = {
-			        { _("Fixed"), _("A Fixed-Rate loan"), ld_prm_type_changed, ldd },
-                                { _("3/1 Year"),
-                        /* Translators: ARM = Adjustable Rate Mortgage; that is a
-			   loan where the rate is constant for the period before
-			   the '/', e.g. 5 years, and then may change. See also
-			   http://www.fanniemae.com/tools/glossary.jhtml */
-				  _("A 3/1 Year ARM"),         ld_prm_type_changed, ldd },
-                                { _("5/1 Year"),   _("A 5/1 Year ARM"),         ld_prm_type_changed, ldd },
-                                { _("7/1 Year"),   _("A 7/1 Year ARM"),         ld_prm_type_changed, ldd },
-                                { _("10/1 Year"),  _("A 10/1 Year ARM"),        ld_prm_type_changed, ldd },
-                        };
-                        ldd->prmType =
-                                GTK_OPTION_MENU( gnc_build_option_menu( typeOptInfo, 5 ) );
-                        a = GTK_ALIGNMENT( gtk_alignment_new( 0.0, 0.5, 0.25, 1.0 ) );
-                        gtk_container_add( GTK_CONTAINER(a), GTK_WIDGET(ldd->prmType) );
-                        gtk_table_attach( ldd->prmTable, GTK_WIDGET(a),
-                                          3, 4, 2, 3,
-                                          0, 0, 2, 2 );
+                        g_signal_connect( ldd->prmType, "changed",
+                                          G_CALLBACK( ld_prm_type_changed ),
+                                          ldd );
                 }
 
                 {
@@ -594,8 +587,7 @@
                         g_signal_connect( ldd->prmLengthSpin, "changed",
                                           G_CALLBACK( ld_calc_upd_rem_payments ),
                                           ldd );
-                        g_signal_connect( gtk_option_menu_get_menu(ldd->prmLengthType),
-                                          "selection-done",
+                        g_signal_connect( ldd->prmLengthType, "changed",
                                           G_CALLBACK( ld_calc_upd_rem_payments ),
                                           ldd );
 
@@ -605,10 +597,6 @@
                         gtk_spin_button_set_adjustment( ldd->prmRemainSpin, a );
                 }
                
-                gnc_option_menu_init( GTK_WIDGET(ldd->prmType) );
-                gnc_option_menu_init( GTK_WIDGET(ldd->prmLengthType) );
-                gnc_option_menu_init( GTK_WIDGET(ldd->revRangeOpt) );
-
                 g_signal_connect( ldd->optEscrowCb, "toggled",
                                   G_CALLBACK(ld_escrow_toggle), ldd );
                 gtk_widget_set_sensitive( GTK_WIDGET(ldd->optEscrowHBox), FALSE );
@@ -713,8 +701,8 @@
 
         /* Review page widget setup. */
         {
-                g_signal_connect( gtk_option_menu_get_menu(ldd->revRangeOpt),
-                                  "selection-done",
+		gtk_combo_box_set_active( ldd->revRangeOpt, 0 );
+                g_signal_connect( ldd->revRangeOpt, "changed",
                                   G_CALLBACK( ld_rev_range_opt_changed ),
                                   ldd );
                 g_signal_connect( ldd->revStartDate, "date-changed",
@@ -862,13 +850,15 @@
                 GET_CASTED_WIDGET( GTK_TABLE,          PARAM_TABLE );
         ldd->prmIrateSpin =
                 GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    IRATE_SPIN );
+        ldd->prmType =
+                GET_CASTED_WIDGET( GTK_COMBO_BOX,      TYPE_COMBOBOX );
         ldd->prmVarFrame =
                 GET_CASTED_WIDGET( GTK_FRAME,          VAR_CONTAINER );
         /* ldd->prmStartDateGDE */
         ldd->prmLengthSpin =
                 GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    LENGTH_SPIN );
         ldd->prmLengthType =
-                GET_CASTED_WIDGET( GTK_OPTION_MENU,    LENGTH_OPT );
+                GET_CASTED_WIDGET( GTK_COMBO_BOX,      LENGTH_OPT );
         ldd->prmRemainSpin =
                 GET_CASTED_WIDGET( GTK_SPIN_BUTTON,    REMAIN_SPIN );
         
@@ -916,7 +906,7 @@
 
         /* rev = review */
         ldd->revRangeOpt =
-                GET_CASTED_WIDGET( GTK_OPTION_MENU,    REV_RANGE_OPT );
+                GET_CASTED_WIDGET( GTK_COMBO_BOX,      REV_RANGE_OPT );
         ldd->revDateFrame =
                 GET_CASTED_WIDGET( GTK_FRAME,          REV_DATE_FRAME );
         ldd->revTable =
@@ -1055,11 +1045,13 @@
 
 static
 void
-ld_prm_type_changed( GtkWidget *w, gint index, gpointer ud )
+ld_prm_type_changed( GtkWidget *w, gpointer ud )
 {
         LoanDruidData *ldd;
+	gint index;
 
         ldd = (LoanDruidData*)ud;
+        index = gtk_combo_box_get_active( ldd->prmType );
         gtk_widget_set_sensitive( GTK_WIDGET(ldd->prmVarFrame),
                                   index != FIXED );
 }
@@ -1170,7 +1162,7 @@
         }
         ldd->ld.principal = gnc_amount_edit_get_amount( ldd->prmOrigPrincGAE );
         ldd->ld.interestRate = gtk_spin_button_get_value( ldd->prmIrateSpin );
-        ldd->ld.type = gnc_option_menu_get_active( GTK_WIDGET(ldd->prmType) );
+        ldd->ld.type = gtk_combo_box_get_active( ldd->prmType );
         if ( ldd->ld.type != FIXED ) {
                 gnc_frequency_save_state( ldd->prmVarGncFreq,
                                           ldd->ld.loanFreq,
@@ -1193,7 +1185,7 @@
         /* len / periods */
         {
                 ldd->ld.perSize =
-                        (gnc_option_menu_get_active( GTK_WIDGET(ldd->prmLengthType) )
+                        (gtk_combo_box_get_active( ldd->prmLengthType )
                          == MONTHS) ? MONTHS : YEARS;
                 ldd->ld.numPer =
                         gtk_spin_button_get_value_as_int( ldd->prmLengthSpin );
@@ -1212,7 +1204,7 @@
         ldd = (LoanDruidData*)ud;
         gnc_amount_edit_set_amount( ldd->prmOrigPrincGAE, ldd->ld.principal );
         gtk_spin_button_set_value( ldd->prmIrateSpin, ldd->ld.interestRate );
-        gtk_option_menu_set_history( ldd->prmType, ldd->ld.type );
+        gtk_combo_box_set_active( ldd->prmType, ldd->ld.type );
         if ( ldd->ld.type != FIXED ) {
                 gnc_frequency_setup( ldd->prmVarGncFreq,
                                      ldd->ld.loanFreq,
@@ -1234,7 +1226,7 @@
         /* length: total and remaining */
         {
                 gtk_spin_button_set_value( ldd->prmLengthSpin, ldd->ld.numPer );
-                gtk_option_menu_set_history( ldd->prmLengthType, ldd->ld.perSize );
+                gtk_combo_box_set_active( ldd->prmLengthType, ldd->ld.perSize );
                 gtk_spin_button_set_value( ldd->prmRemainSpin, ldd->ld.numMonRemain );
         }
 }
@@ -1749,16 +1741,18 @@
         /* 3, here, does not include the Date column. */
         const static int BASE_COLS = 3;
         LoanDruidData *ldd;
-        gchar **titles;
+	GtkListStore *store;
+	GtkCellRenderer *renderer;
+	GtkTreeViewColumn *column;
+	GType *types;
         int i;
 
         ldd = (LoanDruidData*)ud;
 
-        /* Cleanup old clist */
-        if ( ldd->revCL != NULL ) {
-                gtk_container_remove( GTK_CONTAINER(ldd->revScrollWin),
-                                      GTK_WIDGET(ldd->revCL) );
-                ldd->revCL = NULL;
+        /* Cleanup old view */
+        if ( ldd->revView != NULL ) {
+		gtk_widget_destroy( GTK_WIDGET(ldd->revView) );
+                ldd->revView = NULL;
         }
 
         ldd->ld.revNumPmts = BASE_COLS;
@@ -1775,40 +1769,59 @@
         }
 
         /* '+1' for leading date col */
-        titles = g_new0( gchar*, ldd->ld.revNumPmts + 1 );
-        titles[0] = _( "Date" );
-        titles[1] = _( "Payment" );
-        titles[2] = _( "Principal" );
-        titles[3] = _( "Interest" );
+	types = g_new( GType, ldd->ld.revNumPmts + 1 );
+	for ( i=0; i < ldd->ld.revNumPmts + 1; i++ )
+	  types[i] = G_TYPE_STRING;
+	store = gtk_list_store_newv(ldd->ld.revNumPmts + 1, types);
+	g_free(types);
+
+        ldd->revView = GTK_TREE_VIEW(
+		gtk_tree_view_new_with_model( GTK_TREE_MODEL(store) ));
+	g_object_unref(store);
+
+	renderer = gtk_cell_renderer_text_new();
+	column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer,
+							  "text", LOAN_COL_DATE,
+							  NULL);
+	gtk_tree_view_append_column(ldd->revView, column);
+
+	renderer = gtk_cell_renderer_text_new();
+	column = gtk_tree_view_column_new_with_attributes(_("Payment"), renderer,
+							  "text", LOAN_COL_PAYMENT,
+							  NULL);
+	gtk_tree_view_append_column(ldd->revView, column);
+
+	renderer = gtk_cell_renderer_text_new();
+	column = gtk_tree_view_column_new_with_attributes(_("Principal"), renderer,
+							  "text", LOAN_COL_PRINCIPAL,
+							  NULL);
+	gtk_tree_view_append_column(ldd->revView, column);
+
+	renderer = gtk_cell_renderer_text_new();
+	column = gtk_tree_view_column_new_with_attributes(_("Interest"), renderer,
+							  "text", LOAN_COL_INTEREST,
+							  NULL);
+	gtk_tree_view_append_column(ldd->revView, column);
+
         /* move the appropriate names over into the title array */
         {
                 for ( i=0; i < ldd->ld.repayOptCount; i++ ) {
                         if ( ldd->ld.revRepayOptToColMap[i] == -1 ) {
                                 continue;
                         }
-                        /* '+1' offset for the "Date" title */
-                        titles[ ldd->ld.revRepayOptToColMap[i] + 1 ] =
-                                ldd->ld.repayOpts[i]->name;
+
+			renderer = gtk_cell_renderer_text_new();
+			column = gtk_tree_view_column_new_with_attributes
+			  (ldd->ld.repayOpts[i]->name, renderer,
+			   "text", LOAN_COL_INTEREST + i,
+			   NULL);
+			gtk_tree_view_append_column(ldd->revView, column);
                 }
         }
 
-        ldd->revCL = GTK_CLIST(
-                gtk_clist_new_with_titles( ldd->ld.revNumPmts+1,
-                                           titles ) );
-        g_free( titles );
-
-        for( i=0; i < ldd->ld.revNumPmts+1; i++ ) {
-                gtk_clist_set_column_resizeable( ldd->revCL, i, TRUE );
-                
-        }
-
-        g_signal_connect( ldd->revCL, "size-allocate",
-                          G_CALLBACK(ld_rev_clist_allocate_col_widths),
-                          ldd );
-
         gtk_container_add( GTK_CONTAINER(ldd->revScrollWin),
-                           GTK_WIDGET(ldd->revCL) );
-        gtk_widget_show_all( GTK_WIDGET(ldd->revCL) );
+                           GTK_WIDGET(ldd->revView) );
+        gtk_widget_show( GTK_WIDGET(ldd->revView) );
 
         ld_rev_recalc_schedule( ldd );
 
@@ -1817,7 +1830,7 @@
                 g_date_clear( &start, 1 );
                 g_date_clear( &end, 1 );
                 ld_rev_get_dates( ldd, &start, &end );
-                ld_rev_update_clist( ldd, &start, &end );
+                ld_rev_update_view( ldd, &start, &end );
         }
 }
 
@@ -2499,8 +2512,7 @@
                 g_free( valueStr );
         }
         total = totalVal
-                * ( gnc_option_menu_get_active(
-                            GTK_WIDGET(ldd->prmLengthType) )
+                * ( gtk_combo_box_get_active( ldd->prmLengthType )
                     == 1 ? 12 : 1 );
         remain = total - i;
         gtk_spin_button_set_value( ldd->prmRemainSpin, remain );
@@ -2509,12 +2521,12 @@
 
 static
 void
-ld_rev_range_opt_changed( GtkButton *b, gpointer ud )
+ld_rev_range_opt_changed( GtkComboBox *combo, gpointer ud )
 {
         LoanDruidData *ldd = (LoanDruidData*)ud;
         int opt;
 
-        opt = gnc_option_menu_get_active( GTK_WIDGET(ldd->revRangeOpt) );
+        opt = gtk_combo_box_get_active( ldd->revRangeOpt );
         gtk_widget_set_sensitive( GTK_WIDGET(ldd->revDateFrame),
                                   (opt == CUSTOM) );
         {
@@ -2522,7 +2534,7 @@
                 g_date_clear( &start, 1 );
                 g_date_clear( &end, 1 );
                 ld_rev_get_dates( ldd, &start, &end );
-                ld_rev_update_clist( ldd, &start, &end );
+                ld_rev_update_view( ldd, &start, &end );
         }
 }
 
@@ -2536,7 +2548,7 @@
                 g_date_clear( &start, 1 );
                 g_date_clear( &end, 1 );
                 ld_rev_get_dates( ldd, &start, &end );
-                ld_rev_update_clist( ldd, &start, &end );
+                ld_rev_update_view( ldd, &start, &end );
         }
 }
 
@@ -2562,7 +2574,7 @@
 void
 ld_rev_get_dates( LoanDruidData *ldd, GDate *start, GDate *end )
 {
-        int range = gnc_option_menu_get_active( GTK_WIDGET(ldd->revRangeOpt) );
+        int range = gtk_combo_box_get_active( ldd->revRangeOpt );
         switch ( range ) {
         case CURRENT_YEAR:
                 g_date_set_time_t( start, time(NULL) );
@@ -2801,20 +2813,21 @@
 
 static
 void
-ld_rev_update_clist( LoanDruidData *ldd, GDate *start, GDate *end )
+ld_rev_update_view( LoanDruidData *ldd, GDate *start, GDate *end )
 {
         static gchar *NO_AMT_CELL_TEXT = " ";
         GList *l;
         GNCPrintAmountInfo pai;
-        /* '+1' for the date cell */
-        gchar *rowText[ ldd->ld.revNumPmts + 1 ];
+	GtkListStore *store;
+	GtkTreeIter iter;
 
         pai = gnc_default_price_print_info();
         pai.min_decimal_places = 2;
 
-        gtk_clist_clear( ldd->revCL );
-        gtk_clist_freeze( ldd->revCL );
+	store = GTK_LIST_STORE(gtk_tree_view_get_model( ldd->revView ));
 
+        gtk_list_store_clear( store );
+
         for ( l = ldd->ld.revSchedule; l != NULL; l = l->next )
         {
                 int i;
@@ -2826,54 +2839,31 @@
                 if ( g_date_compare( &rrr->date, end ) > 0 )
                         continue; /* though we can probably return, too. */
 
-                qof_print_gdate( tmpBuf, MAX_DATE_LENGTH, &rrr->date );
-                rowText[0] = g_strdup( tmpBuf );
+		gtk_list_store_append(store, &iter);
 
+		qof_print_gdate( tmpBuf, MAX_DATE_LENGTH, &rrr->date );
+		gtk_list_store_set( store, &iter, LOAN_COL_DATE, tmpBuf, -1 );
+
                 for ( i=0; i<ldd->ld.revNumPmts; i++ )
                 {
                         int numPrinted;
                         if ( gnc_numeric_check( rrr->numCells[i] )
                              == GNC_ERROR_ARG )
                         {
-                                rowText[i+1] = NO_AMT_CELL_TEXT;
+				/* '+1' for the date cell */
+				gtk_list_store_set( store, &iter,
+						    i+1, NO_AMT_CELL_TEXT,
+						    -1);
                                 continue;
                         }
 
                         numPrinted = xaccSPrintAmount( tmpBuf, rrr->numCells[i], pai );
                         g_assert( numPrinted < 50 );
-                        rowText[i+1] = g_strdup( tmpBuf );
+			/* '+1' for the date cell */
+			gtk_list_store_set( store, &iter,
+					    i+1, tmpBuf,
+					    -1);
                 }
 
-                gtk_clist_append( ldd->revCL, rowText );
-
-                for ( i=ldd->ld.revNumPmts-1; i>=0; i-- )
-                {
-                        if ( strcmp( rowText[i], NO_AMT_CELL_TEXT ) == 0 )
-                                continue;
-                        g_free( rowText[i] );
-                }
         }
-        gtk_clist_thaw( ldd->revCL );
 }
-
-static
-void
-ld_rev_clist_allocate_col_widths( GtkWidget *w,
-                                  GtkAllocation *alloc,
-                                  gpointer user_data )
-{
-        LoanDruidData *ldd = (LoanDruidData*)user_data;
-        gint i, evenWidth, width;
-
-        width = alloc->width;
-        /* The '-10' is to account for misc widget noise not accounted for by
-         * the simple division. */
-        evenWidth = (gint)(width / (ldd->ld.revNumPmts+1) ) - 10;
-        gtk_clist_freeze( ldd->revCL );
-        for ( i=0; i<ldd->ld.revNumPmts+1; i++ )
-        {
-                gtk_clist_set_column_width( ldd->revCL,
-                                            i, evenWidth );
-        }
-        gtk_clist_thaw( ldd->revCL );
-}

Modified: gnucash/branches/register-rewrite/src/gnome/druid-stock-split.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/druid-stock-split.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/druid-stock-split.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -47,6 +47,14 @@
 
 #define DRUID_STOCK_SPLIT_CM_CLASS "druid-stock-split"
 
+enum split_cols {
+  SPLIT_COL_ACCOUNT = 0,
+  SPLIT_COL_FULLNAME,
+  SPLIT_COL_MNEMONIC,
+  SPLIT_COL_SHARES,
+  NUM_SPLIT_COLS
+};
+
 /** structures *********************************************************/
 typedef struct
 {
@@ -54,7 +62,7 @@
   GtkWidget * druid;
 
   /* account page data */
-  GtkWidget * account_list;
+  GtkWidget * account_view;
   Account   * acct;
 
   /* info page data */
@@ -107,19 +115,23 @@
 }
 
 static int
-fill_account_list (StockSplitInfo *info, Account *account)
+fill_account_list (StockSplitInfo *info, Account *selected_account)
 {
-  GtkCList *clist;
+  GtkTreeRowReference *reference = NULL;
+  GtkTreeView *view;
+  GtkListStore *list;
+  GtkTreeIter iter;
+  GtkTreePath *path;
   GList *accounts;
   GList *node;
   gint rows = 0;
+  gchar *full_name;
 
-  clist = GTK_CLIST (info->account_list);
+  view = GTK_TREE_VIEW(info->account_view);
+  list = GTK_LIST_STORE(gtk_tree_view_get_model(view));
 
-  gtk_clist_freeze (clist);
+  gtk_list_store_clear (list);
 
-  gtk_clist_clear (clist);
-
   accounts = xaccGroupGetSubAccountsSorted (gnc_get_current_group ());
   for (node = accounts; node; node = node->next)
   {
@@ -127,8 +139,6 @@
     GNCPrintAmountInfo print_info;
     const gnc_commodity *commodity;
     gnc_numeric balance;
-    char *strings[4];
-    gint row;
 
     if (!xaccAccountIsPriced(account))
         continue;
@@ -142,59 +152,56 @@
 
     commodity = xaccAccountGetCommodity (account);
 
+    full_name = xaccAccountGetFullName (account);
     print_info = gnc_account_print_info (account, FALSE);
 
-    strings[0] = xaccAccountGetFullName (account);
-    strings[1] = (char *) gnc_commodity_get_mnemonic (commodity);
-    strings[2] = (char *) xaccPrintAmount (balance, print_info);
-    strings[3] = NULL;
+    gtk_list_store_append(list, &iter);
+    gtk_list_store_set(list, &iter,
+		       SPLIT_COL_ACCOUNT,  account,
+		       SPLIT_COL_FULLNAME, full_name,
+		       SPLIT_COL_MNEMONIC, gnc_commodity_get_mnemonic(commodity),
+		       SPLIT_COL_SHARES,   xaccPrintAmount(balance, print_info),
+		       -1);
 
-    row = gtk_clist_append (clist, strings);
+    if (account == selected_account) {
+      path = gtk_tree_model_get_path(GTK_TREE_MODEL(list), &iter);
+      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(list), path);
+      gtk_tree_path_free(path);
+    }
 
-    gtk_clist_set_row_data (clist, row, account);
+    g_free (full_name);
 
-    g_free (strings[0]);
-
     rows++;
   }
   g_list_free(accounts);
 
-  {
-    gint row = 0;
-
-    if (account)
-      row = gtk_clist_find_row_from_data (clist, account);
-
-    if (row < 0)
-      row = 0;
-
-    gtk_clist_select_row (GTK_CLIST (info->account_list), row, 0);
+  if (reference) {
+    GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
+    path = gtk_tree_row_reference_get_path(reference);
+    gtk_tree_row_reference_free(reference);
+    if (path) {
+      gtk_tree_selection_select_path(selection, path);
+      gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE, 0.5, 0.0);
+      gtk_tree_path_free(path);
+    }
   }
 
-  gtk_clist_columns_autosize (clist);
-
-  gtk_clist_thaw (clist);
-
   return rows;
 }
 
 static void
-clist_select_row (GtkCList *clist,
-                  gint row,
-                  gint column,
-                  GdkEventButton *event,
-                  gpointer user_data)
+selection_changed (GtkTreeSelection *selection,
+		   gpointer user_data)
 {
   StockSplitInfo *info = user_data;
-  Account *account;
+  GtkTreeModel *list;
+  GtkTreeIter iter;
 
-  account = gtk_clist_get_row_data (clist, row);
-
-  /* Happens when the first row is inserted, before the row data can be added */
-  if (account == NULL)
+  if (!gtk_tree_selection_get_selected(selection, &list, &iter))
     return;
-
-  info->acct = account;
+  gtk_tree_model_get(list, &iter,
+		     SPLIT_COL_ACCOUNT, &info->acct,
+		     -1);
 }
 
 static void
@@ -550,7 +557,7 @@
   GNCAccountType type;
 
   type = xaccAccountGetType(account);
-  return (type == INCOME);
+  return (type == ACCT_TYPE_INCOME);
 }
 
 static gboolean
@@ -560,7 +567,8 @@
   GNCAccountType type;
 
   type = xaccAccountGetType(account);
-  return ((type == BANK) || (type == CASH) || (type == ASSET));
+  return ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
+	  (type == ACCT_TYPE_ASSET));
 }
 
 static void
@@ -583,16 +591,43 @@
 
   /* account list */
   {
-    GtkCList *clist;
+    GtkTreeView *view;
+    GtkListStore *store;
+    GtkTreeSelection *selection;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
 
-    info->account_list = glade_xml_get_widget (xml, "account_clist");
+    info->account_view = glade_xml_get_widget (xml, "account_view");
 
-    clist = GTK_CLIST (info->account_list);
+    view = GTK_TREE_VIEW(info->account_view);
 
-    gtk_clist_set_selection_mode (clist, GTK_SELECTION_BROWSE);
+    store = gtk_list_store_new(NUM_SPLIT_COLS, G_TYPE_POINTER, G_TYPE_STRING,
+			       G_TYPE_STRING, G_TYPE_STRING);
+    gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
-    g_signal_connect (clist, "select_row",
-		      G_CALLBACK (clist_select_row), info);
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Account"), renderer,
+						      "text", SPLIT_COL_FULLNAME,
+						      NULL);
+    gtk_tree_view_append_column(view, column);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Symbol"), renderer,
+						      "text", SPLIT_COL_MNEMONIC,
+						      NULL);
+    gtk_tree_view_append_column(view, column);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Shares"), renderer,
+						      "text", SPLIT_COL_SHARES,
+						      NULL);
+    gtk_tree_view_append_column(view, column);
+
+    selection = gtk_tree_view_get_selection(view);
+    gtk_tree_selection_set_mode(selection, GTK_SELECTION_BROWSE);
+    g_signal_connect (selection, "changed",
+		      G_CALLBACK (selection_changed), info);
   }
 
   /* info widgets */

Modified: gnucash/branches/register-rewrite/src/gnome/glade/account.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/glade/account.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/glade/account.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -294,7 +294,6 @@
 			  <property name="yalign">0.5</property>
 			  <property name="xpad">0</property>
 			  <property name="ypad">0</property>
-			  <property name="mnemonic_widget">account_scu</property>
 			</widget>
 			<packing>
 			  <property name="left_attach">0</property>
@@ -464,93 +463,6 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkOptionMenu" id="account_scu">
-			  <property name="visible">True</property>
-			  <property name="tooltip" translatable="yes">Smallest fraction of this commodity that can be referenced.</property>
-			  <property name="can_focus">True</property>
-			  <property name="history">0</property>
-
-			  <child internal-child="menu">
-			    <widget class="GtkMenu" id="convertwidget1">
-			      <property name="visible">True</property>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget2">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Use Commodity Value</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget3">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget4">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1/10</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget5">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1/100</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget6">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1/1000</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget7">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1/10000</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget8">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1/100000</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget9">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1/1000000</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">2</property>
-			  <property name="top_attach">4</property>
-			  <property name="bottom_attach">5</property>
-			  <property name="x_options">fill</property>
-			  <property name="y_options"></property>
-			</packing>
-		      </child>
-
-		      <child>
 			<widget class="GtkScrolledWindow" id="scrolledwindow9">
 			  <property name="visible">True</property>
 			  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
@@ -587,6 +499,38 @@
 			  <property name="y_options">fill</property>
 			</packing>
 		      </child>
+
+		      <child>
+			<widget class="GtkEventBox" id="eventbox1">
+			  <property name="visible">True</property>
+			  <property name="tooltip" translatable="yes">Smallest fraction of this commodity that can be referenced.</property>
+			  <property name="visible_window">True</property>
+			  <property name="above_child">False</property>
+
+			  <child>
+			    <widget class="GtkComboBox" id="account_scu">
+			      <property name="visible">True</property>
+			      <property name="items" translatable="yes">Use Commodity Value
+1
+1/10
+1/100
+1/1000
+1/10000
+1/100000
+1/1000000</property>
+			      <property name="focus_on_click">True</property>
+			    </widget>
+			  </child>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">2</property>
+			  <property name="top_attach">4</property>
+			  <property name="bottom_attach">5</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
 		    </widget>
 		    <packing>
 		      <property name="left_attach">1</property>
@@ -943,7 +887,7 @@
 			  <property name="visible">True</property>
 			  <property name="sensitive">False</property>
 			  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-			  <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+			  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 			  <property name="shadow_type">GTK_SHADOW_NONE</property>
 			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 

Modified: gnucash/branches/register-rewrite/src/gnome/glade/commodities.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/glade/commodities.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/glade/commodities.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -220,8 +220,8 @@
 		    <widget class="GtkScrolledWindow" id="commodity_list_window">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
-		      <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+		      <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		      <property name="shadow_type">GTK_SHADOW_IN</property>
 		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 

Modified: gnucash/branches/register-rewrite/src/gnome/glade/fincalc.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/glade/fincalc.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/glade/fincalc.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -910,116 +910,6 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkOptionMenu" id="compounding_menu">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="history">0</property>
-
-			  <child internal-child="menu">
-			    <widget class="GtkMenu" id="convertwidget1">
-			      <property name="visible">True</property>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget2">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Annual</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget3">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Semi-annual</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget4">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Tri-annual</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget5">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Quarterly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget6">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Bi-monthly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget7">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Monthly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget8">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Semi-monthly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget9">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Bi-weekly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget10">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Weekly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget11">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Daily (360)</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget12">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Daily (365)</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">3</property>
-			  <property name="top_attach">2</property>
-			  <property name="bottom_attach">3</property>
-			  <property name="x_options">fill</property>
-			  <property name="y_options"></property>
-			</packing>
-		      </child>
-
-		      <child>
 			<widget class="GtkAlignment" id="alignment23">
 			  <property name="visible">True</property>
 			  <property name="xalign">0.5</property>
@@ -1082,7 +972,6 @@
 			      <property name="yalign">0.5</property>
 			      <property name="xpad">0</property>
 			      <property name="ypad">0</property>
-			      <property name="mnemonic_widget">payment_menu</property>
 			    </widget>
 			  </child>
 			</widget>
@@ -1120,7 +1009,6 @@
 			      <property name="yalign">0.5</property>
 			      <property name="xpad">0</property>
 			      <property name="ypad">0</property>
-			      <property name="mnemonic_widget">payment_menu</property>
 			    </widget>
 			  </child>
 			</widget>
@@ -1219,116 +1107,6 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkOptionMenu" id="payment_menu">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="history">0</property>
-
-			  <child internal-child="menu">
-			    <widget class="GtkMenu" id="convertwidget13">
-			      <property name="visible">True</property>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget14">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Annual</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget15">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Semi-annual</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget16">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Tri-annual</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget17">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Quarterly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget18">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Bi-monthly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget19">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Monthly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget20">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Semi-monthly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget21">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Bi-weekly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget22">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Weekly</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget23">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Daily (360)</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget24">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">Daily (365)</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
-			</widget>
-			<packing>
-			  <property name="left_attach">1</property>
-			  <property name="right_attach">3</property>
-			  <property name="top_attach">6</property>
-			  <property name="bottom_attach">7</property>
-			  <property name="x_options">fill</property>
-			  <property name="y_options"></property>
-			</packing>
-		      </child>
-
-		      <child>
 			<widget class="GtkLabel" id="label797">
 			  <property name="visible">True</property>
 			  <property name="label" translatable="yes">&lt;b&gt;Compounding:&lt;/b&gt;</property>
@@ -1375,6 +1153,58 @@
 			  <property name="y_options"></property>
 			</packing>
 		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="payment_combo">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">Annual
+Semi-annual
+Tri-annual
+Quarterly
+Bi-monthly
+Monthly
+Semi-monthly
+Bi-weekly
+Weekly
+Daily (360)
+Daily (365)</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">3</property>
+			  <property name="top_attach">6</property>
+			  <property name="bottom_attach">7</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
+
+		      <child>
+			<widget class="GtkComboBox" id="compounding_combo">
+			  <property name="visible">True</property>
+			  <property name="items" translatable="yes">Annual
+Semi-annual
+Tri-annual
+Quarterly
+Bi-monthly
+Monthly
+Semi-monthly
+Bi-weekly
+Weekly
+Daily (360)
+Daily (365)</property>
+			  <property name="focus_on_click">True</property>
+			</widget>
+			<packing>
+			  <property name="left_attach">1</property>
+			  <property name="right_attach">3</property>
+			  <property name="top_attach">2</property>
+			  <property name="bottom_attach">3</property>
+			  <property name="x_options">fill</property>
+			  <property name="y_options">fill</property>
+			</packing>
+		      </child>
 		    </widget>
 		  </child>
 		</widget>

Modified: gnucash/branches/register-rewrite/src/gnome/glade/lots.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/glade/lots.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/glade/lots.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -324,7 +324,7 @@
 		      <property name="max_length">0</property>
 		      <property name="text" translatable="yes"></property>
 		      <property name="has_frame">True</property>
-		      <property name="invisible_char" translatable="yes">*</property>
+		      <property name="invisible_char">*</property>
 		      <property name="activates_default">False</property>
 		      <signal name="changed" handler="lv_title_entry_changed_cb" last_modification_time="Sun, 22 May 2005 21:25:12 GMT"/>
 		    </widget>
@@ -492,96 +492,18 @@
 		      <property name="can_focus">True</property>
 		      <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
 		      <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-		      <property name="shadow_type">GTK_SHADOW_NONE</property>
+		      <property name="shadow_type">GTK_SHADOW_IN</property>
 		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		      <child>
-			<widget class="GtkCList" id="lot clist">
+			<widget class="GtkTreeView" id="lot view">
 			  <property name="visible">True</property>
-			  <property name="tooltip" translatable="yes">A list of all of the lots in this account.</property>
 			  <property name="can_focus">True</property>
-			  <property name="n_columns">5</property>
-			  <property name="column_widths">80,80,80,80,80</property>
-			  <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-			  <property name="show_titles">True</property>
-			  <property name="shadow_type">GTK_SHADOW_IN</property>
-			  <signal name="select_row" handler="lv_select_row_cb" last_modification_time="Sun, 22 May 2005 21:25:47 GMT"/>
-			  <signal name="unselect_row" handler="lv_unselect_row_cb" last_modification_time="Sun, 22 May 2005 21:26:02 GMT"/>
-
-			  <child>
-			    <widget class="GtkLabel" id="label3">
-			      <property name="label" translatable="yes">Opened</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="label4">
-			      <property name="label" translatable="yes">Closed</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="label5">
-			      <property name="label" translatable="yes">Title</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="label6">
-			      <property name="label" translatable="yes">Balance</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="label7">
-			      <property name="label" translatable="yes">Gains</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>
+			  <property name="headers_visible">True</property>
+			  <property name="rules_hint">True</property>
+			  <property name="reorderable">False</property>
+			  <property name="enable_search">False</property>
+			  <property name="fixed_height_mode">False</property>
 			</widget>
 		      </child>
 		    </widget>

Modified: gnucash/branches/register-rewrite/src/gnome/glade/price.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/glade/price.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/glade/price.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -60,7 +60,7 @@
 	  <property name="border_width">3</property>
 	  <property name="visible">True</property>
 	  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
-	  <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+	  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 	  <property name="shadow_type">GTK_SHADOW_IN</property>
 	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 

Modified: gnucash/branches/register-rewrite/src/gnome/glade/sched-xact.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/glade/sched-xact.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/glade/sched-xact.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1069,119 +1069,28 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkOptionMenu" id="freq_option">
+	    <widget class="GtkComboBox" id="freq_combobox">
 	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="history">0</property>
-
-	      <child internal-child="menu">
-		<widget class="GtkMenu" id="convertwidget1">
-		  <property name="visible">True</property>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget2">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">None</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget3">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Once</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget4">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Daily</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget5">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Daily [M-F]</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget6">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Weekly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget7">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Bi-Weekly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget8">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Semi-Monthly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget9">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Monthly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget10">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Quarterly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget11">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Tri-Yearly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget12">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Semi-Yearly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-
-		  <child>
-		    <widget class="GtkMenuItem" id="convertwidget13">
-		      <property name="visible">True</property>
-		      <property name="label" translatable="yes">Yearly</property>
-		      <property name="use_underline">True</property>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
+	      <property name="items" translatable="yes">None
+Once
+Daily
+Daily [M-F]
+Weekly
+Bi-Weekly
+Semi-Monthly
+Monthly
+Quarterly
+Tri-Yearly
+Semi-Yearly
+Yearly</property>
+	      <property name="focus_on_click">True</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">1</property>
 	      <property name="right_attach">2</property>
 	      <property name="top_attach">0</property>
 	      <property name="bottom_attach">1</property>
-	      <property name="y_options"></property>
+	      <property name="y_options">fill</property>
 	    </packing>
 	  </child>
 	</widget>
@@ -1988,269 +1897,45 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkOptionMenu" id="semimonthly_first">
+			<widget class="GtkComboBox" id="semimonthly_first">
 			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="history">0</property>
-
-			  <child internal-child="menu">
-			    <widget class="GtkMenu" id="convertwidget14">
-			      <property name="visible">True</property>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget15">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1st</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget16">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">2nd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget17">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">3rd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget18">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">4th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget19">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">5th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget20">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">6th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget21">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">7th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget22">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">8th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget23">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">9th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget24">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">10th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget25">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">11th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget26">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">12th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget27">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">13th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget28">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">14th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget29">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">15th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget30">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">16th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget31">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">17th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget32">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">18th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget33">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">19th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget34">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">20th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget35">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">21st</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget36">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">22nd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget37">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">23rd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget38">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">24th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget39">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">25th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget40">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">26th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget41">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">27th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget42">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">28th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget43">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[29th/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget44">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[30th/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget45">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[31st/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
+			  <property name="items" translatable="yes">1st
+2nd
+3rd
+4th
+5th
+6th
+7th
+8th
+9th
+10th
+11th
+12th
+13th
+14th
+15th
+16th
+17th
+18th
+19th
+20th
+21st
+22nd
+23rd
+24th
+25th
+26th
+27th
+28th
+[29th/last]
+[30th/last]
+[31st/last]</property>
+			  <property name="focus_on_click">True</property>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
-			  <property name="expand">False</property>
-			  <property name="fill">False</property>
+			  <property name="expand">True</property>
+			  <property name="fill">True</property>
 			</packing>
 		      </child>
 		    </widget>
@@ -2289,264 +1974,40 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkOptionMenu" id="semimonthly_second">
+			<widget class="GtkComboBox" id="semimonthly_second">
 			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="history">0</property>
-
-			  <child internal-child="menu">
-			    <widget class="GtkMenu" id="convertwidget46">
-			      <property name="visible">True</property>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget47">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1st</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget48">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">2nd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget49">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">3rd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget50">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">4th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget51">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">5th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget52">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">6th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget53">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">7th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget54">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">8th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget55">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">9th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget56">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">10th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget57">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">11th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget58">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">12th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget59">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">13th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget60">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">14th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget61">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">15th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget62">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">16th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget63">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">17th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget64">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">18th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget65">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">19th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget66">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">20th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget67">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">21st</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget68">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">22nd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget69">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">23rd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget70">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">24th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget71">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">25th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget72">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">26th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget73">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">27th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget74">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">28th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget75">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[29th/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget76">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[30th/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget77">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[31st/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
+			  <property name="items" translatable="yes">1st
+2nd
+3rd
+4th
+5th
+6th
+7th
+8th
+9th
+10th
+11th
+12th
+13th
+14th
+15th
+16th
+17th
+18th
+19th
+20th
+21st
+22nd
+23rd
+24th
+25th
+26th
+27th
+28th
+[29th/last]
+[30th/last]
+[31st/last]</property>
+			  <property name="focus_on_click">True</property>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
@@ -2708,264 +2169,40 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkOptionMenu" id="monthly_day">
+			<widget class="GtkComboBox" id="monthly_day">
 			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="history">0</property>
-
-			  <child internal-child="menu">
-			    <widget class="GtkMenu" id="convertwidget78">
-			      <property name="visible">True</property>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget79">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">1st</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget80">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">2nd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget81">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">3rd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget82">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">4th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget83">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">5th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget84">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">6th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget85">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">7th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget86">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">8th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget87">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">9th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget88">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">10th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget89">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">11th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget90">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">12th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget91">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">13th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget92">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">14th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget93">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">15th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget94">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">16th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget95">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">17th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget96">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">18th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget97">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">19th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget98">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">20th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget99">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">21st</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget100">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">22nd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget101">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">23rd</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget102">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">24th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget103">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">25th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget104">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">26th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget105">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">27th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget106">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">28th</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget107">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[29th/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget108">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[30th/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget109">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">[31st/last]</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
+			  <property name="items" translatable="yes">1st
+2nd
+3rd
+4th
+5th
+6th
+7th
+8th
+9th
+10th
+11th
+12th
+13th
+14th
+15th
+16th
+17th
+18th
+19th
+20th
+21st
+22nd
+23rd
+24th
+25th
+26th
+27th
+28th
+[29th/last]
+[30th/last]
+[31st/last]</property>
+			  <property name="focus_on_click">True</property>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
@@ -3048,40 +2285,12 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="quarterly_occur">
+		    <widget class="GtkComboBox" id="quarterly_occur">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget110">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget111">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Jan, Apr, Jul, Oct</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget112">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Feb, May, Aug, Nov</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget113">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Mar, Jun, Sep, Dec</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">Jan, Apr, Jul, Oct
+Feb, May, Aug, Nov
+Mar, Jun, Sep, Dec</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -3126,264 +2335,40 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="quarterly_day">
+		    <widget class="GtkComboBox" id="quarterly_day">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget114">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget115">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">1st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget116">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">2nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget117">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">3rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget118">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">4th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget119">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">5th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget120">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">6th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget121">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">7th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget122">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">8th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget123">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">9th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget124">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">10th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget125">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">11th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget126">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">12th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget127">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">13th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget128">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">14th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget129">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">15th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget130">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">16th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget131">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">17th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget132">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">18th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget133">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">19th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget134">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">20th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget135">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">21st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget136">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">22nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget137">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">23rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget138">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">24th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget139">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">25th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget140">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">26th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget141">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">27th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget142">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">28th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget143">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[29th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget144">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[30th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget145">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[31st/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">1st
+2nd
+3rd
+4th
+5th
+6th
+7th
+8th
+9th
+10th
+11th
+12th
+13th
+14th
+15th
+16th
+17th
+18th
+19th
+20th
+21st
+22nd
+23rd
+24th
+25th
+26th
+27th
+28th
+[29th/last]
+[30th/last]
+[31st/last]</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -3459,48 +2444,12 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="triyearly_occur">
+		    <widget class="GtkComboBox" id="triyearly_occur">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget146">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget147">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Jan, May, Sep</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget148">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Feb, Jun, Oct</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget149">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Mar, Jul, Nov</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget150">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Apr, Aug, Dec</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">Jan, May, Sep
+Feb, Jun, Oct
+Mar, Jul, Nov</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -3545,264 +2494,40 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="triyearly_day">
+		    <widget class="GtkComboBox" id="triyearly_day">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget151">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget152">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">1st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget153">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">2nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget154">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">3rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget155">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">4th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget156">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">5th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget157">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">6th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget158">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">7th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget159">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">8th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget160">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">9th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget161">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">10th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget162">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">11th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget163">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">12th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget164">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">13th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget165">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">14th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget166">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">15th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget167">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">16th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget168">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">17th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget169">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">18th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget170">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">19th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget171">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">20th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget172">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">21st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget173">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">22nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget174">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">23rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget175">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">24th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget176">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">25th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget177">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">26th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget178">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">27th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget179">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">28th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget180">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[29th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget181">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[30th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget182">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[31st/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">1st
+2nd
+3rd
+4th
+5th
+6th
+7th
+8th
+9th
+10th
+11th
+12th
+13th
+14th
+15th
+16th
+17th
+18th
+19th
+20th
+21st
+22nd
+23rd
+24th
+25th
+26th
+27th
+28th
+[29th/last]
+[30th/last]
+[31st/last]</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -3878,64 +2603,15 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="semiyearly_occur">
+		    <widget class="GtkComboBox" id="semiyearly_occur">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget183">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget184">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Jan, Jul</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget185">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Feb, Aug</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget186">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Mar, Sep</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget187">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Apr, Oct</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget188">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">May, Nov</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget189">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Jun, Dec</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">Jan, Jul
+Feb, Aug
+Mar, Sep
+Apr, Oct
+May, Nov
+Jun, Dec</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -3980,264 +2656,40 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="semiyearly_day">
+		    <widget class="GtkComboBox" id="semiyearly_day">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget190">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget191">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">1st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget192">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">2nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget193">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">3rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget194">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">4th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget195">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">5th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget196">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">6th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget197">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">7th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget198">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">8th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget199">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">9th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget200">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">10th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget201">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">11th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget202">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">12th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget203">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">13th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget204">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">14th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget205">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">15th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget206">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">16th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget207">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">17th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget208">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">18th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget209">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">19th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget210">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">20th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget211">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">21st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget212">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">22nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget213">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">23rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget214">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">24th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget215">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">25th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget216">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">26th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget217">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">27th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget218">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">28th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget219">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[29th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget220">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[30th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget221">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[31st/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">1st
+2nd
+3rd
+4th
+5th
+6th
+7th
+8th
+9th
+10th
+11th
+12th
+13th
+14th
+15th
+16th
+17th
+18th
+19th
+20th
+21st
+22nd
+23rd
+24th
+25th
+26th
+27th
+28th
+[29th/last]
+[30th/last]
+[31st/last]</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -4388,112 +2840,21 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="yearly_month">
+		    <widget class="GtkComboBox" id="yearly_month">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget222">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget223">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">January</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget224">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">February</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget225">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">March</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget226">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">April</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget227">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">May</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget228">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">June</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget229">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">July</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget230">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">August</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget231">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">September</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget232">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">October</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget233">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">November</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget234">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">December</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">January
+February
+March
+April
+May
+June
+July
+August
+September
+October
+November
+December</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -4538,264 +2899,40 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="yearly_day">
+		    <widget class="GtkComboBox" id="yearly_day">
 		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget235">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget236">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">1st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget237">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">2nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget238">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">3rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget239">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">4th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget240">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">5th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget241">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">6th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget242">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">7th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget243">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">8th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget244">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">9th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget245">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">10th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget246">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">11th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget247">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">12th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget248">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">13th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget249">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">14th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget250">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">15th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget251">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">16th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget252">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">17th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget253">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">18th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget254">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">19th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget255">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">20th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget256">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">21st</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget257">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">22nd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget258">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">23rd</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget259">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">24th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget260">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">25th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget261">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">26th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget262">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">27th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget263">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">28th</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget264">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[29th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget265">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[30th/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget266">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">[31st/last]</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <property name="items" translatable="yes">1st
+2nd
+3rd
+4th
+5th
+6th
+7th
+8th
+9th
+10th
+11th
+12th
+13th
+14th
+15th
+16th
+17th
+18th
+19th
+20th
+21st
+22nd
+23rd
+24th
+25th
+26th
+27th
+28th
+[29th/last]
+[30th/last]
+[31st/last]</property>
+		      <property name="focus_on_click">True</property>
 		    </widget>
 		    <packing>
 		      <property name="padding">0</property>
@@ -5367,76 +3504,6 @@
 		  </child>
 
 		  <child>
-		    <widget class="GtkOptionMenu" id="freq_option_menu">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="history">0</property>
-
-		      <child internal-child="menu">
-			<widget class="GtkMenu" id="convertwidget269">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget270">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Daily</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget271">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Weekly</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget272">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Bi-Weekly</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget273">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Monthly</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget274">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Quarterly</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkMenuItem" id="convertwidget275">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes">Yearly</property>
-			      <property name="use_underline">True</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
-		    </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="x_options">fill</property>
-		      <property name="y_options"></property>
-		    </packing>
-		  </child>
-
-		  <child>
 		    <widget class="GtkEntry" id="name_entry">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
@@ -5456,6 +3523,27 @@
 		      <property name="y_options"></property>
 		    </packing>
 		  </child>
+
+		  <child>
+		    <widget class="GtkComboBox" id="freq_combo_box">
+		      <property name="visible">True</property>
+		      <property name="items" translatable="yes">Daily
+Weekly
+Bi-Weekly
+Monthly
+Quarterly
+Yearly</property>
+		      <property name="focus_on_click">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="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
@@ -6697,32 +4785,11 @@
 		      </child>
 
 		      <child>
-			<widget class="GtkOptionMenu" id="len_opt">
+			<widget class="GtkComboBox" id="len_opt">
 			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="history">0</property>
-
-			  <child internal-child="menu">
-			    <widget class="GtkMenu" id="convertwidget288">
-			      <property name="visible">True</property>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget289">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">months</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-
-			      <child>
-				<widget class="GtkMenuItem" id="convertwidget290">
-				  <property name="visible">True</property>
-				  <property name="label" translatable="yes">years</property>
-				  <property name="use_underline">True</property>
-				</widget>
-			      </child>
-			    </widget>
-			  </child>
+			  <property name="items" translatable="yes">months
+years</property>
+			  <property name="focus_on_click">True</property>
 			</widget>
 			<packing>
 			  <property name="padding">0</property>
@@ -6934,6 +5001,26 @@
 		      <property name="y_options">expand|shrink|fill</property>
 		    </packing>
 		  </child>
+
+		  <child>
+		    <widget class="GtkComboBox" id="type_combobox">
+		      <property name="visible">True</property>
+		      <property name="items" translatable="yes">Fixed Rate
+3/1 Year ARM
+5/1 Year ARM
+7/1 Year ARM
+10/1 Year ARM</property>
+		      <property name="focus_on_click">True</property>
+		    </widget>
+		    <packing>
+		      <property name="left_attach">3</property>
+		      <property name="right_attach">4</property>
+		      <property name="top_attach">2</property>
+		      <property name="bottom_attach">3</property>
+		      <property name="x_options">fill</property>
+		      <property name="y_options">fill</property>
+		    </packing>
+		  </child>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
@@ -7898,48 +5985,13 @@
 			      <property name="spacing">0</property>
 
 			      <child>
-				<widget class="GtkOptionMenu" id="rev_range_opt">
+				<widget class="GtkComboBox" id="rev_range_opt">
 				  <property name="visible">True</property>
-				  <property name="can_focus">True</property>
-				  <property name="history">0</property>
-
-				  <child internal-child="menu">
-				    <widget class="GtkMenu" id="convertwidget291">
-				      <property name="visible">True</property>
-
-				      <child>
-					<widget class="GtkMenuItem" id="convertwidget292">
-					  <property name="visible">True</property>
-					  <property name="label" translatable="yes">Current Year</property>
-					  <property name="use_underline">True</property>
-					</widget>
-				      </child>
-
-				      <child>
-					<widget class="GtkMenuItem" id="convertwidget293">
-					  <property name="visible">True</property>
-					  <property name="label" translatable="yes">Now + 1 Year</property>
-					  <property name="use_underline">True</property>
-					</widget>
-				      </child>
-
-				      <child>
-					<widget class="GtkMenuItem" id="convertwidget294">
-					  <property name="visible">True</property>
-					  <property name="label" translatable="yes">Whole Loan</property>
-					  <property name="use_underline">True</property>
-					</widget>
-				      </child>
-
-				      <child>
-					<widget class="GtkMenuItem" id="convertwidget295">
-					  <property name="visible">True</property>
-					  <property name="label" translatable="yes">Custom</property>
-					  <property name="use_underline">True</property>
-					</widget>
-				      </child>
-				    </widget>
-				  </child>
+				  <property name="items" translatable="yes">Current Year
+Now + 1 Year
+Whole Loan
+Custom</property>
+				  <property name="focus_on_click">True</property>
 				</widget>
 				<packing>
 				  <property name="padding">0</property>
@@ -8644,6 +6696,7 @@
 		  <property name="rules_hint">False</property>
 		  <property name="reorderable">False</property>
 		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
 		</widget>
 	      </child>
 	    </widget>

Modified: gnucash/branches/register-rewrite/src/gnome/glade/stocks.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/glade/stocks.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/glade/stocks.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -78,82 +78,23 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkAlignment" id="alignment1">
+		<widget class="GtkScrolledWindow" id="scrolledwindow22">
 		  <property name="visible">True</property>
-		  <property name="xalign">0.5</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xscale">1</property>
-		  <property name="yscale">1</property>
-		  <property name="top_padding">0</property>
-		  <property name="bottom_padding">0</property>
-		  <property name="left_padding">0</property>
-		  <property name="right_padding">0</property>
+		  <property name="can_focus">True</property>
+		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
+		  <property name="shadow_type">GTK_SHADOW_IN</property>
+		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkScrolledWindow" id="scrolledwindow21">
+		    <widget class="GtkTreeView" id="account_view">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="hscrollbar_policy">GTK_POLICY_ALWAYS</property>
-		      <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
-		      <property name="shadow_type">GTK_SHADOW_NONE</property>
-		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
-
-		      <child>
-			<widget class="GtkCList" id="account_clist">
-			  <property name="visible">True</property>
-			  <property name="can_focus">True</property>
-			  <property name="n_columns">3</property>
-			  <property name="column_widths">80,80,80</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="label847718">
-			      <property name="label" translatable="yes">Account</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>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkLabel" id="label847719">
-			      <property name="label" translatable="yes">Symbol</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>
-			    </widget>
-			  </child>
-
-			  <child>
-			    <widget class="GtkLabel" id="label847720">
-			      <property name="label" translatable="yes">Shares</property>
-			      <property name="use_underline">False</property>
-			      <property name="use_markup">False</property>
-			      <property name="justify">GTK_JUSTIFY_RIGHT</property>
-			      <property name="wrap">False</property>
-			      <property name="selectable">False</property>
-			      <property name="xalign">1</property>
-			      <property name="yalign">0.5</property>
-			      <property name="xpad">0</property>
-			      <property name="ypad">0</property>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
+		      <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="fixed_height_mode">False</property>
 		    </widget>
 		  </child>
 		</widget>

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-basic-commands.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-basic-commands.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-basic-commands.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -144,7 +144,7 @@
   { "ActionsScheduledTransactionEditorAction", NULL, N_("_Scheduled Transaction Editor"), NULL,
     N_("The list of Scheduled Transactions"),
     G_CALLBACK (gnc_main_window_cmd_actions_scheduled_transaction_editor) },
-  { "ActionsSinceLastRunAction", NULL, N_("_Since Last Run..."), NULL,
+  { "ActionsSinceLastRunAction", NULL, N_("Since _Last Run..."), NULL,
     N_("Create Scheduled Transactions since the last time run"),
     G_CALLBACK (gnc_main_window_cmd_actions_since_last_run) },
   { "ActionsMortgageLoanAction", NULL, N_("_Mortgage & Loan Repayment..."), NULL,

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-budget.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-budget.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-budget.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -225,6 +225,7 @@
     gtk_tree_selection_set_mode(sel, GTK_SELECTION_BROWSE);
     tm = gnc_tree_model_budget_new(book);
     gnc_tree_view_budget_set_model(tv, tm);
+    g_object_unref(tm);
     gtk_container_add(GTK_CONTAINER(dlg->vbox), GTK_WIDGET(tv));
     gtk_widget_show_all(GTK_WIDGET(dlg));
 

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-account-tree.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-account-tree.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-account-tree.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -74,6 +74,9 @@
 #define PLUGIN_PAGE_ACCT_TREE_CM_CLASS "plugin-page-acct-tree"
 #define GCONF_SECTION "window/pages/account_tree"
 
+#define DELETE_DIALOG_FILTER  "filter"
+#define DELETE_DIALOG_ACCOUNT "account"
+
 enum {
   ACCOUNT_SELECTED,
   LAST_SIGNAL
@@ -156,7 +159,7 @@
 	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_open_subaccounts) },
 
 	/* Edit menu */
-	{ "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("_Edit Account"), "<control>e",
+	{ "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit _Account"), "<control>e",
 	  N_("Edit the selected account"),
 	  G_CALLBACK (gnc_plugin_page_account_tree_cmd_edit_account) },
 	{ "EditDeleteAccountAction", GNC_STOCK_DELETE_ACCOUNT, N_("_Delete Account..."), NULL,
@@ -573,7 +576,7 @@
 	account_page = GNC_PLUGIN_PAGE_ACCOUNT_TREE(page);
 	priv = GNC_PLUGIN_PAGE_ACCOUNT_TREE_GET_PRIVATE(account_page);
 
-	/* Install it now so we can them manipulate the created widget */
+	/* Install it now so we can then manipulate the created widget */
 	gnc_main_window_open_page(GNC_MAIN_WINDOW(window), page);
 
         gnc_tree_view_account_restore(GNC_TREE_VIEW_ACCOUNT(priv->tree_view), 
@@ -762,93 +765,43 @@
 {
   GtkWidget *button;
   gpointer dmas, tmas;
+  gint dmas_cnt, tmas_cnt;
   gboolean sensitive;
 
   dmas = g_object_get_data(G_OBJECT(dialog), "dmas");
   tmas = g_object_get_data(G_OBJECT(dialog), "tmas");
+  dmas_cnt = gnc_account_sel_get_num_account(GNC_ACCOUNT_SEL(dmas));
+  tmas_cnt = gnc_account_sel_get_num_account(GNC_ACCOUNT_SEL(tmas));
+
   sensitive = (((NULL == dmas) ||
-		(!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(dmas)) ||
-		 GTK_LIST(GNC_ACCOUNT_SEL(dmas)->combo->list)->children)) &&
+		(!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(dmas)) || dmas_cnt)) &&
 	       ((NULL == tmas) ||
-		(!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(tmas)) ||
-		 GTK_LIST(GNC_ACCOUNT_SEL(tmas)->combo->list)->children)));
+		(!GTK_WIDGET_IS_SENSITIVE(GTK_WIDGET(tmas)) || tmas_cnt)));
 
   button = gnc_glade_lookup_widget(dialog, "deletebutton");
   gtk_widget_set_sensitive(button, sensitive);
 }
 
-/***
- *** GNCAccountSel has an odd habit of adding a
- *** blank item when its list is otherwise empty.
- ***/
-
 static void
-exclude_account(GtkWidget *item,
-		gpointer name)
-{
-  char *text;
-
-  gtk_label_get(GTK_LABEL(GTK_BIN(item)->child), &text);
-  if ((0 == strlen(text)) || (0 == strcmp(text, name))) {
-    gtk_widget_destroy(GTK_WIDGET(item));
-  }
-}
-
-static void
-exclude_account_subtree(GtkWidget *item,
-			gpointer prefix)
-{
-  char *text;
-
-  gtk_label_get(GTK_LABEL(GTK_BIN(item)->child), &text);
-  if ((0 == strlen(text)) || 0 == strncmp(text, prefix, strlen(prefix))) {
-    gtk_widget_destroy(GTK_WIDGET(item));
-  }
-}
-
-static gint
-compare_listitem_text(gconstpointer item,
-		      gconstpointer entrytext)
-{
-  char *text;
-
-  gtk_label_get(GTK_LABEL(GTK_BIN(item)->child), &text);
-  return strcmp(text, entrytext);
-}
-
-static void
 gppat_populate_gas_list(GtkWidget *dialog,
 			GNCAccountSel *gas,
 			gboolean exclude_subaccounts)
 {
-  GtkList *list;
-  GtkEntry *entry;
-  gpointer name, filter;
+  Account *account;
+  GList *filter;
 
   g_return_if_fail(GTK_IS_DIALOG(dialog));
   if (gas == NULL)
     return;
-  list = GTK_LIST(gas->combo->list);
-  entry = GTK_ENTRY(gas->combo->entry);
-  name = g_object_get_data(G_OBJECT(dialog), "name");
-  filter = g_object_get_data(G_OBJECT(dialog), "filter");
+  account = g_object_get_data(G_OBJECT(dialog), DELETE_DIALOG_ACCOUNT);
+  filter = g_object_get_data(G_OBJECT(dialog), DELETE_DIALOG_FILTER);
 
   /* Setting the account type filter triggers GNCAccountSel population. */
   gnc_account_sel_set_acct_filters (gas, filter);
 
   /* Accounts to be deleted must be removed. */
-  gtk_container_foreach(GTK_CONTAINER(list), (exclude_subaccounts ?
-					      exclude_account_subtree :
-					      exclude_account), name);
+  gnc_account_sel_purge_account( gas, account, exclude_subaccounts);
 
-  /* The entry widget may need to be reset. */
-  if (NULL == g_list_find_custom(list->children, 
-				 gtk_entry_get_text(entry),
-				 compare_listitem_text)) {
-    gtk_entry_set_text(entry, "");
-    gtk_list_select_item(list, 0);
-  }
-
   /* The sensitivity of the OK button needs to be reevaluated. */
   set_ok_sensitivity(GTK_WIDGET(dialog));
 }
@@ -927,8 +880,8 @@
      * type as the one being deleted.
      */
     filter = g_list_prepend(NULL, (gpointer)xaccAccountGetType(account));
-    g_object_set_data(G_OBJECT(dialog), "filter", filter);
-    g_object_set_data(G_OBJECT(dialog), "name", acct_name);
+    g_object_set_data(G_OBJECT(dialog), DELETE_DIALOG_FILTER, filter);
+    g_object_set_data(G_OBJECT(dialog), DELETE_DIALOG_ACCOUNT, account);
 
     /*
      * Adjust the dialog based on whether the account has
@@ -1077,7 +1030,7 @@
 	GList *acct_list, *ptr;
 
 	xaccAccountBeginEdit (daa);
-	acct_list = xaccGroupGetSubAccounts(children);
+	acct_list = g_list_copy(xaccGroupGetAccountList(children));
 	for (ptr = acct_list; ptr; ptr = g_list_next(ptr))
 	  xaccAccountInsertSubAccount (daa, ptr->data);
 	g_list_free(acct_list);
@@ -1197,7 +1150,8 @@
 	xaccAccountScrubOrphans (account);
 	xaccAccountScrubImbalance (account);
 
-	xaccAccountScrubLots (account);
+	// XXX: Lots are disabled
+	//xaccAccountScrubLots (account);
 
 	gnc_resume_gui_refresh ();
 }
@@ -1214,7 +1168,8 @@
 	xaccAccountTreeScrubOrphans (account);
 	xaccAccountTreeScrubImbalance (account);
 
-	xaccAccountTreeScrubLots (account);
+	// XXX: Lots are disabled
+	//xaccAccountTreeScrubLots (account);
 
 	gnc_resume_gui_refresh ();
 }
@@ -1229,7 +1184,8 @@
 	xaccGroupScrubOrphans (group);
 	xaccGroupScrubImbalance (group);
 
-	xaccGroupScrubLots (group);
+	// XXX: Lots are disabled
+	//xaccGroupScrubLots (group);
 
 	gnc_resume_gui_refresh ();
 }

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-budget.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-budget.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-budget.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -941,13 +941,19 @@
     budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col), "budget"));
     period_num = GPOINTER_TO_UINT(g_object_get_data(G_OBJECT(col),
                                                     "period_num"));
-    numeric = gnc_budget_get_account_period_value(budget, account, period_num);
 
-    if (gnc_numeric_zero_p(numeric))
+    if (!gnc_budget_is_account_period_value_set(budget, account, period_num)) {
         amtbuff[0] = '\0';
-    else
-        xaccSPrintAmount (amtbuff, numeric,
-                          gnc_account_print_info (account, FALSE));
+    } else {
+      numeric = gnc_budget_get_account_period_value(budget, account, 
+                                                    period_num);
+      if (gnc_numeric_check(numeric)) {
+          strcpy(amtbuff, "error");
+      } else {
+          xaccSPrintAmount(amtbuff, numeric,
+                           gnc_account_print_info(account, FALSE));
+      }
+    }
 
     return g_strdup(amtbuff);
 }
@@ -958,7 +964,7 @@
 {
     GncBudget *budget;
     guint period_num;
-    gnc_numeric numeric = gnc_numeric_zero();
+    gnc_numeric numeric = gnc_numeric_error(GNC_ERROR_ARG);
 
     if (!xaccParseAmount (new_text, TRUE, &numeric, NULL) &&
         !(new_text && *new_text == '\0'))
@@ -969,7 +975,11 @@
 
     budget = GNC_BUDGET(g_object_get_data(G_OBJECT(col), "budget"));
 
-    gnc_budget_set_account_period_value(budget, account, period_num, numeric);
+    if (new_text && *new_text == '\0')
+        gnc_budget_unset_account_period_value(budget, account, period_num);
+    else
+        gnc_budget_set_account_period_value(budget, account, period_num, 
+                                            numeric);
 }
 
 static void

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -34,12 +34,14 @@
 
 #include "config.h"
 
+#include <libguile.h>
+#include "guile-mappings.h"
 #include <gtk/gtk.h>
 #include <glib/gi18n.h>
 #ifndef HAVE_GLIB26
 #include "gkeyfile.h"
 #endif
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "gnc-plugin-page-register.h"
 #include "gnc-plugin-register.h"
@@ -179,7 +181,7 @@
 	{ "EditPasteAction", GTK_STOCK_PASTE, N_("_Paste"), NULL,
 	  N_("Paste the clipboard content at the cursor position"),
 	  G_CALLBACK (gnc_plugin_page_register_cmd_paste) },
-	{ "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit Account"), "<control>e",
+	{ "EditEditAccountAction", GNC_STOCK_EDIT_ACCOUNT, N_("Edit _Account"), "<control>e",
 	  N_("Edit the selected account"),
 	  G_CALLBACK (gnc_plugin_page_register_cmd_edit_account) },
 
@@ -1723,7 +1725,7 @@
   SplitRegister *reg = gnc_ledger_display_get_split_register (ledger);
   Account *account;
   char *str;
-  SCM qtype;
+  swig_type_info * qtype;
   SCM args;
   SCM func;
   SCM arg;
@@ -1756,19 +1758,19 @@
     g_return_val_if_fail (query != NULL, -1);
   }
 
-  qtype = scm_c_eval_string("<gnc:Query*>");
-  g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
+  qtype = SWIG_TypeQuery ("_p__QofQuery");
+  g_return_val_if_fail (qtype, -1);
 
-  arg = gw_wcp_assimilate_ptr (query, qtype);
+  arg = SWIG_NewPointerObj (query, qtype, 0);
   args = scm_cons (arg, args);
   g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 
 
   if (split)
   {
-    qtype = scm_c_eval_string("<gnc:Split*>");
-    g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
-    arg = gw_wcp_assimilate_ptr (split, qtype);
+    qtype = SWIG_TypeQuery ("_p_Split");
+    g_return_val_if_fail (qtype, -1);
+    arg = SWIG_NewPointerObj (split, qtype, 0);
   }
   else
   {
@@ -1778,11 +1780,11 @@
   g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 
 
-  qtype = scm_c_eval_string("<gnc:Account*>");
-  g_return_val_if_fail (qtype != SCM_UNDEFINED, -1);
+  qtype = SWIG_TypeQuery ("_p_Account");
+  g_return_val_if_fail (qtype, -1);
 
   account = gnc_ledger_display_leader (ledger);
-  arg = gw_wcp_assimilate_ptr (account, qtype);
+  arg = SWIG_NewPointerObj (account, qtype, 0);
   args = scm_cons (arg, args);
   g_return_val_if_fail (arg != SCM_UNDEFINED, -1);
 

Modified: gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gnc-plugin-page-register.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -64,7 +64,7 @@
 
 /* function prototypes */
 
-/** Retrieve the type number for an "account tree" plugin page.
+/** Retrieve the type number for the plugin page.
  *
  *  @return The type number.
  */
@@ -82,7 +82,8 @@
  *
  *  @return The newly created plugin page.
  */
-GncPluginPage *gnc_plugin_page_register_new (Account *account, gboolean subaccounts);
+GncPluginPage *
+gnc_plugin_page_register_new (Account *account, gboolean subaccounts);
 
 
 /** Create a new "register" plugin page, given a pointer to an already
@@ -95,14 +96,16 @@
  *
  *  @return The newly created plugin page.
  */
-GncPluginPage *gnc_plugin_page_register_new_ledger (GNCLedgerDisplay *ledger);
+GncPluginPage *
+gnc_plugin_page_register_new_ledger (GNCLedgerDisplay *ledger);
 
 
 /** Create a new "register" plugin page containing a general ledger.
  *
  *  @return The newly created plugin page.
  */
-GncPluginPage *gnc_plugin_page_register_new_gl (void);
+GncPluginPage *
+gnc_plugin_page_register_new_gl (void);
 
 
 /** Set various register options on a newly created "register" plugin page.
@@ -132,7 +135,8 @@
  *
  *  @param plugin_page A "register" page.
  */
-GNCSplitReg * gnc_plugin_page_register_get_gsr (GncPluginPage *plugin_page);
+GNCSplitReg *
+gnc_plugin_page_register_get_gsr (GncPluginPage *plugin_page);
 
 
 /** Get the Account associated with this register page.
@@ -142,7 +146,8 @@
  *  @return The account if the register contains only a single
  *  account, or an account and its sub-accounts.  NULL otherwise.
  */
-Account *gnc_plugin_page_register_get_account (GncPluginPageRegister *page);
+Account *
+gnc_plugin_page_register_get_account (GncPluginPageRegister *page);
 
 G_END_DECLS
 /** @} */

Copied: gnucash/branches/register-rewrite/src/gnome/gnome.i (from rev 15058, gnucash/trunk/src/gnome/gnome.i)

Deleted: gnucash/branches/register-rewrite/src/gnome/gnucash.desktop.in
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gnucash.desktop.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gnucash.desktop.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,11 +0,0 @@
-[Desktop Entry]
-_Name=GnuCash Finance Management
-_Comment=Manage your finances, accounts, and investments
-Exec=gnucash %f
-Icon=gnucash-icon
-StartupNotify=true
-Terminal=false
-Type=Application
-Categories=Application;GNOME;Office;Finance;
-X-Desktop-File-Install-Version=0.3
-MimeType=application/x-gnucash

Copied: gnucash/branches/register-rewrite/src/gnome/gnucash.desktop.in.in (from rev 15058, gnucash/trunk/src/gnome/gnucash.desktop.in.in)

Deleted: gnucash/branches/register-rewrite/src/gnome/gw-gnc-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/gw-gnc-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/gw-gnc-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,136 +0,0 @@
-(define-module (g-wrapped gw-gnc-spec))
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(use-modules (g-wrapped gw-engine-spec))
-(use-modules (g-wrapped gw-gnome-utils-spec))
-
-(let ((ws (gw:new-wrapset "gw-gnc")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-depends-on ws "gw-engine")
-  (gw:wrapset-depends-on ws "gw-gnome-utils")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-gnc))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <config.h>\n"
-      "#include <glib.h>\n"
-      "#include <gnc-ui.h>\n"
-      "#include <gnc-ui-util.h>\n"
-      "#include <gnc-menu-extensions.h>\n"
-      "#include <guile-util.h>\n"
-      "#include <gnc-engine.h>\n"
-      "#include <gnc-commodity.h>\n"
-      "#include <dialog-totd.h>\n"
-      "#include <gnc-gui-query.h>\n"
-      "#include <dialog-new-user.h>\n"
-      "#include <dialog-progress.h>\n"
-      "#include <dialog-commodity.h>\n"
-      "#include <druid-hierarchy.h>\n"
-      "#include <top-level.h>\n"
-      "#include <gnc-html.h>\n"
-      "#include <gnc-main-window.h>\n"
-      "#include <gnc-window.h>\n"
-      "#include <gnc-plugin-account-tree.h>\n"
-      "#include <gnc-splash.h>\n"
-      "#include <dialog-scheduledxaction.h>\n"
-      "#include <dialog-sxsincelast.h>\n" )))
-
-  (gw:wrap-function
-   ws
-   'gnc:new-user-dialog
-   '<gw:void>
-   "gnc_ui_new_user_dialog"
-   '()
-   "Show the new user dialog.")
-
-  (gw:wrap-as-wct ws
-                  '<gnc:ProgressDialog*>
-                  "GNCProgressDialog *" "const GNCProgressDialog *")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-new
-   '<gnc:ProgressDialog*>
-   "gnc_progress_dialog_new"
-   '((<gnc:UIWidget> parent) (<gw:bool> use_ok_button))
-   "Create and return a progress dialog. The parent may be NULL.")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-set-title
-   '<gw:void>
-   "gnc_progress_dialog_set_title"
-   '((<gnc:ProgressDialog*> progress)
-     ((<gw:mchars> caller-owned const) title))
-   "Set the title of 'progress' to 'title'.")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-set-heading
-   '<gw:void>
-   "gnc_progress_dialog_set_heading"
-   '((<gnc:ProgressDialog*> progress)
-     ((<gw:mchars> caller-owned const) heading))
-   "Set the heading of 'progress' to 'heading'.")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-set-cancel-scm-func
-   '<gw:void>
-   "gnc_progress_dialog_set_cancel_scm_func"
-   '((<gnc:ProgressDialog*> progress)
-     (<gw:scm> cancel_func))
-   "Set the guile cancel callback function. This callback is invoked
-with no arguments when the user hits the cancel button. If the callback
-returns #t, the dialog is closed, but not destroyed.")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-set-value
-   '<gw:void>
-   "gnc_progress_dialog_set_value"
-   '((<gnc:ProgressDialog*> progress) (<gw:double> value))
-   "Set the value of the progress dialog to 'value'.")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-update
-   '<gw:void>
-   "gnc_progress_dialog_update"
-   '((<gnc:ProgressDialog*> progress))
-   "Update the progress bar, calling any pending cancel callback.")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-finish
-   '<gw:void>
-   "gnc_progress_dialog_finish"
-   '((<gnc:ProgressDialog*> progress))
-   "Set the progress dialog to the finished state. The OK button becomes
-sensitive and the dialog closes after the user clicks it.")
-
-  (gw:wrap-function
-   ws
-   'gnc:progress-dialog-destroy
-   '<gw:void>
-   "gnc_progress_dialog_destroy"
-   '((<gnc:ProgressDialog*> progress))
-   "Destroy the progess dialog. You must call this function in
-order to destroy the dialog. The dialog will not be destroyed
-by the user closing the window.")
-
-)

Modified: gnucash/branches/register-rewrite/src/gnome/lot-viewer.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/lot-viewer.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/lot-viewer.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,14 +21,7 @@
  *                                                                  *
 \********************************************************************/
 
-/* This uses the clist widget, which I know is deprecated in gnome2. 
- * Sorry, I'll try to keep it real simple.
- *
- * For example: I'd like to allow the user to edit the lot
- * title 'in-place' in the clist, but gnome-1.2 does not allow
- * entry widgets in clist cells.
- *
- * XXX todo: The button "view lot in register" is not implemented.
+/* XXX todo: The button "view lot in register" is not implemented.
  *   it needs to open register window showing only the splits in the 
  *     given lot ... 
  *
@@ -57,12 +50,15 @@
 
 #define LOT_VIEWER_CM_CLASS "lot-viewer"
 
-#define OPEN_COL  0
-#define CLOSE_COL 1
-#define TITLE_COL 2
-#define BALN_COL  3
-#define GAINS_COL 4
-#define NUM_COLS  5
+enum lot_cols {
+  LOT_COL_OPEN = 0,
+  LOT_COL_CLOSE,
+  LOT_COL_TITLE,
+  LOT_COL_BALN,
+  LOT_COL_GAINS,
+  LOT_COL_PNTR,
+  NUM_LOT_COLS
+};
 
 #define RESPONSE_VIEW          1
 #define RESPONSE_DELETE        2
@@ -83,14 +79,14 @@
    GtkButton     * scrub_lot_button;
    GtkPaned      * lot_hpaned;
    GtkPaned      * lot_vpaned;
-   GtkCList      * lot_clist;
+   GtkTreeView   * lot_view;
+   GtkListStore  * lot_store;
    GtkTextView   * lot_notes;
    GtkEntry      * title_entry;
    GtkCList      * mini_clist;
 
    Account       * account;
    GNCLot        * selected_lot;
-   int             selected_row;
 };
 
 static void gnc_lot_viewer_fill (GNCLotViewer *lv);
@@ -98,16 +94,6 @@
 /* ======================================================================== */
 /* Callback prototypes */
 
-void  lv_select_row_cb (GtkCList       *clist,
-			gint            row,
-			gint            column,
-			GdkEvent       *event,
-			gpointer        user_data);
-void lv_unselect_row_cb (GtkCList       *clist,
-			 gint            row,
-			 gint            column,
-			 GdkEvent       *event,
-			 gpointer        user_data);
 void lv_title_entry_changed_cb (GtkEntry *ent, gpointer user_data);
 void lv_response_cb (GtkDialog *dialog, gint response, gpointer data);
 void lv_window_destroy_cb (GtkObject *object, gpointer user_data);
@@ -227,19 +213,12 @@
 /* ======================================================================== */
 /* Callback for selecting a row the the list-of-list clist */
 
-void 
-lv_select_row_cb (GtkCList       *clist,
-                  gint            row,
-                  gint            column,
-                  GdkEvent       *event,
-                  gpointer        user_data)
+static void 
+lv_select_row (GNCLotViewer *lv,
+	       GNCLot       *lot)
 {
-   GNCLotViewer *lv = user_data;
-   GNCLot *lot;
    const char * str;
 
-   lot = gtk_clist_get_row_data (clist, row);
-
    str = gnc_lot_get_title (lot);
    if (!str) str = "";
    gtk_entry_set_text (lv->title_entry, str);
@@ -253,8 +232,6 @@
 
    /* Don't set until end, to avoid recursion in gtkentry "changed" cb. */
    lv->selected_lot = lot;
-   lv->selected_row = row;
-
    lv_show_splits (lv);
 
 #ifdef LOTS_READY_FOR_SHOWTIME
@@ -271,7 +248,6 @@
 {
    /* Set immediately, to avoid recursion in gtkentry "changed" cb. */
    lv->selected_lot = NULL;
-   lv->selected_row = -1;
 
    /* Blank the title widget */
    gtk_entry_set_text (lv->title_entry, "");
@@ -294,27 +270,17 @@
 /* ======================================================================== */
 /* Callback for un-selecting a row the the list-of-list clist */
 
-void 
-lv_unselect_row_cb (GtkCList       *clist,
-                    gint            row,
-                    gint            column,
-                    GdkEvent       *event,
-                    gpointer        user_data)
+static void 
+lv_unselect_row (GNCLotViewer *lv)
 {
-   GNCLotViewer *lv = user_data;
    GNCLot *lot = lv->selected_lot;
    const char * str;
    char * notes;
 
-   if (lv->selected_row < 0)
-     return;
-
-   /* Get the title, plunk it into ctree */
-   str = gtk_entry_get_text (lv->title_entry);
-   gtk_clist_set_text (lv->lot_clist, row, TITLE_COL, str);
-
    if (lot)
    {
+      /* Get the title, save_the_title */
+      str = gtk_entry_get_text (lv->title_entry);
       gnc_lot_set_title (lot, str);
 
       /* Get the notes, save the notes */
@@ -326,6 +292,23 @@
    lv_unset_lot (lv);
 }
 
+static void
+lv_selection_changed_cb (GtkTreeSelection *selection,
+			 GNCLotViewer *lv)  
+{
+   GNCLot *lot;
+   GtkTreeModel *model;
+   GtkTreeIter iter;
+
+   if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+     gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &lot, -1);
+     lv_select_row(lv, lot);
+   } else {
+     lv_unselect_row(lv);
+   }
+}
+
+
 /* ======================================================================== */
 /* Callback when user types a new lot title into the entry widget */
 
@@ -333,10 +316,16 @@
 lv_title_entry_changed_cb (GtkEntry *ent, gpointer user_data)
 {
    GNCLotViewer *lv = user_data;
+   GtkTreeModel *model;
+   GtkTreeIter iter;
+   GtkTreeSelection *selection;
    const char * title;
    title = gtk_entry_get_text (lv->title_entry);
-   if (0 > lv->selected_row) return; 
-   gtk_clist_set_text (lv->lot_clist, lv->selected_row, TITLE_COL, title);
+
+   selection = gtk_tree_view_get_selection(lv->lot_view);
+   if (gtk_tree_selection_get_selected (selection, &model, &iter)) {
+     gtk_list_store_set(GTK_LIST_STORE(model), &iter, LOT_COL_TITLE, title, -1);
+   }
 }
 
 /* ======================================================================== */
@@ -392,16 +381,23 @@
 static void
 gnc_lot_viewer_fill (GNCLotViewer *lv)
 {
-   int row;
    LotList *lot_list, *node;
-   GNCLot *selected_lot;
-   int selected_row = -1;
+   GNCLot *this_lot, *selected_lot = NULL;
+   GtkListStore *store;
+   GtkTreeModel *model;
+   GtkTreeIter iter;
+   GtkTreeSelection *selection;
+   gboolean found = FALSE;
 
    lot_list = xaccAccountGetLotList (lv->account);
 
-   selected_lot = lv->selected_lot;
-   gtk_clist_freeze (lv->lot_clist);
-   gtk_clist_clear (lv->lot_clist);
+   selection = gtk_tree_view_get_selection(lv->lot_view);
+   if (gtk_tree_selection_get_selected (selection, &model, &iter))
+     gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &selected_lot, -1);
+
+   /* Crazy. Should update in place if possible. */
+   gtk_list_store_clear (lv->lot_store);
+
    for (node = lot_list; node; node=node->next)
    {
       char obuff[MAX_DATE_LENGTH];
@@ -415,11 +411,13 @@
       gnc_numeric amt_baln = gnc_lot_get_balance (lot);
       gnc_commodity *currency = find_first_currency (lot);
       gnc_numeric gains_baln = get_realized_gains (lot, currency);
-      const char *row_vals[NUM_COLS];
 
+      store = lv->lot_store;
+      gtk_list_store_append(store, &iter);
+
       /* Opening date */
       qof_print_date_buff (obuff, MAX_DATE_LENGTH, open_date);
-      row_vals[OPEN_COL] = obuff;
+      gtk_list_store_set(store, &iter, LOT_COL_OPEN, obuff, -1);
 
       /* Closing date */
       if (gnc_lot_is_closed (lot))
@@ -429,43 +427,48 @@
          time_t close_date = xaccTransGetDate (ftrans);
    
          qof_print_date_buff (cbuff, MAX_DATE_LENGTH, close_date);
-         row_vals[CLOSE_COL] = cbuff;
+	 gtk_list_store_set(store, &iter, LOT_COL_CLOSE, cbuff, -1);
       }
       else
       {
-         row_vals[CLOSE_COL] = _("Open");
+	gtk_list_store_set(store, &iter, LOT_COL_CLOSE, cbuff, _("Open"), -1);
       }
 
       /* Title */
-      row_vals[TITLE_COL] = gnc_lot_get_title (lot);
+      gtk_list_store_set(store, &iter, LOT_COL_TITLE, gnc_lot_get_title(lot), -1);
       
       /* Amount */
       xaccSPrintAmount (baln_buff, amt_baln, 
                  gnc_account_print_info (lv->account, TRUE));
-      row_vals[BALN_COL] = baln_buff;
+      gtk_list_store_set(store, &iter, LOT_COL_BALN, baln_buff, -1);
 
       /* Capital Gains/Losses Appreciation/Depreciation */
       xaccSPrintAmount (gain_buff, gains_baln, 
                  gnc_commodity_print_info (currency, TRUE));
-      row_vals[GAINS_COL] = gain_buff;
+      gtk_list_store_set(store, &iter, LOT_COL_GAINS, gain_buff, -1);
 
       /* Self-reference */
-      row = gtk_clist_append (lv->lot_clist, (char **)row_vals);
-      gtk_clist_set_row_data (lv->lot_clist, row, lot);
-      if (lot == selected_lot) selected_row = row;
+      gtk_list_store_set(store, &iter, LOT_COL_PNTR, lot, -1);
    }
-   gtk_clist_thaw (lv->lot_clist);
 
    /* re-select the row that the user had previously selected, 
     * if possible. */
-   if (-1 < selected_row)
-   {
-      gtk_clist_select_row (lv->lot_clist, selected_row, 1);
+   if (selected_lot) {
+     model = GTK_TREE_MODEL(lv->lot_store);
+     if (gtk_tree_model_get_iter_first(model, &iter)) {
+       do {
+	 gtk_tree_model_get(model, &iter, LOT_COL_PNTR, &this_lot, -1);
+	 if (this_lot == selected_lot) {
+	   gtk_tree_selection_select_iter(selection, &iter);
+	   found = TRUE;
+	   break;
+	 }
+       } while (gtk_tree_model_iter_next(model, &iter));
+     }
    }
-   else
-   {
-      gtk_clist_unselect_all (lv->lot_clist);
-   }
+
+   if (!found)
+     gtk_tree_selection_unselect_all(selection);
 }
 
 /* ======================================================================== */
@@ -584,6 +587,59 @@
 /* ======================================================================== */
 
 static void
+lv_init_lot_view (GNCLotViewer *lv)
+{
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeViewColumn *column;
+  GtkTreeSelection *selection;
+  GtkCellRenderer *renderer;
+
+  g_return_if_fail(GTK_IS_TREE_VIEW(lv->lot_view));
+
+  view = lv->lot_view;
+  store = gtk_list_store_new(NUM_LOT_COLS, G_TYPE_STRING, G_TYPE_STRING,
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+			     G_TYPE_POINTER);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+  lv->lot_store = store;
+
+  /* Set up the columns */
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Opened"), renderer,
+						    "text", LOT_COL_OPEN, NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Closed"), renderer,
+						    "text", LOT_COL_CLOSE, NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Title"), renderer,
+						    "text", LOT_COL_TITLE, NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Balance"), renderer,
+						    "text", LOT_COL_BALN, NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Gains"), renderer,
+						    "text", LOT_COL_GAINS, NULL);
+  gtk_tree_view_append_column(view, column);
+
+  /* Set up the selection callbacks */
+  selection =  gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(lv_selection_changed_cb), lv);
+}
+
+/* ======================================================================== */
+
+static void
 lv_create (GNCLotViewer *lv)
 {
    GladeXML *xml;
@@ -603,7 +659,8 @@
    lv->delete_button = GTK_BUTTON(glade_xml_get_widget (xml, "delete button"));
    lv->scrub_lot_button = GTK_BUTTON(glade_xml_get_widget (xml, "scrub lot button"));
 
-   lv->lot_clist = GTK_CLIST(glade_xml_get_widget (xml, "lot clist"));
+   lv->lot_view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "lot view"));
+   lv_init_lot_view(lv);
    lv->lot_notes = GTK_TEXT_VIEW(glade_xml_get_widget (xml, "lot notes text"));
    lv->title_entry = GTK_ENTRY (glade_xml_get_widget (xml, "lot title entry"));
 
@@ -620,19 +677,12 @@
    lv->mini_clist = GTK_CLIST(glade_xml_get_widget (xml, "mini clist"));
 
    lv->selected_lot = NULL;
-   lv->selected_row = -1;
     
    /* Setup signals */
    glade_xml_signal_autoconnect_full( xml,
                                      gnc_glade_autoconnect_full_func,
                                      lv);
 
-   g_signal_connect (lv->lot_clist, "select_row",
-                     G_CALLBACK (lv_select_row_cb), lv);
-
-   g_signal_connect (lv->lot_clist, "unselect_row",
-                     G_CALLBACK (lv_unselect_row_cb), lv);
-
    gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(lv->window));
 }
 


Property changes on: gnucash/branches/register-rewrite/src/gnome/schemas
___________________________________________________________________
Name: svn:ignore
   - *.diff
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
gnc-dir.h
gnucash.desktop
gnucash.keys
gnucash.c
gw-gnc.scm
gw-gnc.h
gw-gnc.c
gw-gnc.html
i18n.h
gnc-version.h
.DS_Store
semantic.cache
*.schemas

   + *.diff
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
semantic.cache
*.schemas


Modified: gnucash/branches/register-rewrite/src/gnome/schemas/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/schemas/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/schemas/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,10 +22,10 @@
 install-data-local:
 if GCONF_SCHEMAS_INSTALL
 	-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
-	-GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA)
+	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-2 --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
 endif

Modified: gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_dialog_scheduled_transctions.schemas.in
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_dialog_scheduled_transctions.schemas.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_dialog_scheduled_transctions.schemas.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -11,10 +11,11 @@
       <locale name="C">
         <short>Show "since last run" dialog when a file is opened.</short>
         <long>
-	  Whether or not to show scheduled transactions "since last
-	  run" dialog when a data file is opened.  This includes the
-	  initial data file open when GnuCash starts.  A value of TRUE
-	  says to show the dialog; FALSE says not to show the dialog.
+	  This setting controls whether the scheduled transactions
+	  "since last run" dialog is shown automatically when a data file is
+	  opened.  This includes the initial opening of the data
+	  file when GnuCash starts.  If this setting is active,
+	  show the dialog, otherwise it is not shown.
 	</long>
       </locale>
     </schema>
@@ -28,10 +29,10 @@
       <locale name="C">
         <short>Set the "auto create" flag by default</short>
         <long>
-	  If set to TRUE then any newly created scheduled transactions
-	  will have its 'auto create' flag set by default.  The user
-	  can change this pre-transaction flag during transaction
-	  creation, or at any later time by editing the transaction.
+	  If active, any newly created scheduled transaction will
+	  have its 'auto create' flag set active by default. The user
+	  can change this flag during transaction creation, or at
+	  any later time by editing the scheduled transaction.
 	</long>
       </locale>
     </schema>
@@ -57,12 +58,12 @@
       <locale name="C">
         <short>Set the "notify" flag by default</short>
         <long>
-	  If set to TRUE then any newly created scheduled transactions
-	  will have its 'notify' flag set by default.  The user can
-	  change this pre-transaction flag during transaction
-	  creation, or at any later time by editing the transaction.
-	  This setting only has meaning of the create_auto setting is
-	  TRUE.
+	  If active, any newly created scheduled transaction will
+	  have its 'notify' flag set by default.  The user can
+	  change this flag during transaction creation, or at any
+	  later time by editing the scheduled transaction. This
+	  setting only has meaning if the create_auto setting is
+	  active.
 	</long>
       </locale>
     </schema>

Modified: gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_general.schemas.in
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_general.schemas.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_general.schemas.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -249,6 +249,21 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnucash/general/show_splash_screen</key>
+      <applyto>/apps/gnucash/general/show_splash_screen</applyto>
+      <owner>gnucash</owner>
+      <type>bool</type>
+      <default>TRUE</default>
+      <locale name="C">
+        <short>Show splash screen</short>
+        <long>
+	  This setting determines whether GnuCash will show a splash screen
+	  at startup.
+	</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnucash/general/register/use_theme_colors</key>
       <applyto>/apps/gnucash/general/register/use_theme_colors</applyto>
       <owner>gnucash</owner>
@@ -462,5 +477,22 @@
       </locale>
     </schema>
 
+    <schema>
+      <key>/schemas/apps/gnucash/general/tab_position</key>
+      <applyto>/apps/gnucash/general/tab_position</applyto>
+      <owner>gnucash</owner>
+      <type>string</type>
+      <default>top</default>
+      <locale name="C">
+        <short>Position of the notebook tabs</short>
+        <long>
+	  This setting determines the edge at which the tabs for
+	  switching pages in notebooks are drawn. Possible values
+	  are "top", "left", "bottom" and "right".
+	  It defaults to "top".
+	</long>
+      </locale>
+    </schema>
+
   </schemalist>
 </gconfschemafile>

Modified: gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_warnings.schemas.in
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_warnings.schemas.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/schemas/apps_gnucash_warnings.schemas.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -11,11 +11,7 @@
       <default>0</default>
       <locale name="C">
         <short>Change contents of reconciled split</short>
-        <long>
-	  This dialog is presented before allowing you to change the
-	  contents of a reconciled split.  Allowing these changes can
-	  make it hard to perform future reconciliations.
-	</long>
+        <long>This dialog is presented before allowing you to change the contents of a reconciled split.  Allowing these changes can make it hard to perform future reconciliations.</long>
       </locale>
     </schema>
 
@@ -28,12 +24,7 @@
       <default>0</default>
       <locale name="C">
         <short>Mark transaction split as unreconciled</short>
-        <long>
-	  This dialog is presented before allowing you to mark a
-	  transaction split as unreconciled.  Doing so will throw off
-	  the reconciled value of the register and can make it hard to
-	  perform future reconciliations.
-	</long>
+        <long>This dialog is presented before allowing you to mark a transaction split as unreconciled.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</long>
       </locale>
     </schema>
 
@@ -46,9 +37,7 @@
       <default>0</default>
       <locale name="C">
         <short>Read only register</short>
-        <long>
-	  This dialog is presented when a read-only register is opened.
-	</long>
+        <long>This dialog is presented when a read-only register is opened.</long>
       </locale>
     </schema>
 
@@ -61,9 +50,7 @@
       <default>0</default>
       <locale name="C">
         <short>Delete a transaction</short>
-        <long>
-	  This dialog is presented before allowing you to delete a transaction.
-	</long>
+        <long>This dialog is presented before allowing you to delete a transaction.</long>
       </locale>
     </schema>
 
@@ -76,12 +63,7 @@
       <default>0</default>
       <locale name="C">
         <short>Delete a transaction</short>
-        <long>
-	  This dialog is presented before allowing you to delete a 
-	  transaction that contains reconciled splits.  Doing so will
-	  throw off the reconciled value of the register and can make
-	  it hard to perform future reconciliations.
-        </long>
+        <long>This dialog is presented before allowing you to delete a transaction that contains reconciled splits.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</long>
       </locale>
     </schema>
 
@@ -94,10 +76,7 @@
       <default>0</default>
       <locale name="C">
         <short>Remove a splits from a transaction</short>
-        <long>
-	  This dialog is presented before allowing you to remove a
-	  splits from a transaction.
-	</long>
+        <long>This dialog is presented before allowing you to remove a splits from a transaction.</long>
       </locale>
     </schema>
 
@@ -110,12 +89,7 @@
       <default>0</default>
       <locale name="C">
         <short>Remove a splits from a transaction</short>
-        <long>
-	  This dialog is presented before allowing you to remove a
-	  reconciled splits from a transaction. Doing so will throw
-	  off the reconciled value of the register and can make it
-	  hard to perform future reconciliations.
-	</long>
+        <long>This dialog is presented before allowing you to remove a reconciled split from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</long>
       </locale>
     </schema>
 
@@ -128,10 +102,7 @@
       <default>0</default>
       <locale name="C">
         <short>Remove all the splits from a transaction</short>
-        <long>
-	  This dialog is presented before allowing you to remove all
-	  splits from a transaction.
-	</long>
+        <long>This dialog is presented before allowing you to remove all splits from a transaction.</long>
       </locale>
     </schema>
 
@@ -144,12 +115,7 @@
       <default>0</default>
       <locale name="C">
         <short>Remove all the splits from a transaction</short>
-        <long>
-	  This dialog is presented before allowing you to remove all
-	  splits (including some reconciled splits) from a transaction.
-          Doing so will throw off the reconciled value of the register
-          and can make it hard to perform future reconciliations.
-	</long>
+        <long>This dialog is presented before allowing you to remove all splits (including some reconciled splits) from a transaction.  Doing so will throw off the reconciled value of the register and can make it hard to perform future reconciliations.</long>
       </locale>
     </schema>
 
@@ -162,10 +128,7 @@
       <default>0</default>
       <locale name="C">
         <short>Commit changes to a transaction</short>
-        <long>
-          This dialog is presented when you attempt to move out of a modified
-          transaction.  The changed data must be either saved or discarded.
-	</long>
+        <long>This dialog is presented when you attempt to move out of a modified transaction.  The changed data must be either saved or discarded.</long>
       </locale>
     </schema>
 
@@ -178,10 +141,7 @@
       <default>0</default>
       <locale name="C">
         <short>Duplicating a changed transaction</short>
-        <long>
-          This dialog is presented when you attempt to duplicate a modified
-          transaction.  The changed data must be saved or the duplication canceled.
-	</long>
+        <long>This dialog is presented when you attempt to duplicate a modified transaction.  The changed data must be saved or the duplication canceled.</long>
       </locale>
     </schema>
 
@@ -194,10 +154,7 @@
       <default>0</default>
       <locale name="C">
         <short>Commit changes to a invoice_entry</short>
-        <long>
-          This dialog is presented when you attempt to move out of a modified
-          invoice entry.  The changed data must be either saved or discarded.
-	</long>
+        <long>This dialog is presented when you attempt to move out of a modified invoice entry.  The changed data must be either saved or discarded.</long>
       </locale>
     </schema>
 
@@ -210,10 +167,7 @@
       <default>0</default>
       <locale name="C">
         <short>Duplicating a changed invoice_entry</short>
-        <long>
-          This dialog is presented when you attempt to duplicate a modified
-          invoice entry.  The changed data must be saved or the duplication canceled.
-	</long>
+        <long>This dialog is presented when you attempt to duplicate a modified invoice entry.  The changed data must be saved or the duplication canceled.</long>
       </locale>
     </schema>
 
@@ -226,9 +180,7 @@
       <default>0</default>
       <locale name="C">
         <short>Delete a commodity</short>
-        <long>
-	  This dialog is presented before allowing you to delete a commodity.
-	</long>
+        <long>This dialog is presented before allowing you to delete a commodity.</long>
       </locale>
     </schema>
 
@@ -241,11 +193,7 @@
       <default>0</default>
       <locale name="C">
         <short>Delete a commodity and prices</short>
-        <long>
-	  This dialog is presented before allowing you to delete a commodity
-	  that has price quotes attached.  Deleting the commodity will delete
-	  the quotes as well.
-	</long>
+        <long>This dialog is presented before allowing you to delete a commodity that has price quotes attached.  Deleting the commodity will delete the quotes as well.</long>
       </locale>
     </schema>
 
@@ -258,10 +206,7 @@
       <default>0</default>
       <locale name="C">
         <short>Delete multiple price quotes</short>
-        <long>
-	  This dialog is presented before allowing you to delete multiple price
-	  quotes at one time.
-	</long>
+        <long>This dialog is presented before allowing you to delete multiple price quotes at one time.</long>
       </locale>
     </schema>
 

Modified: gnucash/branches/register-rewrite/src/gnome/top-level.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/top-level.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/top-level.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -44,6 +44,7 @@
 #include "gnc-file.h"
 #include "gnc-filepath-utils.h"
 #include "gnc-hooks.h"
+#include "gfec.h"
 #include "gnc-main-window.h"
 #include "gnc-menu-extensions.h"
 #include "gnc-plugin-menu-additions.h" /* FIXME Remove this line*/
@@ -69,7 +70,6 @@
 #include "window-report.h"
 #include "gnc-window.h"
 #include "gnc-gkeyfile-utils.h"
-#include <g-wrap-wct.h>
 
 
 /** GLOBALS *********************************************************/
@@ -94,7 +94,8 @@
     entity = qof_collection_lookup_entity (col, &guid);                     \
     if (NULL == entity)                                                     \
     {                                                                       \
-      result->error_message = g_strdup_printf (_("Entity Not Found: %s"), location); \
+      result->error_message = g_strdup_printf (_("Entity Not Found: %s"),   \
+                                               location);                   \
       return FALSE;                                                         \
     }                                                                       \
 
@@ -202,11 +203,6 @@
  *  iterates through this state information, calling a helper function
  *  to recreate each open window.
  *
- *  If the "new" state file cannot be found, this function will open
- *  an account tree window and then attempt to invoke the old gnucash
- *  1.x state routines.  This provides a fluid transition for users
- *  from the old to the new state systems.
- *
  *  @note The name of the state file is based on the name of the data
  *  file, not the path name of the data file.  If there are multiple
  *  data files with the same name, the state files will be suffixed
@@ -244,19 +240,7 @@
 
     if (!keyfile) {
         gnc_main_window_restore_default_state();
-        
-#if (GNUCASH_MAJOR_VERSION < 2) || ((GNUCASH_MAJOR_VERSION == 2) && (GNUCASH_MINOR_VERSION == 0))
-        /* See if there's an old style state file to be found */
-        scm_call_1(scm_c_eval_string("gnc:main-window-book-open-handler"),
-                   (session ?
-                    gw_wcp_assimilate_ptr (session, scm_c_eval_string("<gnc:Session*>")) :
-                    SCM_BOOL_F));
-        /* At this point the reports have only been loaded into
-           memory.  Now we create their ui component. */
-        gnc_reports_show_all(session);
-#endif
-        
-        LEAVE("old");
+        LEAVE("no state file");
         return;
     }
     

Modified: gnucash/branches/register-rewrite/src/gnome/window-reconcile.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome/window-reconcile.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome/window-reconcile.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -117,14 +117,14 @@
  * change!  These macros define the account types for which an auto interest
  * xfer dialog could pop up, if the user's preferences allow it.
  */
-#define account_type_has_auto_interest_charge(type)  (((type) == CREDIT) || \
-                                                      ((type) == LIABILITY) ||\
-						      ((type) == PAYABLE))
+#define account_type_has_auto_interest_charge(type)  (((type) == ACCT_TYPE_CREDIT) || \
+                                                      ((type) == ACCT_TYPE_LIABILITY) ||\
+						      ((type) == ACCT_TYPE_PAYABLE))
 
-#define account_type_has_auto_interest_payment(type) (((type) == BANK)  || \
-                                                      ((type) == ASSET) || \
-                                                      ((type) == MUTUAL) || \
-						      ((type) == RECEIVABLE))
+#define account_type_has_auto_interest_payment(type) (((type) == ACCT_TYPE_BANK)  || \
+                                                      ((type) == ACCT_TYPE_ASSET) || \
+                                                      ((type) == ACCT_TYPE_MUTUAL) || \
+						      ((type) == ACCT_TYPE_RECEIVABLE))
 
 #define account_type_has_auto_interest_xfer(type) \
   (  account_type_has_auto_interest_charge(type) || \
@@ -980,7 +980,7 @@
   if (formal)
     title = _("Debits");
   else
-    title = gnc_get_debit_string(NO_TYPE);
+    title = gnc_get_debit_string(ACCT_TYPE_NONE);
 
   gtk_frame_set_label(GTK_FRAME(recnData->debit_frame), title);
 
@@ -990,7 +990,7 @@
   if (formal)
     title = _("Credits");
   else
-    title = gnc_get_credit_string(NO_TYPE);
+    title = gnc_get_credit_string(ACCT_TYPE_NONE);
 
   gtk_frame_set_label(GTK_FRAME(recnData->credit_frame), title);
 
@@ -1038,7 +1038,7 @@
   scrollWin = gtk_scrolled_window_new (NULL, NULL);
   gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW (scrollWin),
 				 GTK_POLICY_AUTOMATIC,
-				 GTK_POLICY_ALWAYS);
+				 GTK_POLICY_AUTOMATIC);
   gtk_container_set_border_width(GTK_CONTAINER(scrollWin), 5);
 
   gtk_container_add(GTK_CONTAINER(frame), scrollWin);
@@ -1228,7 +1228,8 @@
   xaccAccountTreeScrubOrphans (account);
   xaccAccountTreeScrubImbalance (account);
 
-  xaccAccountTreeScrubLots (account);
+  // XXX: Lots are disabled.
+  //xaccAccountTreeScrubLots (account);
 
   gnc_resume_gui_refresh ();
 }
@@ -1607,7 +1608,7 @@
   {
     GtkWidget *frame = gtk_frame_new(NULL);
     GtkWidget *main_area = gtk_vbox_new(FALSE, 10);
-    GtkWidget *debcred_area = gtk_hbox_new(FALSE, 15);
+    GtkWidget *debcred_area = gtk_table_new(1, 2, TRUE);
     GtkWidget *debits_box;
     GtkWidget *credits_box;
 
@@ -1631,8 +1632,9 @@
     GNC_RECONCILE_LIST(recnData->credit)->sibling = GNC_RECONCILE_LIST(recnData->debit);
 
     gtk_box_pack_start(GTK_BOX(main_area), debcred_area, TRUE, TRUE, 0);
-    gtk_box_pack_start(GTK_BOX(debcred_area), debits_box, TRUE, TRUE, 0);
-    gtk_box_pack_end(GTK_BOX(debcred_area), credits_box, TRUE, TRUE, 0);
+    gtk_table_set_col_spacings(GTK_TABLE(debcred_area), 15);
+    gtk_table_attach_defaults(GTK_TABLE(debcred_area), debits_box, 0, 1, 0, 1);
+    gtk_table_attach_defaults(GTK_TABLE(debcred_area), credits_box, 1, 2, 0, 1);
 
     {
       GtkWidget *hbox, *title_vbox, *value_vbox;
@@ -1846,7 +1848,8 @@
         continue;
 
       type = xaccAccountGetType(a);
-      if ((type == BANK) || (type == CASH) || (type == ASSET))
+      if ((type == ACCT_TYPE_BANK) || (type == ACCT_TYPE_CASH) ||
+	  (type == ACCT_TYPE_ASSET))
         return a;
     }
   }
@@ -1896,7 +1899,7 @@
   xaccAccountSetReconcileLastDate (account, date);
 
   if (auto_payment &&
-      (xaccAccountGetType (account) == CREDIT) &&
+      (xaccAccountGetType (account) == ACCT_TYPE_CREDIT) &&
       (gnc_numeric_negative_p (recnData->new_ending)))
   {
     Account *payment_account;


Property changes on: gnucash/branches/register-rewrite/src/gnome-search
___________________________________________________________________
Name: svn:ignore
   - *.gladep
*.lo
*.la
.deps
.libs
.scm-links
Makefile
Makefile.in
gw-gnome-search.c
gw-gnome-search.h
gw-gnome-search.html
gw-gnome-search.scm
semantic.cache

TAGS

   + *.gladep
*.lo
*.la
.deps
.libs
.scm-links
Makefile
Makefile.in
semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/gnome-search/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -10,7 +10,6 @@
   -I${top_srcdir}/src/gnome-utils \
   -I${top_srcdir}/src/gnc-module \
   -I${top_srcdir}/src/business/business-core \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${GTKHTML_CFLAGS} \
   ${GDK_PIXBUF_CFLAGS} \
@@ -27,6 +26,7 @@
   search-account.c \
   search-boolean.c \
   search-core-type.c \
+  search-core-utils.c \
   search-date.c \
   search-double.c \
   search-int64.c \
@@ -43,6 +43,7 @@
   search-account.h \
   search-boolean.h \
   search-core-type.h \
+  search-core-utils.h \
   search-date.h \
   search-double.h \
   search-int64.h \
@@ -60,6 +61,7 @@
   ${GTKHTML_LIBS} \
   ${GLADE_LIBS} \
   ${GLIB_LIBS} \
+  ${REGEX_LIBS} \
   ${QOF_LIBS} \
   ${GNOME_PRINT_LIBS}
 

Modified: gnucash/branches/register-rewrite/src/gnome-search/dialog-search.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/dialog-search.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/dialog-search.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  * Copyright (C) 2002 Derek Atkins
  * Author: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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
@@ -52,6 +54,12 @@
   GNC_SEARCH_MATCH_ANY = 1
 } GNCSearchType;
 
+enum search_cols {
+  SEARCH_COL_NAME = 0,
+  SEARCH_COL_POINTER,
+  NUM_SEARCH_COLS
+};
+
 struct _GNCSearchWindow {
   GtkWidget *	dialog;
   GtkWidget *	criteria_table;
@@ -298,18 +306,12 @@
 }
 
 static void
-match_all (GtkWidget *widget, GNCSearchWindow *sw)
+match_combo_changed (GtkComboBox *combo_box, GNCSearchWindow *sw)
 {
-  sw->grouping = GNC_SEARCH_MATCH_ALL;
+  sw->grouping = gtk_combo_box_get_active(combo_box);
 }
 
 static void
-match_any (GtkWidget *widget, GNCSearchWindow *sw)
-{
-  sw->grouping = GNC_SEARCH_MATCH_ANY;
-}
-
-static void
 search_type_cb (GtkToggleButton *button, GNCSearchWindow *sw)
 {
   GSList * buttongroup = gtk_radio_button_get_group (GTK_RADIO_BUTTON(button));
@@ -557,11 +559,18 @@
 }
 
 static void
-option_activate (GtkMenuItem *item, struct _crit_data *data)
+combo_box_changed (GtkComboBox *combo_box, struct _crit_data *data)
 {
-  GNCSearchParam *param = g_object_get_data (G_OBJECT (item), "param");
+  GNCSearchParam *param;
   GNCSearchCoreType *newelem;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
 
+  if (!gtk_combo_box_get_active_iter(combo_box, &iter))
+    return;
+  model = gtk_combo_box_get_model(combo_box);
+  gtk_tree_model_get(model, &iter, SEARCH_COL_POINTER, &param, -1);
+
   if (gnc_search_param_type_match (param, data->param)) {
     /* The param type is the same, just save the new param */
     data->param = param;
@@ -614,7 +623,10 @@
 static GtkWidget *
 get_element_widget (GNCSearchWindow *sw, GNCSearchCoreType *element)
 {
-  GtkWidget *menu, *item, *omenu, *hbox, *p;
+  GtkWidget *combo_box, *hbox, *p;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkCellRenderer *cell;
   GList *l;
   struct _crit_data *data;
   int index = 0, current = 0;
@@ -632,27 +644,35 @@
   data->container = hbox;
   data->param = sw->last_param;
 
-  menu = gtk_menu_new ();
+  store = gtk_list_store_new(NUM_SEARCH_COLS, G_TYPE_STRING, G_TYPE_POINTER);
+  combo_box = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  cell = gtk_cell_renderer_text_new ();
+  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT (combo_box), cell, TRUE);
+  gtk_cell_layout_set_attributes (GTK_CELL_LAYOUT (combo_box), cell,
+                                  "text", SEARCH_COL_NAME,
+                                  NULL);
+
   for (l = sw->params_list; l; l = l->next) {
     GNCSearchParam *param = l->data;
-    item = gtk_menu_item_new_with_label (_(param->title));
-    g_object_set_data (G_OBJECT (item), "param", param);
-    g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (option_activate), data);
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-    gtk_widget_show (item);
 
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       SEARCH_COL_NAME, _(param->title),
+		       SEARCH_COL_POINTER, param,
+		       -1);
+
     if (param == sw->last_param) /* is this the right parameter to start? */
       current = index;
 
     index++;
   }
 
-  omenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), current);
-  gtk_widget_show (omenu);
+  gtk_combo_box_set_active (GTK_COMBO_BOX(combo_box), current);
+  g_signal_connect (combo_box, "changed", G_CALLBACK (combo_box_changed), data);
 
-  gtk_box_pack_start (GTK_BOX (hbox), omenu, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (hbox), combo_box, FALSE, FALSE, 0);
   if (p)
     gtk_box_pack_start (GTK_BOX (hbox), p, FALSE, FALSE, 0);
   gtk_widget_show_all (hbox);
@@ -748,7 +768,7 @@
 {
   GladeXML *xml;
   GtkWidget *label, *add, *box;
-  GtkWidget *menu, *item, *omenu;
+  GtkComboBox *combo_box;
   GtkWidget *new_item_button;
   const char * type_label;
   gboolean active;
@@ -782,25 +802,14 @@
   gtk_box_pack_start (GTK_BOX (box), add, FALSE, FALSE, 3);
   
   /* Set the match-type menu */
-  menu = gtk_menu_new ();
+  combo_box = GTK_COMBO_BOX(gtk_combo_box_new_text());
+  gtk_combo_box_append_text(combo_box, _("all criteria are met"));
+  gtk_combo_box_append_text(combo_box, _("any criteria are met"));
+  gtk_combo_box_set_active(combo_box, sw->grouping);
+  g_signal_connect(combo_box, "changed", G_CALLBACK (match_combo_changed), sw);
 
-  item = gtk_menu_item_new_with_label (_("all criteria are met"));
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (match_all), sw);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-	
-  item = gtk_menu_item_new_with_label (_("any criteria are met"));
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (match_any), sw);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-	
-  omenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (omenu), menu);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (omenu), sw->grouping);
-
-  gtk_widget_show (omenu);
   box = glade_xml_get_widget (xml, "type_menu_box");
-  gtk_box_pack_start (GTK_BOX (box), omenu, FALSE, FALSE, 3);
+  gtk_box_pack_start (GTK_BOX (box), GTK_WIDGET(combo_box), FALSE, FALSE, 3);
 
   /* if there's no original query, make the narrow, add, delete 
    * buttons inaccessible */

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -31,6 +33,7 @@
 #include "gnc-gui-query.h"
 
 #include "search-account.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -172,58 +175,30 @@
   return valid;
 }
 
-static void
-option_changed (GtkWidget *widget, GNCSearchAccount *fe)
-{
-  fe->how = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       query_compare_t option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (option_changed), user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_MENU_ITEM(str,op) { \
-	item = add_menu_item (menu, fe, str, op); \
-	if (fi->how == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
   GNCSearchAccount *fi = (GNCSearchAccount *)fe;
   GNCSearchAccountPrivate *priv;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
+  int initial = 0;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
   priv = _PRIVATE(fi);
   if (priv->match_all) {
-    ADD_MENU_ITEM (_("matches all accounts"), GUID_MATCH_ALL);
-    first = item;
+    gnc_combo_box_search_add(combo, _("matches all accounts"), GUID_MATCH_ALL);
+    initial = GUID_MATCH_ALL;
   } else {
-    ADD_MENU_ITEM (_("matches any account"), GUID_MATCH_ANY);
-    first = item;			/* Force one */
-    ADD_MENU_ITEM (_("matches no accounts"), GUID_MATCH_NONE);
+    gnc_combo_box_search_add(combo, _("matches any account"), GUID_MATCH_ANY);
+    gnc_combo_box_search_add(combo, _("matches no accounts"), GUID_MATCH_NONE);
+    initial = GUID_MATCH_ANY;
   }
 
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : initial);
 
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static char *

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-boolean.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-boolean.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-boolean.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -28,6 +30,7 @@
 #include "QueryCore.h"
 
 #include "search-boolean.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -159,56 +162,24 @@
 }
 
 static void
-option_changed (GtkWidget *widget, GNCSearchBoolean *fe)
-{
-  fe->how = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
 toggle_changed (GtkToggleButton *button, GNCSearchBoolean *fe)
 {
   fe->value = gtk_toggle_button_get_active (button);
 }
 
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       query_compare_t option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (option_changed), user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_MENU_ITEM(str,op) { \
-	item = add_menu_item (menu, fe, str, op); \
-	if (fi->how == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
   GNCSearchBoolean *fi = (GNCSearchBoolean *)fe;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+  gnc_combo_box_search_add(combo, _("is"), COMPARE_EQUAL);
+  gnc_combo_box_search_add(combo, _("is not"), COMPARE_NEQ);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_EQUAL);
 
-  ADD_MENU_ITEM (_("is"), COMPARE_EQUAL);
-  first = item;			/* Force one */ 
-  ADD_MENU_ITEM (_("is not"), COMPARE_NEQ);
-
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static GtkWidget *

Copied: gnucash/branches/register-rewrite/src/gnome-search/search-core-utils.c (from rev 15058, gnucash/trunk/src/gnome-search/search-core-utils.c)

Copied: gnucash/branches/register-rewrite/src/gnome-search/search-core-utils.h (from rev 15058, gnucash/trunk/src/gnome-search/search-core-utils.h)

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-date.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-date.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-date.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -30,6 +32,7 @@
 #include "QueryCore.h"
 
 #include "search-date.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -172,60 +175,29 @@
 }
 
 static void
-option_changed (GtkWidget *widget, GNCSearchDate *fe)
-{
-  fe->how = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
 date_changed (GNCDateEdit *date_edit, GNCSearchDate *fe)
 {
   fe->ts = gnc_date_edit_get_date_ts (date_edit);
 }
 
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       query_compare_t option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK(option_changed), user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_MENU_ITEM(str,op) { \
-	item = add_menu_item (menu, fe, str, op); \
-	if (fi->how == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
   GNCSearchDate *fi = (GNCSearchDate *)fe;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
-  ADD_MENU_ITEM (_("is before"), COMPARE_LT);
-  first = item;			/* Force one */
-  ADD_MENU_ITEM (_("is before or on"), COMPARE_LTE);
-  ADD_MENU_ITEM (_("is on"), COMPARE_EQUAL);
-  ADD_MENU_ITEM (_("is not on"), COMPARE_NEQ);
-  ADD_MENU_ITEM (_("is after"), COMPARE_GT);
-  ADD_MENU_ITEM (_("is on or after"), COMPARE_GTE);
+  gnc_combo_box_search_add(combo, _("is before"), COMPARE_LT);
+  gnc_combo_box_search_add(combo, _("is before or on"), COMPARE_LTE);
+  gnc_combo_box_search_add(combo, _("is on"), COMPARE_EQUAL);
+  gnc_combo_box_search_add(combo, _("is not on"), COMPARE_NEQ);
+  gnc_combo_box_search_add(combo, _("is after"), COMPARE_GT);
+  gnc_combo_box_search_add(combo, _("is on or after"), COMPARE_GTE);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static void

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-double.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-double.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-double.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -29,6 +31,7 @@
 #include "QueryCore.h"
 
 #include "search-double.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -164,60 +167,29 @@
 }
 
 static void
-option_changed (GtkWidget *widget, GNCSearchDouble *fe)
-{
-  fe->how = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
 entry_changed (GNCAmountEdit *entry, GNCSearchDouble *fe)
 {
   fe->value = gnc_amount_edit_get_damount (entry);
 }
 
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       query_compare_t option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (option_changed), user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_MENU_ITEM(str,op) { \
-	item = add_menu_item (menu, fe, str, op); \
-	if (fi->how == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
   GNCSearchDouble *fi = (GNCSearchDouble *)fe;
-  GtkWidget *menu, *item, *first = NULL, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
-  ADD_MENU_ITEM (_("is less than"), COMPARE_LT);
-  first = item;			/* Force one */
-  ADD_MENU_ITEM (_("is less than or equal to"), COMPARE_LTE);
-  ADD_MENU_ITEM (_("equals"), COMPARE_EQUAL);
-  ADD_MENU_ITEM (_("does not equal"), COMPARE_NEQ);
-  ADD_MENU_ITEM (_("is greater than"), COMPARE_GT);
-  ADD_MENU_ITEM (_("is greater than or equal to"), COMPARE_GTE);
+  gnc_combo_box_search_add(combo, _("is less than"), COMPARE_LT);
+  gnc_combo_box_search_add(combo, _("is less than or equal to"), COMPARE_LTE);
+  gnc_combo_box_search_add(combo, _("equals"), COMPARE_EQUAL);
+  gnc_combo_box_search_add(combo, _("does not equal"), COMPARE_NEQ);
+  gnc_combo_box_search_add(combo, _("is greater than"), COMPARE_GT);
+  gnc_combo_box_search_add(combo, _("is greater than or equal to"), COMPARE_GTE);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static void

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-int64.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-int64.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-int64.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -29,6 +31,7 @@
 #include "QueryCore.h"
 
 #include "search-int64.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -165,13 +168,6 @@
 }
 
 static void
-option_changed (GtkWidget *widget, GNCSearchInt64 *fe)
-{
-  fe->how = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
 entry_changed (GNCAmountEdit *entry, GNCSearchInt64 *fe)
 {
   gnc_numeric value = gnc_amount_edit_get_amount (entry);
@@ -180,47 +176,22 @@
 }
 
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       query_compare_t option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (option_changed), user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_MENU_ITEM(str,op) { \
-	item = add_menu_item (menu, fe, str, op); \
-	if (fi->how == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
   GNCSearchInt64 *fi = (GNCSearchInt64 *)fe;
-  GtkWidget *menu, *item, *first = NULL, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+  gnc_combo_box_search_add(combo, _("is less than"), COMPARE_LT);
+  gnc_combo_box_search_add(combo, _("is less than or equal to"), COMPARE_LTE);
+  gnc_combo_box_search_add(combo, _("equals"), COMPARE_EQUAL);
+  gnc_combo_box_search_add(combo, _("does not equal"), COMPARE_NEQ);
+  gnc_combo_box_search_add(combo, _("is greater than"), COMPARE_GT);
+  gnc_combo_box_search_add(combo, _("is greater than or equal to"), COMPARE_GTE);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  ADD_MENU_ITEM (_("is less than"), COMPARE_LT);
-  first = item;			/* Force one */
-  ADD_MENU_ITEM (_("is less than or equal to"), COMPARE_LTE);
-  ADD_MENU_ITEM (_("equals"), COMPARE_EQUAL);
-  ADD_MENU_ITEM (_("does not equal"), COMPARE_NEQ);
-  ADD_MENU_ITEM (_("is greater than"), COMPARE_GT);
-  ADD_MENU_ITEM (_("is greater than or equal to"), COMPARE_GTE);
-
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static void

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-numeric.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-numeric.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-numeric.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -29,6 +31,7 @@
 #include "QueryCore.h"
 
 #include "search-numeric.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -194,109 +197,62 @@
 }
 
 static void
-how_option_changed (GtkWidget *widget, GNCSearchNumeric *fe)
-{
-  fe->how = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
-option_changed (GtkWidget *widget, GNCSearchNumeric *fe)
-{
-  fe->option = (query_compare_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
 entry_changed (GNCAmountEdit *entry, GNCSearchNumeric *fe)
 {
   fe->value = gnc_amount_edit_get_amount (entry);
 }
 
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       query_compare_t option, GCallback fcn)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", fcn, user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_MENU_ITEM(cmp,str,op,fcn) { \
-	item = add_menu_item (menu, fe, str, op, fcn); \
-	if (cmp == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_how_menu (GNCSearchCoreType *fe)
 {
   GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
   GNCSearchNumericPrivate *priv;
-  GtkWidget *menu, *item, *first = NULL, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
-
   priv = _PRIVATE(fi);
-  ADD_MENU_ITEM (fi->how, (priv->is_debcred ?
-			   _("less than") : _("is less than")),
-		 COMPARE_LT, G_CALLBACK (how_option_changed));
-  first = item;			/* Force one */
-  ADD_MENU_ITEM (fi->how, (priv->is_debcred ?
-			   _("less than or equal to") :
-			   _("is less than or equal to")),
-		 COMPARE_LTE, G_CALLBACK (how_option_changed));
-  ADD_MENU_ITEM (fi->how, (priv->is_debcred ?
-			   _("equal to") : _("equals")),
-		 COMPARE_EQUAL, G_CALLBACK (how_option_changed));
-  ADD_MENU_ITEM (fi->how, (priv->is_debcred ?
-			   _("not equal to") : _("does not equal")),
-		 COMPARE_NEQ, G_CALLBACK (how_option_changed));
-  ADD_MENU_ITEM (fi->how, (priv->is_debcred ?
-			   _("greater than") : _("is greater than")),
-		 COMPARE_GT, G_CALLBACK (how_option_changed));
-  ADD_MENU_ITEM (fi->how, (priv->is_debcred ?
-			   _("greater than or equal to") :
-			   _("is greater than or equal to")),
-		 COMPARE_GTE, G_CALLBACK (how_option_changed));
 
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+  gnc_combo_box_search_add(combo, (priv->is_debcred ?
+				   _("less than") : _("is less than")),
+			   COMPARE_LT);
+  gnc_combo_box_search_add(combo, (priv->is_debcred ?
+				   _("less than or equal to") :
+				   _("is less than or equal to")),
+			   COMPARE_LTE);
+  gnc_combo_box_search_add(combo, (priv->is_debcred ?
+				   _("equal to") : _("equals")),
+			   COMPARE_EQUAL);
+  gnc_combo_box_search_add(combo, (priv->is_debcred ?
+				   _("not equal to") : _("does not equal")),
+			   COMPARE_NEQ);
+  gnc_combo_box_search_add(combo, (priv->is_debcred ?
+				   _("greater than") : _("is greater than")),
+			   COMPARE_GT);
+  gnc_combo_box_search_add(combo, (priv->is_debcred ?
+				   _("greater than or equal to") :
+				   _("is greater than or equal to")),
+			   COMPARE_GTE);
 
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : COMPARE_LT);
 
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static GtkWidget *
 make_option_menu (GNCSearchCoreType *fe)
 {
   GNCSearchNumeric *fi = (GNCSearchNumeric *)fe;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+  gnc_combo_box_search_add(combo, _("has credits or debits"), NUMERIC_MATCH_ANY);
+  gnc_combo_box_search_add(combo, _("has debits"), NUMERIC_MATCH_DEBIT);
+  gnc_combo_box_search_add(combo, _("has credits"), NUMERIC_MATCH_CREDIT);
+  gnc_combo_box_search_changed(combo, &fi->option);
+  gnc_combo_box_search_set_active(combo, fi->option ? fi->option : NUMERIC_MATCH_ANY);
 
-  ADD_MENU_ITEM (fi->option, _("has credits or debits"), NUMERIC_MATCH_ANY,
-		G_CALLBACK (option_changed));
-  first = item;			/* Force one */
-  ADD_MENU_ITEM (fi->option, _("has debits"), NUMERIC_MATCH_DEBIT,
-		 G_CALLBACK (option_changed));
-  ADD_MENU_ITEM (fi->option, _("has credits"), NUMERIC_MATCH_CREDIT,
-		 G_CALLBACK (option_changed));
-
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static void

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-reconciled.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-reconciled.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-reconciled.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -29,6 +31,7 @@
 #include "Transaction.h"	/* for ?REC */
 
 #include "search-reconciled.h"
+#include "search-core-utils.h"
 
 #define d(x)
 
@@ -160,13 +163,6 @@
 }
 
 static void
-option_changed (GtkWidget *widget, GNCSearchReconciled *fe)
-{
-  fe->how = (char_match_t)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
 toggle_changed (GtkToggleButton *button, GNCSearchReconciled *fe)
 {
   gboolean is_on = gtk_toggle_button_get_active (button);
@@ -180,43 +176,18 @@
 }
 
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       char_match_t option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (option_changed), user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-#define ADD_MENU_ITEM(str,op) { \
-	item = add_menu_item (menu, fe, str, op); \
-	if (fi->how == op) { current = index; first = item; } \
-	index++; \
-} 
-
-static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
   GNCSearchReconciled *fi = (GNCSearchReconciled *)fe;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0, index = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
+  gnc_combo_box_search_add(combo, _("is"), CHAR_MATCH_ANY);
+  gnc_combo_box_search_add(combo, _("is not"), CHAR_MATCH_NONE);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : CHAR_MATCH_ANY);
 
-  ADD_MENU_ITEM (_("is"), CHAR_MATCH_ANY);
-  first = item;			/* Force one */ 
-  ADD_MENU_ITEM (_("is not"), CHAR_MATCH_NONE);
-
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static GtkWidget *

Modified: gnucash/branches/register-rewrite/src/gnome-search/search-string.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search-string.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search-string.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,8 @@
  *
  *  Authors: Derek Atkins <warlord at MIT.EDU>
  *
+ * 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 version 2 of the GNU General Public
  * License as published by the Free Software Foundation.
@@ -29,6 +31,7 @@
 #include <regex.h>
 
 #include "search-string.h"
+#include "search-core-utils.h"
 #include "QueryCore.h"
 
 #define d(x)
@@ -235,13 +238,6 @@
 }
 
 static void
-option_changed (GtkWidget *widget, GNCSearchString *fe)
-{
-  fe->how = (GNCSearchString_Type)
-    g_object_get_data (G_OBJECT (widget), "option");
-}
-
-static void
 entry_changed (GtkEntry *entry, GNCSearchString *fe)
 {
   const char *new;
@@ -251,49 +247,22 @@
 }
 
 static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       GNCSearchString_Type option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label (label);
-  g_object_set_data (G_OBJECT (item), "option", (gpointer) option);
-  g_signal_connect (G_OBJECT (item), "activate", G_CALLBACK (option_changed), user_data);
-  gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-  gtk_widget_show (item);
-  return item;
-}
-
-static GtkWidget *
 make_menu (GNCSearchCoreType *fe)
 {
   GNCSearchString *fi = (GNCSearchString *)fe;
-  GtkWidget *menu, *item, *first, *opmenu;
-  int current = 0;
+  GtkComboBox *combo;
 
-  menu = gtk_menu_new ();
+  combo = GTK_COMBO_BOX(gnc_combo_box_new_search());
 
-  item = add_menu_item (menu, fe, _("contains"), SEARCH_STRING_CONTAINS);
-  first = item;
+  gnc_combo_box_search_add(combo, _("contains"), SEARCH_STRING_CONTAINS);
+  gnc_combo_box_search_add(combo, _("matches regex"),
+				SEARCH_STRING_MATCHES_REGEX);
+  gnc_combo_box_search_add(combo, _("does not match regex"),
+				SEARCH_STRING_NOT_MATCHES_REGEX);
+  gnc_combo_box_search_changed(combo, &fi->how);
+  gnc_combo_box_search_set_active(combo, fi->how ? fi->how : SEARCH_STRING_CONTAINS);
 
-  item = add_menu_item (menu, fe, _("does not contain"),
-			SEARCH_STRING_NOT_CONTAINS);
-  if (fi->how == SEARCH_STRING_NOT_CONTAINS) { current = 1; first = item; }
-
-  item = add_menu_item (menu, fe, _("matches regex"),
-			SEARCH_STRING_MATCHES_REGEX);
-  if (fi->how == SEARCH_STRING_MATCHES_REGEX) { current = 2; first = item; }
-
-  item = add_menu_item (menu, fe, _("does not match regex"),
-			SEARCH_STRING_NOT_MATCHES_REGEX);
-  if (fi->how == SEARCH_STRING_NOT_MATCHES_REGEX)
-    { current = 3; first = item; }
-
-  opmenu = gtk_option_menu_new ();
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (opmenu), menu);
-
-  g_signal_emit_by_name (G_OBJECT (first), "activate", fe);
-  gtk_option_menu_set_history (GTK_OPTION_MENU (opmenu), current);
-
-  return opmenu;
+  return GTK_WIDGET(combo);
 }
 
 static void

Modified: gnucash/branches/register-rewrite/src/gnome-search/search.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-search/search.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-search/search.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -330,7 +330,7 @@
 		    <widget class="GtkScrolledWindow" id="scrolledwindow1">
 		      <property name="visible">True</property>
 		      <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
-		      <property name="vscrollbar_policy">GTK_POLICY_ALWAYS</property>
+		      <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		      <property name="shadow_type">GTK_SHADOW_NONE</property>
 		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 


Property changes on: gnucash/branches/register-rewrite/src/gnome-utils
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
*.gladep
*.lo
*.la
.deps
.libs
.scm-links
gnc-dir.h
gw-gnome-utils.html
gw-gnome-utils.h
gw-gnome-utils.scm
gw-gnome-utils.c
*gnc-version.h
gnc-svninfo.h
g-wrapped
gnucash
_gnc_svninfo.h

TAGS

   + Makefile
Makefile.in
*.gladep
*.lo
*.la
.deps
.libs
.scm-links
gnc-dir.h
swig-gnome-utils.c
*gnc-version.h
gnc-svninfo.h
gnucash
_gnc_svninfo.h

TAGS


Modified: gnucash/branches/register-rewrite/src/gnome-utils/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,15 +1,11 @@
 SUBDIRS = glade schemas . test ui
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-gnome-utils.la libgw-gnome-utils.la
+pkglib_LTLIBRARIES = libgncmod-gnome-utils.la
 
 # Note that src/gnome-utils CANNOT depend on src/gnome!
 
 AM_CFLAGS = \
-  -DPREFIX=\"${prefix}\" \
-  -DSYSCONFDIR=\"${GNC_CONFIGDIR}\" \
-  -DDATADIR=\"${GNC_SHAREDIR}\" \
-  -DLIBDIR=\"${GNC_LIBDIR}\" \
   -I${top_srcdir}/src/core-utils \
   -I${top_srcdir}/src/gnc-module \
   -I${top_srcdir}/src/engine \
@@ -17,6 +13,7 @@
   -I${top_srcdir}/src/network-utils \
   -I${top_srcdir}/src/app-utils \
   -I${top_srcdir}/src \
+  -I${top_srcdir}/lib/libc \
   ${GLIB_CFLAGS} \
   ${GLADE_CFLAGS} \
   ${GTK_CFLAGS} \
@@ -24,14 +21,11 @@
   ${GNOME_CFLAGS} \
   ${GTKHTML_CFLAGS} \
   ${GUILE_INCS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${QOF_CFLAGS} \
   ${GOFFICE_CFLAGS} \
   ${GSF_CFLAGS}
 
 libgncmod_gnome_utils_la_SOURCES = \
-  gtktreedatalist.c \
-  gnctreemodelsort.c \
   QuickFill.c \
   account-quickfill.c \
   cursors.c \
@@ -99,12 +93,11 @@
   print-session.c \
   search-param.c \
   gnc-dialog.c \
+  swig-gnome-utils.c \
   window-main-summarybar.c
 
 gncincludedir = ${GNC_INCLUDE_DIR}
 gncinclude_HEADERS = \
-  gtktreedatalist.h \
-  gnctreemodelsort.h \
   QuickFill.h \
   account-quickfill.h \
   dialog-account.h \
@@ -169,52 +162,42 @@
 
 noinst_HEADERS = \
   argv-list-converters.h \
-  gnc-dir.h \
   gnc-druid-gnome.h \
   gnc-druid-provider-edge-gnome.h \
   gnc-druid-provider-file-gnome.h \
   gnc-druid-provider-multifile-gnome.h \
-  gnc-version.h \
-  gw-gnome-utils.h \
   search-param.h
 
 libgncmod_gnome_utils_la_LIBADD = \
   ${top_builddir}/src/core-utils/libcore-utils.la \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
-  ${top_builddir}/src/engine/libgw-engine.la \
   ${top_builddir}/src/backend/file/libgnc-backend-file-utils.la \
   ${top_builddir}/src/calculation/libgncmod-calculation.la \
   ${top_builddir}/src/network-utils/libgncmod-network-utils.la \
   ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
+  $(top_builddir)/lib/libc/libc-missing.la \
   ${GNOME_LIBS} \
   ${GNOME_PRINT_LIBS} \
   ${GTKHTML_LIBS} \
   ${GUILE_LIBS} \
   ${GDK_PIXBUF_LIBS} \
   ${GLADE_LIBS} \
-  ${G_WRAP_LINK_ARGS} \
   ${GUILE_LIBS} \
   ${GLIB_LIBS} \
   ${DB_LIBS} \
   ${GSF_LIBS} \
   ${QOF_LIBS} \
   ${GOFFICE_LIBS} \
+  ${REGEX_LIBS} \
   ${LIBXML2_LIBS}
 
-libgw_gnome_utils_la_SOURCES = gw-gnome-utils.c
-libgw_gnome_utils_la_LIBADD = \
-  libgncmod-gnome-utils.la \
-  ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
-  ${top_builddir}/src/engine/libgw-engine.la \
-  ${top_builddir}/src/core-utils/libcore-utils.la \
-  ${QOF_LIBS} \
-  ${G_WRAP_LINK_ARGS} \
-  ${GLIB_LIBS}
+if BUILDING_FROM_SVN
+swig-gnome-utils.c: gnome-utils.i gnc-html.h print-session.h
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-gnome-utils.scm gw-gnome-utils-spec.scm
-
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash
 gncmod_DATA = gnome-utils.scm 
 
@@ -222,9 +205,8 @@
 gncscm_DATA = gnc-menu-extensions.scm
 
 EXTRA_DIST = \
-  gnc-dir.h.in \
   gnc-svninfo.h \
-  ${gwmod_DATA} \
+  gnome-utils.i \
   ${gncmod_DATA} \
   ${gncscm_DATA}
 
@@ -232,14 +214,6 @@
 ## brackets here, instead of the usual @... at .  This prevents autoconf
 ## from substituting the values directly into the left-hand sides of
 ## the sed substitutions.
-gnc-dir.h: gnc-dir.h.in ${top_builddir}/config.status Makefile
-	rm -f $@.tmp
-	sed < $< > $@.tmp \
-	    -e 's:@-GNC_ACCOUNTS_DIR-@:${GNC_ACCOUNTS_DIR}:g' \
-	    -e 's:@-GNC_GLADE_DIR-@:${GNC_GLADE_DIR}:g' \
-	    -e 's:@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@:${GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY}:g'
-	mv $@.tmp $@
-
 gnc-version.h: _gnc-version.h
 	-if [ ! -f gnc-version.h ]; then cp _gnc-version.h gnc-version.h; fi
 	-cmp -s _gnc-version.h gnc-version.h || cp _gnc-version.h gnc-version.h
@@ -283,42 +257,32 @@
 		fi ; \
 	fi
 
-BUILT_SOURCES = gnc-dir.h gnc-version.h
+BUILT_SOURCES = gnc-version.h
 
 if GNUCASH_SEPARATE_BUILDDIR
-#For compiling
-SCM_FILE_LINKS = gw-gnome-utils-spec.scm
 #For executing test cases
-SCM_FILE_LINKS += \
+SCM_FILE_LINKS = \
   ${gncmod_DATA} \
   ${gncscm_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-gw-gnome-utils.scm gw-gnome-utils.c gw-gnome-utils.h: \
-  .scm-links gw-gnome-utils-spec.scm ${top_builddir}/config.status Makefile
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (set! %load-path (cons \"${PWD}\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/engine\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/app-utils\" %load-path)) \
-	  (primitive-load \"./gw-gnome-utils-spec.scm\") \
-	  (gw:generate-wrapset \"gw-gnome-utils\")"
+noinst_DATA = .scm-links
+CLEANFILES = $(BUILT_SOURCES) gnucash .scm-links ${SCM_FILE_LINKS}
+MAINTAINERCLEANFILES = swig-gnome-utils.c
 
-BUILT_SOURCES += gw-gnome-utils.scm gw-gnome-utils.c gw-gnome-utils.h
-CLEANFILES = gnucash g-wrapped .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-gnome-utils.html
-
+# FIXME: Symlinking directories only works on non-win32.
+if !PLATFORM_WIN32
 #
 # I hate inconsistent standards. Autotools puts help files into
 # ${datadir}/gnome/help/${program} while the gnome2 libraries expect
@@ -329,3 +293,4 @@
 
 uninstall-hook:
 	rm -f ${DESTDIR}${pkgdatadir}/gnome
+endif

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -54,6 +54,14 @@
 #define DIALOG_EDIT_ACCOUNT_CM_CLASS "dialog-edit-account"
 #define GCONF_SECTION "dialogs/account"
 
+enum account_cols {
+  ACCOUNT_COL_FULLNAME = 0,
+  ACCOUNT_COL_FIELDNAME,
+  ACCOUNT_COL_OLD_VALUE,
+  ACCOUNT_COL_NEW_VALUE,
+  NUM_ACCOUNT_COLS
+};
+
 typedef enum
 {
   NEW_ACCOUNT,
@@ -86,8 +94,9 @@
   GtkWidget * commodity_edit;
   dialog_commodity_mode commodity_mode;
   GtkWidget * account_scu;
-  
-  GList * valid_types;
+
+  guint32 valid_types;
+  GNCAccountType preferred_account_type;
   GtkWidget * type_view;
   GtkTreeView * parent_tree;
 
@@ -121,13 +130,12 @@
 /** Static Globals *******************************************************/
 static QofLogModule log_module = GNC_MOD_GUI;
 
-static int last_used_account_type = BANK;
+static GNCAccountType last_used_account_type = ACCT_TYPE_BANK;
 
 static GList *ac_destroy_cb_list = NULL;
 
 /** Declarations *********************************************************/
 static void gnc_account_window_set_name (AccountWindow *aw);
-static void make_account_changes(GHashTable *change_type);
 
 void gnc_account_renumber_prefix_changed_cb (GtkEditable *editable, RenumberDialog *data);
 void gnc_account_renumber_interval_changed_cb (GtkSpinButton *spinbutton, RenumberDialog *data);
@@ -161,7 +169,7 @@
 {
   dialog_commodity_mode new_mode;
 
-  if ((aw->type == STOCK) || (aw->type == MUTUAL))
+  if ((aw->type == ACCT_TYPE_STOCK) || (aw->type == ACCT_TYPE_MUTUAL))
     new_mode = DIAG_COMM_NON_CURRENCY;
   else
     new_mode = DIAG_COMM_CURRENCY;
@@ -211,7 +219,7 @@
   } else {
     index = 0;
   }
-  gtk_option_menu_set_history(GTK_OPTION_MENU(aw->account_scu), index);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(aw->account_scu), index);
 
   string = xaccAccountGetCode (account);
   if (string == NULL) string = "";
@@ -233,10 +241,6 @@
   flag = xaccAccountGetHidden (account);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (aw->hidden_button),
                                 flag);
-
-  gtk_tree_view_collapse_all (aw->parent_tree);
-  gnc_tree_view_account_set_selected_account (
-      GNC_TREE_VIEW_ACCOUNT(aw->parent_tree), account);
   LEAVE(" ");
 }
 
@@ -314,11 +318,18 @@
     return;
   }
 
+  if (aw->type != xaccAccountGetType (account)) {
+    /* Just refreshing won't work. */
+    aw_call_destroy_callbacks (account);
+  }
+
   xaccAccountBeginEdit (account);
 
   if (aw->type != xaccAccountGetType (account))
     xaccAccountSetType (account, aw->type);
 
+  last_used_account_type = aw->type;
+
   string = gtk_entry_get_text (GTK_ENTRY(aw->name_entry));
   old_string = xaccAccountGetName (account);
   if (safe_strcmp (string, old_string) != 0)
@@ -339,7 +350,7 @@
     old_scu = xaccAccountGetCommoditySCU(account);
   }
 
-  index = gnc_option_menu_get_active(aw->account_scu);
+  index = gtk_combo_box_get_active(GTK_COMBO_BOX(aw->account_scu));
   nonstd = (index != 0);
   if (nonstd != xaccAccountGetNonStdSCU(account))
     xaccAccountSetNonStdSCU(account, nonstd);
@@ -431,15 +442,57 @@
 }
 
 
-static void 
-gnc_finish_ok (AccountWindow *aw,
-               GHashTable *change_type)
+static void
+set_children_types (Account *account, GNCAccountType type)
 {
-  ENTER("aw %p, hash table %p", aw, change_type);
+  AccountGroup *children;
+  GList *iter;
+
+  children = xaccAccountGetChildren (account);
+  if (children == NULL)
+    return;
+
+  for (iter=xaccGroupGetAccountList (children); iter; iter=iter->next) {
+    account = iter->data;
+    if (type == xaccAccountGetType(account))
+      continue;
+
+    /* Just refreshing won't work. */
+    aw_call_destroy_callbacks (account);
+
+    xaccAccountBeginEdit (account);
+    xaccAccountSetType (account, type);
+    xaccAccountCommitEdit (account);
+
+    set_children_types (account, type);
+  }
+}
+
+static void
+make_children_compatible (AccountWindow *aw)
+{
+  Account *account;
+
+  g_return_if_fail (aw);
+
+  account = aw_get_account (aw);
+  g_return_if_fail (account);
+
+  if (xaccAccountTypesCompatible (xaccAccountGetType (account), aw->type))
+    return;
+
+  set_children_types (account, aw->type);
+}
+
+
+static void
+gnc_finish_ok (AccountWindow *aw)
+{
+  ENTER("aw %p", aw);
   gnc_suspend_gui_refresh ();
 
   /* make the account changes */
-  make_account_changes (change_type);
+  make_children_compatible (aw);
   gnc_ui_to_account (aw);
 
   gnc_resume_gui_refresh ();
@@ -489,156 +542,43 @@
 }
 
 
-/* Record all of the children of the given account as needing their
- * type changed to the one specified. */
 static void
-gnc_edit_change_account_types(GHashTable *change_type, Account *account,
-                              Account *except, GNCAccountType type)
+add_children_to_expander (GObject *object, GParamSpec *param_spec, gpointer data)
 {
-  AccountGroup *children;
-  GList *list;
-  GList *node;
+  GtkExpander *expander = GTK_EXPANDER (object);
+  Account *account = data;
+  GtkWidget *scrolled_window;
+  GtkTreeView *view;
 
-  if ((change_type == NULL) || (account == NULL))
-    return;
+  if (gtk_expander_get_expanded (expander) &&
+      !gtk_bin_get_child (GTK_BIN (expander))) {
 
-  if (account == except)
-    return;
+    view = gnc_tree_view_account_new_with_group (
+      xaccAccountGetChildren (account), FALSE);
 
-  g_hash_table_insert(change_type, account, GINT_TO_POINTER(type));
+    scrolled_window = gtk_scrolled_window_new (NULL, NULL);
+    gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (scrolled_window),
+                                    GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC);
+    gtk_scrolled_window_set_shadow_type (GTK_SCROLLED_WINDOW (scrolled_window),
+                                         GTK_SHADOW_IN);
+    gtk_container_add (GTK_CONTAINER (scrolled_window), GTK_WIDGET (view));
 
-  children = xaccAccountGetChildren(account);
-  if (children == NULL)
-    return;
-
-  list = xaccGroupGetAccountList (children);
-
-  for (node= list; node; node = node->next)
-  {
-    account = node->data;
-    gnc_edit_change_account_types(change_type, account, except, type);
+    gtk_container_add (GTK_CONTAINER (expander), scrolled_window);
+    gtk_widget_show_all (scrolled_window);
   }
 }
 
-
-/* helper function to perform changes to accounts */
-static void
-change_func (gpointer key, gpointer value, gpointer unused)
-{
-  Account *account = key;
-  int type;
- 
-  if (account == NULL)
-    return;
-
-  xaccAccountBeginEdit(account);
-
-  type = GPOINTER_TO_INT(value);
-
-  if (type == xaccAccountGetType(account))
-    return;
-
-  /* Just refreshing won't work. */
-  aw_call_destroy_callbacks (account);
-
-  xaccAccountSetType(account, type);
-
-  xaccAccountCommitEdit(account);
-}
-
-
-/* Perform the changes to accounts dictated by the hash tables */
-static void
-make_account_changes(GHashTable *change_type)
-{
-  if (change_type != NULL)
-    g_hash_table_foreach(change_type, change_func, NULL);
-}
-
-
-typedef struct
-{
-  Account *account;
-  GtkCList *list;
-  guint count;
-} FillStruct;
-
-static void
-fill_helper(gpointer key, gpointer value, gpointer data)
-{
-  Account *account = key;
-  FillStruct *fs = data;
-  gchar *full_name;
-  gchar *account_field_name;
-  gchar *account_field_value;
-  gchar *value_str;
-
-  if (fs == NULL) return;
-  if (fs->account == account) return;
-
-  full_name = xaccAccountGetFullName(account);
-  if(!full_name)
-    full_name = g_strdup("");
-
-  account_field_name = g_strdup("Type");
-  if (!account_field_name)
-    account_field_name = g_strdup("");
-
-  account_field_value =
-    g_strdup (xaccAccountGetTypeStr(xaccAccountGetType(account)));
-  if (!account_field_value)
-    account_field_value = g_strdup("");
-
-  value_str = g_strdup(xaccAccountGetTypeStr(GPOINTER_TO_INT(value)));
-
-  {  
-    gchar *strings[5];
-
-    strings[0] = full_name;
-    strings[1] = account_field_name;
-    strings[2] = account_field_value;
-    strings[3] = value_str;
-    strings[4] = NULL; 
-
-    gtk_clist_append(fs->list, strings);
-  }
-
-  g_free(full_name);
-  g_free(account_field_name);
-  g_free(account_field_value);
-  g_free(value_str);
-  fs->count++;
-}
-
-static guint
-fill_list(Account *account, GtkCList *list,
-          GHashTable *change)
-{
-  FillStruct fs;
-
-  if (change == NULL)
-    return 0;
-
-  fs.account = account;
-  fs.list = list;
-  fs.count = 0;
-
-  g_hash_table_foreach(change, fill_helper, &fs);
-
-  return fs.count;
-}
-
-
-/* Present a dialog of proposed account changes for the user's ok */
+/* Check whether there are children needing a type adjustment because of a
+   a change to an incompatible type (like after some reparenting) and let the
+   user decide whether he wants that */
 static gboolean
-extra_change_verify (AccountWindow *aw,
-                     GHashTable *change_type)
+verify_children_compatible (AccountWindow *aw)
 {
   Account *account;
-  GtkCList *list;
-  gchar *titles[5];
+  AccountGroup *children;
+  GtkWidget *dialog, *vbox, *hbox, *label, *expander;
+  gchar *str;
   gboolean result;
-  guint size;
 
   if (aw == NULL)
     return FALSE;
@@ -647,69 +587,88 @@
   if (!account)
     return FALSE;
 
-  titles[0] = _("Account");
-  titles[1] = _("Field");
-  titles[2] = _("Old Value");
-  titles[3] = _("New Value");
-  titles[4] = NULL;
+  if (xaccAccountTypesCompatible (xaccAccountGetType (account), aw->type))
+    return TRUE;
 
-  list = GTK_CLIST(gtk_clist_new_with_titles(4, titles));
+  children = xaccAccountGetChildren (account);
+  if (!children ||
+      !xaccGroupGetNumAccounts (children))
+    return TRUE;
 
-  size = 0;
-  size += fill_list(account, list, change_type);
+  dialog = gtk_dialog_new_with_buttons ("",
+                                        GTK_WINDOW(aw->dialog),
+                                        GTK_DIALOG_DESTROY_WITH_PARENT |
+                                        GTK_DIALOG_MODAL,
+                                        GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
+                                        GTK_STOCK_OK, GTK_RESPONSE_OK,
+                                        NULL);
 
-  if (size == 0)
-  {
-    gtk_widget_destroy(GTK_WIDGET(list));
-    return TRUE;
-  }
+  gtk_window_set_skip_taskbar_hint (GTK_WINDOW (dialog), TRUE);
 
-  gtk_clist_column_titles_passive(list);
-  gtk_clist_set_sort_column(list, 0);
-  gtk_clist_sort(list);
-  gtk_clist_columns_autosize(list);
+  hbox = gtk_hbox_new (FALSE, 12);
+  vbox = gtk_vbox_new (FALSE, 12);
 
+  gtk_box_pack_start (
+    GTK_BOX (hbox),
+    gtk_image_new_from_stock (GTK_STOCK_DIALOG_INFO, GTK_ICON_SIZE_DIALOG),
+    FALSE, FALSE, 0);
+
+  /* primary label */
+  label = gtk_label_new (_("Give the children the same type?"));
+  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+  gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
   {
-    GtkWidget *dialog;
-    GtkWidget *scroll;
-    GtkWidget *label;
-    GtkWidget *frame;
-    GtkWidget *vbox;
+    gint size;
+    PangoFontDescription *font_desc;
 
-    dialog = gtk_dialog_new_with_buttons (_("Verify Changes"),
-		    			  GTK_WINDOW(aw->dialog),
-					  GTK_DIALOG_DESTROY_WITH_PARENT |
-					  GTK_DIALOG_MODAL,
-					  GTK_STOCK_OK, GTK_RESPONSE_OK,
-					  GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-					  NULL);
+    size = pango_font_description_get_size (label->style->font_desc);
+    font_desc = pango_font_description_new ();
+    pango_font_description_set_weight (font_desc, PANGO_WEIGHT_BOLD);
+    pango_font_description_set_size (font_desc, size * PANGO_SCALE_LARGE);
+    gtk_widget_modify_font (label, font_desc);
+    pango_font_description_free (font_desc);
+  }
+  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
 
-    gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
-    gtk_window_set_default_size (GTK_WINDOW (dialog), 0, 300);
+  /* secondary label */
+  str = g_strdup_printf (_("The children of the edited account have to be "
+                           "changed to type \"%s\" to make them compatible."),
+                         xaccAccountGetTypeStr (aw->type));
+  label = gtk_label_new (str);
+  g_free (str);
+  gtk_label_set_line_wrap (GTK_LABEL (label), TRUE);
+  gtk_label_set_selectable (GTK_LABEL (label), TRUE);
+  gtk_misc_set_alignment (GTK_MISC (label), 0.0, 0.0);
+  gtk_box_pack_start (GTK_BOX (vbox), label, FALSE, FALSE, 0);
 
-    vbox = GTK_DIALOG (dialog)->vbox;
+  /* children */
+  expander = gtk_expander_new_with_mnemonic (_("_Show children accounts"));
+  gtk_expander_set_spacing (GTK_EXPANDER (expander), 6);
+  g_signal_connect (G_OBJECT (expander), "notify::expanded",
+                    G_CALLBACK (add_children_to_expander), account);
+  gtk_box_pack_start (GTK_BOX (vbox), expander, TRUE, TRUE, 0);
 
-    label = gtk_label_new(_("The following changes must be made. Continue?"));
-    gtk_box_pack_start(GTK_BOX(vbox), label, FALSE, FALSE, 0);
+  gtk_box_pack_start (GTK_BOX (hbox), vbox, TRUE, TRUE, 0);
 
-    frame = gtk_frame_new(NULL);
-    gtk_box_pack_start(GTK_BOX(vbox), frame, TRUE, TRUE, 0);
+  gtk_box_pack_start (GTK_BOX (GTK_DIALOG (dialog)->vbox), hbox,
+                      TRUE, TRUE, 0);
 
-    scroll = gtk_scrolled_window_new(NULL, NULL);
-    gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll),
-                                   GTK_POLICY_NEVER, 
-                                   GTK_POLICY_AUTOMATIC);
+  /* spacings */
+  gtk_container_set_border_width (GTK_CONTAINER (dialog), 5);
+  gtk_container_set_border_width (GTK_CONTAINER (hbox), 5);
+  gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->vbox), 14);
+  gtk_container_set_border_width (
+    GTK_CONTAINER (GTK_DIALOG (dialog)->action_area), 5);
+  gtk_box_set_spacing (GTK_BOX (GTK_DIALOG (dialog)->action_area), 6);
 
-    gtk_container_add(GTK_CONTAINER(frame), scroll);
-    gtk_container_set_border_width(GTK_CONTAINER(scroll), 5);
-    gtk_container_add(GTK_CONTAINER(scroll), GTK_WIDGET(list));
+  gtk_widget_show_all (hbox);
 
-    gtk_widget_show_all(vbox);
+  gtk_dialog_set_default_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
 
-    result = (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK);
+  result = (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_OK);
 
-    gtk_widget_destroy(dialog);
-  }
+  gtk_widget_destroy(dialog);
 
   return result;
 }
@@ -794,13 +753,23 @@
   }
 
   /* check for valid type */
-  if (aw->type == BAD_TYPE) {
+  if (aw->type == ACCT_TYPE_INVALID) {
     const char *message = _("You must select an account type.");
     gnc_error_dialog(aw->dialog, message);
     LEAVE("invalid type");
     return FALSE;
   }
 
+  /* check whether the types of child and parent are compatible */
+  if (parent != aw->top_level_account &&
+      !xaccAccountTypesCompatible (aw->type, xaccAccountGetType (parent))) {
+    const char *message = _("The selected account type is incompatible with "
+                            "the one of the selected parent.");
+    gnc_error_dialog(aw->dialog, message);
+    LEAVE("incompatible types");
+    return FALSE;
+  }
+
   /* check for commodity */
   commodity = (gnc_commodity *)
     gnc_general_select_get_selected (GNC_GENERAL_SELECT (aw->commodity_edit));
@@ -818,18 +787,8 @@
 static void
 gnc_edit_account_ok(AccountWindow *aw)
 {
-  GHashTable *change_type;
-
-  gboolean change_children;
-  gboolean has_children;
-  gboolean change_all;
-
-  Account *new_parent;
   Account *account;
-  AccountGroup *children;
 
-  GNCAccountType current_type;
-
   ENTER("aw %p", aw);
 
   account = aw_get_account (aw);
@@ -843,75 +802,13 @@
     return;
   }
 
-  change_type = g_hash_table_new (NULL, NULL);
-
-  children = xaccAccountGetChildren(account);
-  if (children == NULL)
-    has_children = FALSE;
-  else if (xaccGroupGetNumAccounts(children) == 0)
-    has_children = FALSE;
-  else
-    has_children = TRUE;
-
-  current_type = xaccAccountGetType(account);
-
-  /* If the account has children and the new type isn't compatible
-   * with the old type, the children's types must be changed. */
-  change_children = (has_children &&
-                     !xaccAccountTypesCompatible(current_type, aw->type));
-
-  /* If the new parent's type is not compatible with the new type,
-   * the whole sub-tree containing the account must be re-typed. */
-  new_parent = gnc_tree_view_account_get_selected_account (
-      GNC_TREE_VIEW_ACCOUNT (aw->parent_tree));
-  if (new_parent != aw->top_level_account)
-  {
-    int parent_type;
-
-    parent_type = xaccAccountGetType(new_parent);
-
-    if (!xaccAccountTypesCompatible(parent_type, aw->type))
-      change_all = TRUE;
-    else
-      change_all = FALSE;
-  }
-  else
-    change_all = FALSE;
-
-  if (change_children)
-    gnc_edit_change_account_types(change_type, account, NULL, aw->type);
-
-  if (change_all)
-  {
-    Account *ancestor;
-    Account *temp;
-
-    temp = new_parent;
-
-    do
-    {
-      ancestor = temp;
-      temp = xaccAccountGetParentAccount(ancestor);
-    } while (temp != NULL);
-
-    gnc_edit_change_account_types(change_type, ancestor, account, aw->type);
-  }
-
-  if (!extra_change_verify(aw, change_type))
-  {
-    g_hash_table_destroy(change_type);
+  if (!verify_children_compatible (aw)) {
     LEAVE(" ");
     return;
   }
 
-  if (current_type != aw->type)
-    /* Just refreshing won't work. */
-    aw_call_destroy_callbacks (account);
-
-  gnc_finish_ok (aw, change_type);
-
-  g_hash_table_destroy (change_type);
-    LEAVE(" ");
+  gnc_finish_ok (aw);
+  LEAVE(" ");
 }
 
 
@@ -963,7 +860,7 @@
     }
   }
 
-  gnc_finish_ok (aw, NULL);
+  gnc_finish_ok (aw);
   LEAVE(" ");
 }
 
@@ -1061,12 +958,64 @@
     aw->next_name = NULL;
   }
 
-  g_list_free (aw->valid_types);
   g_free (aw);
   LEAVE(" ");
 }
 
 static void
+gnc_account_parent_changed_cb (GtkTreeSelection *selection, gpointer data)
+{
+  AccountWindow *aw = data;
+  Account *parent_account;
+  guint32 types, old_types;
+  GtkTreeModel *type_model;
+  GtkTreeSelection *type_selection;
+  gboolean scroll_to = FALSE;
+
+  g_return_if_fail (aw);
+
+  parent_account = gnc_tree_view_account_get_selected_account (
+    GNC_TREE_VIEW_ACCOUNT (aw->parent_tree));
+  if (!parent_account)
+    return;
+
+  if (parent_account == aw->top_level_account) {
+    types = aw->valid_types;
+  } else {
+    types = aw->valid_types &
+      xaccAccountTypesCompatibleWith (xaccAccountGetType (parent_account));
+  }
+
+  type_model = gtk_tree_view_get_model (GTK_TREE_VIEW (aw->type_view));
+  if (!type_model)
+    return;
+
+  if (aw->type != aw->preferred_account_type &&
+      (types & (1 << aw->preferred_account_type)) != 0) {
+    /* we can change back to the preferred account type */
+    aw->type = aw->preferred_account_type;
+    scroll_to = TRUE;
+  }
+  else if ((types & (1 << aw->type)) == 0) {
+    /* our type is invalid now */
+    aw->type = ACCT_TYPE_INVALID;
+  }
+  else {
+    /* no type change, but maybe list of valid types changed */
+    old_types = gnc_tree_model_account_types_get_mask (type_model);
+    if (old_types != types)
+      scroll_to = TRUE;
+  }
+
+  gnc_tree_model_account_types_set_mask (type_model, types);
+
+  if (scroll_to) {
+    type_selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (aw->type_view));
+    gnc_tree_model_account_types_set_selection(type_selection, 1 << aw->type);
+  }
+}
+
+static void
 gnc_account_type_changed_cb (GtkTreeSelection *selection, gpointer data)
 {
   AccountWindow *aw = data;
@@ -1078,18 +1027,18 @@
   sensitive = FALSE;
 
   type_id = gnc_tree_model_account_types_get_selection_single(selection);
-  if (type_id == NO_TYPE) {
-    aw->type = BAD_TYPE;
+  if (type_id == ACCT_TYPE_NONE) {
+    aw->type = ACCT_TYPE_INVALID;
   } else {
     aw->type = type_id;
-    last_used_account_type = type_id;
+    aw->preferred_account_type = type_id;
 
     gnc_account_commodity_from_type (aw, TRUE);
 
-    sensitive = (aw->type != EQUITY &&
-		 aw->type != CURRENCY &&
-		 aw->type != STOCK &&
-		 aw->type != MUTUAL);
+    sensitive = (aw->type != ACCT_TYPE_EQUITY &&
+		 aw->type != ACCT_TYPE_CURRENCY &&
+		 aw->type != ACCT_TYPE_STOCK &&
+		 aw->type != ACCT_TYPE_MUTUAL);
   }
 
   gtk_widget_set_sensitive (aw->opening_balance_page, sensitive);
@@ -1100,18 +1049,6 @@
   }
 }
 
-static GNCAccountType
-gnc_account_choose_new_acct_type (AccountWindow *aw)
-{
-  if (g_list_index (aw->valid_types, GINT_TO_POINTER(aw->type)) != -1)
-    return aw->type;
-
-  if (g_list_index (aw->valid_types, GINT_TO_POINTER(last_used_account_type)) != -1)
-    return last_used_account_type;
-
-  return ((GNCAccountType)(aw->valid_types->data));
-}
-
 static void
 gnc_account_type_view_create (AccountWindow *aw)
 {
@@ -1119,20 +1056,35 @@
   GtkTreeSelection *selection;
   GtkCellRenderer *renderer;
   GtkTreeView *view;
-  GList *list;
-  guint32 types = 0;
 
-  if ((aw->dialog_type == NEW_ACCOUNT) && aw->valid_types)
-    aw->type = gnc_account_choose_new_acct_type (aw);
+  if (aw->valid_types == 0) {
+    /* no type restrictions, choose aw->type */
+    aw->valid_types = xaccAccountTypesValid () | (1 << aw->type);
+    aw->preferred_account_type = aw->type;
+  }
+  else if ((aw->valid_types & (1 << aw->type)) != 0) {
+    /* aw->type is valid */
+    aw->preferred_account_type = aw->type;
+  }
+  else if ((aw->valid_types & (1 << last_used_account_type)) != 0) {
+    /* last used account type is valid */
+    aw->type = last_used_account_type;
+    aw->preferred_account_type = last_used_account_type;
+  }
+  else {
+    /* choose first valid account type */
+    int i;
+    aw->preferred_account_type = aw->type;
+    aw->type = ACCT_TYPE_INVALID;
+    for (i=0; i<32; i++)
+      if ((aw->valid_types & (1 << i)) != 0) {
+        aw->type = i;
+        break;
+      }
+  }
 
-  if (aw->valid_types == NULL)
-      types = xaccAccountTypesValid () | (1 << aw->type);
-  else
-      for (list = aw->valid_types; list; list = list->next)
-          types |= (1 << GPOINTER_TO_INT(list->data));
+  model = gnc_tree_model_account_types_filter_using_mask (aw->valid_types);
 
-  model = gnc_tree_model_account_types_filter_using_mask (types);
-
   view = GTK_TREE_VIEW (aw->type_view);
   gtk_tree_view_set_model (view, model);
   g_object_unref (G_OBJECT (model));
@@ -1147,7 +1099,7 @@
   selection = gtk_tree_view_get_selection (view);
   g_signal_connect (G_OBJECT (selection), "changed",
 		    G_CALLBACK (gnc_account_type_changed_cb), aw);
-  
+
   gnc_tree_model_account_types_set_selection(selection, 1 << aw->type);
 }
 
@@ -1232,7 +1184,6 @@
 static void
 gnc_account_window_create(AccountWindow *aw)
 {
-  GtkDialog *awd;
   GtkWidget *amount;
   GObject *awo;
   GtkWidget *box;
@@ -1245,7 +1196,6 @@
 
   aw->dialog = glade_xml_get_widget (xml, "Account Dialog");
   awo = G_OBJECT (aw->dialog);
-  awd = GTK_DIALOG (awo);
 
   g_object_set_data (awo, "dialog_info", aw);
 
@@ -1284,7 +1234,6 @@
                     G_CALLBACK (commodity_changed_cb), aw);
 
   aw->account_scu = glade_xml_get_widget (xml, "account_scu");
-  gnc_option_menu_init(aw->account_scu);
 
   box = glade_xml_get_widget (xml, "parent_scroll");
 
@@ -1292,6 +1241,9 @@
   aw->parent_tree = gnc_tree_view_account_new(TRUE);
   gtk_container_add(GTK_CONTAINER(box), GTK_WIDGET(aw->parent_tree));
   gtk_widget_show(GTK_WIDGET(aw->parent_tree));
+  selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (aw->parent_tree));
+  g_signal_connect (G_OBJECT (selection), "changed",
+                    G_CALLBACK (gnc_account_parent_changed_cb), aw);
   aw->top_level_account =
     gnc_tree_view_account_get_top_level (GNC_TREE_VIEW_ACCOUNT(aw->parent_tree));
 
@@ -1484,13 +1436,17 @@
   gnc_commodity *commodity, *parent_commodity;
   AccountWindow *aw;
   Account *account;
+  GList *list;
 
   aw = g_new0 (AccountWindow, 1);
 
   aw->modal = modal;
   aw->dialog_type = NEW_ACCOUNT;
-  aw->valid_types = g_list_copy (valid_types);
 
+  aw->valid_types = 0;
+  for (list = valid_types; list; list = list->next)
+    aw->valid_types |= (1 << GPOINTER_TO_INT (list->data));
+
   account = xaccMallocAccount (gnc_get_current_book ());
   aw->account = *xaccAccountGetGUID (account);
 
@@ -1518,7 +1474,7 @@
 
   if (default_commodity != NULL) {
     commodity = default_commodity;
-  } else if ((aw->type != STOCK) && (aw->type != MUTUAL)) {
+  } else if ((aw->type != ACCT_TYPE_STOCK) && (aw->type != ACCT_TYPE_MUTUAL)) {
     commodity = parent_commodity;
   } else {
     commodity = NULL;
@@ -1527,16 +1483,15 @@
                                     commodity);
   gnc_account_commodity_from_type (aw, FALSE);
 
-  gtk_widget_show (aw->dialog);
+  if (base_account == NULL)
+    base_account = aw->top_level_account;
 
-  if (base_account == NULL) {
-	  base_account = aw->top_level_account;
-  }
-
   gtk_tree_view_collapse_all (aw->parent_tree);
   gnc_tree_view_account_set_selected_account (
-      GNC_TREE_VIEW_ACCOUNT (aw->parent_tree), base_account);
+    GNC_TREE_VIEW_ACCOUNT (aw->parent_tree), base_account);
 
+  gtk_widget_show (aw->dialog);
+
   gnc_window_adjust_for_screen (GTK_WINDOW(aw->dialog));
 
   gnc_account_window_set_name (aw);
@@ -1544,7 +1499,7 @@
   aw->component_id = gnc_register_gui_component (DIALOG_NEW_ACCOUNT_CM_CLASS,
                                                  refresh_handler,
                                                  modal ? NULL : close_handler,
-						 aw);
+                                                 aw);
 
   gnc_gui_component_set_session (aw->component_id, gnc_get_current_session());
   gnc_gui_component_watch_entity_type (aw->component_id,
@@ -1612,10 +1567,11 @@
   return gnc_ui_new_accounts_from_name_with_defaults(name, valid_types, NULL, NULL);
 }
 
-Account * gnc_ui_new_accounts_from_name_with_defaults (const char *name,
-						       GList *valid_types,
-						       gnc_commodity * default_commodity,
-						       Account * parent)
+Account *
+gnc_ui_new_accounts_from_name_with_defaults (const char *name,
+                                             GList *valid_types,
+                                             gnc_commodity * default_commodity,
+                                             Account * parent)
 {
   AccountWindow *aw;
   Account *base_account = NULL;
@@ -1729,8 +1685,9 @@
   if (parent == NULL)
     parent = aw->top_level_account;
 
+  gtk_tree_view_collapse_all (aw->parent_tree);
   gnc_tree_view_account_set_selected_account (
-      GNC_TREE_VIEW_ACCOUNT(aw->parent_tree), parent);
+    GNC_TREE_VIEW_ACCOUNT(aw->parent_tree), parent);
 
   gnc_account_window_set_name (aw);
 
@@ -1778,16 +1735,7 @@
 gnc_ui_new_account_with_types( AccountGroup *unused,
                                GList *valid_types )
 {
-  GList *validTypesCopy = g_list_copy( valid_types );
-  AccountWindow *aw;
-
-  aw = gnc_ui_new_account_window_internal( NULL, NULL, validTypesCopy, NULL, FALSE );
-  if ( validTypesCopy != NULL ) {
-    /* Attach it with "[...]_full" so we can set the appropriate
-     * GtkDestroyNotify func. */
-    g_object_set_data_full( G_OBJECT(aw->dialog), "validTypesListCopy",
-			    validTypesCopy, (GDestroyNotify)g_list_free );
-  }
+  gnc_ui_new_account_window_internal( NULL, NULL, valid_types, NULL, FALSE );
 }
 
 /************************************************************

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -42,18 +42,23 @@
 #include "dialog-commodity.h"
 #include "dialog-utils.h"
 #include "gnc-engine.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-gui-query.h"
 #include "gnc-ui-util.h"
 #include "gnc-ui.h"
 
 static QofLogModule log_module = GNC_MOD_GUI;
 
+enum {
+  SOURCE_COL_NAME = 0,
+  SOURCE_COL_FQ_SUPPORTED,
+  NUM_SOURCE_COLS
+};
+
 struct select_commodity_window {
   GtkWidget * dialog;
   GtkWidget * namespace_combo;
-  GtkWidget * namespace_entry;
   GtkWidget * commodity_combo;
-  GtkWidget * commodity_entry;
   GtkWidget * select_user_prompt;
   GtkWidget * ok_button;
 
@@ -102,9 +107,9 @@
 			       dialog_commodity_mode mode);
 void gnc_ui_select_commodity_new_cb(GtkButton * button,
 				    gpointer user_data);
-void gnc_ui_select_commodity_changed_cb(GtkEditable * entry,
+void gnc_ui_select_commodity_changed_cb(GtkComboBoxEntry *cbe,
 					gpointer user_data);
-void gnc_ui_select_commodity_namespace_changed_cb(GtkEditable * entry,
+void gnc_ui_select_commodity_namespace_changed_cb(GtkComboBoxEntry *cbe,
 						  gpointer user_data);
 
 /* The commodity creation window */
@@ -229,7 +234,8 @@
 {
   SelectCommodityWindow * retval = g_new0(SelectCommodityWindow, 1);
   GladeXML *xml;
-  const char * namespace, *title, *text;
+  const char *title, *text;
+  gchar *namespace;
   GtkWidget *button, *label;
 
   xml = gnc_glade_xml_new ("commodity.glade", "Security Selector Dialog");
@@ -238,13 +244,17 @@
                                      retval );
 
   retval->dialog = glade_xml_get_widget (xml, "Security Selector Dialog");
-  retval->namespace_combo = glade_xml_get_widget (xml, "namespace_combo");
-  retval->commodity_combo = glade_xml_get_widget (xml, "commodity_combo");
-  retval->commodity_entry = glade_xml_get_widget (xml, "commodity_entry");
+  retval->namespace_combo = glade_xml_get_widget (xml, "namespace_cbe");
+  retval->commodity_combo = glade_xml_get_widget (xml, "commodity_cbe");
   retval->select_user_prompt = glade_xml_get_widget (xml, "select_user_prompt");
   retval->ok_button = glade_xml_get_widget (xml, "ok_button");
   label = glade_xml_get_widget (xml, "item_label");
 
+  gtk_combo_box_remove_text(GTK_COMBO_BOX(retval->namespace_combo), 0);
+  gtk_combo_box_remove_text(GTK_COMBO_BOX(retval->commodity_combo), 0);
+  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(retval->namespace_combo));
+  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(retval->commodity_combo));
+
   gtk_label_set_text (GTK_LABEL (retval->select_user_prompt), "");
 
 #ifdef DRH
@@ -275,12 +285,13 @@
   gtk_label_set_text_with_mnemonic (GTK_LABEL(label), text);
 
   /* build the menus of namespaces and commodities */
-  gnc_ui_update_namespace_picker(retval->namespace_combo, 
+  gnc_ui_update_namespace_picker(retval->namespace_combo,
 				 gnc_commodity_get_namespace(orig_sel),
 				 mode);
   namespace = gnc_ui_namespace_picker_ns(retval->namespace_combo);
   gnc_ui_update_commodity_picker(retval->commodity_combo, namespace,
                                  gnc_commodity_get_printname(orig_sel));
+  g_free(namespace);
   return retval;
 }
 
@@ -305,7 +316,7 @@
 {
   SelectCommodityWindow * w = user_data;
 
-  const char * namespace = gnc_ui_namespace_picker_ns (w->namespace_combo);
+  gchar * namespace = gnc_ui_namespace_picker_ns (w->namespace_combo);
 
   const gnc_commodity * new_commodity = 
     gnc_ui_new_commodity_modal_full(namespace,
@@ -322,6 +333,7 @@
                                    gnc_commodity_get_namespace(new_commodity),
                                    gnc_commodity_get_printname(new_commodity));
   }
+  g_free(namespace);
 }
 
 
@@ -334,27 +346,28 @@
  *  Commodity Selection dialog.  It should not be used outside of the
  *  dialog-commodity.c file.
  *
- *  @param entry A pointer to the commodity name entry widget in the
+ *  @param cbe A pointer to the commodity name entry widget in the
  *  dialog.
  *
  *  @param user_data A pointer to the data structure describing the
  *  current state of the commodity picker.
  */
 void
-gnc_ui_select_commodity_changed_cb(GtkEditable * entry,
-				   gpointer user_data)
+gnc_ui_select_commodity_changed_cb (GtkComboBoxEntry *cbe,
+				    gpointer user_data)
 {
   SelectCommodityWindow * w = user_data;
-  const char * namespace;
-  const char * fullname;
+  gchar *namespace, *fullname;
   gboolean ok;
 
-  ENTER("entry=%p, user_data=%p", entry, user_data);
+  ENTER("cbe=%p, user_data=%p", cbe, user_data);
   namespace = gnc_ui_namespace_picker_ns (w->namespace_combo);
-  fullname = gtk_entry_get_text(GTK_ENTRY(w->commodity_entry));
+  fullname = gtk_combo_box_get_active_text(GTK_COMBO_BOX(w->commodity_combo));
   DEBUG("namespace=%s, name=%s", namespace, fullname);
   w->selection = gnc_commodity_table_find_full(gnc_get_current_commodities(), 
 					       namespace, fullname);
+  g_free(fullname);
+  g_free(namespace);
 
   ok = (w->selection != NULL);
   gtk_widget_set_sensitive(w->ok_button, ok);
@@ -373,23 +386,24 @@
  *  Commodity Selection dialog.  It should not be used outside of the
  *  dialog-commodity.c file.
  *
- *  @param entry A pointer to the commodity namespace entry widget in
+ *  @param cbe A pointer to the commodity namespace entry widget in
  *  the dialog.
  *
  *  @param user_data A pointer to the data structure describing the
  *  current state of the commodity picker.
  */
 void
-gnc_ui_select_commodity_namespace_changed_cb(GtkEditable * entry,
-                                             gpointer user_data)
+gnc_ui_select_commodity_namespace_changed_cb (GtkComboBoxEntry *cbe,
+                                              gpointer user_data)
 {
   SelectCommodityWindow * w = user_data;
-  const char * namespace;
+  gchar *namespace;
 
-  ENTER("entry=%p, user_data=%p", entry, user_data);
+  ENTER("cbe=%p, user_data=%p", cbe, user_data);
   namespace = gnc_ui_namespace_picker_ns (w->namespace_combo);
   DEBUG("namespace=%s", namespace);
   gnc_ui_update_commodity_picker(w->commodity_combo, namespace, NULL);
+  g_free(namespace);
   LEAVE(" ");
 }
 
@@ -398,50 +412,58 @@
  * gnc_ui_update_commodity_picker
  ********************************************************************/
 static int 
-g_strcmp(gconstpointer a, gconstpointer b)
+collate(gconstpointer a, gconstpointer b)
 {
-  return strcmp(a, b);
+  if (!a)
+    return -1;
+  if (!b)
+    return 1;
+  return g_utf8_collate(a, b);
 }
 
 
 void
-gnc_ui_update_commodity_picker(GtkWidget * combobox, 
-                               const char * namespace,
-                               const char * init_string)
+gnc_ui_update_commodity_picker (GtkWidget *cbe,
+                                const gchar * namespace,
+				const gchar * init_string)
 {
   GList      * commodities; 
   GList      * iterator = NULL;
   GList      * commodity_items = NULL;
+  GtkComboBox *combo_box;
+  GtkTreeModel *model;
   gnc_commodity_table *table;
-  const char * current;
+  gint current = 0, match = 0;
+  gchar *name;
 
+  g_return_if_fail(GTK_IS_COMBO_BOX_ENTRY(cbe));
+  g_return_if_fail(namespace);
+
+  /* Erase the old entries */
+  combo_box = GTK_COMBO_BOX(cbe);
+  model = gtk_combo_box_get_model(combo_box);
+  gtk_list_store_clear(GTK_LIST_STORE(model));
+  gtk_combo_box_set_active(combo_box, -1);
+
   table = gnc_book_get_commodity_table (gnc_get_current_book ());
   commodities = gnc_commodity_table_get_commodities(table, namespace);
-
   for(iterator = commodities; iterator; iterator = iterator->next) {
     commodity_items = 
       g_list_append(commodity_items, 
                     (gpointer) gnc_commodity_get_printname(iterator->data));
   }
-  commodity_items = g_list_sort(commodity_items, g_strcmp);
+  g_list_free(commodities);
 
-  if(!commodity_items) {
-    commodity_items = g_list_append(commodity_items, "");
+  commodity_items = g_list_sort(commodity_items, collate);
+  for (iterator = commodity_items; iterator; iterator = iterator->next) {
+    name = (char *)iterator->data;
+    gtk_combo_box_append_text(combo_box, name);
+    if (init_string && g_utf8_collate(name, init_string) == 0)
+       match = current;
+     current++;
   }
-  gtk_combo_set_popdown_strings(GTK_COMBO(combobox), 
-                                commodity_items);
 
-  if(init_string) {
-    current = init_string;
-  }
-  else {
-    current = commodity_items->data;
-  }
-
-  gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combobox)->entry), current);
-
-  /* free the lists */
-  g_list_free(commodities);
+  gtk_combo_box_set_active(combo_box, match);
   g_list_free(commodity_items);
 }
 
@@ -466,7 +488,7 @@
 gnc_ui_select_commodity_response_cb (GtkDialog * dialog, gint response, gpointer data)
 {
   SelectCommodityWindow * w = data;
-  const gchar *namespace;
+  gchar *namespace;
   const gchar *fullname;
   gnc_commodity *commodity = NULL;
 
@@ -477,6 +499,7 @@
 
     commodity = gnc_commodity_table_find_full (gnc_get_current_commodities (),
 					       namespace, fullname);
+    g_free(namespace);
 
     if (commodity != NULL) {
       if (w->callback != NULL)
@@ -506,6 +529,7 @@
 				      gnc_commodity_get_namespace (commodity),
 				      gnc_commodity_get_printname (commodity));
     }
+    g_free(namespace);
     break;
    default:
     if (w->callback != NULL)
@@ -574,13 +598,23 @@
  ********************************************************************/
 
 void
-gnc_ui_update_namespace_picker(GtkWidget * combobox, 
-                               const char * init_string,
-                               dialog_commodity_mode mode)
+gnc_ui_update_namespace_picker (GtkWidget *cbe,
+				const char * init_string,
+				dialog_commodity_mode mode)
 {
-  GList * namespaces, *node;
-  const char * active;
+  GtkComboBox *combo_box;
+  GtkTreeModel *model;
+  GList *namespaces, *node;
+  gint current = 0, match = 0;
 
+  g_return_if_fail(GTK_IS_COMBO_BOX_ENTRY(cbe));
+
+  /* Erase the old entries */
+  combo_box = GTK_COMBO_BOX(cbe);
+  model = gtk_combo_box_get_model(combo_box);
+  gtk_list_store_clear(GTK_LIST_STORE(model));
+  gtk_combo_box_set_active(combo_box, -1);
+
   /* fetch a list of the namespaces */
   switch (mode) {
     case DIAG_COMM_ALL:
@@ -591,7 +625,7 @@
    case DIAG_COMM_NON_CURRENCY:
      namespaces =
        gnc_commodity_table_get_namespaces (gnc_get_current_commodities());
-     node = g_list_find_custom (namespaces, GNC_COMMODITY_NS_CURRENCY, g_strcmp);
+     node = g_list_find_custom (namespaces, GNC_COMMODITY_NS_CURRENCY, collate);
      if (node) {
        namespaces = g_list_remove_link (namespaces, node);
        g_list_free_1 (node);
@@ -607,48 +641,34 @@
     break;     
   }
 
-  /* Legacy namespace should never be seen */
-  node = g_list_find_custom (namespaces, GNC_COMMODITY_NS_LEGACY, g_strcmp);
-  if (node) {
-    namespaces = g_list_remove_link (namespaces, node);
-    g_list_free_1 (node);
-  }
-
   /* stick them in the combobox */
-  namespaces = g_list_sort(namespaces, g_strcmp);
-  gtk_combo_set_popdown_strings (GTK_COMBO (combobox), namespaces);
-
-  /* set the entry text */
-  if (init_string)
-    active = init_string;
-  else if (namespaces)
-    active = namespaces->data;
-  else
-    active = "";
-
-  if (safe_strcmp (active, "CURRENCY") == 0 ||
-      safe_strcmp (init_string, "CURRENCY") == 0)
-  {
-    active = "CURRENCY";
+  namespaces = g_list_sort(namespaces, collate);
+  for (node = namespaces; node; node = node->next) {
+    if (g_utf8_collate(node->data, GNC_COMMODITY_NS_LEGACY) == 0)
+      continue;
+     gtk_combo_box_append_text(combo_box, node->data);
+     if (init_string && (g_utf8_collate(node->data, init_string) == 0))
+       match = current;
+     current++;
   }
 
-  gtk_entry_set_text(GTK_ENTRY(GTK_COMBO(combobox)->entry), active);
+  gtk_combo_box_set_active(combo_box, match);
   g_list_free(namespaces);
 }
 
-const char *
-gnc_ui_namespace_picker_ns (GtkWidget *combobox)
+gchar *
+gnc_ui_namespace_picker_ns (GtkWidget *cbe)
 {
-  const char *namespace;
+  char *namespace;
 
-  g_return_val_if_fail (combobox != NULL, NULL);
-  g_return_val_if_fail (GTK_IS_COMBO (combobox), NULL);
+  g_return_val_if_fail(GTK_IS_COMBO_BOX_ENTRY (cbe), NULL);
 
-  namespace = gtk_entry_get_text (GTK_ENTRY(GTK_COMBO (combobox)->entry));
+  namespace = gtk_combo_box_get_active_text(GTK_COMBO_BOX(cbe));
 
   if (safe_strcmp (namespace, GNC_COMMODITY_NS_ISO) == 0) {
     /* In case the user types in ISO4217, map it to CURRENCY. */
-    return GNC_COMMODITY_NS_CURRENCY;
+    g_free(namespace);
+    return strdup(GNC_COMMODITY_NS_CURRENCY);
   } else
     return namespace;
 }
@@ -660,14 +680,15 @@
 {
   CommodityWindow *cw = data;
   gboolean get_quote, allow_src, active;
-  const char *text;
+  gchar *text;
   gint i;
 
   ENTER(" ");
   get_quote = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (w));
 
-  text = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(cw->namespace_combo)->entry));
+  text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(cw->namespace_combo));
   allow_src = !gnc_commodity_namespace_is_iso(text);
+  g_free(text);
   gtk_widget_set_sensitive(cw->source_label, get_quote && allow_src);
 
   for (i = SOURCE_SINGLE; i < SOURCE_MAX; i++) {
@@ -687,7 +708,7 @@
 gnc_ui_commodity_changed_cb(GtkWidget * dummy, gpointer user_data)
 {
   CommodityWindow * w = user_data;
-  const char * namespace;
+  gchar *namespace;
   const char * fullname;
   const char * mnemonic;
   gboolean ok;
@@ -700,6 +721,7 @@
     DEBUG("namespace=%s, name=%s, mnemonic=%s", namespace, fullname, mnemonic);
     ok = (fullname    && namespace    && mnemonic &&
 	  fullname[0] && namespace[0] && mnemonic[0]);
+    g_free(namespace);
   } else {
     ok = TRUE;
   }
@@ -719,37 +741,48 @@
 gnc_ui_source_menu_create(QuoteSourceType type)
 {
   gint i, max;
-  GtkMenu   *menu;
-  GtkWidget *item;
-  GtkWidget *omenu;
+  const gchar *name;
+  gboolean supported;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkWidget *combo;
+  GtkCellRenderer *renderer;
   gnc_quote_source *source;
 
-  menu = GTK_MENU(gtk_menu_new());
-  gtk_widget_show(GTK_WIDGET(menu));
-
+  store = gtk_list_store_new(NUM_SOURCE_COLS, G_TYPE_STRING, G_TYPE_BOOLEAN);
   if (type == SOURCE_CURRENCY) {
-    item = gtk_menu_item_new_with_label(_("Currency"));
-    gtk_widget_show(item);
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter, 
+		       SOURCE_COL_NAME, _("Currency"),
+		       SOURCE_COL_FQ_SUPPORTED, TRUE,
+		       -1);
   } else {
     max = gnc_quote_source_num_entries(type);
     for (i = 0; i < max; i++) {
 	source = gnc_quote_source_lookup_by_ti(type, i);
 	if (source == NULL)
 	  break;
-	item = gtk_menu_item_new_with_label(gnc_quote_source_get_user_name(source));
-	gtk_widget_set_sensitive(item, gnc_quote_source_get_supported(source));
-	gtk_widget_show(item);
-	gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+	name = gnc_quote_source_get_user_name(source);
+	supported = gnc_quote_source_get_supported(source);
+	gtk_list_store_append(store, &iter);
+	gtk_list_store_set(store, &iter,
+			   SOURCE_COL_NAME, name,
+			   SOURCE_COL_FQ_SUPPORTED, supported,
+			   -1);
       }
   }
 
-  omenu = gtk_option_menu_new();
-  gtk_widget_show(omenu);
-  gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), GTK_WIDGET(menu));
-  gnc_option_menu_init(omenu);
-
-  return omenu;
+  combo = gtk_combo_box_new_with_model(GTK_TREE_MODEL(store));
+  g_object_unref(store);
+  renderer = gtk_cell_renderer_text_new();
+  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, TRUE);
+  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo), renderer,
+				"text", SOURCE_COL_NAME);
+  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo), renderer,
+				"sensitive", SOURCE_COL_FQ_SUPPORTED);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(combo), 0);
+  gtk_widget_show(combo);
+  return combo;
 }
 
 /********************************************************************\
@@ -795,9 +828,7 @@
 static GtkWidget *
 gnc_ui_quote_tz_menu_create(void)
 {
-  GtkMenu   *menu;
-  GtkWidget *item;
-  GtkWidget *omenu;
+  GtkWidget  *combo;
   gchar     **itemstr;
 
   /* add items here as needed, but bear in mind that right now these
@@ -806,25 +837,14 @@
      order to be portable to non GNU OSes, we may have to support
      whatever we add here manually on those systems. */
 
-  menu = GTK_MENU(gtk_menu_new());
-  gtk_widget_show(GTK_WIDGET(menu));
-
-  item = gtk_menu_item_new_with_label(_("Use local time"));
-  gtk_widget_show(item);
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
- 
+  combo = gtk_combo_box_new_text();
+  gtk_combo_box_append_text(GTK_COMBO_BOX(combo), _("Use local time"));
   for(itemstr = &known_timezones[0]; *itemstr; itemstr++) {
-    item = gtk_menu_item_new_with_label(*itemstr);
-    gtk_widget_show(item);
-    gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
+    gtk_combo_box_append_text(GTK_COMBO_BOX(combo), *itemstr);
   }
 
-  omenu = gtk_option_menu_new();
-  gtk_widget_show(omenu);
-  gtk_option_menu_set_menu(GTK_OPTION_MENU(omenu), GTK_WIDGET(menu));
-  gnc_option_menu_init(omenu);
-
-  return omenu;
+  gtk_widget_show(combo);
+  return combo;
 }
 
 /** Build the new/edit commodity dialog box
@@ -876,7 +896,7 @@
   /* Get widget pointers */
   retval->fullname_entry = glade_xml_get_widget (xml, "fullname_entry");
   retval->mnemonic_entry = glade_xml_get_widget (xml, "mnemonic_entry");
-  retval->namespace_combo = glade_xml_get_widget (xml, "namespace_combo");
+  retval->namespace_combo = glade_xml_get_widget (xml, "namespace_cbe");
   retval->code_entry = glade_xml_get_widget (xml, "code_entry");
   retval->fraction_spinbutton = glade_xml_get_widget (xml,
                                                       "fraction_spinbutton");
@@ -966,6 +986,8 @@
   
   gtk_entry_set_text (GTK_ENTRY (retval->fullname_entry), fullname ? fullname : "");
   gtk_entry_set_text (GTK_ENTRY (retval->mnemonic_entry), mnemonic ? mnemonic : "");
+  gnc_cbe_add_completion(GTK_COMBO_BOX_ENTRY(retval->namespace_combo));
+  gtk_combo_box_remove_text(GTK_COMBO_BOX(retval->namespace_combo), 0);
   gnc_ui_update_namespace_picker(retval->namespace_combo,
 				 selected_namespace,
 				 include_iso ? DIAG_COMM_ALL : DIAG_COMM_NON_CURRENCY);
@@ -1001,18 +1023,18 @@
   if (!gnc_commodity_is_iso(commodity)) {
     type = gnc_quote_source_get_type(source);
     gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(win->source_button[type]), TRUE);
-    gtk_option_menu_set_history (GTK_OPTION_MENU (win->source_menu[type]),
-				 gnc_quote_source_get_index(source));
+    gtk_combo_box_set_active(GTK_COMBO_BOX(win->source_menu[type]),
+			     gnc_quote_source_get_index(source));
   }
 
   if (quote_tz) {
     pos = gnc_find_timezone_menu_position(quote_tz);
-    if(pos == 0) {
-      PWARN("Unknown price quote timezone (%s), resetting to default.",
-	    quote_tz ? quote_tz : "(null)");
-    }
+//    if(pos == 0) {
+//      PWARN("Unknown price quote timezone (%s), resetting to default.",
+//	    quote_tz ? quote_tz : "(null)");
+//    }
   }
-  gtk_option_menu_set_history (GTK_OPTION_MENU (win->quote_tz_menu), pos);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(win->quote_tz_menu), pos);
   LEAVE(" ");
 }
 
@@ -1156,7 +1178,7 @@
   gnc_quote_source *source;
   QuoteSourceType type;
   const char * fullname  = gtk_entry_get_text(GTK_ENTRY(w->fullname_entry));
-  const char * namespace = gnc_ui_namespace_picker_ns (w->namespace_combo);
+  gchar *namespace = gnc_ui_namespace_picker_ns (w->namespace_combo);
   const char * mnemonic  = gtk_entry_get_text(GTK_ENTRY(w->mnemonic_entry));
   const char * code      = gtk_entry_get_text(GTK_ENTRY(w->code_entry));
   QofBook * book = gnc_get_current_book ();
@@ -1174,7 +1196,7 @@
       gnc_commodity_begin_edit(c);
       gnc_commodity_set_quote_flag (c, gtk_toggle_button_get_active
 				    (GTK_TOGGLE_BUTTON (w->get_quote_check)));
-      selection = gnc_option_menu_get_active (w->quote_tz_menu);
+      selection = gtk_combo_box_get_active(GTK_COMBO_BOX(w->quote_tz_menu));
       string = gnc_timezone_menu_position_to_string(selection);
       gnc_commodity_set_quote_tz(c, string);
       gnc_commodity_commit_edit(c);
@@ -1194,6 +1216,7 @@
     if ((!w->edit_commodity && c) ||
         (w->edit_commodity && c && (c != w->edit_commodity))) {
       gnc_warning_dialog (w->dialog, _("That commodity already exists."));
+      g_free(namespace);
       return FALSE;
     }
 
@@ -1217,11 +1240,11 @@
       if (gtk_toggle_button_get_active(GTK_TOGGLE_BUTTON(w->source_button[type])))
 	break;
     }
-    selection = gnc_option_menu_get_active (w->source_menu[type]);
+    selection = gtk_combo_box_get_active(GTK_COMBO_BOX(w->source_menu[type]));
     source = gnc_quote_source_lookup_by_ti (type, selection);
     gnc_commodity_set_quote_source(c, source);
 
-    selection = gnc_option_menu_get_active (w->quote_tz_menu);
+    selection = gtk_combo_box_get_active(GTK_COMBO_BOX(w->quote_tz_menu));
     string = gnc_timezone_menu_position_to_string(selection);
     gnc_commodity_set_quote_tz(c, string);
     gnc_commodity_commit_edit(c);
@@ -1231,8 +1254,10 @@
 		       _("You must enter a non-empty \"Full name\", "
 			 "\"Symbol/abbreviation\", "
 			 "and \"Type\" for the commodity."));
+    g_free(namespace);
     return FALSE;
   }
+  g_free(namespace);
   LEAVE(" ");
   return TRUE;
 }

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-commodity.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * dialog-commodity.h -- "select" and "new" commodity windows       *
  *                       (GnuCash)                                  *
  * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
+ * 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   *
@@ -214,7 +215,7 @@
 /** Given a combo box, fill in the known commodity namespaces and then
  *  select one.
  *
- *  @param combobox The combo box to populate with information.
+ *  @param cbe The widget to populate with information.
  *
  *  @param sel The namespace that should be initially selected when
  *  the combo box appears.
@@ -226,25 +227,25 @@
  *
  *  @note The returned string must be freed by the caller.
  */
-void gnc_ui_update_namespace_picker(GtkWidget * combobox,
-				    const char * sel,
+void gnc_ui_update_namespace_picker(GtkWidget *cbe,
+				    const gchar *sel,
 				    dialog_commodity_mode mode);
 
 /** Given a combo box, return the currently selected namespaces.
  *
- *  @param combobox The combo box of namespaces.
+ *  @param cbe The combo box of namespaces.
  *
  *  @return The currently selected namespace.
  *
  *  @note This string is owned by the engine and must not be freed by
  *  the caller.
  */
-const char * gnc_ui_namespace_picker_ns (GtkWidget *combobox);
+gchar *gnc_ui_namespace_picker_ns (GtkWidget *cbe);
 
 /** Given a combo box, fill in all the known commodities for the
  *  specified namespace, and then select one.
  *
- *  @param combobox The combo box to populate with information.
+ *  @param cbe The widget to populate with information.
  *
  *  @param namespace All commodities with this namespace will be added
  *  to the combo box.
@@ -252,9 +253,9 @@
  *  @param sel The commodity that should be initially selected when
  *  the combo box appears.
  */
-void gnc_ui_update_commodity_picker(GtkWidget * combobox, 
-                                    const char * namespace,
-                                    const char * sel);
+void gnc_ui_update_commodity_picker(GtkWidget *cbe,
+                                    const gchar *namespace,
+                                    const gchar *sel);
 /** @} */
 
 #endif

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -31,7 +31,7 @@
 #endif
 #include <gdk/gdk.h>
 #include <glib/gi18n.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "gnc-tree-model-budget.h" //FIXME?
 #include "gnc-budget.h"
@@ -56,6 +56,7 @@
 #include "gnc-date-format.h"
 #include "misc-gnome-utils.h"
 
+#define FUNC_NAME __FUNCTION__
 /* TODO: clean up "register-stocks" junk
  */
 
@@ -908,100 +909,91 @@
 }
 
 static void
-gnc_option_list_select_cb(GtkCList *clist, gint row, gint column,
-                          GdkEventButton *event, gpointer data)
+gnc_option_list_changed_cb(GtkTreeSelection *selection,
+			   GNCOption *option)
 {
-  GNCOption *option = data;
+  GtkTreeView *view;
 
-  gtk_clist_set_row_data(clist, row, GINT_TO_POINTER(TRUE));
-  gnc_option_changed_widget_cb(GTK_WIDGET(clist), option);
+  view = gtk_tree_selection_get_tree_view(selection);
+  gnc_option_changed_widget_cb(GTK_WIDGET(view), option);
 }
 
 static void
-gnc_option_list_unselect_cb(GtkCList *clist, gint row, gint column,
-                            GdkEventButton *event, gpointer data)
-{
-  GNCOption *option = data;
-
-  gtk_clist_set_row_data(clist, row, GINT_TO_POINTER(FALSE));
-  gnc_option_changed_widget_cb(GTK_WIDGET(clist), option);
-}
-
-static void
 gnc_option_list_select_all_cb(GtkWidget *widget, gpointer data)
 {
   GNCOption *option = data;
+  GtkTreeView *view;
+  GtkTreeSelection *selection;
 
-  gtk_clist_select_all(GTK_CLIST(gnc_option_get_widget (option)));
-  gnc_option_changed_widget_cb(widget, option);
+  view = GTK_TREE_VIEW(gnc_option_get_widget (option));
+  selection = gtk_tree_view_get_selection(view);
+  gtk_tree_selection_select_all(selection);
+  gnc_option_changed_widget_cb(GTK_WIDGET(view), option);
 }
 
 static void
 gnc_option_list_clear_all_cb(GtkWidget *widget, gpointer data)
 {
   GNCOption *option = data;
+  GtkTreeView *view;
+  GtkTreeSelection *selection;
 
-  gtk_clist_unselect_all(GTK_CLIST(gnc_option_get_widget (option)));
-  gnc_option_changed_widget_cb(widget, option);
+  view = GTK_TREE_VIEW(gnc_option_get_widget (option));
+  selection = gtk_tree_view_get_selection(view);
+  gtk_tree_selection_unselect_all(selection);
+  gnc_option_changed_widget_cb(GTK_WIDGET(view), option);
 }
 
 static GtkWidget *
 gnc_option_create_list_widget(GNCOption *option, char *name, GtkTooltips *tooltips)
 {
-  GtkWidget *scroll_win;
-  GtkWidget *top_hbox;
+  GtkListStore *store;
+  GtkTreeView *view;
+  GtkTreeIter iter;
+  GtkTreeViewColumn *column;
+  GtkCellRenderer *renderer;
+  GtkTreeSelection *selection;
+
   GtkWidget *button;
   GtkWidget *frame;
-  GtkWidget *clist;
   GtkWidget *hbox;
   GtkWidget *bbox;
   gint num_values;
-  gint width;
   gint i;
 
-  top_hbox = gtk_hbox_new(FALSE, 0);
-
   frame = gtk_frame_new(name);
-  gtk_box_pack_start(GTK_BOX(top_hbox), frame, FALSE, FALSE, 0);
-
   hbox = gtk_hbox_new(FALSE, 0);
   gtk_container_add(GTK_CONTAINER(frame), hbox);
 
-  clist = gtk_clist_new(1);
-  gtk_clist_column_titles_hide(GTK_CLIST(clist));
-  gtk_clist_set_selection_mode(GTK_CLIST(clist), GTK_SELECTION_MULTIPLE);
+  store = gtk_list_store_new(1, G_TYPE_STRING);
+  view = GTK_TREE_VIEW(gtk_tree_view_new_with_model(GTK_TREE_MODEL(store)));
+  g_object_unref(store);
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes("", renderer,
+						    "text", 0,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+  gtk_tree_view_set_headers_visible(view, FALSE);
 
   num_values = gnc_option_num_permissible_values(option);
   for (i = 0; i < num_values; i++)
   {
-    gchar *text[1];
     gchar *string;
 
     string = gnc_option_permissible_value_name(option, i);
-    if (string != NULL)
-    {
-      text[0] = *string ? _(string) : "";
-      gtk_clist_append(GTK_CLIST(clist), text);
-      gtk_clist_set_row_data(GTK_CLIST(clist), i, GINT_TO_POINTER(FALSE));
-      free(string);
-    }
-    else
-    {
-      PERR("bad value name\n");
-    }
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       0, string ? string : "",
+		       -1);
   }
 
-  scroll_win = gtk_scrolled_window_new(NULL, NULL);
-  gtk_scrolled_window_set_policy(GTK_SCROLLED_WINDOW(scroll_win),
-                                 GTK_POLICY_NEVER, 
-                                 GTK_POLICY_AUTOMATIC);
+  gtk_box_pack_start(GTK_BOX(hbox), GTK_WIDGET(view), FALSE, FALSE, 0);
 
-  width = gtk_clist_columns_autosize(GTK_CLIST(clist));
-  gtk_widget_set_size_request(scroll_win, width + 50, -1);
+  selection = gtk_tree_view_get_selection(view);
+  gtk_tree_selection_set_mode(selection, GTK_SELECTION_MULTIPLE);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(gnc_option_list_changed_cb), option);
 
-  gtk_box_pack_start(GTK_BOX(hbox), scroll_win, FALSE, FALSE, 0);
-  gtk_container_set_border_width(GTK_CONTAINER(scroll_win), 5);
-  gtk_container_add(GTK_CONTAINER(scroll_win), clist);
 
   bbox = gtk_vbutton_box_new();
   gtk_button_box_set_layout(GTK_BUTTON_BOX(bbox), GTK_BUTTONBOX_SPREAD);
@@ -1028,9 +1020,9 @@
   g_signal_connect(G_OBJECT(button), "clicked",
 		   G_CALLBACK(gnc_option_default_cb), option);
 
-  gnc_option_set_widget (option, clist);
+  gnc_option_set_widget (option, GTK_WIDGET(view));
 
-  return top_hbox;
+  return frame;
 }
 
 static void
@@ -1220,7 +1212,7 @@
 
 
 /********************************************************************\
- * gnc_build_options_dialog_contents                                *
+ * gnc_options_dialog_build_contents                                *
  *   builds an options dialog given a property box and an options   *
  *   database                                                       *
  *                                                                  *
@@ -1229,7 +1221,7 @@
  * Return: nothing                                                  *
 \********************************************************************/
 void
-gnc_build_options_dialog_contents(GNCOptionWin *propertybox,
+gnc_options_dialog_build_contents(GNCOptionWin *propertybox,
                                   GNCOptionDB  *odb)
 {
   GNCOptionSection *section;
@@ -1815,8 +1807,7 @@
   value = gnc_account_sel_new();
   gnc_account_sel_set_acct_filters(GNC_ACCOUNT_SEL(value), acct_type_list);
 
-  g_signal_connect(G_OBJECT(gnc_account_sel_gtk_entry(GNC_ACCOUNT_SEL(value))),
-		   "changed",
+  g_signal_connect(value, "changed",
 		   G_CALLBACK(gnc_option_changed_widget_cb), option);
 
   gnc_option_set_widget (option, value);
@@ -1840,7 +1831,6 @@
 {
   GtkWidget *value;
   GtkWidget *eventbox;
-  gint num_lines;
 
   *enclosing = gnc_option_create_list_widget(option, name, tooltips);
   value = gnc_option_get_widget (option);
@@ -1854,21 +1844,8 @@
 
   gtk_tooltips_set_tip(tooltips, eventbox, documentation, NULL);
 
-  //gtk_widget_realize(value);
-
   gnc_option_set_ui_value(option, FALSE);
-
-  g_signal_connect(G_OBJECT(value), "select_row",
-		   G_CALLBACK(gnc_option_list_select_cb), option);
-  g_signal_connect(G_OBJECT(value), "unselect_row",
-		   G_CALLBACK(gnc_option_list_unselect_cb), option);
-
-  num_lines = gnc_option_num_permissible_values(option);
-  num_lines = MIN(num_lines, 9) + 1;
-
-  gtk_clist_set_row_height(GTK_CLIST(value), 0);
-  gtk_widget_set_size_request(value, -1, GTK_CLIST(value)->row_height * num_lines);
-  gtk_widget_show_all(*enclosing);
+  gtk_widget_show(*enclosing);
   return value;
 }
 
@@ -2391,11 +2368,11 @@
   Account *acc = NULL;
 
   if (value != SCM_BOOL_F) {
-    if (!gw_wcp_p(value))
-      scm_misc_error("gnc_option_set_ui_value_account_sel",
-		     "Option Value not a gw:wcp.", value);
+    if (!SWIG_IsPointer(value))
+        scm_misc_error("gnc_option_set_ui_value_account_sel",
+                       "Option Value not a wcp.", value);
       
-    acc = gw_wcp_get_ptr(value);
+    acc = SWIG_MustGetPtr(value, SWIG_TypeQuery("_p_Account"), 4, 0);
   }
 	
   gnc_account_sel_set_account (GNC_ACCOUNT_SEL(widget), acc);
@@ -2407,14 +2384,13 @@
 gnc_option_set_ui_value_list (GNCOption *option, gboolean use_default,
 				 GtkWidget *widget, SCM value)
 {
-  gint num_rows, row;
+  GtkTreeSelection *selection;
+  GtkTreePath *path;
+  gint row;
 
-  gtk_clist_unselect_all(GTK_CLIST(widget));
+  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
+  gtk_tree_selection_unselect_all(selection);
 
-  num_rows = gnc_option_num_permissible_values(option);
-  for (row = 0; row < num_rows; row++)
-    gtk_clist_set_row_data(GTK_CLIST(widget), row, GINT_TO_POINTER(FALSE));
-
   while (SCM_LISTP(value) && !SCM_NULLP(value))
   {
     SCM item;
@@ -2428,8 +2404,9 @@
       return TRUE;
     }
 
-    gtk_clist_select_row(GTK_CLIST(widget), row, 0);
-    gtk_clist_set_row_data(GTK_CLIST(widget), row, GINT_TO_POINTER(TRUE));
+    path = gtk_tree_path_new_from_indices(row, -1);
+    gtk_tree_selection_select_path(selection, path);
+    gtk_tree_path_free(path);
   }
 
   if (!SCM_LISTP(value) || !SCM_NULLP(value))
@@ -2546,11 +2523,11 @@
     GtkTreeIter iter;
 
     if (value != SCM_BOOL_F) {
-        if (!gw_wcp_p(value))
+        if (!SWIG_IsPointer(value))
             scm_misc_error("gnc_option_set_ui_value_budget",
-                           "Option Value not a gw:wcp.", value);
+                           "Option Value not a wcp.", value);
 
-        bgt = gw_wcp_get_ptr(value);
+        bgt = SWIG_MustGetPtr(value, SWIG_TypeQuery("GncBudget *"), 4, 0);
         cb = GTK_COMBO_BOX(widget);
         tm = gtk_combo_box_get_model(cb);
         if (gnc_tree_model_budget_get_iter_for_budget(tm, &iter, bgt))
@@ -2782,7 +2759,7 @@
   list = gnc_tree_view_account_get_selected_accounts (tree);
 
   /* handover list */
-  result = gnc_glist_to_scm_list(list, scm_c_eval_string("<gnc:Account*>"));
+  result = gnc_glist_to_scm_list(list, "_p_Account");
   g_list_free(list);
   return result;
 }
@@ -2799,7 +2776,7 @@
   if (!acc)
     return SCM_BOOL_F;
 
-  return gw_wcp_assimilate_ptr(acc, scm_c_eval_string("<gnc:Account*>"));
+  return SWIG_NewPointerObj(acc, SWIG_TypeQuery("_p_Account"), 0);
 }
 
 static SCM
@@ -2819,26 +2796,29 @@
     if (!bgt)
         return SCM_BOOL_F;
 
-    return gw_wcp_assimilate_ptr(bgt, scm_c_eval_string("<gnc:Budget*>"));
+    return SWIG_NewPointerObj(bgt, SWIG_TypeQuery("_p_gnc_budget_private"), 0);
 }
 
 static SCM
 gnc_option_get_ui_value_list (GNCOption *option, GtkWidget *widget)
 {
+  GtkTreeSelection *selection;
+  GtkTreePath *path;
   SCM result;
   gboolean selected;
-  GtkCList *clist;
   gint num_rows;
   gint row;
 
-  clist = GTK_CLIST(widget);
+  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(widget));
   num_rows = gnc_option_num_permissible_values(option);
   result = scm_c_eval_string("'()");
 
   for (row = 0; row < num_rows; row++)
   {
-    selected = GPOINTER_TO_INT(gtk_clist_get_row_data(clist, row));
-    if (selected)
+   path = gtk_tree_path_new_from_indices(row, -1);
+   selected = gtk_tree_selection_path_is_selected(selection, path);
+   gtk_tree_path_free(path);
+   if (selected)
       result = scm_cons(gnc_option_permissible_value(option, row), result);
   }
 
@@ -3020,7 +3000,7 @@
 
 void gnc_options_ui_initialize (void)
 {
-
+  SWIG_GetModule(NULL); /* Work-around for SWIG bug. */
   //  gnc_options_register_stocks ();
   g_return_if_fail (optionTable == NULL);
   optionTable = g_hash_table_new (g_str_hash, g_str_equal);

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-options.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -56,7 +56,7 @@
 void gnc_options_dialog_set_global_help_cb(GNCOptionWinCallback thunk,
                                            gpointer cb_data);
 
-void gnc_build_options_dialog_contents(GNCOptionWin *win,
+void gnc_options_dialog_build_contents(GNCOptionWin *win,
                                        GNCOptionDB  *odb);
 
 /* Both apply_cb and close_cb should be scheme functions with 0 arguments.

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-preferences.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-preferences.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-preferences.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1264,7 +1264,8 @@
      gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
      gnc_unregister_gui_component_by_data(DIALOG_PREFERENCES_CM_CLASS,
 					  dialog);
-     gnc_gconf_remove_notification(G_OBJECT(dialog), NULL);
+     gnc_gconf_remove_notification(G_OBJECT(dialog), NULL,
+				   DIALOG_PREFERENCES_CM_CLASS);
      gtk_widget_destroy(GTK_WIDGET(dialog));
      break;
   }
@@ -1614,7 +1615,8 @@
   gtk_widget_show(dialog);
 
   gnc_gconf_add_notification(G_OBJECT(dialog), NULL,
-			     gnc_preferences_gconf_changed);
+			     gnc_preferences_gconf_changed,
+			     DIALOG_PREFERENCES_CM_CLASS);
   gnc_gconf_general_register_cb(KEY_ACCOUNT_SEPARATOR,
 				(GncGconfGeneralCb)gnc_account_separator_prefs_cb,
 				dialog);

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-reset-warnings.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-reset-warnings.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-reset-warnings.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -38,6 +38,7 @@
 #define GCONF_SECTION			"dialogs/reset_warnings"
 #define DIALOG_RESET_WARNINGS_CM_CLASS	"reset-warnings"
 #define GCONF_ENTRY_LIST		"gconf_entries"
+#define TIPS_STRING                     "tips"
 
 void gnc_reset_warnings_select_all_cb (GtkButton *button, gpointer user_data);
 void gnc_reset_warnings_unselect_all_cb (GtkButton *button, gpointer user_data);
@@ -220,7 +221,8 @@
       break;
 
     case GTK_RESPONSE_OK:
-      gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS);
+      gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS,
+				    DIALOG_RESET_WARNINGS_CM_CLASS);
       gnc_reset_warnings_apply_changes(dialog);
       gnc_save_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
       gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
@@ -229,7 +231,8 @@
       break;
 
     default:
-      gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS);
+      gnc_gconf_remove_notification(G_OBJECT(dialog), GCONF_WARNINGS,
+				    DIALOG_RESET_WARNINGS_CM_CLASS);
       gnc_reset_warnings_revert_changes(dialog);
       gnc_unregister_gui_component_by_data(DIALOG_RESET_WARNINGS_CM_CLASS,
 					   dialog);
@@ -240,7 +243,7 @@
 static void
 gnc_reset_warnings_add_one (GConfEntry *entry, GtkWidget *box)
 {
-  const gchar *name, *schema_name, *desc = NULL;
+  const gchar *name, *schema_name, *desc, *long_desc = NULL;
   GtkWidget *checkbox;
   GConfSchema *schema = NULL;
 
@@ -253,7 +256,17 @@
     DEBUG("found schema %p", schema);
     desc = gconf_schema_get_short_desc(schema);
     DEBUG("description %s", desc);
+    long_desc = gconf_schema_get_long_desc(schema);
     checkbox = gtk_check_button_new_with_label(desc ? desc : name);
+    if (long_desc) {
+      GtkTooltips *tips;
+      tips = g_object_get_data(G_OBJECT(box), TIPS_STRING);
+      if (!tips) {
+        tips = gtk_tooltips_new();
+        g_object_set_data(G_OBJECT(box), TIPS_STRING, tips);
+      }
+      gtk_tooltips_set_tip(tips, checkbox, long_desc, NULL);
+    }
     gconf_schema_free(schema);
   } else {
     DEBUG("no schema");
@@ -404,7 +417,8 @@
   gnc_reset_warnings_update_widgets(dialog);
 
   gnc_gconf_add_notification(G_OBJECT(dialog), GCONF_WARNINGS,
-			     gnc_reset_warnings_gconf_changed);
+			     gnc_reset_warnings_gconf_changed,
+			     DIALOG_RESET_WARNINGS_CM_CLASS);
 
   gnc_restore_window_size(GCONF_SECTION, GTK_WINDOW(dialog));
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-transfer.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-transfer.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-transfer.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -437,7 +437,7 @@
   }
 
   type = xaccAccountGetType(account);
-  return ((type != INCOME) && (type != EXPENSE)); 
+  return ((type != ACCT_TYPE_INCOME) && (type != ACCT_TYPE_EXPENSE)); 
 }
 
 static void
@@ -638,7 +638,7 @@
     /* Don't want to deactivate the button just because this
      * isn't an income or expense account
      */
-    if( (other_type == EXPENSE) || (other_type == INCOME) )
+    if( (other_type == ACCT_TYPE_EXPENSE) || (other_type == ACCT_TYPE_INCOME) )
       gtk_toggle_button_set_active(GTK_TOGGLE_BUTTON(other_button), TRUE);
 
     gnc_transfer_dialog_set_selected_account (xferData, other_acct, xferData->quickfill);
@@ -2139,7 +2139,8 @@
 
   type = xaccAccountGetType (account);
   gtk_toggle_button_set_active (GTK_TOGGLE_BUTTON (show_button),
-				(type == EXPENSE) || (type == INCOME));
+				(type == ACCT_TYPE_EXPENSE) ||
+				(type == ACCT_TYPE_INCOME));
 
   gnc_tree_view_account_set_selected_account (GNC_TREE_VIEW_ACCOUNT (tree_view),
 					      account);

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -38,7 +38,7 @@
 #include "dialog-utils.h"
 #include "gnc-commodity.h"
 #include "Group.h"
-#include "gnc-dir.h"
+#include "gnc-path.h"
 #include "gnc-engine.h"
 #include "gnc-euro.h"
 #include "gnc-ui-util.h"
@@ -50,9 +50,6 @@
 #define WINDOW_POSITION		"window_position"
 #define WINDOW_GEOMETRY		"window_geometry"
 
-#define DESKTOP_GNOME_INTERFACE "/desktop/gnome/interface"
-#define KEY_TOOLBAR_STYLE	"toolbar_style"
-
 /* =========================================================== */
 
 static void
@@ -810,6 +807,7 @@
 {
   GladeXML *xml;
   char *fname;
+  gchar *gnc_glade_dir;
 
   g_return_val_if_fail (filename != NULL, NULL);
   g_return_val_if_fail (root != NULL, NULL);
@@ -820,7 +818,9 @@
     glade_inited = TRUE;
   }
 
-  fname = g_strconcat (GNC_GLADE_DIR, "/", filename, (char *)NULL);
+  gnc_glade_dir = gnc_path_get_gladedir ();
+  fname = g_build_filename(gnc_glade_dir, filename, (char *)NULL);
+  g_free (gnc_glade_dir);
 
   xml = glade_xml_new (fname, root, NULL);
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/dialog-utils.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -113,8 +113,10 @@
  * place. Stick to gtk_clist_append, or use gnc_clist_set_check
  * after you have built the list. This only applies to unrealized
  * widgets. */
+#ifdef __GTK_CLIST_H__
 void gnc_clist_set_check (GtkCList *list, int row, int col, 
 			  gboolean checked);
+#endif
 
 GladeXML * gnc_glade_xml_new (const char *filename, const char *root);
 GtkWidget * gnc_glade_lookup_widget (GtkWidget *widget, const char *name);

Modified: gnucash/branches/register-rewrite/src/gnome-utils/druid-gconf-setup.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/druid-gconf-setup.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/druid-gconf-setup.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -41,7 +41,7 @@
 #include "dialog-utils.h"
 #include "druid-gconf-setup.h"
 #include "druid-utils.h"
-#include "gnc-dir.h"
+#include "gnc-path.h"
 #include "gnc-gconf-utils.h"
 #include "gnc-gui-query.h"
 #include "gnc-gnome-utils.h"
@@ -113,6 +113,7 @@
   gchar *contents, **lines, *line;
   gboolean found_user_dir = FALSE;
   FILE *output;
+  gchar *gconfdir;
 
   data_filename = g_build_filename(g_get_home_dir(), ".gconf", (char *)NULL);
   path_filename = g_build_filename(g_get_home_dir(), ".gconf.path", (char *)NULL);
@@ -151,7 +152,9 @@
   fprintf(output, "\n######## The following lines were added by GnuCash. ########\n");
   if (!found_user_dir)
     fprintf(output, PATH_STRING1);
-  fprintf(output, PATH_STRING2, GNC_GCONF_DIR);
+  gconfdir = gnc_path_get_gconfdir ();
+  fprintf(output, PATH_STRING2, gconfdir);
+  g_free (gconfdir);
   fprintf(output,   "############## End of lines added by GnuCash. ##############\n");
   if (fclose(output) != 0)  {
     *error = g_error_new (G_FILE_ERROR,
@@ -284,11 +287,13 @@
   GtkTextBuffer *textbuffer;
   GtkWidget *textview;
   gchar *msg;
+  gchar *gconfdir = gnc_path_get_gconfdir ();
 
   textview = gnc_glade_lookup_widget(GTK_WIDGET(druidpage), "update_text");
   textbuffer = gtk_text_view_get_buffer(GTK_TEXT_VIEW(textview));
-  msg = g_strdup_printf(PATH_STRING1 PATH_STRING2, GNC_GCONF_DIR);
+  msg = g_strdup_printf(PATH_STRING1 PATH_STRING2, gconfdir);
   gtk_text_buffer_set_text(textbuffer, msg, -1);
+  g_free (gconfdir);
 }
 
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/druid-gnc-xml-import.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/druid-gnc-xml-import.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/druid-gnc-xml-import.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -186,21 +186,27 @@
                         GncXmlImportData *data);
 
 static const gchar *encodings_doc_string = N_(
-  "The file you tried to load does not specify an encoding, so GnuCash is "
-  "unable to unambiguously interpret it. This is typical for files created with "
-  "GnuCash prior to 2.0.\n\n"
-  "On the next page you will be asked to select the best looking decoded string "
-  "for every ambiguous word GnuCash found while trying to open your file. "
-  "Therefore GnuCash has guessed what encodings you might have used. So "
-  "probably everything will look just fine and you can simply click "
-  "'Forward'.\n\n"
-  "If it does not work for you, try to change the default encoding at the top. "
-  "Maybe you even have to edit the list of encodings by clicking on the button "
-  "in the top right corner.\n\n"
-  "The page is not overly complicated, just take the time until you feel "
-  "comfortable with it. You can always come back and read this message again.");
+  "The file you are trying to load is from an older version of "
+  "GnuCash. The file format in the older versions was missing the "
+  "detailed specification of the character encoding being used. This "
+  "means the text in your data file could be read in multiple ambiguous "
+  "ways. This ambiguity cannot be resolved automatically, but the new "
+  "GnuCash 2.0.0 file format will include all necessary specifications so "
+  "that you do not have to go through this step again."
+  "\n\n"
+  "GnuCash will try to guess the correct character encoding for your data "
+  "file. On the next page GnuCash will show the resulting texts when "
+  "using this guess. You have to check whether the words look as "
+  "expected. Either everything looks fine and you can simply press "
+  "'Forward'. Or the words contain unexpected characters, in which "
+  "case you should select different character encodings to see "
+  "different results. You may have to edit the list of character "
+  "encodings by clicking on the respective button."
+  "\n\n"
+  "Press 'Forward' now to select the correct character encoding for "
+  "your data file.");
 
-static const gchar *encodings_doc_page_title = N_("Missing file encoding");
+static const gchar *encodings_doc_page_title = N_("Ambiguous character encoding");
 
 static const gchar *finish_convert_string = N_(
   "The file has been loaded successfully. If you click 'Apply' it will be saved "

Modified: gnucash/branches/register-rewrite/src/gnome-utils/glade/commodity.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/glade/commodity.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/glade/commodity.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -88,130 +88,6 @@
 	  <property name="column_spacing">12</property>
 
 	  <child>
-	    <widget class="GtkCombo" id="commodity_combo">
-	      <property name="visible">True</property>
-	      <property name="value_in_list">True</property>
-	      <property name="allow_empty">False</property>
-	      <property name="case_sensitive">False</property>
-	      <property name="enable_arrow_keys">True</property>
-	      <property name="enable_arrows_always">False</property>
-
-	      <child internal-child="entry">
-		<widget class="GtkEntry" id="commodity_entry">
-		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="editable">False</property>
-		  <property name="visibility">True</property>
-		  <property name="max_length">0</property>
-		  <property name="text" translatable="yes"></property>
-		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
-		  <property name="activates_default">False</property>
-		  <signal name="changed" handler="gnc_ui_select_commodity_changed_cb" last_modification_time="Wed, 16 Jul 2003 20:18:37 GMT"/>
-		</widget>
-	      </child>
-
-	      <child internal-child="list">
-		<widget class="GtkList" id="convertwidget4">
-		  <property name="visible">True</property>
-		  <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
-		  <child>
-		    <widget class="GtkListItem" id="convertwidget5">
-		      <property name="visible">True</property>
-
-		      <child>
-			<widget class="GtkLabel" id="convertwidget6">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes"></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>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="left_attach">1</property>
-	      <property name="right_attach">3</property>
-	      <property name="top_attach">2</property>
-	      <property name="bottom_attach">3</property>
-	      <property name="y_options"></property>
-	    </packing>
-	  </child>
-
-	  <child>
-	    <widget class="GtkCombo" id="namespace_combo">
-	      <property name="visible">True</property>
-	      <property name="value_in_list">True</property>
-	      <property name="allow_empty">False</property>
-	      <property name="case_sensitive">False</property>
-	      <property name="enable_arrow_keys">True</property>
-	      <property name="enable_arrows_always">False</property>
-
-	      <child internal-child="entry">
-		<widget class="GtkEntry" id="namespace_entry">
-		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="editable">False</property>
-		  <property name="visibility">True</property>
-		  <property name="max_length">0</property>
-		  <property name="text" translatable="yes"></property>
-		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
-		  <property name="activates_default">False</property>
-		  <signal name="changed" handler="gnc_ui_select_commodity_namespace_changed_cb"/>
-		</widget>
-	      </child>
-
-	      <child internal-child="list">
-		<widget class="GtkList" id="convertwidget1">
-		  <property name="visible">True</property>
-		  <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
-		  <child>
-		    <widget class="GtkListItem" id="convertwidget2">
-		      <property name="visible">True</property>
-
-		      <child>
-			<widget class="GtkLabel" id="convertwidget3">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes"></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>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
-	    </widget>
-	    <packing>
-	      <property name="left_attach">1</property>
-	      <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="select_user_prompt">
 	      <property name="visible">True</property>
 	      <property name="label" translatable="yes">Select user information here...</property>
@@ -260,7 +136,7 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">namespace_entry</property>
+		  <property name="mnemonic_widget">namespace_cbe</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -299,7 +175,7 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">commodity_entry</property>
+		  <property name="mnemonic_widget">commodity_cbe</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -312,6 +188,42 @@
 	      <property name="y_options">fill</property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <widget class="GtkComboBoxEntry" id="namespace_cbe">
+	      <property name="visible">True</property>
+	      <property name="items">Dummy namespace entry</property>
+	      <property name="has_frame">True</property>
+	      <property name="focus_on_click">True</property>
+	      <signal name="changed" handler="gnc_ui_select_commodity_namespace_changed_cb" last_modification_time="Thu, 08 Jun 2006 23:26:58 GMT"/>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">1</property>
+	      <property name="bottom_attach">2</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
+
+	  <child>
+	    <widget class="GtkComboBoxEntry" id="commodity_cbe">
+	      <property name="visible">True</property>
+	      <property name="items">Dummy security entry</property>
+	      <property name="has_frame">True</property>
+	      <property name="focus_on_click">True</property>
+	      <signal name="changed" handler="gnc_ui_select_commodity_changed_cb" last_modification_time="Thu, 08 Jun 2006 23:30:40 GMT"/>
+	    </widget>
+	    <packing>
+	      <property name="left_attach">1</property>
+	      <property name="right_attach">3</property>
+	      <property name="top_attach">2</property>
+	      <property name="bottom_attach">3</property>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>
@@ -479,69 +391,6 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkCombo" id="namespace_combo">
-	      <property name="visible">True</property>
-	      <property name="value_in_list">False</property>
-	      <property name="allow_empty">True</property>
-	      <property name="case_sensitive">False</property>
-	      <property name="enable_arrow_keys">True</property>
-	      <property name="enable_arrows_always">False</property>
-
-	      <child internal-child="entry">
-		<widget class="GtkEntry" id="namespace_entry">
-		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Enter the type of commodity. For stocks, this is often an exchange on which the stock is traded. You can choose an existing type from the list or enter a new type with the keyboard.</property>
-		  <property name="can_focus">True</property>
-		  <property name="editable">True</property>
-		  <property name="visibility">True</property>
-		  <property name="max_length">0</property>
-		  <property name="text" translatable="yes"></property>
-		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
-		  <property name="activates_default">True</property>
-		  <signal name="changed" handler="gnc_ui_commodity_changed_cb" last_modification_time="Sat, 19 Jul 2003 20:58:53 GMT"/>
-		</widget>
-	      </child>
-
-	      <child internal-child="list">
-		<widget class="GtkList" id="convertwidget7">
-		  <property name="visible">True</property>
-		  <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
-		  <child>
-		    <widget class="GtkListItem" id="convertwidget8">
-		      <property name="visible">True</property>
-
-		      <child>
-			<widget class="GtkLabel" id="convertwidget9">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes"></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>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
-		</widget>
-	      </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"></property>
-	    </packing>
-	  </child>
-
-	  <child>
 	    <widget class="GtkEntry" id="code_entry">
 	      <property name="visible">True</property>
 	      <property name="tooltip" translatable="yes">Enter a unique code used to identify the commodity. Or, you may safely leave this field blank.</property>
@@ -889,7 +738,7 @@
 		  <property name="yalign">0.5</property>
 		  <property name="xpad">0</property>
 		  <property name="ypad">0</property>
-		  <property name="mnemonic_widget">namespace_entry</property>
+		  <property name="mnemonic_widget">namespace_cbe</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -1255,6 +1104,24 @@
 	      <property name="y_options">fill</property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <widget class="GtkComboBoxEntry" id="namespace_cbe">
+	      <property name="visible">True</property>
+	      <property name="items">Dummy namespace</property>
+	      <property name="has_frame">True</property>
+	      <property name="focus_on_click">True</property>
+	      <signal name="changed" handler="gnc_ui_commodity_changed_cb" last_modification_time="Thu, 08 Jun 2006 23:29:20 GMT"/>
+	    </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="x_options">fill</property>
+	      <property name="y_options">fill</property>
+	    </packing>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>

Modified: gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-gnc-xml-import.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-gnc-xml-import.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-gnc-xml-import.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -5,7 +5,7 @@
 <requires lib="gnome"/>
 
 <widget class="GtkDialog" id="GnuCash XML Import Dialog">
-  <property name="title" translatable="yes">GnuCash XML Import Druid</property>
+  <property name="title" translatable="yes">GnuCash Datafile Import Druid</property>
   <property name="type">GTK_WINDOW_TOPLEVEL</property>
   <property name="window_position">GTK_WIN_POS_CENTER_ON_PARENT</property>
   <property name="modal">False</property>
@@ -350,7 +350,7 @@
 	  <child>
 	    <widget class="GnomeDruidPageStandard" id="loaded_files_page">
 	      <property name="visible">True</property>
-	      <property name="title" translatable="yes">GnuCash XML files you have loaded</property>
+	      <property name="title" translatable="yes">GnuCash data files you have loaded</property>
 	      <signal name="prepare" handler="gxi_loaded_files_prepare_cb" last_modification_time="Thu, 30 Mar 2006 22:20:01 GMT"/>
 	      <signal name="next" handler="gxi_loaded_files_next_cb" last_modification_time="Thu, 30 Mar 2006 23:20:21 GMT"/>
 
@@ -394,7 +394,7 @@
 		      <property name="visible">True</property>
 		      <property name="label" translatable="yes">Click &quot;Load another file&quot; if you have more data to import at this time. Do this if you have saved your accounts to separate GnuCash files.
 
-Click &quot;Forward&quot; to finish loading files and move to the next step of the GnuCash XML import process.</property>
+Click &quot;Forward&quot; to finish loading files and move to the next step of the GnuCash Datafile import process.</property>
 		      <property name="use_underline">False</property>
 		      <property name="use_markup">False</property>
 		      <property name="justify">GTK_JUSTIFY_LEFT</property>
@@ -679,7 +679,7 @@
 	    <widget class="GnomeDruidPageEdge" id="end_page">
 	      <property name="visible">True</property>
 	      <property name="position">GNOME_EDGE_FINISH</property>
-	      <property name="title" translatable="yes">Finish GnuCash XML Import</property>
+	      <property name="title" translatable="yes">Finish GnuCash Datafile Import</property>
 	      <property name="text">finish placeholder</property>
 	      <signal name="finish" handler="gxi_end_finish_cb" last_modification_time="Thu, 30 Mar 2006 05:00:17 GMT"/>
 	    </widget>

Modified: gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-provider-multifile.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-provider-multifile.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/glade/druid-provider-multifile.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -72,30 +72,14 @@
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkCList" id="file_list">
+		    <widget class="GtkTreeView" id="file_view">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="n_columns">1</property>
-		      <property name="column_widths">80</property>
-		      <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-		      <property name="show_titles">False</property>
-		      <property name="shadow_type">GTK_SHADOW_IN</property>
-		      <signal name="select_row" handler="gnc_ui_qif_import_select_loaded_file_cb"/>
-
-		      <child>
-			<widget class="GtkLabel" id="label827">
-			  <property name="label" translatable="no">labe82l7</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>
+		      <property name="headers_visible">False</property>
+		      <property name="rules_hint">True</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
 		    </widget>
 		  </child>
 		</widget>

Modified: gnucash/branches/register-rewrite/src/gnome-utils/glade/preferences.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/glade/preferences.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/glade/preferences.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1325,7 +1325,7 @@
 	      <child>
 		<widget class="GtkRadioButton" id="gconf/general/date_format/uk">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Use the date format comon in the United Kingdom.</property>
+		  <property name="tooltip" translatable="yes">Use the date format common in the United Kingdom.</property>
 		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes">U_K:</property>
 		  <property name="use_underline">True</property>
@@ -1350,7 +1350,7 @@
 	      <child>
 		<widget class="GtkRadioButton" id="gconf/general/date_format/us">
 		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Use the date format comon in the United States.</property>
+		  <property name="tooltip" translatable="yes">Use the date format common in the United States.</property>
 		  <property name="can_focus">True</property>
 		  <property name="label" translatable="yes">_US:</property>
 		  <property name="use_underline">True</property>
@@ -1568,8 +1568,8 @@
 		<packing>
 		  <property name="left_attach">0</property>
 		  <property name="right_attach">4</property>
-		  <property name="top_attach">2</property>
-		  <property name="bottom_attach">3</property>
+		  <property name="top_attach">3</property>
+		  <property name="bottom_attach">4</property>
 		  <property name="x_padding">12</property>
 		  <property name="x_options">fill</property>
 		  <property name="y_options"></property>
@@ -1625,30 +1625,6 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkCheckButton" id="gconf/general/tab_close_buttons">
-		  <property name="visible">True</property>
-		  <property name="tooltip" translatable="yes">Show a close button on each notebook tab.  These function identically to the 'Close' menu item.</property>
-		  <property name="can_focus">True</property>
-		  <property name="label" translatable="yes">Show close button on _notebook tabs</property>
-		  <property name="use_underline">True</property>
-		  <property name="relief">GTK_RELIEF_NORMAL</property>
-		  <property name="focus_on_click">True</property>
-		  <property name="active">False</property>
-		  <property name="inconsistent">False</property>
-		  <property name="draw_indicator">True</property>
-		</widget>
-		<packing>
-		  <property name="left_attach">0</property>
-		  <property name="right_attach">4</property>
-		  <property name="top_attach">3</property>
-		  <property name="bottom_attach">4</property>
-		  <property name="x_padding">12</property>
-		  <property name="x_options">fill</property>
-		  <property name="y_options"></property>
-		</packing>
-	      </child>
-
-	      <child>
 		<widget class="GtkHBox" id="hbox2">
 		  <property name="visible">True</property>
 		  <property name="homogeneous">False</property>
@@ -2044,6 +2020,30 @@
 		  <property name="y_options"></property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkCheckButton" id="gconf/general/show_splash_screen">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Show splash screen at startup.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Show splash scree_n</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">4</property>
+		  <property name="top_attach">2</property>
+		  <property name="bottom_attach">3</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="tab_expand">False</property>
@@ -3020,7 +3020,7 @@
 	    <widget class="GtkTable" id="table5">
 	      <property name="border_width">6</property>
 	      <property name="visible">True</property>
-	      <property name="n_rows">9</property>
+	      <property name="n_rows">18</property>
 	      <property name="n_columns">4</property>
 	      <property name="homogeneous">False</property>
 	      <property name="row_spacing">0</property>
@@ -3130,7 +3130,7 @@
 		  <property name="visible">True</property>
 		  <property name="tooltip" translatable="yes">Use the system setting for displaying toolbar items.</property>
 		  <property name="can_focus">True</property>
-		  <property name="label" translatable="yes">Use s_ystem _default</property>
+		  <property name="label" translatable="yes">Use s_ystem default</property>
 		  <property name="use_underline">True</property>
 		  <property name="relief">GTK_RELIEF_NORMAL</property>
 		  <property name="focus_on_click">True</property>
@@ -3244,6 +3244,225 @@
 		  <property name="y_options"></property>
 		</packing>
 	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label110">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes"></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>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">12</property>
+		  <property name="bottom_attach">13</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label111">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Tab Position&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</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>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">13</property>
+		  <property name="bottom_attach">14</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="gconf/general/tab_position/top">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Display the notebook tabs at the top of the window.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">To_p</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">14</property>
+		  <property name="bottom_attach">15</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="gconf/general/tab_position/bottom">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Display the notebook tabs at the bottom of the window.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">B_ottom</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">gconf/general/tab_position/top</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">15</property>
+		  <property name="bottom_attach">16</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="gconf/general/tab_position/left">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Display the notebook tabs at the left of the window.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">_Left</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">gconf/general/tab_position/top</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">16</property>
+		  <property name="bottom_attach">17</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkRadioButton" id="gconf/general/tab_position/right">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Display the notebook tabs at the right of the window.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">_Right</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		  <property name="group">gconf/general/tab_position/top</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">17</property>
+		  <property name="bottom_attach">18</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label112">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes"></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>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">9</property>
+		  <property name="bottom_attach">10</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkLabel" id="label113">
+		  <property name="visible">True</property>
+		  <property name="label" translatable="yes">&lt;b&gt;Close Button&lt;/b&gt;</property>
+		  <property name="use_underline">False</property>
+		  <property name="use_markup">True</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>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">10</property>
+		  <property name="bottom_attach">11</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
+
+	      <child>
+		<widget class="GtkCheckButton" id="gconf/general/tab_close_buttons">
+		  <property name="visible">True</property>
+		  <property name="tooltip" translatable="yes">Show a close button on each notebook tab.  These function identically to the 'Close' menu item.</property>
+		  <property name="can_focus">True</property>
+		  <property name="label" translatable="yes">Show close button on _notebook tabs</property>
+		  <property name="use_underline">True</property>
+		  <property name="relief">GTK_RELIEF_NORMAL</property>
+		  <property name="focus_on_click">True</property>
+		  <property name="active">False</property>
+		  <property name="inconsistent">False</property>
+		  <property name="draw_indicator">True</property>
+		</widget>
+		<packing>
+		  <property name="left_attach">0</property>
+		  <property name="right_attach">1</property>
+		  <property name="top_attach">11</property>
+		  <property name="bottom_attach">12</property>
+		  <property name="x_padding">12</property>
+		  <property name="x_options">fill</property>
+		  <property name="y_options"></property>
+		</packing>
+	      </child>
 	    </widget>
 	    <packing>
 	      <property name="tab_expand">False</property>

Modified: gnucash/branches/register-rewrite/src/gnome-utils/glade/transfer.glade
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/glade/transfer.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/glade/transfer.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -19,7 +19,6 @@
   <property name="gravity">GDK_GRAVITY_NORTH_WEST</property>
   <property name="has_separator">False</property>
   <signal name="response" handler="gnc_xfer_dialog_response_cb" last_modification_time="Sun, 27 Jul 2003 17:44:58 GMT"/>
-  <signal name="close" handler="gnc_xfer_dialog_close_cb" last_modification_time="Sun, 27 Jul 2003 17:45:10 GMT"/>
 
   <child internal-child="vbox">
     <widget class="GtkVBox" id="vbox">

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,6 +3,7 @@
  *
  * Copyright (C) 2002 Joshua Sled <jsled at asynchronous.org>
  * All rights reserved.
+ * Copyright (C) 2006 David Hampton <hampton at employees.org>
  *
  * Gnucash is free software; you can redistribute it and/or
  * modify it under the terms of the GNU Library General Public License
@@ -31,6 +32,7 @@
 #include "GNCId.h"
 #include "gnc-account-sel.h"
 #include "gnc-exp-parser.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-ui-util.h"
 #include "qof.h"
 
@@ -43,6 +45,12 @@
         LAST_SIGNAL
 };
 
+enum account_cols {
+	ACCT_COL_NAME = 0,
+	ACCT_COL_PTR,
+	NUM_ACCT_COLS
+};
+
 static guint account_sel_signals [LAST_SIGNAL] = { 0 };
 
 static void gnc_account_sel_init (GNCAccountSel *gas);
@@ -50,20 +58,12 @@
 static void gnc_account_sel_finalize (GObject *object);
 static void gnc_account_sel_dispose (GObject *object);
 
-static void gas_accounts_to_names (gpointer data, gpointer user_data);
+static void gas_filter_accounts (gpointer data, gpointer user_data);
 
 static void gas_populate_list (GNCAccountSel *gas);
-static void gas_strcmp_adapter (gpointer a, gpointer b);
 
 static void gas_new_account_click (GtkButton *b, gpointer ud);
 
-#if 0 /* completion not implemented */
-static void gnc_account_sel_changed( GtkEditable *entry, gpointer ud );
-static void gnc_account_sel_list_clicked( GtkButton *b, gpointer ud );
-static gint gnc_account_sel_key_press( GtkWidget          *widget,
-                                       GdkEventKey        *event );
-#endif /* 0 -- completion not implemented */
-
 static GtkHBox *parent_class;
 
 GType
@@ -134,23 +134,24 @@
 static void
 gnc_account_sel_init (GNCAccountSel *gas)
 {
+	GtkWidget *widget;
+
         gas->initDone = FALSE;
         gas->acctTypeFilters = FALSE;
         gas->newAccountButton = NULL;
 
-        gas->combo = GTK_COMBO(gtk_combo_new());
-        gtk_combo_set_value_in_list( gas->combo, TRUE, TRUE );
-        gtk_container_add( GTK_CONTAINER(gas), GTK_WIDGET(gas->combo) );
+	gas->store = gtk_list_store_new(NUM_ACCT_COLS, G_TYPE_STRING, G_TYPE_POINTER);
+        widget =
+	  gtk_combo_box_entry_new_with_model(GTK_TREE_MODEL(gas->store), ACCT_COL_NAME);
+        gas->combo = GTK_COMBO_BOX_ENTRY(widget);
+	gtk_combo_box_set_model(GTK_COMBO_BOX(widget),
+				GTK_TREE_MODEL(gas->store));
+	g_object_unref(gas->store);
+        gtk_container_add( GTK_CONTAINER(gas), widget );
 
-        /* This is only because completion cannot be implemented. */
-        gtk_editable_set_editable( GTK_EDITABLE(gas->combo->entry), FALSE );
+        /* Add completion. */
+	gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(widget));
 
-#if 0 /* completion not implemented. */
-        g_signal_connect( gas->combo->entry, "changed",
-			  G_CALLBACK( gnc_account_sel_changed ),
-			  gas );
-#endif /* 0 -- completion not implemented. */
-
         /* Get the accounts, place into combo list */
         gas_populate_list( gas );
 
@@ -163,92 +164,68 @@
 typedef struct {
         GNCAccountSel *gas;
         GList **outList;
-} accounts_to_names_data;
+} account_filter_data;
 
-/**
- * Used in the g_list_foreach call in gas_populate_list to see if the given
- * string is in [via strcmp] the list, and to set the flag as necessary.
- **/
-typedef struct {
-        char *str;
-        gboolean flag;
-} findData;
-
 static
 void
-gas_strcmp_adapter( gpointer listElt, gpointer ud )
-{
-        findData *fd = (findData*)ud;
-        fd->flag |= ( strcmp( (char*)listElt, (char*)fd->str ) == 0 );
-}
-
-static
-void
 gas_populate_list( GNCAccountSel *gas )
 {
-        accounts_to_names_data atnd;
+        account_filter_data atnd;
         AccountGroup *ag;
-        GList *accts, *nameList;
-        gchar *currentSel;
+	Account *acc;
+	GtkTreeIter iter;
+	GtkEntry *entry;
+	gint i, active = 0;
+        GList *accts, *ptr, *filteredAccts;
+        gchar *currentSel, *name;
 
+	entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(gas->combo)));
         currentSel = gtk_editable_get_chars(
-                GTK_EDITABLE(gas->combo->entry), 0, -1 );
+                GTK_EDITABLE(entry), 0, -1 );
 
         ag = gnc_book_get_group( gnc_get_current_book() );
         accts = (GList*)xaccGroupGetSubAccountsSorted( ag );
 
-        nameList        = NULL;
+        filteredAccts   = NULL;
         atnd.gas        = gas;
-        atnd.outList    = &nameList;
+        atnd.outList    = &filteredAccts;
 
-        g_list_foreach( accts, gas_accounts_to_names,
-                        (gpointer)&atnd );
+        g_list_foreach( accts, gas_filter_accounts, (gpointer)&atnd );
         g_list_free( accts );
 
-	/* Make sure we have a list of something... */
-	if ( nameList == NULL )
-		nameList = g_list_prepend( NULL, "" );
+	gtk_list_store_clear(gas->store);
+	for (ptr = filteredAccts, i = 0; ptr; ptr = g_list_next(ptr), i++) {
+	  acc = ptr->data;
+	  name = xaccAccountGetFullName(acc);
+	  gtk_list_store_append(gas->store, &iter);
+	  gtk_list_store_set(gas->store, &iter,
+			     ACCT_COL_NAME, name,
+			     ACCT_COL_PTR,  acc,
+			     -1);
+	  if (g_utf8_collate(name, currentSel) == 0) {
+	    active = i;
+	  g_free(name);
+	  }
+	}
 
-	gtk_combo_set_popdown_strings( gas->combo, nameList );
-
         /* If the account which was in the text box before still exists, then
          * reset to it. */
-        {
-                findData tmpfd;
-                gint pos;
-                tmpfd.str = currentSel;
-                tmpfd.flag = FALSE;
+	gtk_combo_box_set_active(GTK_COMBO_BOX(gas->combo), active);
 
-                g_list_foreach( nameList, gas_strcmp_adapter, &tmpfd );
-
-                if ( tmpfd.flag ) {
-                        gtk_editable_delete_text(
-                                GTK_EDITABLE(gas->combo->entry), 0, -1 );
-                        pos = 0;
-                        gtk_editable_insert_text(
-                                GTK_EDITABLE(gas->combo->entry),
-                                currentSel, strlen(currentSel), &pos );
-                }
-        }
-        g_list_free( nameList );
+        g_list_free( filteredAccts );
         if ( currentSel ) {
                 g_free( currentSel );
         }
-
-#if 0 /* completion not implemented */
-        gas->completion = g_completion_new( NULL );
-        g_completion_add_items( gas->completion, nameList );
-#endif /* 0 -- completion not implemented */
 }
 
 static
 void
-gas_accounts_to_names( gpointer data, gpointer user_data )
+gas_filter_accounts( gpointer data, gpointer user_data )
 {
-        accounts_to_names_data *atnd;
+        account_filter_data *atnd;
         Account *a;
 
-        atnd = (accounts_to_names_data*)user_data;
+        atnd = (account_filter_data*)user_data;
         a = (Account*)data;
         /* Filter as we've been configured to do. */
         if ( atnd->gas->acctTypeFilters ) {
@@ -261,90 +238,10 @@
                         return;
                 }
         }
-        *atnd->outList =
-                g_list_append( *atnd->outList, xaccAccountGetFullName(a) );
+        *atnd->outList = g_list_append( *atnd->outList, a );
 }
 
-#if 0 /* completion not implemented  */
-/*
- * There is apparently no way -- in GTK 1.x -- to programatically select a
- * region in the way we would like... so we've disallowed manual editing of
- * the Account string.
- */
-static
-void
-gnc_account_sel_changed( GtkEditable *entry, gpointer ud )
-{
-        gchar *s, *prefix;
-        GNCAccountSel *gas = (GNCAccountSel*)ud;
 
-        if ( !gas->initDone ) {
-                return;
-        }
-        s = gtk_editable_get_chars( entry, 0, -1 );
-        g_completion_complete( gas->completion, s, &prefix );
-        if ( prefix && (strlen(prefix) > 0) ) {
-                printf( "changed into \"%s\"; longest completion: \"%s\"\n", s, prefix );
-                g_signal_handlers_block_by_func( gas->combo->entry,
-						 gnc_account_sel_changed,
-						 ud );
-                gtk_entry_set_text( GTK_ENTRY(gas->combo->entry), prefix );
-                gtk_editable_select_region( GTK_EDITABLE(gas->combo->entry),
-                                            strlen(s), -1 );
-                {
-                        GdkEventKey k;
-                        gboolean ret;
-                        
-                        k.type = GDK_KEY_RELEASE;
-                        k.send_event = TRUE;
-                        k.state = GDK_SHIFT_MASK;
-                        k.keyval = GDK_End;
-                        k.length = 0;
-                        k.string = "";
-                        printf( "foo [%d : \"%s\"]\n", k.length, k.string );
-                        //gtk_widget_event( GTK_WIDGET(gas->combo->entry), &e );
-                        g_signal_emit_by_name( gas->combo->entry,
-					       "key-press-event",
-					       gas->combo->entry, &k, NULL, &ret );
-                        printf( "bar\n" );
-                }
-                gtk_editable_set_position( GTK_EDITABLE(gas->combo->entry),
-                                           strlen(s) );
-                g_signal_handlers_unblock_by_func( gas->combo->entry,
-						   gnc_account_sel_changed,
-						   ud );
-                g_free( prefix );
-        }
-        g_free( s );
-}
-
-static
-gint
-gnc_account_sel_key_press(GtkWidget *widget, GdkEventKey *event)
-{
-        GNCAccountSel *gas = GNC_ACCOUNT_SEL(widget);
-        gint result;
-
-        result = (* GTK_WIDGET_CLASS (parent_class)->key_press_event)(widget, event);
-
-        switch (event->keyval)
-        {
-        case GDK_Tab:
-                /* FIXME: += equivalent keys. */
-                break;
-                if (event->state & (GDK_CONTROL_MASK | GDK_MOD1_MASK | GDK_SHIFT_MASK))
-                        break;
-                return result;
-        case GDK_KP_Enter:
-                break;
-        default:
-                return result;
-        }
-
-        return TRUE;
-}
-#endif /* 0 -- completion not implemented */
-
 GtkWidget *
 gnc_account_sel_new (void)
 {
@@ -355,47 +252,56 @@
         return GTK_WIDGET (gas);
 }
 
-GtkWidget *
-gnc_account_sel_gtk_entry (GNCAccountSel *gas)
+typedef struct {
+  GNCAccountSel *gas;
+  Account *acct;
+} gas_find_data;
+
+static
+gboolean
+gnc_account_sel_find_account (GtkTreeModel *model,
+			      GtkTreePath *path,
+			      GtkTreeIter *iter,
+			      gas_find_data *data)
 {
-        g_return_val_if_fail(gas != NULL, NULL);
-        g_return_val_if_fail(GNC_IS_ACCOUNT_SEL(gas), NULL);
+  Account *model_acc;
 
-        return (GtkWidget *)gas->combo->entry;
-}
+  gtk_tree_model_get(model, iter, ACCT_COL_PTR, &model_acc, -1);
+  if (data->acct != model_acc)
+    return FALSE;
 
+  gtk_combo_box_set_active_iter(GTK_COMBO_BOX(data->gas->combo), iter);
+  return TRUE;
+}
 void
 gnc_account_sel_set_account( GNCAccountSel *gas, Account *acct )
 {
-        gchar *acctStr;
+	gas_find_data data;
 
-        if ( acct == NULL ) {
-                gtk_list_select_item( GTK_LIST(gas->combo->list), 0 );
+	gtk_combo_box_set_active( GTK_COMBO_BOX(gas->combo), -1 );
+        if ( acct == NULL )
                 return;
-        }
-        acctStr = xaccAccountGetFullName( acct );
-        gtk_entry_set_text( GTK_ENTRY(gas->combo->entry), acctStr );
-        g_free( acctStr );
+
+	data.gas = gas;
+	data.acct = acct;
+	gtk_tree_model_foreach(GTK_TREE_MODEL(gas->store),
+			       (GtkTreeModelForeachFunc)gnc_account_sel_find_account,
+			       &data);
 }
 
 Account*
 gnc_account_sel_get_account( GNCAccountSel *gas )
 {
-        AccountGroup *ag;
-        Account *ret;
-        gchar *txt;
+	GtkTreeIter iter;
+        Account *acc;
 
-        ret = NULL;
-        txt = gtk_editable_get_chars( GTK_EDITABLE(gas->combo->entry), 0, -1 );
-        g_assert( txt != NULL );
-        if ( strlen(txt) == 0 ) {
-                goto cleanup;
-        }
-        ag = gnc_book_get_group( gnc_get_current_book() );
-        ret = xaccGetAccountFromFullName( ag, txt );
- cleanup:
-        g_free( txt );
-        return ret;
+	if (!gtk_combo_box_get_active_iter(GTK_COMBO_BOX(gas->combo), &iter))
+	  return NULL;
+
+	gtk_tree_model_get(GTK_TREE_MODEL(gas->store), &iter,
+			   ACCT_COL_PTR, &acc,
+			   -1);
+        return acc;
 }
 
 
@@ -500,3 +406,53 @@
 	else
 	  gnc_ui_new_account_with_types( NULL, gas->acctTypeFilters );
 }
+
+gint
+gnc_account_sel_get_num_account( GNCAccountSel *gas )
+{
+  if (NULL == gas)
+    return 0;
+  return gtk_tree_model_iter_n_children( GTK_TREE_MODEL(gas->store), NULL );
+}
+
+void
+gnc_account_sel_purge_account( GNCAccountSel *gas,
+			       Account *target,
+			       gboolean recursive)
+{
+  GtkTreeModel *model = GTK_TREE_MODEL(gas->store);
+  GtkTreeIter iter;
+  Account *acc;
+  gboolean more;
+
+  if (!gtk_tree_model_get_iter_first(model, &iter))
+    return;
+
+  if (!recursive) {
+    do {
+      gtk_tree_model_get(model, &iter, ACCT_COL_PTR, &acc, -1);
+      if (acc == target) {
+	gtk_list_store_remove(gas->store, &iter);
+	break;
+      }
+    } while (gtk_tree_model_iter_next(model, &iter));
+  } else {
+    do {
+      gtk_tree_model_get(model, &iter, ACCT_COL_PTR, &acc, -1);
+      while (acc) {
+	if (acc == target)
+	  break;
+	acc = xaccAccountGetParentAccount(acc);
+      }
+
+      if (acc == target)
+	more = gtk_list_store_remove(gas->store, &iter);
+      else
+	more = gtk_tree_model_iter_next(model, &iter);
+    } while (more);
+  }
+
+  gtk_combo_box_set_active(GTK_COMBO_BOX(gas->combo), 0);
+}
+
+

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-account-sel.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,6 +6,7 @@
  * freshly-retreived account list, the widget will re-select that account.
  *
  * Copyright (C) 2002 Joshua Sled <jsled at asynchronous.org>
+ * Copyright (c) 2006 David Hampton <hampton at employees.org>
  * All rights reserved.
  **/
 
@@ -42,7 +43,8 @@
         GtkHBox hbox;
         gboolean initDone;
 	gboolean isModal;
-        GtkCombo *combo;
+	GtkListStore *store;
+        GtkComboBoxEntry *combo;
         GList *acctTypeFilters;
         gint eventHandlerId;
         /* The state of this pointer also serves as a flag about what state
@@ -64,7 +66,7 @@
 
 GType      gnc_account_sel_get_type (void);
 GtkWidget* gnc_account_sel_new (void);
-GtkWidget* gnc_account_sel_gtk_entry (GNCAccountSel *gas);
+
 /**
  * Sets the GAS to the given account.  If the account doesn't exist in the
  * list, then it doesn't change the state of the GAS.  If the account is
@@ -99,4 +101,7 @@
 void gnc_account_sel_set_new_account_modal( GNCAccountSel *gas,
                                               gboolean state );
 
+gint gnc_account_sel_get_num_account( GNCAccountSel *gas );
+void gnc_account_sel_purge_account( GNCAccountSel *gas, Account *acc, gboolean recursive);
+
 #endif /* !ndef GNC_ACCOUNT_SEL_H */

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-currency-edit.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-currency-edit.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-currency-edit.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -64,6 +64,7 @@
 
 #include "gnc-currency-edit.h"
 #include "gnc-commodity.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-ui-util.h"
 
 static void gnc_currency_edit_init         (GNCCurrencyEdit      *gce);
@@ -74,8 +75,7 @@
 /** The instance private data for a content plugin. */
 typedef struct _GNCCurrencyEditPrivate
 {
-	gint last_index;	/**< Last valid GtkListStore index  */
-	gulong changed_id;	/**< Signal handler id */
+	gint dummy;
 } GNCCurrencyEditPrivate;
 
 #define GET_PRIVATE(o)  \
@@ -139,135 +139,9 @@
 static void
 gnc_currency_edit_init (GNCCurrencyEdit *gce)
 {
-	GNCCurrencyEditPrivate *priv;
-
-	priv = GET_PRIVATE(gce);
-	priv->last_index = -1;
-	priv->changed_id = 0;
 }
 
 
-/** Find an entry in the GtkComboBoxEntry by its text value, and set
- *  the widget to that value.  This function also records the index of
- *  that text value for use when the user leaves the widget.
- *
- *  @param gce A pointer to a currency entry widget.
- *
- *  @param text The entry text to find in the model of the combo box
- *  entry. */
-static void
-gce_set_by_string(GNCCurrencyEdit *gce,
-		  const gchar *text)
-{
-	GNCCurrencyEditPrivate *priv;
-	GtkTreeModel *model;
-	GtkTreeIter iter;
-	GValue value = { 0 };
-	const gchar *tree_string;
-	gint result = 1;
-
-	priv = GET_PRIVATE(gce);
-	model = gtk_combo_box_get_model(GTK_COMBO_BOX(gce));
-	if (!gtk_tree_model_get_iter_first(model, &iter)) {
-		/* empty tree */
-		return;
-	}
-
-	do {
-		gtk_tree_model_get_value(model, &iter, 0, &value);
-		tree_string = g_value_get_string(&value);
-		result = strcmp(text, tree_string);
-		g_value_unset(&value);
-		if (result != 0)
-			continue;
-
-		/* Found a matching string */
-		g_signal_handler_block(gce, priv->changed_id);
-		gtk_combo_box_set_active_iter(GTK_COMBO_BOX(gce), &iter);
-		g_signal_handler_unblock(gce, priv->changed_id);
-		priv->last_index = gtk_combo_box_get_active(GTK_COMBO_BOX(gce));
-		return;
-	} while (gtk_tree_model_iter_next(model, &iter));
-}
-
-
-/**  The currency edit widget has changed its value.  If the widget
- *   now points to another valid currency name then record the index
- *   of that currency name for use when the user leaves the widget.
- *
- *   @param widget Unused.
- *
- *   @param gce A pointer to a currency entry widget. */
-static void
-gnc_changed_cb (GtkComboBox *widget,
-		GNCCurrencyEdit *gce)
-{
-	GNCCurrencyEditPrivate *priv;
-	gint current;
-
-	priv = GET_PRIVATE(gce);
-	current = gtk_combo_box_get_active(widget);
-	if (current == -1)
-		return;
-	priv->last_index = current;
-}
-
-
-/**  The completion attached to currency edit widget has selected a
- *   match.  This function extracts the completed string from the
- *   completion code's temporary model, and uses that to set the index
- *   of that currency name for use when the user leaves the widget.
- *   This should always point to a valid currency name since the user
- *   made the selection from a list of currency names.
- *
- *   @param completion Unused.
- *
- *   @param comp_model A temporary model used by completion code that
- *   contains only the current matches.
- *
- *   @param comp_iter The iter in the completion's temporary model
- *   that represents the user selected match.
- *
- *   @param gce A pointer to a currency entry widget. */
-static gboolean
-gnc_match_selected_cb (GtkEntryCompletion *completion,
-		       GtkTreeModel       *comp_model,
-		       GtkTreeIter        *comp_iter,
-		       GNCCurrencyEdit    *gce)
-{
-	gchar *text;
-
-	gtk_tree_model_get(comp_model, comp_iter, 0, &text, -1);
-	gce_set_by_string(gce, text);
-	return FALSE;
-}
-
-
-/**  The focus left the currency edit widget, so reset the widget to
- *   its last known good value.  If the widget value contained a valid
- *   currency then this is a noop.  Otherwise the widget will be reset
- *   to the last user selected currency.  This latter state will occur
- *   if the user has typed characters directly into the widget but not
- *   selected a completion.
- *
- *   @param entry Unused.
- *
- *   @param event Unused.
- *
- *   @param gce A pointer to a currency entry widget. */
-static gboolean
-gce_focus_out_cb (GtkEntry *entry,
-		  GdkEventFocus *event,
-		  GNCCurrencyEdit *gce)
-{
-	GNCCurrencyEditPrivate *priv;
-
-	priv = GET_PRIVATE(gce);
-	gtk_combo_box_set_active(GTK_COMBO_BOX(gce), priv->last_index);
-	return FALSE;
-}
-
-
 /** This auxiliary function adds a single currency name to the combo
  *  box.  It is called as an iterator function when running a list of
  *  currencies.
@@ -316,11 +190,8 @@
 GtkWidget *
 gnc_currency_edit_new (void)
 {
-	GNCCurrencyEditPrivate *priv;
 	GNCCurrencyEdit *gce;
 	GtkListStore *store;
-	GtkEntry *entry;
-	GtkEntryCompletion* completion;
 
 	store = gtk_list_store_new (1, G_TYPE_STRING);
 	gce = g_object_new (GNC_TYPE_CURRENCY_EDIT,
@@ -329,24 +200,9 @@
 			    NULL);
 	g_object_unref (store);
 
-	/* Set up completion on the entry */
-	entry = GTK_ENTRY(gtk_bin_get_child(GTK_BIN(gce)));
-	completion = gtk_entry_completion_new();
-	gtk_entry_completion_set_model(completion,
-				       GTK_TREE_MODEL(store));
-	gtk_entry_completion_set_text_column(completion, 0);
-	gtk_entry_set_completion(entry, completion);
-
 	/* Now the signals to make sure the user can't leave the
 	   widget without a valid currency. */
-	priv = GET_PRIVATE(gce);
-	priv->changed_id =
-		g_signal_connect(gce, "changed",
-				 G_CALLBACK(gnc_changed_cb), gce);
-	g_signal_connect(completion, "match_selected",
-			 G_CALLBACK(gnc_match_selected_cb), gce);
-	g_signal_connect(entry, "focus-out-event",
-			 G_CALLBACK(gce_focus_out_cb), gce);
+	gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(gce));
 
 	/* Fill in all the data. */
 	fill_currencies (gce);
@@ -378,7 +234,7 @@
         g_return_if_fail(currency != NULL);
 	
 	printname = gnc_commodity_get_printname(currency);
-	gce_set_by_string(gce, printname);
+	gnc_cbe_set_by_string(GTK_COMBO_BOX_ENTRY(gce), printname);
 }
 
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -158,8 +158,8 @@
 gnc_date_delta_init (GNCDateDelta *gdd)
 {
   gdd->value_spin = NULL;
-  gdd->units_menu = NULL;
-  gdd->polarity_menu = NULL;
+  gdd->units_combo = NULL;
+  gdd->polarity_combo = NULL;
 
   gdd->units = 0;
   gdd->polarity = 0;
@@ -194,93 +194,59 @@
 }
 
 static void
-set_units (GtkWidget *widget, gpointer data)
+set_units (GtkComboBox *combo, GNCDateDelta *gdd)
 {
-  GNCDateDeltaUnits units;
-  GNCDateDelta *gdd;
+  gint active;
 
-  units = GPOINTER_TO_INT(data);
-  gdd = GNC_DATE_DELTA(g_object_get_data(G_OBJECT(widget), GDD_LABEL));
+  active = gtk_combo_box_get_active(GTK_COMBO_BOX(gdd->units_combo));
+  if ((active < GNC_DATE_DELTA_DAYS) || (active > GNC_DATE_DELTA_YEARS))
+    active = GNC_DATE_DELTA_DAYS;
+  gdd->units = active;
 
-  gdd->units = units;
-
   g_signal_emit (gdd, date_delta_signals [UNITS_CHANGED], 0);
   g_signal_emit (gdd, date_delta_signals [DELTA_CHANGED], 0);
 }
 
 static void
-fill_units_menu(GNCDateDelta *gdd)
+fill_units_combo(GNCDateDelta *gdd)
 {
-  GtkWidget *menu;
-  GtkWidget *item;
-  char *strings[] = {
-    _("Days"),
-    _("Weeks"),
-    _("Months"),
-    _("Years"),
-    NULL
-  };
-  gint i;
+  gtk_combo_box_append_text(GTK_COMBO_BOX(gdd->units_combo),
+			    _("Days"));
+  gtk_combo_box_append_text(GTK_COMBO_BOX(gdd->units_combo),
+			    _("Weeks"));
+  gtk_combo_box_append_text(GTK_COMBO_BOX(gdd->units_combo),
+			    _("Months"));
+  gtk_combo_box_append_text(GTK_COMBO_BOX(gdd->units_combo),
+			    _("Years"));
 
-  menu = gtk_menu_new ();
-  gtk_widget_show(menu);
-
-  for (i = 0; strings[i] != NULL; i++)
-  {
-    item = gtk_menu_item_new_with_label (strings[i]);
-    g_object_set_data(G_OBJECT(item), GDD_LABEL, gdd);
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-    gtk_widget_show(item);
-
-    g_signal_connect (item, "activate",
-		      G_CALLBACK (set_units), GINT_TO_POINTER(i));
-  }
-
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (gdd->units_menu), menu);
+  g_signal_connect (gdd->units_combo, "changed",
+		    G_CALLBACK (set_units), gdd);
 }
 
 static void
-set_polarity (GtkWidget *widget, gpointer data)
+set_polarity (GtkComboBox *combo, GNCDateDelta *gdd)
 {
-  GNCDateDeltaPolarity polarity;
-  GNCDateDelta *gdd;
+  gint active;
 
-  polarity = GPOINTER_TO_INT(data);
-  gdd = GNC_DATE_DELTA(g_object_get_data(G_OBJECT(widget), GDD_LABEL));
+  active = gtk_combo_box_get_active(GTK_COMBO_BOX(gdd->units_combo));
+  if ((active < GNC_DATE_DELTA_PAST) || (active > GNC_DATE_DELTA_FUTURE))
+    active = GNC_DATE_DELTA_PAST;
+  gdd->polarity = active;
 
-  gdd->polarity = polarity;
-
   g_signal_emit (gdd, date_delta_signals [POLARITY_CHANGED], 0);
   g_signal_emit (gdd, date_delta_signals [DELTA_CHANGED], 0);
 }
 
 static void
-fill_polarity_menu(GNCDateDelta *gdd)
+fill_polarity_combo(GNCDateDelta *gdd)
 {
-  GtkWidget *menu;
-  GtkWidget *item;
-  char *strings[] = {
-    _("Ago"),
-    _("From Now"),
-    NULL
-  };
-  gint i;
+  gtk_combo_box_append_text(GTK_COMBO_BOX(gdd->polarity_combo),
+			    _("Ago"));
+  gtk_combo_box_append_text(GTK_COMBO_BOX(gdd->polarity_combo),
+			    _("From Now"));
 
-  menu = gtk_menu_new ();
-  gtk_widget_show(menu);
-
-  for (i = 0; strings[i] != NULL; i++)
-  {
-    item = gtk_menu_item_new_with_label (strings[i]);
-    g_object_set_data(G_OBJECT(item), GDD_LABEL, gdd);
-    gtk_menu_shell_append (GTK_MENU_SHELL (menu), item);
-    gtk_widget_show(item);
-
-    g_signal_connect (item, "activate",
-		      G_CALLBACK (set_polarity), GINT_TO_POINTER(i));
-  }
-
-  gtk_option_menu_set_menu (GTK_OPTION_MENU (gdd->polarity_menu), menu);
+  g_signal_connect (gdd->polarity_combo, "changed",
+		    G_CALLBACK(set_polarity), gdd);
 }
 
 static void
@@ -297,18 +263,18 @@
   g_signal_connect(gdd->value_spin, "changed",
 		   G_CALLBACK(value_changed), gdd);
 
-  gdd->units_menu = gtk_option_menu_new();
-  fill_units_menu(gdd);
-  gtk_option_menu_set_history(GTK_OPTION_MENU(gdd->units_menu), 0);
-  gtk_box_pack_start(GTK_BOX(gdd), gdd->units_menu, FALSE, FALSE, 0);
-  gtk_widget_show(gdd->units_menu);
+  gdd->units_combo = gtk_combo_box_new_text();
+  fill_units_combo(gdd);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(gdd->units_combo), 0);
+  gtk_box_pack_start(GTK_BOX(gdd), gdd->units_combo, FALSE, FALSE, 0);
+  gtk_widget_show(gdd->units_combo);
 
-  gdd->polarity_menu = gtk_option_menu_new();
-  fill_polarity_menu(gdd);
-  gtk_option_menu_set_history(GTK_OPTION_MENU(gdd->polarity_menu), 0);
-  gtk_box_pack_start(GTK_BOX(gdd), gdd->polarity_menu, FALSE, FALSE, 0);
+  gdd->polarity_combo = gtk_combo_box_new_text();
+  fill_polarity_combo(gdd);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(gdd->polarity_combo), 0);
+  gtk_box_pack_start(GTK_BOX(gdd), gdd->polarity_combo, FALSE, FALSE, 0);
   if (gdd->show_polarity)
-    gtk_widget_show(gdd->polarity_menu);
+    gtk_widget_show(gdd->polarity_combo);
 }
 
 /**
@@ -382,7 +348,7 @@
 
   gdd->units = units;
 
-  gtk_option_menu_set_history(GTK_OPTION_MENU(gdd->units_menu), units);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(gdd->units_combo), units);
 }
 
 /**
@@ -417,7 +383,7 @@
 
   gdd->polarity = polarity;
 
-  gtk_option_menu_set_history(GTK_OPTION_MENU(gdd->polarity_menu), polarity);
+  gtk_combo_box_set_active(GTK_COMBO_BOX(gdd->polarity_combo), polarity);
 }
 
 /**
@@ -451,7 +417,7 @@
   gdd->show_polarity = show_polarity;
 
   if (show_polarity)
-    gtk_widget_show(gdd->polarity_menu);
+    gtk_widget_show(gdd->polarity_combo);
   else
-    gtk_widget_hide(gdd->polarity_menu);
+    gtk_widget_hide(gdd->polarity_combo);
 }

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-delta.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -54,8 +54,8 @@
   GtkHBox hbox;
 
   GtkWidget *value_spin;
-  GtkWidget *units_menu;
-  GtkWidget *polarity_menu;
+  GtkWidget *units_combo;
+  GtkWidget *polarity_combo;
 
   GNCDateDeltaUnits units;
   GNCDateDeltaPolarity polarity;

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-format.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-format.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-date-format.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -41,6 +41,10 @@
 #include "gnc-date-format.h"
 #include "dialog-utils.h"
 
+#ifndef HAVE_LOCALTIME_R
+# include "localtime_r.h"
+#endif
+
 /* Perhaps it's better just to use MAX_DATE_LENGTH defined in gnc-date.h */
 #define MAX_DATE_LEN 80
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-dialog.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-dialog.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-dialog.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -18,6 +18,7 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org
  */
 
+#include "config.h"
 #include <gtk/gtk.h>
 #include <glade/glade.h>
 

Deleted: gnucash/branches/register-rewrite/src/gnome-utils/gnc-dir.h.in
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-dir.h.in	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-dir.h.in	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,30 +0,0 @@
-/**-*- c -*-*********************************************************\
- * gnc-dir.h -- directories for GnuCash                             *
- * Copyright (C) 2001 Gnumatic, Inc.                                *
- *                                                                  *
- * 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_DIR_H
-#define GNC_DIR_H
-
-#define GNC_ACCOUNTS_DIR "@-GNC_ACCOUNTS_DIR-@"
-#define GNC_GLADE_DIR "@-GNC_GLADE_DIR-@"
-#define GNC_GCONF_DIR "@-GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY-@"
-
-#endif

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-file-gnome.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-file-gnome.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-file-gnome.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -122,6 +122,7 @@
   return res;
 }
 
+#ifdef HAVE_GLOB_H
 static int
 gnc_dpfg_file_err(const char *path, int err)
 {
@@ -132,6 +133,7 @@
 
   return (res == GTK_RESPONSE_OK ? 0 : 1);
 }
+#endif
 
 /* Return TRUE if we have a valid file... */
 static gboolean

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -11,6 +11,12 @@
 #include "gnc-ui.h"
 #include "gnc-gui-query.h"
 
+enum file_cols {
+  FILE_COL_FILENAME = 0,
+  FILE_COL_POINTER,
+  NUM_FILE_COLS
+};
+
 static void gnc_druid_provider_multifile_gnome_class_init	(GNCDruidProviderMultifileGnomeClass *class);
 static void gnc_druid_provider_multifile_gnome_finalize		(GObject *obj);
 
@@ -52,13 +58,19 @@
 }
 
 static void
-gnc_dpmfg_select_file_cb(GtkCList *clist, int row, int column, GdkEvent *event,
-			 gpointer user_data)
+gnc_dpmfg_select_file_cb(GtkTreeSelection *selection,
+			 GNCDruidProviderMultifileGnome *prov_mf)
 {
-  GNCDruidProviderMultifileGnome *prov_mf = user_data;
-  gpointer file = gtk_clist_get_row_data(clist, row);
+  GtkTreeModel *model;
+  GtkTreeIter iter;
 
-  prov_mf->selected_file = file;
+  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
+    gtk_tree_model_get(model, &iter,
+		       FILE_COL_POINTER, &prov_mf->selected_file,
+		       -1);
+  } else {
+    prov_mf->selected_file = NULL;
+  }
 }
 
 static void
@@ -66,35 +78,46 @@
 {
   GNCDruidProviderDescMultifile *desc_mf =
     GNC_DRUID_PROVIDER_DESC_MULTIFILE(prov_mf->parent.desc);
-  GtkCList *clist = GTK_CLIST(prov_mf->list);
+  GtkTreeView *view = GTK_TREE_VIEW(prov_mf->file_view);
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeSelection *selection;
+  GtkTreeRowReference *reference = NULL;
   GList *list;
   const gchar* filename;
-  gint row = 0;
-  gint sel_row = -1;
   gpointer be_ctx = prov_mf->parent.druid->be_ctx;
 
-  gtk_clist_freeze(clist);
-  gtk_clist_clear(clist);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+  gtk_list_store_clear(store);
 
   for (list = desc_mf->get_files(be_ctx); list; list = list->next) {
     filename = desc_mf->get_filename(be_ctx, list->data);
 
-    row = gtk_clist_append(clist, (char**)&filename);
-    gtk_clist_set_row_data(clist, row, list->data);
-
-    if (prov_mf->selected_file == list->data)
-      sel_row = row;
+    gtk_list_store_prepend(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       FILE_COL_FILENAME, filename,
+		       FILE_COL_POINTER, list->data,
+		       -1);
+    if (prov_mf->selected_file == list->data) {
+      path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+      gtk_tree_path_free(path);
+    }
   }
 
-  gtk_clist_thaw(clist);
-
-  if(sel_row >= 0)
-    gtk_clist_select_row(clist, sel_row, 0);
-  else
+  if (reference) {
+    path = gtk_tree_row_reference_get_path(reference);
+    gtk_tree_row_reference_free(reference);
+    if (path) {
+      selection = gtk_tree_view_get_selection(view);
+      gtk_tree_selection_select_path(selection, path);
+      gtk_tree_view_scroll_to_cell(view, path, NULL, TRUE, 0.5, 0.0);
+      gtk_tree_path_free(path);
+    }
+  } else {
     prov_mf->selected_file = NULL;
-  
-  /* hopefully we don't need to queue the actual window */
-  gtk_widget_queue_resize(GTK_WIDGET(prov_mf->page));
+  }
 }
 
 static GNCDruidPage*
@@ -188,8 +211,12 @@
   GNCDruidProviderMultifileGnome *prov;
   GNCDruidProviderDescMultifile *desc_mf;
   GNCDruidCB *cb;
-  GtkWidget *window, *page, *list, *button1, *button2, *label;
+  GtkWidget *window, *page, *view, *button1, *button2, *label;
   GladeXML *xml;
+  GtkTreeViewColumn *column;
+  GtkCellRenderer *renderer;
+  GtkListStore *store;
+  GtkTreeSelection *selection;
 
   /* verify that this is the correct provider descriptor */
   g_return_val_if_fail(IS_GNC_DRUID_PROVIDER_DESC_MULTIFILE(desc), NULL);
@@ -218,7 +245,7 @@
   g_assert(xml);
   window = glade_xml_get_widget(xml, "Multifile Provider Window");
   page = glade_xml_get_widget(xml, "Multifile Provider Page");
-  list = glade_xml_get_widget(xml, "file_list");
+  view = glade_xml_get_widget(xml, "file_view");
   button1 = glade_xml_get_widget(xml, "load_button");
   button2 = glade_xml_get_widget(xml, "unload_button");
   label = glade_xml_get_widget(xml, "instruction_label");
@@ -233,11 +260,24 @@
   g_assert(page);
   prov->page = GNOME_DRUID_PAGE(page);
   prov_base->pages = g_list_prepend(NULL, page);
-  prov->list = list;
+  prov->file_view = view;
 
+  /* Set up the file view */
+  store = gtk_list_store_new (NUM_FILE_COLS, G_TYPE_STRING, G_TYPE_POINTER);
+  gtk_tree_view_set_model(GTK_TREE_VIEW(view), GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes("", renderer,
+						    "text", FILE_COL_FILENAME,
+						    NULL);
+  gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
+
+  selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+  g_signal_connect(selection, "changed",
+		   (GCallback)gnc_dpmfg_select_file_cb, prov);
+
   /* Set the page properties */
-  g_signal_connect(G_OBJECT(list), "select-row",
-		   (GCallback)gnc_dpmfg_select_file_cb, prov);
   g_signal_connect(G_OBJECT(button1), "clicked",
 		   (GCallback)gnc_dpmfg_load_another_cb, prov);
   g_signal_connect(G_OBJECT(button2), "clicked",

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-druid-provider-multifile-gnome.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -41,7 +41,7 @@
   GNCDruidProvider parent;
 
   GnomeDruidPage*	page;
-  GtkWidget*		list;
+  GtkWidget*		file_view;
 
   GNCDruidCB*		cb;
   gpointer		selected_file;

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-embedded-window.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-embedded-window.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-embedded-window.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -31,7 +31,6 @@
 
 #include "gnc-engine.h"
 #include "gnc-gnome-utils.h"
-#include "gnc-dir.h"
 #include "gnc-gobject-utils.h"
 #include "gnc-gui-query.h"
 #include "gnc-plugin.h"

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -26,7 +26,6 @@
 #include <errno.h>
 #include <libguile.h>
 #include <string.h>
-#include <g-wrap-wct.h>
 
 #include "dialog-utils.h"
 #include "druid-gnc-xml-import.h"
@@ -205,12 +204,12 @@
     case ERR_BACKEND_NO_ERR:
       uh_oh = FALSE;
       break;
-	
-	case ERR_BACKEND_NO_HANDLER: {
-		fmt = _("No suitable backend was found for %s.");
-		gnc_error_dialog(parent, fmt, newfile);
-		break;
-	}
+
+    case ERR_BACKEND_NO_HANDLER:
+      fmt = _("No suitable backend was found for %s.");
+      gnc_error_dialog(parent, fmt, newfile);
+      break;
+
     case ERR_BACKEND_NO_BACKEND:
       fmt = _("The URL %s is not supported by this version of GnuCash.");
       gnc_error_dialog (parent, fmt, newfile);
@@ -416,8 +415,12 @@
       break;
 
     case ERR_FILEIO_FILE_NOT_FOUND:
-      fmt = _("The file %s could not be found.");
-      gnc_error_dialog (parent, fmt, newfile);
+      if (type == GNC_FILE_DIALOG_SAVE) {
+        uh_oh = FALSE;
+      } else {
+        fmt = _("The file %s could not be found.");
+        gnc_error_dialog (parent, fmt, newfile);
+      }
       break;
 
     case ERR_FILEIO_FILE_TOO_OLD:
@@ -443,6 +446,11 @@
       gnc_error_dialog(parent, fmt, newfile);
       break;
 
+    case ERR_FILEIO_FILE_EACCES:
+      fmt = _("No read permission to read from file %s.");
+      gnc_error_dialog (parent, fmt, newfile);
+      break;
+
     case ERR_SQL_DB_TOO_OLD:
       fmt = _("This database is from an older version of GnuCash. "
               "Do you want to want to upgrade the database "
@@ -1063,7 +1071,8 @@
   }
 
   /* if the database doesn't exist, ask the user ... */
-  else if ((ERR_BACKEND_NO_SUCH_DB == io_err) ||
+  else if ((ERR_FILEIO_FILE_NOT_FOUND == io_err) ||
+           (ERR_BACKEND_NO_SUCH_DB == io_err) ||
            (ERR_SQL_DB_TOO_OLD == io_err))
   {
     if (FALSE == show_session_error (io_err, newfile, GNC_FILE_DIALOG_SAVE))

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-file.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -31,7 +31,6 @@
  * These utilities are written in a GUI-independent fashion, and should
  * work just fine with the Motif, gnome/gtk and Qt interfaces.
  * These utilities are appropriate for direct invocation from guile.
- * (they should be wrapped by g-wrap).
  *
  * These GUI utilities implement and maintain a single global "session"
  * that defines the currently edited account group.  In a sense, these

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * gnc-frequency.c -- GnuCash widget for frequency editing.         *
  * Copyright (C) 2001,2002 Joshua Sled <jsled at asynchronous.org>     *
  * Copyright (C) 2003 Linas Vepstas <linas at linas.org>               *
+ * 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   *
@@ -51,7 +52,7 @@
 
 static void gnc_frequency_class_init( GNCFrequencyClass *klass );
 
-static void freq_option_value_changed( GtkMenuShell *b, gpointer d );
+static void freq_combo_changed( GtkComboBox *b, gpointer d );
 static void start_date_changed( GNCDateEdit *gde, gpointer d );
 static void spin_changed_helper( GtkAdjustment *adj, gpointer d );
 
@@ -156,11 +157,11 @@
         GtkWidget   *o;
         GtkAdjustment  *adj;
 
-        static const struct optionMenuTuple {
+        static const struct comboBoxTuple {
                 char *name;
                 void (*fn)();
-        } optionMenus[] = {
-                { "freq_option",        freq_option_value_changed },
+        } comboBoxes[] = {
+                { "freq_combobox",      freq_combo_changed },
                 { "semimonthly_first",  semimonthly_sel_changed },
                 { "semimonthly_second", semimonthly_sel_changed },
                 { "monthly_day",        monthly_sel_changed },
@@ -191,8 +192,8 @@
         gf->gxml = gnc_glade_xml_new( "sched-xact.glade", "gncfreq_vbox" );
         o = glade_xml_get_widget( gf->gxml, "gncfreq_nb" );
         gf->nb = GTK_NOTEBOOK(o);
-        o = glade_xml_get_widget( gf->gxml, "freq_option" );
-        gf->freqOpt = GTK_OPTION_MENU(o);
+        o = glade_xml_get_widget( gf->gxml, "freq_combobox" );
+        gf->freqComboBox = GTK_COMBO_BOX(o);
         gf->startDate = GNC_DATE_EDIT(gnc_date_edit_new( time(NULL), FALSE, FALSE ));
         /* Add the new widget to the table. */
         {
@@ -206,17 +207,13 @@
         gf->vb = vb;
         gtk_container_add( GTK_CONTAINER(&gf->widget), GTK_WIDGET(gf->vb) );
 
-        /* initialize the option menus */
-        for ( i=0; optionMenus[i].name != NULL; i++ ) {
-                o = glade_xml_get_widget( gf->gxml, optionMenus[i].name );
-                gnc_option_menu_init( GTK_WIDGET(o) );
-                if ( optionMenus[i].fn != NULL ) {
-                        o = gtk_option_menu_get_menu(GTK_OPTION_MENU(o));
-                        /* FIXME: having the user-data be a struct of a
-                         * calendar name and the GNCFrequency would allow a
-                         * single callback fn */
-                        g_signal_connect( o, "selection-done",
-					  G_CALLBACK(optionMenus[i].fn), gf );
+        /* initialize the combo boxes */
+        for ( i=0; comboBoxes[i].name != NULL; i++ ) {
+                o = glade_xml_get_widget( gf->gxml, comboBoxes[i].name );
+		gtk_combo_box_set_active(GTK_COMBO_BOX(o), 0);
+                if ( comboBoxes[i].fn != NULL ) {
+                        g_signal_connect( o, "changed",
+					  G_CALLBACK(comboBoxes[i].fn), gf );
                 }
         }
 
@@ -281,7 +278,7 @@
         g_assert( page != -1 );
 
         gtk_notebook_set_current_page( gf->nb, page );
-        gtk_option_menu_set_history( gf->freqOpt, page );
+        gtk_combo_box_set_active( gf->freqComboBox, page );
 
         switch ( uift ) 
         {
@@ -425,7 +422,7 @@
                 gtk_spin_button_set_value( GTK_SPIN_BUTTON(o), monthlyMult );
                 /*  first date */
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_first" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o), firstDayOfMonth-1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o), firstDayOfMonth-1 );
                 /*  second date */
                 subFS = (FreqSpec*)(g_list_nth( list, 1 )->data);
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_second" );
@@ -434,7 +431,7 @@
                         PERR( "Inappropriate FreqSpec type\n" );
                         return;
                 }
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o), secondDayOfMonth-1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o), secondDayOfMonth-1 );
         }
         break;
         case UIFREQ_MONTHLY:
@@ -452,7 +449,7 @@
                 o = glade_xml_get_widget( gf->gxml, "monthly_spin" );
                 gtk_spin_button_set_value( GTK_SPIN_BUTTON(o), monthlyMult );
                 o = glade_xml_get_widget( gf->gxml, "monthly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o), dayOfMonth-1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o), dayOfMonth-1 );
                 /*  set the day-of-month */
         }
         break;
@@ -544,9 +541,9 @@
                 gtk_spin_button_set_value( GTK_SPIN_BUTTON(o),
                                            (int)rint(floor(monthlyMult / 12)) );
                 o = glade_xml_get_widget( gf->gxml, "yearly_month" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o), monthOffset );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o), monthOffset );
                 o = glade_xml_get_widget( gf->gxml, "yearly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o), dayOfMonth-1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o), dayOfMonth-1 );
         }
         break;
         default:
@@ -558,7 +555,7 @@
         g_signal_emit_by_name( gf, "changed" );
 }
 
-static void
+void
 gnc_frequency_setup_default( GNCFrequency *gf, FreqSpec *fs, GDate *date )
 {
    time_t secs;
@@ -581,7 +578,7 @@
       g_assert( page != -1 );
    
       gtk_notebook_set_current_page( gf->nb, page );
-      gtk_option_menu_set_history( gf->freqOpt, page );
+      gtk_combo_box_set_active( gf->freqComboBox, page );
    }
 
    /* Setup the start date */
@@ -757,7 +754,7 @@
                 tmpInt = gtk_spin_button_get_value_as_int( GTK_SPIN_BUTTON(o) );
 
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_first" );
-                day = gnc_option_menu_get_active( GTK_WIDGET(o) )+1;
+                day = gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1;
                 tmpFS = xaccFreqSpecMalloc(gnc_get_current_book ());
                 g_date_to_struct_tm( &gd, &stm);
                 if ( day >= stm.tm_mday ) {
@@ -771,7 +768,7 @@
                 xaccFreqSpecCompositeAdd( fs, tmpFS );
 
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_second" );
-                day = gnc_option_menu_get_active( GTK_WIDGET(o) )+1;
+                day = gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1;
                 tmpFS = xaccFreqSpecMalloc(gnc_get_current_book ());
                 tmpTimeT = gnc_date_edit_get_date( gf->startDate );
                 g_date_set_time_t( &gd, tmpTimeT );
@@ -796,7 +793,7 @@
                 g_date_to_struct_tm( &gd, &stm);
 
                 o = glade_xml_get_widget( gf->gxml, "monthly_day" );
-                day = gnc_option_menu_get_active( GTK_WIDGET(o) ) + 1;
+                day = gtk_combo_box_get_active( GTK_COMBO_BOX(o) ) + 1;
                 stm.tm_mday = day;
                 g_date_set_time_t( &gd, mktime( &stm ) );
                 xaccFreqSpecSetMonthly( fs, &gd, tmpInt );
@@ -857,7 +854,7 @@
 
         o = glade_xml_get_widget( ((GNCFrequency*)d)->gxml,
                                   "monthly_day" );
-        dayOfMonth = gnc_option_menu_get_active( GTK_WIDGET(o) ) + 1;
+        dayOfMonth = gtk_combo_box_get_active( GTK_COMBO_BOX(o) ) + 1;
 
         tmptt = gnc_date_edit_get_date( gf->startDate );
         tmptm = localtime( &tmptt );
@@ -888,10 +885,10 @@
         tmptm = localtime( &tmptt );
 
         o = glade_xml_get_widget( gf->gxml, "semimonthly_first" );
-        tmpint = gnc_option_menu_get_active( GTK_WIDGET(o) )+1;
+        tmpint = gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1;
         o = glade_xml_get_widget( gf->gxml, "semimonthly_second" );
-        if ( tmpint > gnc_option_menu_get_active( GTK_WIDGET(o) )+1 ) {
-                tmpint = gnc_option_menu_get_active( GTK_WIDGET(o) )+1;
+        if ( tmpint > gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1 ) {
+                tmpint = gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1;
         }
 
         tmptm->tm_mday = tmpint;
@@ -946,8 +943,8 @@
         time_t tmpTT;
         struct tm *tmpTm;
 
-        occur = gnc_option_menu_get_active( occurW );
-        day = gnc_option_menu_get_active( dayOfMonthW ) + 1;
+        occur = gtk_combo_box_get_active( GTK_COMBO_BOX(occurW) );
+        day = gtk_combo_box_get_active( GTK_COMBO_BOX(dayOfMonthW) ) + 1;
 
         tmpTT = gnc_date_edit_get_date( gf->startDate );
         tmpTm = localtime( &tmpTT );
@@ -975,9 +972,9 @@
         tmptm = localtime( &tmptt );
 
         o = glade_xml_get_widget( gf->gxml, "yearly_month" );
-        tmptm->tm_mon = gnc_option_menu_get_active( GTK_WIDGET(o) );
+        tmptm->tm_mon = gtk_combo_box_get_active( GTK_COMBO_BOX(o) );
         o = glade_xml_get_widget( gf->gxml, "yearly_day" );
-        tmptm->tm_mday = gnc_option_menu_get_active( GTK_WIDGET(o) )+1;
+        tmptm->tm_mday = gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1;
 
         /* FIXME: correct for
            option_menu_selected_day > min(31,correct_days_in_month)
@@ -1005,7 +1002,7 @@
 }
 
 static void
-freq_option_value_changed( GtkMenuShell *b, gpointer d )
+freq_combo_changed( GtkComboBox *b, gpointer d )
 {
         GNCFrequency *gf = (GNCFrequency*)d;
         int optIdx;
@@ -1015,7 +1012,7 @@
         GtkWidget *o;
 
         /* Set the new page. */
-        optIdx = gnc_option_menu_get_active( GTK_WIDGET(((GNCFrequency*)d)->freqOpt) );
+        optIdx = gtk_combo_box_get_active( GTK_COMBO_BOX(((GNCFrequency*)d)->freqComboBox) );
         gtk_notebook_set_current_page( ((GNCFrequency*)d)->nb, optIdx );
 
         /* setup initial values for new page, as possible. */
@@ -1033,45 +1030,45 @@
                 tmpTm->tm_mday += 14;
                 tmpDate = mktime( tmpTm );
                 tmpTm = localtime( &tmpDate );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             min( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  min( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_second" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             max( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  max( tmpTm->tm_mday, tmpDayOfMonth ) - 1 );
         }
         break;
         case UIFREQ_MONTHLY:
                 /* on the <startdate_dom> */
                 o = glade_xml_get_widget( gf->gxml, "monthly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mday - 1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mday - 1 );
                 break;
         case UIFREQ_QUARTERLY:
                 /* on the <startdate_dom> */
                 o = glade_xml_get_widget( gf->gxml, "quarterly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mday - 1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mday - 1 );
                 break;
         case UIFREQ_TRI_ANUALLY:
                 /* on the <startdate_dom> */
                 o = glade_xml_get_widget( gf->gxml, "triyearly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mday - 1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mday - 1 );
                 break;
         case UIFREQ_SEMI_YEARLY:
                 /* on the <startdate_dom> */
                 o = glade_xml_get_widget( gf->gxml, "semiyearly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mday - 1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mday - 1 );
                 break;
         case UIFREQ_YEARLY:
                 /* on the <startdate_mon>, <startdate_dom> */
                 o = glade_xml_get_widget( gf->gxml, "yearly_month" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mon );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mon );
                 o = glade_xml_get_widget( gf->gxml, "yearly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mday - 1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mday - 1 );
                 break;
         default:
                 /* nuttin can be done, for whatever reason. */
@@ -1088,10 +1085,10 @@
 {
         struct tm  *tmpTm;
         tmpTm = localtime( &startDate );
-        gtk_option_menu_set_history( GTK_OPTION_MENU(occurOptMenu),
-                                     tmpTm->tm_mon % monthsInRange );
-        gtk_option_menu_set_history( GTK_OPTION_MENU(dayOptMenu),
-                                     tmpTm->tm_mday - 1 );
+        gtk_combo_box_set_active( GTK_COMBO_BOX(occurOptMenu),
+				  tmpTm->tm_mon % monthsInRange );
+        gtk_combo_box_set_active( GTK_COMBO_BOX(dayOptMenu),
+				   tmpTm->tm_mday - 1 );
 }
 
 static void
@@ -1125,23 +1122,23 @@
         {
                 gint first_day;
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_first" );
-                first_day = gnc_option_menu_get_active( GTK_WIDGET(o) )+1;
+                first_day = gtk_combo_box_get_active( GTK_COMBO_BOX(o) )+1;
                 o = glade_xml_get_widget( gf->gxml, "semimonthly_second" );
-                if ( first_day < gnc_option_menu_get_active(
-                             GTK_WIDGET(o) )+1 ) {
+                if ( first_day < gtk_combo_box_get_active(
+                             GTK_COMBO_BOX(o) )+1 ) {
                         o = glade_xml_get_widget( gf->gxml,
                                                   "semimonthly_first" );
                 }
 
                 tmpTm = localtime( &dateFromGDE );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
                                              tmpTm->tm_mday-1 );
         }
         break;
         case UIFREQ_MONTHLY:
                 o = glade_xml_get_widget( gf->gxml, "monthly_day" );
                 tmpTm = localtime( &dateFromGDE );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
                                              (tmpTm->tm_mday-1) );
                 break;
         case UIFREQ_QUARTERLY:
@@ -1168,11 +1165,11 @@
         case UIFREQ_YEARLY:
                 o = glade_xml_get_widget( gf->gxml, "yearly_month" );
                 tmpTm = localtime( &dateFromGDE );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mon );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mon );
                 o = glade_xml_get_widget( gf->gxml, "yearly_day" );
-                gtk_option_menu_set_history( GTK_OPTION_MENU(o),
-                                             tmpTm->tm_mday-1 );
+                gtk_combo_box_set_active( GTK_COMBO_BOX(o),
+					  tmpTm->tm_mday-1 );
                 break;
         default:
                 PERR( "unknown uift value %d\n", uift );

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-frequency.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,7 +45,7 @@
 
   	GtkVBox         *vb;
 	GtkNotebook     *nb;
-	GtkOptionMenu   *freqOpt;
+	GtkComboBox     *freqComboBox;
 	GNCDateEdit     *startDate;
 	GladeXML        *gxml;
 } GNCFrequency;
@@ -102,4 +102,7 @@
  */
 void gnc_frequency_set_date_label_text (GNCFrequency *gf, const gchar *txt);
 
+void
+gnc_frequency_setup_default( GNCFrequency *gf, FreqSpec *fs, GDate *date );
+
 #endif /* !defined( GNC_FREQUENCY_H ) */

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-gnome-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-gnome-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-gnome-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -38,6 +38,7 @@
 #include "gnc-gnome-utils.h"
 #include "gnc-html.h"
 #include "gnc-engine.h"
+#include "gnc-path.h"
 #include "gnc-ui.h"
 #include "gnc-file.h"
 #include "gnc-hooks.h"
@@ -52,7 +53,6 @@
 #include "dialog-totd.h"
 #include "gnc-ui-util.h"
 #include "gnc-session.h"
-#include <gnc-dir.h>
 
 static QofLogModule log_module = GNC_MOD_GUI;
 static GnomeProgram *gnucash_program = NULL;
@@ -194,12 +194,24 @@
 {
   char *fullname;
   GError *error = NULL;
+  gchar *prefix = gnc_path_get_prefix ();
+  gchar *pkgsysconfdir = gnc_path_get_pkgsysconfdir ();
+  gchar *pkgdatadir = gnc_path_get_pkgdatadir ();
+  gchar *pkglibdir = gnc_path_get_pkglibdir ();
 
   gnc_gtk_add_rc_file();
   gnucash_program = gnome_program_init(
       "gnucash", version, LIBGNOMEUI_MODULE,
       argc, argv,
-      GNOME_PROGRAM_STANDARD_PROPERTIES, GNOME_PARAM_NONE);
+      GNOME_PARAM_APP_PREFIX, prefix,
+      GNOME_PARAM_APP_SYSCONFDIR, pkgsysconfdir,
+      GNOME_PARAM_APP_DATADIR, pkgdatadir,
+      GNOME_PARAM_APP_LIBDIR, pkglibdir,
+      GNOME_PARAM_NONE);
+  g_free (prefix);
+  g_free (pkgsysconfdir);
+  g_free (pkgdatadir);
+  g_free (pkglibdir);
 
   /* initialization required for gtkhtml */
   gtk_widget_set_default_colormap (gdk_rgb_get_colormap ());
@@ -385,7 +397,8 @@
         return main_window;
     }
 
-    gnc_gui_init_splash();
+    if (gnc_gconf_get_bool(GCONF_GENERAL, "show_splash_screen", NULL))
+        gnc_gui_init_splash();
 
     gnome_is_initialized = TRUE;
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-html.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-html.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-html.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -175,9 +175,6 @@
 void gnc_html_set_button_cb(gnc_html * html, GncHTMLButtonCB button_cb,
                             gpointer data);
 
-GtkWidget   * gnc_html_get_container_widget(gnc_html * html);
-GtkWidget   * gnc_html_get_html_widget(gnc_html * html); 
-
 /* Initialize the html subsystem */
 void gnc_html_initialize (void);
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -37,6 +37,8 @@
 
 #include <gnome.h>
 #include <glib/gi18n.h>
+#include <libguile.h>
+#include "guile-mappings.h"
 #ifndef HAVE_GLIB26
 #include "gkeyfile.h"
 #endif
@@ -83,7 +85,10 @@
 #define PLUGIN_PAGE_CLOSE_BUTTON "close-button"
 
 #define KEY_SHOW_CLOSE_BUTTON	"tab_close_buttons"
+#define KEY_TAB_POSITION	"tab_position"
 
+#define GNC_MAIN_WINDOW_NAME "GncMainWindow"
+
 /* Static Globals *******************************************************/
 
 /** The debugging module that this .o belongs to.  */
@@ -108,6 +113,9 @@
 /* Callbacks */
 static void gnc_main_window_add_widget (GtkUIManager *merge, GtkWidget *widget, GncMainWindow *window);
 static void gnc_main_window_switch_page (GtkNotebook *notebook, GtkNotebookPage *notebook_page, gint pos, GncMainWindow *window);
+#ifdef HAVE_GTK_2_10
+static void gnc_main_window_page_reordered (GtkNotebook *notebook, GtkWidget *child, guint pos, GncMainWindow *window);
+#endif
 static void gnc_main_window_plugin_added (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
 static void gnc_main_window_plugin_removed (GncPlugin *manager, GncPlugin *plugin, GncMainWindow *window);
 
@@ -423,7 +431,8 @@
  *  @param data A data structure containing state about the
  *  window/page restoration process. */
 static void
-gnc_main_window_restore_page (GncMainWindow *window, GncMainWindowSaveData *data)
+gnc_main_window_restore_page (GncMainWindow *window, 
+                              GncMainWindowSaveData *data)
 {
   GncMainWindowPrivate *priv;
   GncPluginPage *page;
@@ -432,10 +441,12 @@
   GError *error = NULL;
 
   ENTER("window %p, data %p (key file %p, window %d, page start %d, page num %d)",
-	window, data, data->key_file, data->window_num, data->page_offset, data->page_num);
+	window, data, data->key_file, data->window_num, data->page_offset, 
+        data->page_num);
 
   priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
-  page_group = g_strdup_printf(PAGE_STRING, data->page_offset + data->page_num);
+  page_group = g_strdup_printf(PAGE_STRING, 
+                               data->page_offset + data->page_num);
   page_type = g_key_file_get_string(data->key_file, page_group,
 				    PAGE_TYPE, &error);
   if (error) {
@@ -577,8 +588,8 @@
 	     (pos[0] > gdk_screen_width()) ||
 	     (pos[1] + (geom ? geom[1] : 0) < 0) ||
 	     (pos[1] > gdk_screen_height())) {
-    g_debug("position %dx%d, size%dx%d is offscreen; will not move",
-	    pos[0], pos[1], geom[0], geom[1]);
+//    g_debug("position %dx%d, size%dx%d is offscreen; will not move",
+//	    pos[0], pos[1], geom[0], geom[1]);
   } else {
     gtk_window_move(GTK_WINDOW(window), pos[0], pos[1]);
     DEBUG("window (%p) position %dx%d", window, pos[0], pos[1]);
@@ -767,7 +778,7 @@
   /* Save page ordering within the notebook. Use +1 notation so the
    * numbers in the page order match the page sections, at least for
    * the one window case. */
-  order = malloc(sizeof(gint) * num_pages);
+  order = g_malloc(sizeof(gint) * num_pages);
   for (i = 0; i < num_pages; i++) {
     gpointer page = g_list_nth_data(priv->usage_order, i);
     order[i] = g_list_index(priv->installed_pages, page) + 1;
@@ -990,13 +1001,6 @@
 {
   static gboolean already_dead = FALSE;
   QofSession *session;
-  GtkWidget *dialog;
-  gint response;
-  const gchar *title = _("Quit GnuCash?");
-  const gchar *message =_("You are attempting to close the last "
-			  "GnuCash window.  Doing so will quit the "
-			  "application.  Are you sure that this is "
-			  "what you want to do?");
 
   if (already_dead)
     return TRUE;
@@ -1020,26 +1024,10 @@
     return TRUE;
   }
 
-  dialog = gtk_message_dialog_new(GTK_WINDOW(window),
-				  GTK_DIALOG_MODAL,
-				  GTK_MESSAGE_WARNING,
-				  GTK_BUTTONS_NONE,
-				  "%s", title);
-  gtk_message_dialog_format_secondary_text(GTK_MESSAGE_DIALOG(dialog),
-					   "%s", message);
-  gtk_dialog_add_buttons(GTK_DIALOG(dialog),
-			 GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
-			 GTK_STOCK_QUIT, GTK_RESPONSE_OK,
-			 NULL);
-  gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_OK);
-  response = gtk_dialog_run (GTK_DIALOG (dialog));
-  gtk_widget_destroy(dialog);
+  /* Tell gnucash to shutdown cleanly */
+  g_timeout_add(250, gnc_main_window_timed_quit, NULL);
+  already_dead = TRUE;
 
-  if (response == GTK_RESPONSE_OK) {
-    /* Tell gnucash to shutdown cleanly */
-    g_timeout_add(250, gnc_main_window_timed_quit, NULL);
-    already_dead = TRUE;
-  }
   return TRUE;
 }
 
@@ -1820,8 +1808,10 @@
 	  /* Update the "Windows" menu in all other windows */
 	  gnc_main_window_update_all_menu_items();
 
-	  gnc_gconf_remove_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE);
-	  gnc_gconf_remove_notification(G_OBJECT(window), GCONF_GENERAL);
+	  gnc_gconf_remove_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE,
+					GNC_MAIN_WINDOW_NAME);
+	  gnc_gconf_remove_notification(G_OBJECT(window), GCONF_GENERAL,
+					GNC_MAIN_WINDOW_NAME);
 
 	  qof_event_unregister_handler(priv->event_handler_id);
 	  priv->event_handler_id = 0;
@@ -1889,6 +1879,9 @@
 	priv->usage_order = g_list_prepend (priv->usage_order, page);
 	gtk_notebook_append_page_menu (notebook, page->notebook_page,
 				       tab_hbox, menu_label);
+#ifdef HAVE_GTK_2_10
+	gtk_notebook_set_tab_reorderable (notebook, page->notebook_page, TRUE);
+#endif
 	gnc_plugin_page_inserted (page);
 	gtk_notebook_set_current_page (notebook, -1);
 	if (GNC_PLUGIN_PAGE_GET_CLASS(page)->window_changed)
@@ -2363,6 +2356,28 @@
 	LEAVE("");
 }
 
+static void
+gnc_main_window_update_tab_position (GncMainWindow *window)
+{
+	GtkPositionType position = GTK_POS_TOP;
+	gchar *conf_string;
+	GncMainWindowPrivate *priv;
+
+	ENTER ("window %p", window);
+	conf_string = gnc_gconf_get_string (GCONF_GENERAL,
+					    KEY_TAB_POSITION, NULL);
+	if (conf_string) {
+		position = gnc_enum_from_nick (GTK_TYPE_POSITION_TYPE,
+					       conf_string, GTK_POS_TOP);
+		g_free (conf_string);
+	}
+
+	priv = GNC_MAIN_WINDOW_GET_PRIVATE (window);
+	gtk_notebook_set_tab_pos (GTK_NOTEBOOK (priv->notebook), position);
+
+	LEAVE ("");
+}
+
 /*
  * Based on code from Epiphany (src/ephy-window.c)
  */
@@ -2496,6 +2511,8 @@
 	  key_tail++;
 	if (strcmp(key_tail, KEY_TOOLBAR_STYLE) == 0) {
 	  gnc_main_window_update_toolbar(window);
+	} else if (strcmp(key_tail, KEY_TAB_POSITION) == 0) {
+	  gnc_main_window_update_tab_position(window);
 	}
 }
 
@@ -2623,6 +2640,10 @@
 	gtk_widget_show (priv->notebook);
 	g_signal_connect (G_OBJECT (priv->notebook), "switch-page",
 			  G_CALLBACK (gnc_main_window_switch_page), window);
+#ifdef HAVE_GTK_2_10
+	g_signal_connect (G_OBJECT (priv->notebook), "page-reordered",
+			  G_CALLBACK (gnc_main_window_page_reordered), window);
+#endif
 	gtk_box_pack_start (GTK_BOX (main_vbox), priv->notebook,
 			    TRUE, TRUE, 0);
 
@@ -2696,10 +2717,13 @@
 	g_free(filename);
 
 	gnc_gconf_add_notification(G_OBJECT(window), GCONF_GENERAL,
-				   gnc_main_window_gconf_changed);
+				   gnc_main_window_gconf_changed,
+				   GNC_MAIN_WINDOW_NAME);
 	gnc_gconf_add_notification(G_OBJECT(window), DESKTOP_GNOME_INTERFACE,
-				   gnc_main_window_gconf_changed);
+				   gnc_main_window_gconf_changed,
+				   GNC_MAIN_WINDOW_NAME);
 	gnc_main_window_update_toolbar(window);
+	gnc_main_window_update_tab_position(window);
 
 	gnc_main_window_init_menu_updaters(window);
 
@@ -2843,7 +2867,47 @@
 	LEAVE(" ");
 }
 
+#ifdef HAVE_GTK_2_10
+/** This function is invoked when a GtkNotebook tab gets reordered by
+ *  drag and drop. It adjusts the list installed_pages to reflect the new
+ *  ordering so that GnuCash saves and restores the tabs correctly.
+ *
+ *  @internal
+ */
 static void
+gnc_main_window_page_reordered (GtkNotebook *notebook,
+				GtkWidget *child,
+				guint pos,
+				GncMainWindow *window)
+{
+	GncMainWindowPrivate *priv;
+	GncPluginPage *page;
+	GList *old_link;
+
+	ENTER("Notebook %p, child %p, index %d, window %p",
+	       notebook, child, pos, window);
+	g_return_if_fail (GNC_IS_MAIN_WINDOW (window));
+
+	if (!child) return;
+
+	priv = GNC_MAIN_WINDOW_GET_PRIVATE(window);
+
+	page = g_object_get_data (G_OBJECT (child), PLUGIN_PAGE_LABEL);
+	if (!page) return;
+
+	old_link = g_list_find (priv->installed_pages, page);
+	if (!old_link) return;
+
+	priv->installed_pages = g_list_delete_link (priv->installed_pages,
+						    old_link);
+	priv->installed_pages = g_list_insert (priv->installed_pages,
+					       page, pos);
+
+	LEAVE(" ");
+}
+#endif
+
+static void
 gnc_main_window_plugin_added (GncPlugin *manager,
 			      GncPlugin *plugin,
 			      GncMainWindow *window)

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-main-window.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -39,8 +39,6 @@
 #include <gtk/gtk.h>
 #include "gnc-plugin-page.h"
 
-G_BEGIN_DECLS
-
 /* type macros */
 #define GNC_TYPE_MAIN_WINDOW            (gnc_main_window_get_type ())
 #define GNC_MAIN_WINDOW(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindow))
@@ -49,8 +47,6 @@
 #define GNC_IS_MAIN_WINDOW_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_MAIN_WINDOW))
 #define GNC_MAIN_WINDOW_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_MAIN_WINDOW, GncMainWindowClass))
 
-#define GNC_MAIN_WINDOW_NAME "GncMainWindow"
-
 #define PLUGIN_PAGE_IMMUTABLE    "page-immutable"
 
 /* typedefs & structures */
@@ -356,8 +352,6 @@
  *  this action. */
 void gnc_main_window_all_action_set_sensitive (const gchar *action_name, gboolean sensitive);
 
-G_END_DECLS
-
 #endif /* __GNC_MAIN_WINDOW_H */
 
 /** @} */

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin-menu-additions.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin-menu-additions.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin-menu-additions.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -37,7 +37,7 @@
 
 #include <gtk/gtk.h>
 #include <string.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "guile-util.h"
 #include "gnc-engine.h"
@@ -184,21 +184,15 @@
 static SCM
 gnc_main_window_to_scm (GncMainWindow *window)
 {
-  static SCM main_window_type = SCM_UNDEFINED;
+  static swig_type_info * main_window_type = NULL;
 
   if (!window)
     return SCM_BOOL_F;
 
-  if (main_window_type == SCM_UNDEFINED)
-  {
-    main_window_type = scm_c_eval_string ("<gnc:MainWindow*>");
+  if (!main_window_type)
+    main_window_type = SWIG_TypeQuery("_p_GncMainWindow");
 
-    /* don't really need this - types are bound globally anyway. */
-    if (main_window_type != SCM_UNDEFINED)
-      scm_gc_protect_object (main_window_type);
-  }
-  
-  return gw_wcp_assimilate_ptr ((void *)window, main_window_type);
+  return SWIG_NewPointerObj(window, main_window_type, 0);
 }
 
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -85,7 +85,7 @@
 		};
 
 		gnc_plugin_type = g_type_register_static (G_TYPE_OBJECT,
-							  "GncPlugin",
+							  GNC_PLUGIN_NAME,
 							   &our_info, 0);
 	}
 
@@ -195,7 +195,7 @@
 	if (class->gconf_section && class->gconf_notifications) {
 	  DEBUG ("Requesting notification for section %s", class->gconf_section);
 	  gnc_gconf_add_notification(G_OBJECT(window), class->gconf_section,
-				     class->gconf_notifications);
+				     class->gconf_notifications, GNC_PLUGIN_NAME);
 	}
 
 	/*
@@ -241,7 +241,8 @@
 	 */
 	if (class->gconf_section && class->gconf_notifications) {
 	  DEBUG ("Remove notification for section %s", class->gconf_section);
-	  gnc_gconf_remove_notification (G_OBJECT(window), class->gconf_section);
+	  gnc_gconf_remove_notification (G_OBJECT(window), class->gconf_section,
+					 GNC_PLUGIN_NAME);
 	}
 
 	/*
@@ -316,7 +317,7 @@
   }
 
   /* If this trips, you've got too many "important" actions.  That
-   * can't *all* me that important, can they? */
+   * can't *all* be that important, can they? */
   g_assert(i <= 3);
 }
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-plugin.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -93,6 +93,8 @@
 #define GNC_IS_PLUGIN_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN))
 #define GNC_PLUGIN_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_PLUGIN, GncPluginClass))
 
+#define GNC_PLUGIN_NAME "GncPlugin"
+
 /* typedefs & structures */
 
 /** The instance data structure for a menu-only plugin. */

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-query-list.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-query-list.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-query-list.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -138,6 +138,9 @@
 
   /* Initialize the CList */
   gnc_query_list_init_clist(list);
+
+  /* Set initial sort order */
+  gnc_query_list_set_query_sort(list, TRUE);
 }
 
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -35,6 +35,8 @@
 static QofLogModule log_module = GNC_MOD_GUI;
 static GtkTreeModel *account_types_tree_model = NULL;
 
+#define TYPE_MASK "type-mask"
+
 /* Functions for the type system */
 static void
 gnc_tree_model_account_types_class_init (GncTreeModelAccountTypesClass *klass);
@@ -153,13 +155,15 @@
 
 
 static gboolean
-gnc_tree_model_account_types_is_valid (GtkTreeModel *model, 
+gnc_tree_model_account_types_is_valid (GtkTreeModel *model,
                                        GtkTreeIter *iter, gpointer data)
 {
     GNCAccountType type;
-    guint32 valid_types = GPOINTER_TO_UINT (data);
+    GObject *f_model = G_OBJECT (data);
+    guint32 valid_types = GPOINTER_TO_UINT (g_object_get_data (
+                                                f_model, TYPE_MASK));
 
-    gtk_tree_model_get (model, iter, 
+    gtk_tree_model_get (model, iter,
                         GNC_TREE_MODEL_ACCOUNT_TYPES_COL_TYPE, &type, -1);
     return (valid_types & (1 << type)) ? TRUE : FALSE;
 }
@@ -176,16 +180,35 @@
 {
     GtkTreeModel *f_model;
 
-    f_model = gtk_tree_model_filter_new(gnc_tree_model_account_types_master(), 
+    f_model = gtk_tree_model_filter_new (gnc_tree_model_account_types_master (),
                                         NULL);
+    g_object_set_data (G_OBJECT (f_model), TYPE_MASK, GUINT_TO_POINTER (types));
     gtk_tree_model_filter_set_visible_func (
         GTK_TREE_MODEL_FILTER (f_model), gnc_tree_model_account_types_is_valid,
-        GUINT_TO_POINTER (types), NULL);
+        f_model, NULL);
 
     return f_model;
 }
 
+void
+gnc_tree_model_account_types_set_mask (GtkTreeModel *f_model,
+                                       guint32 types)
+{
+    g_return_if_fail (f_model);
+
+    g_object_set_data (G_OBJECT (f_model), TYPE_MASK, GUINT_TO_POINTER (types));
+    gtk_tree_model_filter_refilter (GTK_TREE_MODEL_FILTER (f_model));
+}
+
 guint32
+gnc_tree_model_account_types_get_mask (GtkTreeModel *f_model)
+{
+    g_return_val_if_fail (f_model, 0);
+
+    return GPOINTER_TO_UINT (g_object_get_data (G_OBJECT (f_model), TYPE_MASK));
+}
+
+guint32
 gnc_tree_model_account_types_get_selected (GncTreeModelAccountTypes * model)
 {
 	GncTreeModelAccountTypesPrivate *priv;
@@ -221,7 +244,12 @@
     view = gtk_tree_selection_get_tree_view(sel);
     g_return_val_if_fail (view, 0);
 
+    /* circumvent a bug in gtk+ not always filling f_model */
+    f_model = NULL;
     list = gtk_tree_selection_get_selected_rows(sel, &f_model);
+    if (!f_model)
+      f_model = gtk_tree_view_get_model(view);
+
     model = gtk_tree_model_filter_get_model(GTK_TREE_MODEL_FILTER(f_model));
     if (model != account_types_tree_model)
        PERR("TreeSelection's TreeModel is not the account-types Model");
@@ -252,7 +280,7 @@
     for (i = 0; i < NUM_ACCOUNT_TYPES; i++)
         if (selected & (1 << i))
             return i;
-    return NO_TYPE;
+    return ACCT_TYPE_NONE;
 }
 
 void
@@ -334,7 +362,7 @@
 
     i = gtk_tree_path_get_indices (path)[0];
 
-    if (i > NO_TYPE && i < NUM_ACCOUNT_TYPES) {
+    if (i > ACCT_TYPE_NONE && i < NUM_ACCOUNT_TYPES) {
         iter->stamp = model->stamp;
         iter->user_data = GINT_TO_POINTER (i);
         return TRUE;
@@ -468,7 +496,7 @@
 
     model = GNC_TREE_MODEL_ACCOUNT_TYPES (tree_model);
 
-    if (n > NO_TYPE && n < NUM_ACCOUNT_TYPES) {
+    if (n > ACCT_TYPE_NONE && n < NUM_ACCOUNT_TYPES) {
 	iter->stamp = model->stamp;
 	iter->user_data = GINT_TO_POINTER (n);
 	return TRUE;

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account-types.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -113,6 +113,13 @@
    Caller is responsible for ref/unref. */
 GtkTreeModel * gnc_tree_model_account_types_filter_using_mask (guint32 types);
 
+/* Update the set of the visibible account types in 'f_model' to 'types'. */
+void gnc_tree_model_account_types_set_mask (GtkTreeModel *f_model,
+                                            guint32 types);
+
+/* Return the current set of the visibible account types. */
+guint32 gnc_tree_model_account_types_get_mask (GtkTreeModel *f_model);
+
 /* Return the bitmask of the account type enums reflecting the state
    of the tree selection.  If your view allows the selection of
    multiple account types, use must use this function to get the
@@ -121,8 +128,8 @@
 
 /* Gets the selected account type.  Use the function if your view
    allows the selection of only one account type. If no types are
-   selected, returns NO_TYPE.  If more than one type is selected,
-   arbitrarily returns one of the selected types. */
+   selected, returns ACCT_TYPE_NONE.  If more than one type is
+   selected, arbitrarily returns one of the selected types. */
 GNCAccountType
 gnc_tree_model_account_types_get_selection_single(GtkTreeSelection *sel);
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -330,7 +330,7 @@
 
   string = g_static_private_get (&gtmits_buffer_key);
   if (string == NULL) {
-    string = malloc(ITER_STRING_LEN + 1);
+    string = g_malloc(ITER_STRING_LEN + 1);
     g_static_private_set (&gtmits_buffer_key, string, g_free);
   }
 #else

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-account.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -122,7 +122,8 @@
 
 /** Create a new GtkTreeModel for manipulating gnucash accounts.
  *
- *  @param group The account group to put at the top level of the tree hierarchy. */
+ *  @param group The account group to put at the top level of the tree
+ *  hierarchy. */
 GtkTreeModel *gnc_tree_model_account_new (AccountGroup *group);
 /** @} */
 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-commodity.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-commodity.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-commodity.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -305,7 +305,7 @@
 
   string = g_static_private_get (&gtmits_buffer_key);
   if (string == NULL) {
-    string = malloc(ITER_STRING_LEN + 1);
+    string = g_malloc(ITER_STRING_LEN + 1);
     g_static_private_set (&gtmits_buffer_key, string, g_free);
   }
 #else
@@ -1256,7 +1256,7 @@
 	    return;
 	  }
 
-	  data = malloc(sizeof(*data));
+	  data = g_new0 (remove_data, 1);
 	  data->model = model;
 	  data->path = path;
 	  pending_removals = g_slist_append (pending_removals, data);

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-price.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-price.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-price.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -361,7 +361,7 @@
 
   string = g_static_private_get (&gtmits_buffer_key);
   if (string == NULL) {
-    string = malloc(ITER_STRING_LEN + 1);
+    string = g_malloc(ITER_STRING_LEN + 1);
     g_static_private_set (&gtmits_buffer_key, string, g_free);
   }
 #else
@@ -1515,7 +1515,7 @@
 	    return;
 	  }
 
-	  data = malloc(sizeof(*data));
+	  data = g_new0 (remove_data, 1);
 	  data->model = model;
 	  data->path = path;
 	  pending_removals = g_slist_append (pending_removals, data);

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-model-transaction.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -312,7 +312,7 @@
 
     string = g_static_private_get (&gtmits_buffer_key);
     if (string == NULL) {
-        string = malloc(ITER_STRING_LEN + 1);
+        string = g_malloc(ITER_STRING_LEN + 1);
         g_static_private_set (&gtmits_buffer_key, string, g_free);
     }
 #else

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-account.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-account.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-account.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -507,7 +507,7 @@
   /* Set default visibilities */
   gtk_tree_view_set_headers_visible (GTK_TREE_VIEW(view), FALSE);
 
-  sample_type = xaccAccountGetTypeStr(CREDIT);
+  sample_type = xaccAccountGetTypeStr(ACCT_TYPE_CREDIT);
   sample_commodity = gnc_commodity_get_fullname(gnc_default_currency());
 
   priv->name_column 

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-transaction.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-transaction.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view-transaction.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -64,7 +64,7 @@
 #include "gnc-tree-model-account.h"
 #include "gnc-tree-model-transaction.h"
 #include "gnc-tree-view-transaction.h"
-#include "gnctreemodelsort.h"
+//#include "gnctreemodelsort.h"
 
 #include "Account.h"
 #include "Transaction.h"
@@ -274,25 +274,25 @@
 static GncTreeModelTransaction *
 get_trans_model_from_view(GncTreeViewTransaction *tv)
 {
-    GncTreeModelSort *s_model = GNC_TREE_MODEL_SORT(
+    GtkTreeModelSort *s_model = GTK_TREE_MODEL_SORT(
         gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
-    return GNC_TREE_MODEL_TRANSACTION(gnc_tree_model_sort_get_model(s_model));
+    return GNC_TREE_MODEL_TRANSACTION(gtk_tree_model_sort_get_model(s_model));
 }
 
 static gboolean
 get_model_iter_from_view_string(GncTreeViewTransaction *tv,
                                 const gchar *path_string, GtkTreeIter *iter)
 {
-    GncTreeModelSort *s_model;
+    GtkTreeModelSort *s_model;
     GtkTreeIter s_iter;
 
-    s_model = GNC_TREE_MODEL_SORT(gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
+    s_model = GTK_TREE_MODEL_SORT(gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
     if (!gtk_tree_model_get_iter_from_string(GTK_TREE_MODEL(s_model),
                                              &s_iter, path_string)) {
         iter = NULL;
         return FALSE;
     }
-    gnc_tree_model_sort_convert_iter_to_child_iter(s_model, iter, &s_iter);
+    gtk_tree_model_sort_convert_iter_to_child_iter(s_model, iter, &s_iter);
     return TRUE;
 }
 
@@ -304,8 +304,8 @@
     GtkTreeIter s_iter;
 
     if (gtk_tree_selection_get_selected(sel, &s_model, &s_iter)) {
-        gnc_tree_model_sort_convert_iter_to_child_iter(
-            GNC_TREE_MODEL_SORT(s_model), iter, &s_iter);
+        gtk_tree_model_sort_convert_iter_to_child_iter(
+            GTK_TREE_MODEL_SORT(s_model), iter, &s_iter);
         return TRUE;
     }
     return FALSE;
@@ -347,11 +347,11 @@
 static GtkTreePath *
 get_view_path_from_model_iter(GncTreeViewTransaction *tv, GtkTreeIter *iter)
 {
-    GncTreeModelSort *s_model;
+    GtkTreeModelSort *s_model;
     GtkTreeIter s_iter;
 
-    s_model = GNC_TREE_MODEL_SORT(gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
-    gnc_tree_model_sort_convert_child_iter_to_iter(s_model, &s_iter, iter);
+    s_model = GTK_TREE_MODEL_SORT(gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
+    gtk_tree_model_sort_convert_child_iter_to_iter(s_model, &s_iter, iter);
     return gtk_tree_model_get_path(GTK_TREE_MODEL(s_model), &s_iter);
 }
 
@@ -360,18 +360,18 @@
 get_model_iter_from_view_path(GncTreeViewTransaction *tv,
                               GtkTreePath *s_path, GtkTreeIter *iter)
 {
-    GncTreeModelSort *s_model;
+    GtkTreeModelSort *s_model;
     GtkTreeModel *model;
     GtkTreePath *path;
 
-    s_model = GNC_TREE_MODEL_SORT(gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
-    model = gnc_tree_model_sort_get_model(s_model);
+    s_model = GTK_TREE_MODEL_SORT(gtk_tree_view_get_model(GTK_TREE_VIEW(tv)));
+    model = gtk_tree_model_sort_get_model(s_model);
     if (!model) {
         iter = NULL;
         return FALSE;
     }
 
-    path = gnc_tree_model_sort_convert_path_to_child_path(s_model, s_path);
+    path = gtk_tree_model_sort_convert_path_to_child_path(s_model, s_path);
     if (gtk_tree_model_get_iter(model, iter, path)) {
         gtk_tree_path_free(path);
         return TRUE;
@@ -384,11 +384,11 @@
                                     gpointer data)
 {
     GtkTreeIter iter;
-    GncTreeModelSort *tms = GNC_TREE_MODEL_SORT(tm);
+    GtkTreeModelSort *tms = GTK_TREE_MODEL_SORT(tm);
     GtkTreeModel *tmt;
 
-    gnc_tree_model_sort_convert_iter_to_child_iter(tms, &iter, s_iter);
-    tmt = gnc_tree_model_sort_get_model(tms);
+    gtk_tree_model_sort_convert_iter_to_child_iter(tms, &iter, s_iter);
+    tmt = gtk_tree_model_sort_get_model(tms);
     return FALSE;
     //return gnc_tree_model_transaction_separator(tmt, &iter, data);
 }
@@ -564,13 +564,13 @@
 
     g_return_if_fail(GTK_TREE_VIEW_COLUMN(col));
     g_return_if_fail(GTK_CELL_RENDERER(cell));
-    g_return_if_fail(GNC_TREE_MODEL_SORT(s_model));
+    g_return_if_fail(GTK_TREE_MODEL_SORT(s_model));
 
     model = get_trans_model_from_view(tv);
     g_return_if_fail(model);
 
-    gnc_tree_model_sort_convert_iter_to_child_iter(
-        GNC_TREE_MODEL_SORT(s_model), &iter, s_iter);
+    gtk_tree_model_sort_convert_iter_to_child_iter(
+        GTK_TREE_MODEL_SORT(s_model), &iter, s_iter);
     viewcol = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(cell),
                                                 "view_column"));
     g_return_if_fail(gnc_tree_model_transaction_get_split_and_trans(
@@ -1551,7 +1551,7 @@
 
     tv = g_object_new(gnc_tree_view_transaction_get_type(), NULL);
 
-    s_model = gnc_tree_model_sort_new_with_model(GTK_TREE_MODEL(model));
+    s_model = gtk_tree_model_sort_new_with_model(GTK_TREE_MODEL(model));
     //g_object_unref(G_OBJECT(model));
     gnc_tree_view_set_model(GNC_TREE_VIEW(tv), s_model);
     g_object_unref(G_OBJECT(s_model));

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-tree-view.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -904,7 +904,7 @@
     return;
   order = gnc_enum_from_nick(GTK_TYPE_SORT_TYPE, name, GTK_SORT_ASCENDING);
   if (!gtk_tree_sortable_get_sort_column_id(GTK_TREE_SORTABLE(s_model),
-					    &current, &order))
+					    &current, NULL))
       current = GTK_TREE_SORTABLE_DEFAULT_SORT_COLUMN_ID;
   g_signal_handler_block(s_model, priv->sort_column_changed_cb_id);
   gtk_tree_sortable_set_sort_column_id(GTK_TREE_SORTABLE(s_model),
@@ -1192,7 +1192,8 @@
   }
 
   DEBUG("removing gconf notification");
-  gnc_gconf_remove_notification(G_OBJECT(view), priv->gconf_section);
+  gnc_gconf_remove_notification(G_OBJECT(view), priv->gconf_section,
+				GNC_TREE_VIEW_NAME);
   g_free(priv->gconf_section);
   priv->gconf_section = NULL;
   LEAVE(" ");
@@ -1229,7 +1230,8 @@
   priv = GNC_TREE_VIEW_GET_PRIVATE(view);
   priv->gconf_section = g_strdup(section);
   gnc_gconf_add_notification(G_OBJECT(view), section,
-			     gnc_tree_view_gconf_changed);
+			     gnc_tree_view_gconf_changed,
+			     GNC_TREE_VIEW_NAME);
 
   /* Catch changes to the sort column. Propagate to gconf. The key can
    * be set before the model, so the code must handle that case. */

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnc-window.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnc-window.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnc-window.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -116,7 +116,8 @@
 }
 
 void
-gnc_window_set_status (GncWindow *window, GncPluginPage *page, const gchar *message)
+gnc_window_set_status (GncWindow *window, GncPluginPage *page, 
+                       const gchar *message)
 {
   g_return_if_fail(GNC_WINDOW (window));
   g_return_if_fail(GNC_PLUGIN_PAGE (page));
@@ -185,7 +186,8 @@
 	(GNC_WINDOW_GET_IFACE(window)->ui_set_sensitive != NULL))
       GNC_WINDOW_GET_IFACE(window)->ui_set_sensitive(window, FALSE);
     if (percentage <= 100) {
-      gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), percentage/100);
+      gtk_progress_bar_set_fraction(GTK_PROGRESS_BAR(progressbar), 
+                                    percentage/100);
     } else {
       gtk_progress_bar_pulse(GTK_PROGRESS_BAR(progressbar));
     }

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gncmod-gnome-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gncmod-gnome-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gncmod-gnome-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -57,6 +57,8 @@
   g_free(form);
 }
 
+extern SCM scm_init_sw_gnome_utils_module(void);
+
 int
 libgncmod_gnome_utils_LTX_gnc_module_init(int refcount) {
   /* load the engine (we depend on it) */
@@ -79,8 +81,8 @@
     return FALSE;
   }
 
-  /* publish g-wrapped bindings */
-  lmod("(g-wrapped gw-gnome-utils)");
+  scm_init_sw_gnome_utils_module();
+  lmod("(sw_gnome_utils)");
   lmod("(gnucash gnome-utils)");
   
   /* Initialize the options-ui database */

Copied: gnucash/branches/register-rewrite/src/gnome-utils/gnome-utils.i (from rev 15058, gnucash/trunk/src/gnome-utils/gnome-utils.i)

Modified: gnucash/branches/register-rewrite/src/gnome-utils/gnome-utils.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gnome-utils.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gnome-utils.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,9 +1,9 @@
 (define-module (gnucash gnome-utils))
 
-(use-modules (g-wrapped gw-gnome-utils))
 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash gnc-module))
 
+(use-modules (sw_gnome_utils))
 (gnc:module-load "gnucash/app-utils" 0)
 
 ;; from gnc-menu-extensions.scm
@@ -21,18 +21,18 @@
 (load-from-path "gnc-menu-extensions.scm")
 
 (define (gnc:kvp-option-dialog id-type slots title changed_cb)
-  (let* ((options (gnc:make-kvp-options id-type))
-	 (optiondb (gnc:option-db-new options))
-	 (optionwin (gnc:option-dialog-new title)))
+  (let* ((options (gnc-make-kvp-options id-type))
+	 (optiondb (gnc-option-db-new options))
+	 (optionwin (gnc-options-dialog-new title)))
 
     (define (apply-cb)
       (gnc:options-scm->kvp options slots gnc:*kvp-option-path* #t)
       (if changed_cb (changed_cb)))
 
     (define (close-cb)
-      (gnc:option-dialog-destroy optionwin)
-      (gnc:option-db-destroy optiondb))
+      (gnc-options-dialog-destroy optionwin)
+      (gnc-option-db-destroy optiondb))
 
     (gnc:options-kvp->scm options slots gnc:*kvp-option-path*)
-    (gnc:option-dialog-set-callbacks optionwin apply-cb close-cb)
-    (gnc:option-dialog-build-contents optionwin optiondb)))
+    (gnc-options-dialog-set-scm-callbacks optionwin apply-cb close-cb)
+    (gnc-options-dialog-build-contents optionwin optiondb)))

Deleted: gnucash/branches/register-rewrite/src/gnome-utils/gw-gnome-utils-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/gw-gnome-utils-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/gw-gnome-utils-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,507 +0,0 @@
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(define-module (g-wrapped gw-gnome-utils-spec))
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(use-modules (g-wrapped gw-engine-spec))
-(use-modules (g-wrapped gw-app-utils-spec))
-
-(let ((ws (gw:new-wrapset "gw-gnome-utils")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-depends-on ws "gw-engine")
-  (gw:wrapset-depends-on ws "gw-app-utils")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-gnome-utils))
-
-  (gw:wrap-value ws 'gnc:additional-menus-placeholder '(<gw:mchars> callee-owned const) "ADDITIONAL_MENUS_PLACEHOLDER")
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset) 
-     (list
-      "#include <config.h>\n"
-      "#include <dialog-options.h>\n"
-      "#include <dialog-utils.h>\n"
-      "#include <druid-utils.h>\n"
-      "#include <gtk/gtk.h>\n"
-      "#include <gnc-amount-edit.h>\n"
-      "#include <gnc-date-edit.h>\n"
-      "#include <gnc-file.h>\n"
-      "#include <gnc-gconf-utils.h>\n"
-      "#include <gnc-gnome-utils.h>\n"
-      "#include <gnc-gui-query.h>\n"
-      "#include <gnc-html.h>\n"
-      "#include <gnc-main-window.h>\n"
-      "#include <gnc-window.h>\n"
-      "#include <gnc-menu-extensions.h>\n"
-      "#include <gnc-plugin-file-history.h>\n"
-      "#include <gnc-ui.h>\n"
-      "#include <print-session.h>\n"
-      "#include <gnc-splash.h>\n"
-      )))
-
-
-  (gw:wrap-as-wct ws '<gtk:Widget*> "GtkWidget*" "const GtkWidget*")
-  (gw:wrap-as-wct ws '<gtk:Window*> "GtkWindow*" "const GtkWindow*")
-  (gw:wrap-as-wct ws '<gnc:UIWidget> "gncUIWidget" "const gncUIWidget")
-  (gw:wrap-as-wct ws '<gnc:OptionWin*> "GNCOptionWin*" "const GNCOptionWin*")
-  (gw:wrap-as-wct ws '<gnc:url-type> "URLType" "const URLType")
-  (gw:wrap-as-wct ws '<gnc:Window*> "GncWindow *" "const GncWindow *")
-  (gw:wrap-as-wct ws '<gnc:MainWindow*> "GncMainWindow *" "const GncMainWindow *")
-
-  ;;
-  ;; URLTypes
-  ;;
-  (gw:wrap-value ws 'gnc:url-type-file '<gnc:url-type> "URL_TYPE_FILE")
-  (gw:wrap-value ws 'gnc:url-type-jump '<gnc:url-type> "URL_TYPE_JUMP")
-  (gw:wrap-value ws 'gnc:url-type-http '<gnc:url-type> "URL_TYPE_HTTP")
-  (gw:wrap-value ws 'gnc:url-type-ftp '<gnc:url-type> "URL_TYPE_FTP")
-  (gw:wrap-value ws 'gnc:url-type-secure '<gnc:url-type> "URL_TYPE_SECURE")
-  (gw:wrap-value ws 'gnc:url-type-register '<gnc:url-type> "URL_TYPE_REGISTER")
-  (gw:wrap-value ws 'gnc:url-type-accttree '<gnc:url-type> "URL_TYPE_ACCTTREE")
-  (gw:wrap-value ws 'gnc:url-type-report '<gnc:url-type> "URL_TYPE_REPORT")
-  (gw:wrap-value ws 'gnc:url-type-options '<gnc:url-type> "URL_TYPE_OPTIONS")
-  (gw:wrap-value ws 'gnc:url-type-scheme '<gnc:url-type> "URL_TYPE_SCHEME")
-  (gw:wrap-value ws 'gnc:url-type-help '<gnc:url-type> "URL_TYPE_HELP")
-  (gw:wrap-value ws 'gnc:url-type-xmldata '<gnc:url-type> "URL_TYPE_XMLDATA")
-  (gw:wrap-value ws 'gnc:url-type-price '<gnc:url-type> "URL_TYPE_PRICE")
-  (gw:wrap-value ws 'gnc:url-type-other '<gnc:url-type> "URL_TYPE_OTHER")
-
-
-  (gw:wrap-function
-   ws
-   'gnc:option-dialog-new
-   '<gnc:OptionWin*>
-   "gnc_options_dialog_new"
-   '(((<gw:mchars> caller-owned) title))
-   "Create a new option dialog")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-dialog-destroy
-   '<gw:void>
-   "gnc_options_dialog_destroy"
-   '((<gnc:OptionWin*> option-window))
-   "Destroy an option dialog")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-dialog-build-contents
-   '<gw:void>
-   "gnc_build_options_dialog_contents"
-   '((<gnc:OptionWin*> option-window) (<gnc:OptionDB*> option-db))
-   "Fill in the option window with the provided option db")
-
-  (gw:wrap-function
-   ws
-   'gnc:option-dialog-set-callbacks
-   '<gw:void>
-   "gnc_options_dialog_set_scm_callbacks"
-   '((<gnc:OptionWin*> option-window) (<gw:scm> apply-cb) (<gw:scm> close-cb))
-   "Setup callbacks for the option window.")
-
-
-  (gw:wrap-as-wct ws '<gnc:PrintSession*> "PrintSession*" "const PrintSession*")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-create
-   '<gnc:PrintSession*>
-   "gnc_print_session_create"
-   '((<gw:bool> yes_is_default))
-   "Start a new print session.  This will display a dialog asking for "
-   "number of copies, print vs. preview, etc.")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-destroy
-   '<gw:void>
-   "gnc_print_session_destroy"
-   '((<gnc:PrintSession*> p))
-   "Free a print session's resources")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-moveto
-   '<gw:void>
-   "gnc_print_session_moveto"
-   '((<gnc:PrintSession*> p) (<gw:double> x) (<gw:double> y))
-   "Move the current point")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-text
-   '<gw:void>
-   "gnc_print_session_text"
-   '((<gnc:PrintSession*> p) ((<gw:mchars> caller-owned const) text))
-   "Show some text in Courier 16")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-rotate
-   '<gw:void>
-   "gnc_print_session_rotate"
-   '((<gnc:PrintSession*> p) (<gw:double> theta_in_degrees))
-   "Rotate the image by X degrees")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-translate
-   '<gw:void>
-   "gnc_print_session_translate"
-   '((<gnc:PrintSession*> p) (<gw:double> x) (<gw:double> y))
-   "Translate the image to point x,y")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-gsave
-   '<gw:void>
-   "gnc_print_session_gsave"
-   '((<gnc:PrintSession*> p))
-   "Save the current print-session state")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-grestore
-   '<gw:void>
-   "gnc_print_session_grestore"
-   '((<gnc:PrintSession*> p))
-   "Restore the current print-session state")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-session-done
-   '<gw:void>
-   "gnc_print_session_done"
-   '((<gnc:PrintSession*> p))
-   "Let the print context know you're finished with it.")
-
-  (gw:wrap-function
-   ws
-   'gnc:error-dialog
-   '<gw:void>
-   "gnc_error_dialog"
-   '((<gtk:Widget*> window)
-     ((<gw:mchars> caller-owned const) message))
-   "Show ok dialog box with given error message.")
-
-  (gw:wrap-function
-   ws
-   'gnc:verify-dialog
-   '<gw:bool>
-   "gnc_verify_dialog"
-   '((<gtk:Widget*> window)
-     (<gw:bool> yes_is_default)
-     ((<gw:mchars> caller-owned const) message))
-   "Show yes/no dialog box with given message.")
-
-  (gw:wrap-function
-   ws
-   'gnc:info-dialog
-   '<gw:void>
-   "gnc_info_dialog"
-   '((<gtk:Widget*> window)
-     ((<gw:mchars> caller-owned const) message))
-   "Show ok dialog box with given message.")
-
-  (gw:wrap-function
-   ws
-   'gnc:warning-dialog
-   '<gw:void>
-   "gnc_warning_dialog"
-   '((<gtk:Widget*> window)
-     ((<gw:mchars> caller-owned const) message))
-   "Show warning dialog box with given message.")
-
-  (gw:wrap-function
-   ws
-   'gnc:add-extension
-   '<gw:void>
-   "gnc_add_scm_extension"
-   '((<gw:scm> extension))
-   "Add a menu extension.")
-
-  (gw:wrap-function
-   ws
-   'gnc:choose-radio-option-dialog
-   '<gw:int>
-   "gnc_choose_radio_option_dialog"
-   '((<gnc:UIWidget> parent)
-     ((<gw:mchars> caller-owned const) title)
-     ((<gw:mchars> caller-owned const) msg)
-     ((<gw:mchars> caller-owned const) button-name)
-     (<gw:int> default-choice)
-     ((gw:glist-of (<gw:mchars> callee-owned) callee-owned) choices))
-   "Show a dialog offering different mutually exclusive choices
-in a radio list.")
-
-  ;;
-  ;; gnc-html.h
-  ;;
-
-  (gw:wrap-function 
-   ws
-   'gnc:html-encode-string 
-   '(<gw:gchars> caller-owned)
-   "gnc_html_encode_string"
-   '(((<gw:mchars> caller-owned const) bookname)))
-
-  (gw:wrap-function
-   ws
-   'gnc:html-build-url
-   '(<gw:gchars> caller-owned)
-   "gnc_build_url"
-   '((<gnc:url-type> url-type) ((<gw:mchars> caller-owned const) location)
-     ((<gw:mchars> caller-owned const) label))
-   "Build a GNC URL based on the URL Type and location.  The label may
-be left empty")
-
-
-  ;; gnc-amount-edit.h
-  (gw:wrap-as-wct ws
-                  '<gnc:GNCAmountEdit>
-                  "GNCAmountEdit*" "const GNCAmountEdit*")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-new
-   '<gnc:UIWidget>
-   "gnc_amount_edit_new"
-   '()
-   "Return a new amount edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-gtk-entry
-   '<gnc:UIWidget>
-   "gnc_amount_edit_gtk_entry"
-   '((<gnc:GNCAmountEdit> amount-edit))
-   "Return the gtk entry for a gnc amount edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-set-amount
-   '<gw:void>
-   "gnc_amount_edit_set_amount"
-   '((<gnc:GNCAmountEdit> amount-edit)
-     (<gnc:numeric> amount))
-   "Set the amount of an amount edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-get-amount
-   '<gnc:numeric>
-   "gnc_amount_edit_get_amount"
-   '((<gnc:GNCAmountEdit> amount-edit))
-   "Return the amount in an amount edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-evaluate
-   '<gw:bool>
-   "gnc_amount_edit_evaluate"
-   '((<gnc:GNCAmountEdit> amount-edit))
-   "Evaluate the contents of an amount edit widget and return
-#t if it is a valid entry.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-set-print-info
-   '<gw:void>
-   "gnc_amount_edit_set_print_info"
-   '((<gnc:GNCAmountEdit> amount-edit)
-     (<gnc:print-amount-info-scm> print-info))
-   "Set the print info used by the amount edit.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-set-fraction
-   '<gw:void>
-   "gnc_amount_edit_set_fraction"
-   '((<gnc:GNCAmountEdit> amount-edit)
-     (<gw:int> fraction))
-   "Set the fraction used by the amount edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:amount-edit-set-evaluate-on-enter
-   '<gw:void>
-   "gnc_amount_edit_set_evaluate_on_enter"
-   '((<gnc:GNCAmountEdit> amount-edit)
-     (<gw:bool> evaluate-on-enter))
-   "Set whether the edit widget evaluates on enter.")
-
-
-  ;; gnc-date-edit.h
-  (gw:wrap-as-wct ws '<gnc:GNCDateEdit> "GNCDateEdit*" "const GNCDateEdit*")
-
-  (gw:wrap-function
-   ws
-   'gnc:date-edit-new
-   '<gnc:UIWidget>
-   "gnc_date_edit_new_ts"
-   '((<gnc:time-pair> date) (<gw:bool> show-time) (<gw:bool> use-24-hour-format))
-   "Return a new date edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:date-edit-set-time
-   '<gw:void>
-   "gnc_date_edit_set_time_ts"
-   '((<gnc:GNCDateEdit> date-edit)
-     (<gnc:time-pair> time))
-   "Set the time used by the date edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:date-edit-get-date
-   '<gnc:time-pair>
-   "gnc_date_edit_get_date_ts"
-   '((<gnc:GNCDateEdit> date-edit))
-   "Return the date of the date-edit widget.")
-
-  (gw:wrap-function
-   ws
-   'gnc:date-edit-get-date-end
-   '<gnc:time-pair>
-   "gnc_date_edit_get_date_end_ts"
-   '((<gnc:GNCDateEdit> date-edit))
-   "Return the date of the date-edit widget at the end of the day.")
-
-
-  ;; druid-utils.h
-  (gw:wrap-as-wct ws '<gnc:GnomeDruid> "GnomeDruid*" "const GnomeDruid*")
-
- (gw:wrap-function
-   ws
-   'gnc:druid-set-colors
-   '<gw:void>
-   "gnc_druid_set_colors"
-   '((<gnc:GnomeDruid> druid))
-   "Set the colors of a druid.")
-
-
-  ;; dialog-utils.h
-  (gw:wrap-as-wct ws '<gnc:GtkCList> "GtkCList*" "const GtkCList*")
-
-  (gw:wrap-function
-   ws
-   'gnc:clist-set-check
-   '<gw:void>
-   "gnc_clist_set_check"
-   '((<gnc:GtkCList> clist)
-     (<gw:int> row)
-     (<gw:int> col)
-     (<gw:bool> checked))
-   "Set the check status of a clist cell.")
-
-  (gw:wrap-function
-   ws
-   'gnc:set-busy-cursor
-   '<gw:void>
-   "gnc_set_busy_cursor"
-   '((<gtk:Widget*> window)
-     (<gw:bool> update_now))
-   "Set a busy cursor for a specific window. If null, the busy cursor will be set on all windows.")
-
-  (gw:wrap-function
-   ws
-   'gnc:unset-busy-cursor
-   '<gw:void>
-   "gnc_unset_busy_cursor"
-   '((<gtk:Widget*> window))
-   "Remove a busy cursor for a specific window. If null, the busy cursor will be removed on all windows.")
-
-  (gw:wrap-function
-   ws
-   'gnc:gconf-get-bool
-   '<gw:bool>
-   "gnc_gconf_get_bool_no_error"
-   '(((<gw:mchars> caller-owned) section)
-     ((<gw:mchars> caller-owned) name))
-   "Get a boolean value from gconf.")
-
-  (gw:wrap-function
-   ws
-   'gnc:file-quit
-   '<gw:void>
-   "gnc_file_quit"
-   '()
-   "Stop working with the current file.")
-
-  (gw:wrap-function
-   ws
-   'gnc:file-open-file
-   '<gw:bool>
-   "gnc_file_open_file"
-   '(((<gw:mchars> caller-owned const) filename))
-   "Open filename.")
-
-  (gw:wrap-function
-   ws
-   'gnc:history-get-last
-   '(<gw:mchars> caller-owned)
-   "gnc_history_get_last"
-   '()
-   "Get the last file opened by the user.")
-
-  (gw:wrap-function
-   ws
-   'gnc:main-window-set-progressbar-window
-   '<gw:void>
-   "gnc_main_window_set_progressbar_window"
-   '((<gnc:MainWindow*> window))
-   "Set the progressbar window from the given GncMainWindow; does the cast. :p")
-
-  (gw:wrap-function
-   ws
-   'gnc:window-set-progressbar-window
-   '<gw:void>
-   "gnc_window_set_progressbar_window"
-   '((<gnc:Window*> window))
-   "Set the progressbar window from the given GncWindow.")
-
-  (gw:wrap-function
-   ws
-   'gnc:window-show-progress
-   '<gw:void>
-   "gnc_window_show_progress"
-   '(((<gw:mchars> caller-owned const) message)
-     (<gw:double> percentage))
-   "Set the progressbar window from the given GncWindow.")
-
-  (gw:wrap-function
-   ws
-   'gnc:gnome-locate-data-file
-   '(<gw:mchars> caller-owned)
-   "gnc_gnome_locate_data_file"
-   '(((<gw:mchars> caller-owned const) name))
-   "Find the file in the application data directory.")
-
-  (gw:wrap-function
-   ws
-   'gnc:ui-is-running?
-   '<gw:bool>
-   "gnucash_ui_is_running"
-   '()
-   "Predicate to determine if the UI is running.")
-
-  (gw:wrap-function
-   ws
-   'gnc:update-splash-screen
-   '<gw:void>
-   "gnc_update_splash_screen"
-   '(((<gw:mchars> caller-owned const) string))
-   "Update the progress box on the splash screen dialog.")
-
-)

Modified: gnucash/branches/register-rewrite/src/gnome-utils/schemas/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/schemas/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/schemas/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,10 +12,10 @@
 install-data-local:
 if GCONF_SCHEMAS_INSTALL
 	-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
-	-GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA)
+	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-2 --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
 endif

Modified: gnucash/branches/register-rewrite/src/gnome-utils/search-param.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/search-param.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/search-param.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,6 @@
 /*
  * search-param.c -- a container for a Search Parameter 
- * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU
+ * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as

Modified: gnucash/branches/register-rewrite/src/gnome-utils/search-param.h
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/search-param.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/search-param.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,6 @@
 /*
  * search-param.h -- a container for a Search Parameter 
- * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU
+ * Copyright (C) 2002 Derek Atkins <warlord at MIT.EDU>
  *
  * This program is free software; you can redistribute it and/or
  * modify it under the terms of the GNU General Public License as

Modified: gnucash/branches/register-rewrite/src/gnome-utils/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -27,14 +27,12 @@
   --gnc-module-dir ${top_builddir}/src/gnome-utils \
   --gnc-module-dir ${top_builddir}/src/gnome \
   --gnc-module-dir ${top_builddir}/src/scm \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/gnome \
   --guile-load-dir ${top_srcdir}/src/engine \
   --guile-load-dir ${top_srcdir}/src/app-utils \
   --guile-load-dir ${top_srcdir}/src/gnome-utils \
-  --library-dir    ${top_srcdir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_srcdir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/gnome-utils/test/test-gnc-recurrence.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/test/test-gnc-recurrence.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/test/test-gnc-recurrence.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -8,6 +8,7 @@
  *
  */
 
+#include "config.h"
 #include <glib.h>
 #include <gtk/gtk.h>
 #include <stdio.h>

Modified: gnucash/branches/register-rewrite/src/gnome-utils/window-main-summarybar.c
===================================================================
--- gnucash/branches/register-rewrite/src/gnome-utils/window-main-summarybar.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/gnome-utils/window-main-summarybar.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -181,15 +181,15 @@
 
     switch (account_type)
     {
-      case BANK:
-      case CASH:
-      case ASSET:
-      case STOCK:
-      case MUTUAL:
-      case CREDIT:
-      case LIABILITY:
-      case PAYABLE:
-      case RECEIVABLE:
+      case ACCT_TYPE_BANK:
+      case ACCT_TYPE_CASH:
+      case ACCT_TYPE_ASSET:
+      case ACCT_TYPE_STOCK:
+      case ACCT_TYPE_MUTUAL:
+      case ACCT_TYPE_CREDIT:
+      case ACCT_TYPE_LIABILITY:
+      case ACCT_TYPE_PAYABLE:
+      case ACCT_TYPE_RECEIVABLE:
 	end_amount = xaccAccountGetBalanceAsOfDate(account, options.end_date);
         timespecFromTime_t(&end_timespec, options.end_date);
 	end_amount_default_currency = 
@@ -229,8 +229,8 @@
 	if (children != NULL)
 	  gnc_ui_accounts_recurse(children, currency_list, options);
 	break;
-      case INCOME:
-      case EXPENSE:
+      case ACCT_TYPE_INCOME:
+      case ACCT_TYPE_EXPENSE:
 	start_amount = xaccAccountGetBalanceAsOfDate(account, options.start_date);
         timespecFromTime_t(&start_timespec, options.start_date);
 	start_amount_default_currency = 
@@ -295,10 +295,10 @@
 	if (children != NULL)
 	  gnc_ui_accounts_recurse(children, currency_list, options);
 	break;
-      case EQUITY:
+      case ACCT_TYPE_EQUITY:
         /* no-op, see comments at top about summing assets */
 	break;
-      case CURRENCY:
+      case ACCT_TYPE_CURRENCY:
       default:
 	break;
     }


Property changes on: gnucash/branches/register-rewrite/src/import-export
___________________________________________________________________
Name: svn:ignore
   - *.gladep
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
generic-import
import-export
g-wrapped
gnucash


semantic.cache

TAGS

   + *.gladep
*.la
*.lo
.deps
.libs
.scm-links
Makefile
Makefile.in
generic-import
import-export
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/import-export/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,7 @@
 SUBDIRS = . schemas qif qif-import \
-	${OFX_DIR} ${HBCI_DIR} ${MT940_DIR} log-replay test
+	${OFX_DIR} ${HBCI_DIR} log-replay test
 DIST_SUBDIRS = schemas qif qif-import qif-io-core \
-	ofx hbci mt940 log-replay test
+	ofx hbci log-replay test
 
 pkglib_LTLIBRARIES=libgncmod-generic-import.la
 
@@ -48,6 +48,7 @@
   ${GNOME_LIBS} \
   ${GLADE_LIBS} \
   ${QOF_LIBS} \
+  ${REGEX_LIBS} \
   ${GLIB_LIBS}
 
 gladedir = ${GNC_GLADE_DIR}
@@ -63,7 +64,6 @@
   -I${top_srcdir}/src/app-utils \
   -I${top_srcdir}/src/gnome \
   -I${top_srcdir}/src/gnome-utils \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GNOME_CFLAGS} \
   ${GTKHTML_CFLAGS} \
   ${GDK_PIXBUF_CFLAGS} \
@@ -75,28 +75,3 @@
 EXTRA_DIST = \
   $(glade_DATA) \
   generic-import-design.txt
-
-if GNUCASH_SEPARATE_BUILDDIR
-#For compiling
-SCM_FILE_LINKS = 
-#For executing test cases
-SCM_FILE_LINKS +=
-endif
-
-noinst_DATA = .scm-links
-
-.scm-links:
-	rm -f g-wrapped gnucash generic-import import-export
-	$(LN_S) -f . import-export
-	$(LN_S) -f . gnucash
-	$(LN_S) -f . generic-import
-	$(LN_S) -f . g-wrapped
-if GNUCASH_SEPARATE_BUILDDIR
-	for X in ${SCM_FILE_LINKS} ; do \
-	  $(LN_S) -f ${srcdir}/$$X . ; \
-	done
-endif
-	touch .scm-links
-
-CLEANFILES = gnucash generic-import g-wrapped .scm-links import-export
-DISTCLEANFILES = ${SCM_FILE_LINKS}


Property changes on: gnucash/branches/register-rewrite/src/import-export/binary-import
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
.deps
.libs
*.diff
*.gladep
*.lo
*.la
.scm-links
gw-binary-import.scm
gw-binary-import.c
gw-binary-import.h
gw-binary-import.html
semantic.cache

TAGS

   + Makefile
Makefile.in
.deps
.libs
*.diff
*.gladep
*.lo
*.la
.scm-links
semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/import-export/binary-import/druid-commodity.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/binary-import/druid-commodity.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/binary-import/druid-commodity.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -393,9 +393,9 @@
 {
   CommodityDruid * cd = user_data;
   CommodityDruidPage * dpage = g_object_get_data(G_OBJECT(page), "page_struct");
-  const char * new_type;
-  const char * new_name;
-  const char * new_mnemonic;
+  gchar * new_type;
+  const gchar * new_name;
+  const gchar * new_mnemonic;
   gnc_commodity * new_comm;
 
   new_type     = gnc_ui_namespace_picker_ns (dpage->new_type_combo);
@@ -408,6 +408,7 @@
 		       _("You must put values for the type, name, "
 			 "and abbreviation of the currency/stock."));
 
+    g_free(new_type);
     return TRUE;
   }
 
@@ -418,7 +419,7 @@
     gnc_warning_dialog(cd->window,
 		       _("You must enter an existing national "
 			 "currency or enter a different type."));
-
+    g_free(new_type);
     return TRUE;
   }
   new_comm = g_hash_table_lookup(cd->new_map, dpage->old_name);
@@ -428,6 +429,7 @@
   gnc_commodity_set_fullname(new_comm, new_name);
   gnc_commodity_set_namespace_and_mnemonic(new_comm, new_type, new_mnemonic);
 
+  g_free(new_type);
   return FALSE;
 }
 

Modified: gnucash/branches/register-rewrite/src/import-export/generic-import.glade
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/generic-import.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/generic-import.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -261,151 +261,14 @@
 	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 	      <child>
-		<widget class="GtkCList" id="downloaded_clist">
+		<widget class="GtkTreeView" id="downloaded_view">
 		  <property name="visible">True</property>
 		  <property name="can_focus">True</property>
-		  <property name="n_columns">9</property>
-		  <property name="column_widths">67,89,49,109,43,58,32,29,34</property>
-		  <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-		  <property name="show_titles">True</property>
-		  <property name="shadow_type">GTK_SHADOW_IN</property>
-		  <signal name="select_row" handler="downloaded_transaction_select_cb"/>
-		  <signal name="unselect_row" handler="downloaded_transaction_unselect_cb"/>
-
-		  <child>
-		    <widget class="GtkLabel" id="label847716">
-		      <property name="label" translatable="yes">Date</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="label847717">
-		      <property name="label" translatable="yes">Account</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="label847718">
-		      <property name="label" translatable="yes">Amount</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="label847719">
-		      <property name="label" translatable="yes">Description</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="label847720">
-		      <property name="label" translatable="yes">Memo</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.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="label847721">
-		      <property name="label" translatable="yes">A</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="label847722">
-		      <property name="label" translatable="yes">R</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="label847723">
-		      <property name="label" translatable="yes">EDIT</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="label847724">
-		      <property name="label" translatable="yes">Select Import Action</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>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">True</property>
+		  <property name="reorderable">True</property>
+		  <property name="enable_search">False</property>
+		  <property name="fixed_height_mode">False</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -415,6 +278,10 @@
 	      <property name="fill">True</property>
 	    </packing>
 	  </child>
+
+	  <child>
+	    <placeholder/>
+	  </child>
 	</widget>
 	<packing>
 	  <property name="padding">0</property>
@@ -785,105 +652,14 @@
 	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 	      <child>
-		<widget class="GtkCList" id="downloaded_clist">
+		<widget class="GtkTreeView" id="downloaded_view">
 		  <property name="visible">True</property>
-		  <property name="n_columns">6</property>
-		  <property name="column_widths">80,80,80,80,80,80</property>
-		  <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-		  <property name="show_titles">True</property>
-		  <property name="shadow_type">GTK_SHADOW_IN</property>
-		  <signal name="select_row" handler="downloaded_transaction_select_cb"/>
-		  <signal name="unselect_row" handler="downloaded_transaction_unselect_cb"/>
-
-		  <child>
-		    <widget class="GtkLabel" id="label847779">
-		      <property name="label" translatable="yes">Account</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="label847780">
-		      <property name="label" translatable="yes">Date</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="label847781">
-		      <property name="label" translatable="yes">Amount</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_RIGHT</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="label847782">
-		      <property name="label" translatable="yes">Description</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.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="label847783">
-		      <property name="label" translatable="yes">Memo</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="label847784">
-		      <property name="label" translatable="yes">Imbalance</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>
+		  <property name="can_focus">True</property>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">True</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">True</property>
+		  <property name="fixed_height_mode">False</property>
 		</widget>
 	      </child>
 	    </widget>
@@ -924,91 +700,14 @@
 	      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 	      <child>
-		<widget class="GtkCList" id="matched_clist">
+		<widget class="GtkTreeView" id="matched_view">
 		  <property name="visible">True</property>
 		  <property name="can_focus">True</property>
-		  <property name="n_columns">5</property>
-		  <property name="column_widths">80,80,80,80,80</property>
-		  <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-		  <property name="show_titles">True</property>
-		  <property name="shadow_type">GTK_SHADOW_IN</property>
-		  <signal name="select_row" handler="match_transaction_select_cb"/>
-		  <signal name="unselect_row" handler="match_transaction_unselect_cb"/>
-
-		  <child>
-		    <widget class="GtkLabel" id="label847767">
-		      <property name="label" translatable="yes">Confidence</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_RIGHT</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="label847768">
-		      <property name="label" translatable="yes">Date</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="label847769">
-		      <property name="label" translatable="yes">Amount</property>
-		      <property name="use_underline">False</property>
-		      <property name="use_markup">False</property>
-		      <property name="justify">GTK_JUSTIFY_RIGHT</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="label847770">
-		      <property name="label" translatable="yes">Description</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.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="label847771">
-		      <property name="label" translatable="yes">Memo</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>
+		  <property name="headers_visible">True</property>
+		  <property name="rules_hint">True</property>
+		  <property name="reorderable">False</property>
+		  <property name="enable_search">True</property>
+		  <property name="fixed_height_mode">False</property>
 		</widget>
 	      </child>
 	    </widget>

Modified: gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -27,6 +27,12 @@
 		       gnc_import_format_gnome_class_init, NULL,
 		       gnc_import_format_gnome_get_type)
 
+enum ifg_cols {
+ IFG_COL_TEXT = 0,
+ IFG_COL_VALUE,
+ NUM_IFG_COLS
+};
+
 static void
 gnc_import_format_gnome_class_init (GNCImportProvFormatGnomeClass *klass)
 {
@@ -54,39 +60,48 @@
 }
 
 static void
-gnc_ifg_option_changed (GtkWidget *widget, GNCImportProvFormatGnome *prov_f)
+gnc_ifg_option_changed (GtkComboBox *combo, GNCImportProvFormatGnome *prov_f)
 {
-  prov_f->choice = (GncImportFormat)
-    g_object_get_data(G_OBJECT(widget), "option");
-}
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  gint value;
 
-static GtkWidget *
-add_menu_item (GtkWidget *menu, gpointer user_data, char *label,
-	       GncImportFormat option)
-{
-  GtkWidget *item = gtk_menu_item_new_with_label(label);
-  g_object_set_data(G_OBJECT(item), "option", (gpointer) option);
-  g_signal_connect(G_OBJECT(item), "activate", G_CALLBACK(gnc_ifg_option_changed),
-		   user_data);
-  gtk_menu_shell_append(GTK_MENU_SHELL(menu), item);
-  gtk_widget_show(item);
-  return item;
+  g_return_if_fail(GTK_IS_COMBO_BOX(combo));
+  g_return_if_fail(value);
+
+  model = gtk_combo_box_get_model(combo);
+  if (!gtk_combo_box_get_active_iter(combo, &iter))
+    return;
+
+  gtk_tree_model_get(model, &iter, IFG_COL_VALUE, &value, -1);
+  prov_f->choice = (GncImportFormat)value;
 }
 
 #define ADD_MENU_ITEM(str,op) { \
-	if (formats & op) { \
-	    item = add_menu_item(menu, prov_f, str, op); \
-	    if (!first) first = item; \
-	} \
+  gtk_list_store_append(store, &iter); \
+  gtk_list_store_set(store, &iter, \
+		     IFG_COL_TEXT, str, \
+		     IFG_COL_VALUE, op, \
+		     -1); \
 } 
 
 static void
 make_menu (GNCImportProvFormatGnome *prov_f, GncImportFormat formats)
 {
-  GtkWidget *menu, *item, *first = NULL;
+  GtkComboBox *combo = prov_f->format_combo;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkCellRenderer *renderer;
 
-  menu = gtk_menu_new();
+  store = gtk_list_store_new(NUM_IFG_COLS, G_TYPE_STRING, G_TYPE_INT);
+  gtk_combo_box_set_model(combo, GTK_TREE_MODEL(store));
+  g_object_unref(store);
 
+  renderer = gtk_cell_renderer_text_new();
+  gtk_cell_layout_pack_start(GTK_CELL_LAYOUT(combo), renderer, TRUE);
+  gtk_cell_layout_add_attribute(GTK_CELL_LAYOUT(combo), renderer,
+				"text", IFG_COL_TEXT);
+
   /* Numeric formats */
   ADD_MENU_ITEM(_("Period-as-decimal (1,000.00)"), GNCIF_NUM_PERIOD);
   ADD_MENU_ITEM(_("Comma-as-decimal (1.000,00)"), GNCIF_NUM_COMMA);
@@ -97,12 +112,9 @@
   ADD_MENU_ITEM(_("y-m-d"), GNCIF_DATE_YMD);
   ADD_MENU_ITEM(_("y-d-m"), GNCIF_DATE_YDM);
 
-  gtk_option_menu_set_menu(prov_f->format_menu, menu);
-
-  g_signal_emit_by_name(G_OBJECT(first), "activate", prov_f);
-  gtk_option_menu_set_history(prov_f->format_menu, 0);
-
-  gtk_widget_show(menu);
+  g_signal_connect(G_OBJECT(prov_f->format_combo), "changed",
+		   G_CALLBACK(gnc_ifg_option_changed), prov_f);
+  gtk_combo_box_set_active(prov_f->format_combo, 0);
 }
 
 static GNCDruidPage*
@@ -153,7 +165,7 @@
   GNCImportProvFormatGnome *prov;
   GNCImportDescFormat *desc_f;
   GNCImportFormatCB *cb;
-  GtkWidget *window, *page, *label, *format_menu, *sample_label;
+  GtkWidget *window, *page, *label, *format_combo, *sample_label;
   GladeXML *xml;
 
   /* verify that this is the correct provider descriptor */
@@ -183,10 +195,10 @@
   window = glade_xml_get_widget(xml, "Format Provider Window");
   page = glade_xml_get_widget(xml, "Format Provider Page");
   label = glade_xml_get_widget(xml, "inst_label");
-  format_menu = glade_xml_get_widget(xml, "import_format_menu");
+  format_combo = glade_xml_get_widget(xml, "import_format_combo");
   sample_label = glade_xml_get_widget(xml, "format_sample_label");
 
-  prov->format_menu = GTK_OPTION_MENU(format_menu);
+  prov->format_combo = GTK_COMBO_BOX(format_combo);
   prov->sample_label = GTK_LABEL(sample_label);
 
   g_object_ref(page);

Modified: gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/gnc-import-format-gnome.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -28,7 +28,7 @@
   GNCDruidProvider parent;
 
   GnomeDruidPage*	page;
-  GtkOptionMenu*	format_menu;
+  GtkComboBox*		format_combo;
   GtkLabel*		sample_label;
 
   GncImportFormat	choice;

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,6 +6,7 @@
   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 \
@@ -30,6 +31,7 @@
   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 \
@@ -67,7 +69,6 @@
   -I${top_srcdir}/src/register/register-core \
   -I${top_srcdir}/src/register/register-gnome \
   -I${top_srcdir}/src/register/ledger-core \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${GNOME_CFLAGS} \
   ${GTKHTML_CFLAGS} \

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,6 +45,7 @@
 
 #include "gtk-compat.h"
 #include "dialog-utils.h"
+#include "gnc-glib-utils.h"
 #include "gnc-ui.h"
 #include "gnc-amount-edit.h"
 #include "dialog-transfer.h"
@@ -246,7 +247,7 @@
 		GList *templates)
 {
   GladeXML *xml;
-  const char *hbci_bankid, *hbci_bankname;
+  const char *hbci_bankid;
   HBCITransDialog *td;
   GtkTreeSelection *selection;
   GtkTreeViewColumn *column;
@@ -258,7 +259,6 @@
   td->trans_type = trans_type;
   g_assert (h_acc);
   hbci_bankid = AB_Account_GetBankCode(h_acc);
-  hbci_bankname = AB_Account_GetBankName(h_acc);
 #if HAVE_KTOBLZCHECK_H
   td->blzcheck = AccountNumberCheck_new();
 #endif
@@ -272,6 +272,7 @@
 				  GTK_WINDOW (parent));
   
   {
+    gchar *hbci_bankname, *hbci_ownername;
     GtkWidget *heading_label;
     GtkWidget *recp_name_heading;
     GtkWidget *recp_account_heading;
@@ -394,9 +395,16 @@
     /* 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), 
-			AB_Account_GetOwnerName (h_acc));
+			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), 
@@ -405,6 +413,8 @@
 			 _("(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);
@@ -413,6 +423,7 @@
 						 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();
@@ -719,7 +730,7 @@
 }
 
 AB_JOB *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, AB_BANKING *api,
+gnc_hbci_trans_dialog_enqueue(const AB_TRANSACTION *hbci_trans, AB_BANKING *api,
 			      AB_ACCOUNT *h_acc, 
 			      GNC_HBCI_Transtype trans_type) 
 {
@@ -751,7 +762,7 @@
 
   switch (trans_type) {
   case SINGLE_DEBITNOTE:
-    AB_JobSingleDebitNote_SetTransaction(job, td->hbci_trans);
+    AB_JobSingleDebitNote_SetTransaction(job, hbci_trans);
     break;
   case SINGLE_INTERNAL_TRANSFER:
 #if ((AQBANKING_VERSION_MAJOR > 1) || \
@@ -760,12 +771,12 @@
        ((AQBANKING_VERSION_MINOR == 6) && \
         ((AQBANKING_VERSION_PATCHLEVEL > 0) || \
 	 (AQBANKING_VERSION_BUILD > 2))))))
-    AB_JobInternalTransfer_SetTransaction(job, td->hbci_trans);
+    AB_JobInternalTransfer_SetTransaction(job, hbci_trans);
     break;
 #endif
   default:
   case SINGLE_TRANSFER:
-    AB_JobSingleTransfer_SetTransaction(job, td->hbci_trans);
+    AB_JobSingleTransfer_SetTransaction(job, hbci_trans);
   };
 
   /* Add job to queue */
@@ -866,13 +877,26 @@
   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", "ISO-8859-15",
+				      "UTF-8", ktoblzcheck_encoding,
 				      NULL, NULL, &error);
     if (error != NULL) {
-      printf ("Error convertion bankname \"%s\" to UTF-8\n", bankname);
+      printf ("Error converting bankname \"%s\" to UTF-8\n", bankname);
       g_error_free (error);
-      utf8_bankname = g_strdup (bankname);
+      /* 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 ? 

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/dialog-hbcitrans.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -86,7 +86,7 @@
 int gnc_hbci_dialog_run_until_ok(HBCITransDialog *td, 
 				 const AB_ACCOUNT *h_acc);
 AB_JOB *
-gnc_hbci_trans_dialog_enqueue(HBCITransDialog *td, AB_BANKING *api,
+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

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/druid-hbci-initial.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/druid-hbci-initial.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/druid-hbci-initial.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,7 @@
 /********************************************************************\
  * 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   *
@@ -36,6 +37,7 @@
 #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"
@@ -51,6 +53,15 @@
 
 /* #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;
@@ -61,35 +72,19 @@
   
   /* account match page */
   GtkWidget *accountpage;
-  GtkWidget *accountlist;
+  GtkTreeView *accountview;
+  GtkListStore *accountstore;
     
   /* OpenHBCI stuff */
   AB_BANKING *api;
   GNCInteractor *interactor;
 
-  /* account match: row_number (int) -> hbci_account */
-  GHashTable *hbci_hash;
   /* hbci_account (direct) -> gnucash_account  -- DO NOT DELETE THE KEYS! */
   GHashTable *gnc_hash;
 
 };
 
-static gboolean
-hash_remove (gpointer key, gpointer value, gpointer user_data) 
-{
-  free (key);
-  return TRUE;
-}
-
 static void
-delete_hash (GHashTable *hash) 
-{
-  if (hash != NULL) {
-    g_hash_table_foreach_remove (hash, &hash_remove, NULL);
-    g_hash_table_destroy (hash);
-  }
-}
-static void
 reset_initial_info (HBCIInitialInfo *info)
 {
   if (info == NULL) return;
@@ -99,8 +94,6 @@
   }
   info->api = NULL;
 
-  delete_hash (info->hbci_hash);
-  info->hbci_hash = NULL;
   if (info->gnc_hash != NULL)
     g_hash_table_destroy (info->gnc_hash);
   info->gnc_hash = NULL;
@@ -125,21 +118,25 @@
 
 static gchar *gnc_hbci_account_longname(const AB_ACCOUNT *hacc)
 {
-  const char *bankname;
+  gchar *bankname;
+  gchar *result;
   const char *bankcode;
   g_assert(hacc);
-  bankname = AB_Account_GetBankName (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 (bankname)
-    return g_strdup_printf(_("%s at %s (code %s)"),
+  if (strlen(bankname) > 0)
+    result = g_strdup_printf(_("%s at %s (code %s)"),
 			   AB_Account_GetAccountNumber (hacc),
 			   bankname,
 			   bankcode);
   else
-    return g_strdup_printf(_("%s at bank code %s"),
+    result = g_strdup_printf(_("%s at bank code %s"),
 			   AB_Account_GetAccountNumber (hacc),
 			   bankcode);
+  g_free (bankname);
+  return result;
 }
 
 
@@ -150,48 +147,47 @@
 update_accountlist_acc_cb (AB_ACCOUNT *hacc, gpointer user_data)
 {
   HBCIInitialInfo *info = user_data;
-  gchar *row_text[3];
+  gchar *gnc_name, *hbci_name;
   Account *gacc;
-  int row;
-  gint *row_key;
+  GtkTreeIter iter;
 
   g_assert(hacc);
   g_assert(info);
-  row_text[2] = "";
-  
-  row_text[0] = gnc_hbci_account_longname(hacc);
+
+  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)
-    row_text[1] = "";
+    gnc_name = g_strdup("");
   else 
-    row_text[1] = xaccAccountGetFullName (gacc);
+    gnc_name = xaccAccountGetFullName (gacc);
 
-  /* Add this row to the list */
-  row = gtk_clist_append (GTK_CLIST (info->accountlist), row_text);
+  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);
 
-  /* Set the "new" checkbox. */
-  gnc_clist_set_check (GTK_CLIST (info->accountlist), row, 2,
-		       FALSE);
-
-  /* Store the row_number -> hbci_account hash reference. */
-  row_key = g_new(gint, 1);
-  *row_key = row;
-  g_hash_table_insert (info->hbci_hash, row_key, (AB_ACCOUNT*)hacc);
-
+  g_free(gnc_name);
+  g_free(hbci_name);
   return NULL;
 }
 
-/* Update the account list GtkCList widget */
+/* Update the account list GtkListStore widget */
 static void
 update_accountlist (HBCIInitialInfo *info)
 {
-  int sel_row = 0;
   AB_BANKING *banking;
   AB_ACCOUNT_LIST2 *acclist;
+  GtkTreeModel *model;
+  GtkTreeSelection *selection;
+  GtkTreeIter iter;
+  GtkTreePath *path = NULL;
 
   g_assert(info);
   banking = info->api;
@@ -199,15 +195,12 @@
   g_assert(info->gnc_hash);
 
   /* Store old selected row here. */
-  sel_row = (GTK_CLIST(info->accountlist))->focus_row;
+  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_clist_freeze (GTK_CLIST (info->accountlist));
-  gtk_clist_clear (GTK_CLIST (info->accountlist));
-
-  /* Delete old hash with row_number -> hbci_account */
-  delete_hash (info->hbci_hash);
-  info->hbci_hash = g_hash_table_new (&g_int_hash, &g_int_equal);
+  gtk_list_store_clear(info->accountstore);
   
   /* Go through all HBCI accounts */
   acclist = AB_Banking_GetAccounts(banking);
@@ -218,14 +211,13 @@
   else
     printf("update_accountlist: Oops, account list from AB_Banking is NULL.\n");
 
-  /* printf("update_accountlist: HBCI hash has %d entries.\n", g_hash_table_size(info->hbci_hash)); */
   /* printf("update_accountlist: GNC hash has %d entries.\n", g_hash_table_size(info->gnc_hash)); */
-  
-  gtk_clist_thaw (GTK_CLIST (info->accountlist));
 
-  /* move to the old selected row */
-  (GTK_CLIST(info->accountlist))->focus_row = sel_row;
-  gtk_clist_moveto(GTK_CLIST(info->accountlist), sel_row, 0, 0.0, 0.0);
+  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 
@@ -344,17 +336,24 @@
 
 
 static void
-on_accountlist_select_row (GtkCList *clist, gint row,
-			   gint column, GdkEvent *event,
-			   gpointer user_data)
+on_accountlist_changed (GtkTreeSelection *selection,
+			gpointer          user_data)     
 {
   HBCIInitialInfo *info = user_data;
   AB_ACCOUNT *hbci_acc;
   Account *gnc_acc, *old_value;
-  gchar *longname;
+  gchar *longname, *gnc_name;
   gnc_commodity *currency = NULL;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
   
-  hbci_acc = g_hash_table_lookup (info->hbci_hash, &row);
+  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);
 
@@ -371,19 +370,24 @@
     }
 
     gnc_acc = gnc_import_select_account(info->window,
-					NULL, TRUE, longname, currency, BANK,
-					old_value, NULL);
+					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 = xaccAccountGetFullName (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);
     }
-    
-    /* update display */
-    update_accountlist(info);
   } /* hbci_acc */
 }
 
@@ -544,8 +548,6 @@
 
     /* Reset existing mapping tables */
     AB_Banking_Fini (info->api);
-    delete_hash (info->hbci_hash);
-    info->hbci_hash = NULL;
     if (info->gnc_hash != NULL)
       g_hash_table_destroy (info->gnc_hash);
     info->gnc_hash = NULL;
@@ -626,6 +628,9 @@
   HBCIInitialInfo *info;
   GladeXML *xml;
   GtkWidget *page;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkTreeSelection *selection;
   
   info = g_new0 (HBCIInitialInfo, 1);
 
@@ -657,9 +662,40 @@
   {
     page = glade_xml_get_widget(xml, "account_match_page");
     info->accountpage = page;
-    info->accountlist = glade_xml_get_widget(xml, "account_page_list");
-    g_signal_connect (info->accountlist, "select_row",
-		      G_CALLBACK (on_accountlist_select_row), info);
+    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(_("HBCI 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);
   }

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/glade/hbci.glade
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/glade/hbci.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/glade/hbci.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -199,59 +199,14 @@
 		      <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		      <child>
-			<widget class="GtkCList" id="account_page_list">
+			<widget class="GtkTreeView" id="account_page_view">
 			  <property name="visible">True</property>
 			  <property name="can_focus">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>
+			  <property name="headers_visible">True</property>
+			  <property name="rules_hint">True</property>
+			  <property name="reorderable">False</property>
+			  <property name="enable_search">True</property>
+			  <property name="fixed_height_mode">False</property>
 			</widget>
 		      </child>
 		    </widget>

Copied: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-file-aqb-import.c (from rev 15058, gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.c)

Copied: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-file-aqb-import.h (from rev 15058, gnucash/trunk/src/import-export/hbci/gnc-file-aqb-import.h)

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-kvp.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-kvp.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-kvp.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -20,6 +20,7 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 \********************************************************************/
 
+#include "config.h"
 #include "gnc-hbci-kvp.h"
 #include <stdio.h>
 

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-transfer.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-transfer.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-transfer.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -101,6 +101,13 @@
       /* 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);
@@ -111,16 +118,12 @@
 	       maketrans_save_templates(parent, gnc_acc, template_list,
 					(result == GNC_RESPONSE_NOW));
 
-      if ((result != GNC_RESPONSE_NOW) && (result != GNC_RESPONSE_LATER)) {
-	break;
-      } 
-	
       /* Make really sure the dialog is hidden now. */
       gnc_hbci_dialog_hide(td);
 
       {
 	AB_JOB *job = 
-	  gnc_hbci_trans_dialog_enqueue(td, api,
+	  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 */

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -321,7 +321,7 @@
     return FALSE;
 #endif
   case AB_ERROR_NETWORK:
-    GNCInteractor_hide (inter);
+    if (inter) GNCInteractor_hide (inter);
     gnc_error_dialog 
       (parent,
        _("The server of your bank refused the HBCI connection. "
@@ -403,8 +403,9 @@
 			AB_JOB *job, GNCInteractor *inter)
 {
   int err;
-  int resultcode;
+  int resultcode = 3000; /* This code means: Warnings, but not errors */
   int be_verbose = FALSE;
+  g_assert (api);
 	  
   if (inter)
     GNCInteractor_show (inter);
@@ -434,7 +435,8 @@
     
   } while (gnc_hbci_Error_retry (parent, err, inter));
   
-  resultcode = gnc_hbci_debug_outboxjob (job, be_verbose);
+  if (job)
+    resultcode = gnc_hbci_debug_outboxjob (job, be_verbose);
   if (!hbci_Error_isOk(err)) {
 /*     char *errstr =  */
 /*       g_strdup_printf("gnc_AB_BANKING_execute: Error at executeQueue: %s", */
@@ -443,8 +445,8 @@
 /*     HBCI_Interactor_msgStateResponse (HBCI_Hbci_interactor  */
 /* 				      (AB_BANKING_Hbci (api)), errstr); */
 /*     g_free (errstr); */
-    gnc_hbci_debug_outboxjob (job, TRUE);
-    GNCInteractor_show_nodelete (inter);
+    if (job) gnc_hbci_debug_outboxjob (job, TRUE);
+    if (inter) GNCInteractor_show_nodelete (inter);
     return FALSE;
   }
 

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/gnc-hbci-utils.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -90,7 +90,9 @@
 /* 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. */
+ * 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);

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci-ui.xml
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci-ui.xml	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci-ui.xml	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,5 +1,17 @@
 <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="FileCsvImport" action="CsvImportAction"/>
+      	   <menuitem name="FileDtausImportsend" action="DtausImportSendAction"/>
+      	   <menuitem name="FileCsvImportsend" action="CsvImportSendAction"/>
+      	</placeholder>
+      </menu>
+    </menu>
     <menu name="Actions" action="ActionsAction">
       <placeholder name="ActionsPlaceholder">
         <menu name="OnlineActions"           action="OnlineActionsAction">

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/gnc-plugin-hbci.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -33,6 +33,7 @@
 #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"
@@ -75,6 +76,12 @@
 static void gnc_plugin_hbci_cmd_issue_inttransaction (GtkAction *action, GncMainWindowActionData *data);
 #endif
 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"
@@ -110,6 +117,27 @@
   { "HbciIssueDirectDebitAction", NULL, N_("_Direct Debit..."), NULL,
     N_("Issue a new direct debit note online through HBCI/AqBanking"),
     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) },
+  { "CsvImportAction", GTK_STOCK_CONVERT, N_("Import _CSV"), NULL,
+    N_("Import a CSV file into GnuCash"),
+    G_CALLBACK (gnc_plugin_hbci_cmd_csv_import) },
+  { "DtausImportSendAction", GTK_STOCK_CONVERT, N_("Import DTAUS and _send..."), NULL,
+    N_("Import a DTAUS file into GnuCash and send the transfers online through HBCI/AqBanking"),
+    G_CALLBACK (gnc_plugin_hbci_cmd_dtaus_importsend) },
+  { "CsvImportSendAction", GTK_STOCK_CONVERT, N_("Import CSV and s_end..."), NULL,
+    N_("Import a CSV file into GnuCash and send the transfers online through HBCI/AqBanking"),
+    G_CALLBACK (gnc_plugin_hbci_cmd_csv_importsend) },
+
 };
 static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
 
@@ -511,6 +539,43 @@
   LEAVE(" ");
 }
 
+static void
+gnc_plugin_hbci_cmd_dtaus_importsend (GtkAction *action,
+				  GncMainWindowActionData *data)
+{
+  gnc_file_aqbanking_import ("dtaus", "default", TRUE);
+}
+static void
+gnc_plugin_hbci_cmd_csv_importsend (GtkAction *action,
+				  GncMainWindowActionData *data)
+{
+  gnc_file_aqbanking_import ("csv", "default", TRUE);
+}
+
+static void
+gnc_plugin_hbci_cmd_mt940_import (GtkAction *action,
+				  GncMainWindowActionData *data)
+{
+  gnc_file_aqbanking_import ("swift", "swift-mt940", FALSE);
+}
+static void
+gnc_plugin_hbci_cmd_mt942_import (GtkAction *action,
+				  GncMainWindowActionData *data)
+{
+  gnc_file_aqbanking_import ("swift", "swift-mt942", FALSE);
+}
+static void
+gnc_plugin_hbci_cmd_dtaus_import (GtkAction *action,
+				  GncMainWindowActionData *data)
+{
+  gnc_file_aqbanking_import ("dtaus", "default", FALSE);
+}
+static void
+gnc_plugin_hbci_cmd_csv_import (GtkAction *action,
+				  GncMainWindowActionData *data)
+{
+  gnc_file_aqbanking_import ("csv", "default", FALSE);
+}
 /************************************************************
  *                    Plugin Bootstrapping                   *
  ************************************************************/

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -102,12 +102,18 @@
  */
 
 
-GtkWidget *GNCInteractor_parent(GNCInteractor *i)
+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);

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/hbci-interaction.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -44,7 +44,8 @@
 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(GNCInteractor *i);
+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.) */

Modified: gnucash/branches/register-rewrite/src/import-export/hbci/schemas/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/hbci/schemas/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/hbci/schemas/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,10 +12,10 @@
 install-data-local:
 if GCONF_SCHEMAS_INSTALL
 	-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
-	-GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA)
+	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-2 --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
 endif

Modified: gnucash/branches/register-rewrite/src/import-export/import-account-matcher.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-account-matcher.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-account-matcher.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -98,17 +98,18 @@
   Account *selected_account, *new_account;
   GList * valid_types = NULL;
   /*DEBUG("Begin");  */
-  
-  if(picker->new_account_default_type!=NO_TYPE)
+
+  if(picker->new_account_default_type!=ACCT_TYPE_NONE)
     {
       /*Yes, this is weird, but we really DO want to pass the value instead of the pointer...*/
-     valid_types = g_list_prepend(valid_types, (gpointer)picker->new_account_default_type);
+      valid_types = g_list_prepend(valid_types, GINT_TO_POINTER(picker->new_account_default_type));
     }
   selected_account = gnc_tree_view_account_get_selected_account(picker->account_tree);
   new_account = gnc_ui_new_accounts_from_name_with_defaults ( picker->account_human_description,
 							      valid_types,
 							      picker->new_account_default_commodity,
 							      selected_account);
+  g_list_free(valid_types);
   gnc_tree_view_account_set_selected_account(picker->account_tree, new_account);
 }
 

Modified: gnucash/branches/register-rewrite/src/import-export/import-account-matcher.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-account-matcher.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-account-matcher.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -65,10 +65,10 @@
 
     @param new_account_default_type
 	 Default account type of a
-    new account. Can be NULL.  If not NO_TYPE, it will be the
-    account's type if a new account is created.  If not NO_TYPE, the
-    function will also warn the user if the found or created account's
-    commodity doesn't match.
+    new account. Can be NULL.  If not ACCT_TYPE_NONE, it will be the
+    account's type if a new account is created.  If not
+    ACCT_TYPE_NONE, the function will also warn the user if the found
+    or created account's commodity doesn't match.
 
     @param auto_create 
          Only active if no account with the

Modified: gnucash/branches/register-rewrite/src/import-export/import-backend.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-backend.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-backend.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
     @brief import-backend.c: Generic importer backend implementation (duplicate matching algorithm, action handling,  etc.)
     @author Copyright (C) 2002 Benoit Grégoire
     @author Christian Stimming
+    @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
  
 #include "config.h"
@@ -256,9 +257,9 @@
   }
 }
 
-GdkPixmap* gen_probability_pixmap(gint score_original, GNCImportSettings *settings, GtkWidget * widget)
+GdkPixbuf* gen_probability_pixbuf(gint score_original, GNCImportSettings *settings, GtkWidget * widget)
 {
-  GdkPixmap* retval = NULL;
+  GdkPixbuf* retval = NULL;
   gint i, j;
   gint score;
   const gint height = 15;
@@ -339,11 +340,7 @@
 	}
     }  
   
-  retval =  gdk_pixmap_colormap_create_from_xpm_d    (NULL,
-						      gtk_widget_get_colormap(widget),
-						      NULL,
-						      NULL,
-						      xpm);
+  retval =  gdk_pixbuf_new_from_xpm_data((const gchar **)xpm);
   for(i=0;i<=num_colors+height;i++)
     { 
       /*DEBUG("free_loop i=%d%s%s",i,": ",xpm[i]);*/
@@ -595,7 +592,9 @@
       /*DEBUG(" downloaded_split_amount=%f", downloaded_split_amount);*/
       match_split_amount = gnc_numeric_to_double(xaccSplitGetAmount(split));
       /*DEBUG(" match_split_amount=%f", match_split_amount);*/
-      if(downloaded_split_amount == match_split_amount)
+      if(fabs(downloaded_split_amount - match_split_amount) < 1e-6)
+	/* bug#347791: Doubly type shouldn't be compared for exact
+	   equality, so we're using fabs() instead. */
 	/*if (gnc_numeric_equal(xaccSplitGetAmount
 	  (gnc_import_TransInfo_get_fsplit (trans_info)),
 	  xaccSplitGetAmount(split))) 
@@ -820,23 +819,14 @@
 /***********************************************************************
  */
 
-/** /brief -- Processes every selected match
+/** /brief -- Processes one match
    according to its selected action.  */
-void
-gnc_import_process_trans_clist (GtkCList *clist, 
-				GncImportMatchMap *matchmap)
+gboolean
+gnc_import_process_trans_item (GncImportMatchMap *matchmap,
+			       GNCImportTransInfo *trans_info)
 {
-  GNCImportTransInfo * trans_info;
-  gint row_number = 0, i = 0;
-  g_assert (clist);
-  
   /* DEBUG("Begin"); */
-  gtk_clist_freeze (clist);
-  trans_info = 
-    (GNCImportTransInfo *) gtk_clist_get_row_data(clist, 0);
-  
-  for(i = 1; trans_info != NULL; i++)
-    {
+
       g_assert (trans_info);
       /*DEBUG("Iteration %d, action %d, split %s", i, 
 	trans_info->action,
@@ -845,7 +835,7 @@
       switch (gnc_import_TransInfo_get_action (trans_info))
 	{
 	case GNCImport_SKIP:
-	  break;
+	  return FALSE;
 	case GNCImport_ADD:
 	  /* Transaction gets imported. */
 
@@ -887,7 +877,7 @@
 	  /* Done editing. */
 	  xaccTransCommitEdit 
 	    (gnc_import_TransInfo_get_trans (trans_info));
-	  break;
+	  return TRUE;
 	case GNCImport_CLEAR: {
 	  GNCImportMatchInfo *selected_match =
 	    gnc_import_TransInfo_get_selected_match (trans_info);
@@ -944,31 +934,15 @@
 	      trans_info->trans = NULL;
 	    }
 	  }
-	  break;
+	  return TRUE;
 	case GNCImport_EDIT:
 	    PERR("EDIT action is UNSUPPORTED!");
 	  break;
 	default:
 	  DEBUG("Invalid GNCImportAction for this imported transaction.");
 	}
-
-      /* For all actions except SKIP delete this transaction now. */
-      if(trans_info->action != GNCImport_SKIP) {
-	row_number = gtk_clist_find_row_from_data(clist, trans_info);
-	gtk_clist_remove (clist, row_number);
-	/* decrement the iteration counter since we've just removed
-	   one row. */
-	i--;
-      }
-
-      /* Get next trans_info, NULL if finished */
-      trans_info =
-	(GNCImportTransInfo *) gtk_clist_get_row_data(clist, i);
-    }
-  
   /*DEBUG("End");*/
-  gtk_clist_thaw (clist);
-  /*DEBUG("Thawed.")*/
+  return FALSE;
 }
 
 /********************************************************************\

Modified: gnucash/branches/register-rewrite/src/import-export/import-backend.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-backend.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-backend.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,7 +21,8 @@
 /** @file import-backend.h
     @brief Generic importer backend interface
     @author Copyright (C) 2002 Benoit Grégoire
-	@author Christian Stimming
+    @author Christian Stimming
+    @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
  
 #ifndef TRANSACTION_MATCHER_H
@@ -100,23 +101,25 @@
 				   GNCImportSettings *settings);
 
 /** This function is intended to be called when the importer dialog is
- * finished. It iterates through the GtkCList of imported transaction
- * * (i.e. the TransInfo as user_data in each row is considered) and
- * processes each ImportTransInfo according to its selected action:
+ * finished. It should be called once for each imported transaction
+ * and processes each ImportTransInfo according to its selected action:
  * For GNCImport_ADD, the transaction is added etc. etc. 
  *
  * Each succesful match is also stored in the given ImportMatchMap,
  * or, if that argument is NULL, in the ImportMatchMap of each
  * originating account.
  *
- * @param clist The GtkCList to iterate over.
- *
  * @param matchmap The ImportMatchMap where each match should be
  * stored. May be NULL, in which case the ImportMatchMap of each
- * account will be used. */
-void
-gnc_import_process_trans_clist (GtkCList *clist, 
-				GncImportMatchMap *matchmap);
+ * account will be used.
+ *
+ * @param trans_info The ImportTransInfo item to process.
+ *
+ * @return TRUE if the item has been processed.
+ */
+gboolean
+gnc_import_process_trans_item (GncImportMatchMap *matchmap,
+			       GNCImportTransInfo *trans_info);
 
 /** This function generates a new pixmap representing a match score.
     It is a series of vertical bars of different colors.  
@@ -131,7 +134,7 @@
     @param widget The parent widget in which the pixmap will eventually
     be added.  Will be used to generate the colormap.
  */
-GdkPixmap* gen_probability_pixmap (gint score, 
+GdkPixbuf* gen_probability_pixbuf (gint score, 
 				   GNCImportSettings *settings,
 				   GtkWidget * widget);
 

Modified: gnucash/branches/register-rewrite/src/import-export/import-main-matcher.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-main-matcher.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-main-matcher.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,10 +23,11 @@
     @brief Transaction matcher main window
     @author Copyright (C) 2002 Benoit Grégoire
     @author Christian Stimming    
+    @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
 #include "config.h"
 
-#include <gnome.h>
+#include <gtk/gtk.h>
 #include <glib/gi18n.h>
 
 #include "import-main-matcher.h"
@@ -46,180 +47,45 @@
 struct _main_matcher_info
 {
   GtkWidget *dialog;
-  GtkWidget *clist;
+  GtkTreeView *view;
   GNCImportSettings *user_settings;
-  GdkPixmap* fleche_pixmap;
-  GdkPixmap* checkbox_checked_pixmap;
-  GdkPixmap* checkbox_unchecked_pixmap;
-  GdkColor color_back_white;
   GdkColor color_back_red;
   GdkColor color_back_green;
   GdkColor color_back_yellow;
   int selected_row;
 };
 
-#define NUM_COLUMNS_DOWNLOADED_CLIST 9
-#define DOWNLOADED_CLIST_ACCOUNT 1
-#define DOWNLOADED_CLIST_DATE 0
-#define DOWNLOADED_CLIST_AMOUNT 2
-#define DOWNLOADED_CLIST_DESCRIPTION 3
-#define DOWNLOADED_CLIST_MEMO 4
-#define DOWNLOADED_CLIST_ACTION_ADD 5
-#define DOWNLOADED_CLIST_ACTION_CLEAR 6
-#define DOWNLOADED_CLIST_ACTION_EDIT 7
-#define DOWNLOADED_CLIST_ACTION_INFO 8
-static QofLogModule log_module = GNC_MOD_IMPORT;
+enum downloaded_cols {
+  DOWNLOADED_COL_DATE = 0,
+  DOWNLOADED_COL_ACCOUNT,
+  DOWNLOADED_COL_AMOUNT,
+  DOWNLOADED_COL_DESCRIPTION,
+  DOWNLOADED_COL_MEMO,
+  DOWNLOADED_COL_ACTION_ADD,
+  DOWNLOADED_COL_ACTION_CLEAR,
+  DOWNLOADED_COL_ACTION_EDIT,
+  DOWNLOADED_COL_ACTION_INFO,
+  DOWNLOADED_COL_ACTION_PIXBUF,
+  DOWNLOADED_COL_DATA,
+  DOWNLOADED_COL_COLOR,
+  NUM_DOWNLOADED_COLS
+};
 
-/* Local prototypes */
-static void automatch_clist_transactions(GNCImportMainMatcher *info, GtkCList *clist, int starting_row);
+#define COLOR_RED    "brown1"
+#define COLOR_YELLOW "gold"
+#define COLOR_GREEN  "DarkSeaGreen1"
 
+static QofLogModule log_module = GNC_MOD_IMPORT;
 
-
-static char * fleche_xpm[] = {
-"17 22 41 1",
-" 	c None",
-".	c #FFFFFF",
-"+	c #000000",
-"@	c #FFFAFF",
-"#	c #F6FFF6",
-"$	c #EEEEE6",
-"%	c #B4B29C",
-"&	c #F6F6F6",
-"*	c #F6F2F6",
-"=	c #EFF7EF",
-"-	c #EEF2EE",
-";	c #EEEEEE",
-">	c #F6EEF6",
-",	c #E6EEE6",
-"'	c #EEEAEE",
-")	c #E6EAE6",
-"!	c #EEE6EE",
-"~	c #E6E6E6",
-"{	c #DEE2DE",
-"]	c #E6E2E6",
-"^	c #DEDEDE",
-"/	c #E6DEE6",
-"(	c #DEDADE",
-"_	c #D5DED5",
-":	c #D5DAD5",
-"<	c #DED6DE",
-"[	c #D5D6D5",
-"}	c #D5D2D5",
-"|	c #CDD6CD",
-"1	c #CDD2CD",
-"2	c #CDCECD",
-"3	c #D5CED5",
-"4	c #CDCACD",
-"5	c #C5CAC5",
-"6	c #C5C6C5",
-"7	c #CDC6CD",
-"8	c #BDC6BD",
-"9	c #C5C2C5",
-"0	c #C5BEC5",
-"a	c #BDC2BD",
-"b	c #BDBEBD",
-".+++++++++++++++.",
-"+ at .............#+",
-"+.$$$$$$$$$$$$$%+",
-"+.$&&*&&&&&=&&&%+",
-"+.$*--*-**-*-*-%+",
-"+.$;;;;>-;;;;;-%+",
-"+.$,',';;';',';%+",
-"+.$)!)!)!))))')%+",
-"+.$~~~~~~~~~~~~%+",
-"+.${]+++++++]]]%+",
-"+.${^/+++++/{^{%+",
-"+.$(^(_+++((_(^%+",
-"+.$:<:(<+<::<(<%+",
-"+.$[[<[[[[[<[[[%+",
-"+.$}|}}}}|}}}}}%+",
-"+.$111112131131%+",
-"+.$242442422424%+",
-"+.$454545444545%+",
-"+.$676676656767%+",
-"+.$689689696966%+",
-"+0%%%%%%%%%%%%%a+",
-"b+++++++++++++++b"};
-
-static char * checkbox_checked_xpm[] = {
-"16 16 28 1",
-" 	c None",
-".	c #20449C",
-"+	c #000000",
-"@	c #FFFFFF",
-"#	c #D5D2D5",
-"$	c #EEEEEE",
-"%	c #B4B6B4",
-"&	c #20409C",
-"*	c #DEE2DE",
-"=	c #E6E6E6",
-"-	c #EEEAEE",
-";	c #838183",
-">	c #184094",
-",	c #CDCACD",
-"'	c #8B898B",
-")	c #949594",
-"!	c #9C999C",
-"~	c #A4A5A4",
-"{	c #C5C6C5",
-"]	c #949194",
-"^	c #A4A1A4",
-"/	c #BDBABD",
-"(	c #DEDADE",
-"_	c #C5C2C5",
-":	c #BDBEBD",
-"<	c #DEDEDE",
-"[	c #D5D6D5",
-"}	c #ACAAAC",
-" .............. ",
-"................",
-"..++++++++++++..",
-"..+@@@@@@@@@#+..",
-"..+@$$$$$$$+%+..",
-"..+@$$$$$$++++&.",
-"..+@$+*=-+++;+>.",
-"..+ at +++,+++''+&.",
-"..+@=+++++)!~+..",
-"..+ at -{+++]^//+..",
-"..+@$(_+]^_#:+..",
-"..+@<[#/}/#[:+..",
-"..+#:::/%/:::+..",
-"..++++++++++++..",
-"................",
-" .............. "};
-
-static char * checkbox_unchecked_xpm[] = {
-"12 12 14 1",
-" 	c None",
-".	c #000000",
-"+	c #FFFFFF",
-"@	c #A4A5A4",
-"#	c #DEE2DE",
-"$	c #7B7D7B",
-"%	c #DEDEDE",
-"&	c #D5D6D5",
-"*	c #CDD2CD",
-"=	c #CDCACD",
-"-	c #C5C6C5",
-";	c #C5C2C5",
-">	c #BDBEBD",
-",	c #ACAEAC",
-"............",
-".+++++++++ at .",
-".+########$.",
-".+%%%%%%%%$.",
-".+&&&&&&&&$.",
-".+********$.",
-".+========$.",
-".+--;---;-$.",
-".+>>>>>>>>$.",
-".+,,,,,,,,$.",
-".@$$$$$$$$$.",
-"............"};
-
+/* Local prototypes */
 static void
-refresh_clist_row (GNCImportMainMatcher *gui, 
-		   int row_number, GNCImportTransInfo *info);
+automatch_store_transactions(GNCImportMainMatcher *info,
+			     GtkTreeModel *model,
+			     GtkTreeIter *iter,
+			     GNCImportTransInfo *trans_info);
+static void
+refresh_model_row(GNCImportMainMatcher *gui, GtkTreeModel *model,
+		  GtkTreeIter *iter, GNCImportTransInfo *info);
 
 void gnc_gen_trans_list_delete (GNCImportMainMatcher *info)
 {
@@ -234,13 +100,49 @@
 
 static void 
 on_matcher_ok_clicked (GtkButton *button,
-			   gpointer user_data)
+		       GNCImportMainMatcher *info)
 {
-  GNCImportMainMatcher *info = user_data;
+  GtkTreeModel *model;
+  GtkTreePath *path;
+  GtkTreeRowReference *ref;
+  GtkTreeIter iter;
+  GNCImportTransInfo *trans_info;
+  GSList *refs_list = NULL, *item;
+
   g_assert (info);
+
   /*   DEBUG ("Begin") */
-  gnc_import_process_trans_clist (GTK_CLIST (info->clist), NULL);
+
+  model = gtk_tree_view_get_model(info->view);
+  if (!gtk_tree_model_get_iter_first(model, &iter))
+    return;
+
+  do {
+    gtk_tree_model_get(model, &iter,
+		       DOWNLOADED_COL_DATA, &trans_info,
+		       -1);
+    if (gnc_import_process_trans_item (NULL, trans_info)) {
+      path = gtk_tree_model_get_path(model, &iter);
+      ref = gtk_tree_row_reference_new(model, path);
+      refs_list = g_slist_append(refs_list, ref);
+      gtk_tree_path_free(path);
+    }
+  } while (gtk_tree_model_iter_next (model, &iter));
+
   /* DEBUG ("Deleting") */
+  /* DRH: Is this necessary. Isn't the call to trans_list_delete at
+     the end of this routine going to destroy the entire list store
+     anyway? */
+  for (item = refs_list; item; item = g_slist_next(item)) {
+    ref = item->data;
+    path =  gtk_tree_row_reference_get_path(ref);
+    if (gtk_tree_model_get_iter(model, &iter, path))
+      gtk_list_store_remove(GTK_LIST_STORE(model), &iter);
+    gtk_tree_path_free(path);
+    gtk_tree_row_reference_free(ref);
+  }
+  g_slist_free(refs_list);
+
   gnc_gen_trans_list_delete (info);
   /* DEBUG ("End") */
 }
@@ -292,7 +194,9 @@
 
 static void 
 run_account_picker_dialog (GNCImportMainMatcher *info, 
-			   gint row, GNCImportTransInfo *trans_info)
+			   GtkTreeModel *model,
+			   GtkTreeIter *iter,
+			   GNCImportTransInfo *trans_info)
 {
   Account *old_acc, *new_acc;
   gboolean ok_pressed;
@@ -303,7 +207,7 @@
 				      TRUE,
 				      _("Destination account for the auto-balance split."),
 				      xaccTransGetCurrency(gnc_import_TransInfo_get_trans(trans_info)),
-				      NO_TYPE,
+				      ACCT_TYPE_NONE,
 				      old_acc,
 				      &ok_pressed);
   if(ok_pressed)
@@ -313,112 +217,245 @@
 					TRUE);
 
       /* Iterate through the transactions in a given clist to auto match them */
-      automatch_clist_transactions(info, (GtkCList*)info->clist, row);
+      automatch_store_transactions(info, model, iter, trans_info);
     }
 }
 
 static void 
 run_match_dialog (GNCImportMainMatcher *info, 
-		  gint row, GNCImportTransInfo *trans_info)
+		  GNCImportTransInfo *trans_info)
 {
   gnc_import_match_picker_run_and_close (trans_info);
 }
 
 static void
-clist_select_row_cb (GtkCList *clist,
-		     gint row_number,
-		     gint column,
-		     GdkEventButton *event,
-		     gpointer user_data) 
+gnc_gen_trans_add_toggled_cb (GtkCellRendererToggle *cell_renderer,
+			      gchar                 *path,
+			      GNCImportMainMatcher  *gui)
 {
-  GNCImportMainMatcher *gui = user_data; 
+  GtkTreeModel *model;
+  GtkTreeIter iter;
   GNCImportTransInfo *trans_info;
-  gboolean should_refresh = TRUE;
-  /*DEBUG("row_number: %d%s%d",row_number,", column: ",column);*/
-  trans_info = gtk_clist_get_row_data (clist, row_number);
-  if (trans_info == NULL)
+
+  model = gtk_tree_view_get_model(gui->view);
+  if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
     return;
+  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
 
-  switch(column)
+  if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_ADD 
+      && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
     {
-    case DOWNLOADED_CLIST_ACTION_ADD:
-     if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_ADD 
-	 && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
-       {
-	 gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
-       }
-     else
-       {
-	 gnc_import_TransInfo_set_action(trans_info, GNCImport_ADD);
-       }
+      gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
+    }
+  else
+    {
+      gnc_import_TransInfo_set_action(trans_info, GNCImport_ADD);
+    }
+  refresh_model_row(gui, model, &iter, trans_info);
+}
+
+static void
+gnc_gen_trans_clear_toggled_cb (GtkCellRendererToggle *cell_renderer,
+				gchar                 *path,
+				GNCImportMainMatcher  *gui)
+{
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  GNCImportTransInfo *trans_info;
+
+  model = gtk_tree_view_get_model(gui->view);
+  if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
+    return;
+  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+
+  if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_CLEAR
+      && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
+    {
+      gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
+    }
+  else
+    {
+      gnc_import_TransInfo_set_action(trans_info, GNCImport_CLEAR);
+    }
+  refresh_model_row(gui, model, &iter, trans_info);
+}
+
+static void
+gnc_gen_trans_edit_toggled_cb (GtkCellRendererToggle *cell_renderer,
+			       gchar                 *path,
+			       GNCImportMainMatcher  *gui)
+{
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  GNCImportTransInfo *trans_info;
+
+  model = gtk_tree_view_get_model(gui->view);
+  if (!gtk_tree_model_get_iter_from_string(model, &iter, path))
+    return;
+  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+
+  if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_EDIT
+      && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
+    {
+      gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
+    }
+  else
+    {
+      gnc_import_TransInfo_set_action(trans_info, GNCImport_EDIT);
+    }
+  refresh_model_row(gui, model, &iter, trans_info);
+}
+
+static void
+gnc_gen_trans_row_activated_cb (GtkTreeView           *view,
+				GtkTreePath           *path,
+				GtkTreeViewColumn     *column,
+				GNCImportMainMatcher  *gui)    
+{
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  GNCImportTransInfo *trans_info;
+
+  model = gtk_tree_view_get_model(gui->view);
+  if (!gtk_tree_model_get_iter(model, &iter, path))
+    return;
+  gtk_tree_model_get(model, &iter, DOWNLOADED_COL_DATA, &trans_info, -1);
+
+  switch(gnc_import_TransInfo_get_action (trans_info))
+    {
+    case GNCImport_ADD:
+      if (gnc_import_TransInfo_is_balanced(trans_info) == FALSE) {
+	run_account_picker_dialog (gui, model, &iter, trans_info);
+      }
       break;
-    case DOWNLOADED_CLIST_ACTION_CLEAR:
-      if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_CLEAR
-	  && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
-	{
-	  gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
-	}
-      else
-	{
-	  gnc_import_TransInfo_set_action(trans_info, GNCImport_CLEAR);
-	}
+    case GNCImport_CLEAR:
+      run_match_dialog (gui, trans_info);
       break;
-    case DOWNLOADED_CLIST_ACTION_EDIT: 
-      if( gnc_import_TransInfo_get_action(trans_info)==GNCImport_EDIT
-	  && gnc_import_Settings_get_action_skip_enabled (gui->user_settings)==TRUE)
-	{
-	  gnc_import_TransInfo_set_action(trans_info, GNCImport_SKIP);
-	}
-      else
-	{
-	  gnc_import_TransInfo_set_action(trans_info, GNCImport_EDIT);
-	}
+    case GNCImport_SKIP:
+      /*The information displayed is only informative, until you select an action*/
       break;
-    case DOWNLOADED_CLIST_ACTION_INFO:
-      switch(gnc_import_TransInfo_get_action (trans_info))
-	{
-	case GNCImport_ADD:
-	  if(gnc_import_TransInfo_is_balanced(trans_info)==FALSE)
-	    {
-	      run_account_picker_dialog (gui, row_number, trans_info);
-	    }
-	  break;
-	case GNCImport_CLEAR:
-	  run_match_dialog (gui, row_number, trans_info);
-	  break;
-	case GNCImport_SKIP:
-	  /*The information displayed is only informative, until you select an action*/
-	  break;
-	default:
-	  PERR("I don't know what to do! (Yet...)");
-	}
-      break;
     default:
-      /*Do nothing for other columns*/
-      should_refresh = FALSE;
+      PERR("I don't know what to do! (Yet...)");
     }
-  
-  if(should_refresh == TRUE)/*If there was a change, refresh the GUI for that row*/
-    {
-      refresh_clist_row (gui, row_number, trans_info);
-    }
-  gtk_clist_unselect_row (clist,
-			  row_number,
-			  column);
+  refresh_model_row(gui, model, &iter, trans_info);
 }
 
-static void gnc_gen_trans_list_freeze (GNCImportMainMatcher *gui)
+static void
+gnc_gen_trans_row_changed_cb (GtkTreeSelection *selection,
+			      GNCImportMainMatcher *gui)
 {
-  g_assert (gui);
-  gtk_clist_freeze (GTK_CLIST (gui->clist));
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+
+  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+    return;
+  gtk_tree_selection_unselect_iter(selection, &iter);
 }
 
-static void gnc_gen_trans_list_thaw (GNCImportMainMatcher *gui)
+static GtkTreeViewColumn *
+add_text_column(GtkTreeView *view, const gchar *title, int col_num)
 {
-  g_assert (gui);
-  gtk_clist_thaw (GTK_CLIST (gui->clist));
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+ 
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes
+    (title, renderer,
+     "text", col_num,
+     "background", DOWNLOADED_COL_COLOR,
+     NULL);
+  g_object_set(G_OBJECT(column),
+	       "reorderable", TRUE,
+	       "resizable", TRUE,
+	       NULL);
+  gtk_tree_view_append_column(view, column);
+  return column;
 }
 
+static GtkTreeViewColumn *
+add_toggle_column(GtkTreeView *view, const gchar *title, int col_num,
+		  GCallback cb_fn, gpointer cb_arg)
+{
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+ 
+  renderer = gtk_cell_renderer_toggle_new();
+  column = gtk_tree_view_column_new_with_attributes
+    (title, renderer,
+     "active", col_num,
+     "cell-background", DOWNLOADED_COL_COLOR,
+     NULL);
+  g_object_set(G_OBJECT(column),
+	       "reorderable", TRUE,
+	       NULL);
+  g_signal_connect(renderer, "toggled", cb_fn, cb_arg);
+  gtk_tree_view_append_column(view, column);
+  return column;
+}
+
+static void
+gnc_gen_trans_init_view (GNCImportMainMatcher *info,
+			 gboolean show_account,
+			 gboolean show_edit)
+{
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkTreeSelection *selection;
+
+  view = info->view;
+  store = gtk_list_store_new(NUM_DOWNLOADED_COLS,
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN,
+			     G_TYPE_BOOLEAN, G_TYPE_BOOLEAN, G_TYPE_STRING,
+			     GDK_TYPE_PIXBUF, G_TYPE_POINTER, G_TYPE_STRING);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  /* Add the columns */
+  add_text_column(view, _("Date"), DOWNLOADED_COL_DATE);
+  column = add_text_column(view, _("Account"), DOWNLOADED_COL_ACCOUNT);
+  gtk_tree_view_column_set_visible(column, show_account);
+  add_text_column(view, _("Amount"), DOWNLOADED_COL_AMOUNT);
+  add_text_column(view, _("Description"), DOWNLOADED_COL_DESCRIPTION);
+  add_text_column(view, _("Memo"), DOWNLOADED_COL_MEMO);
+  add_toggle_column(view, _("A"), DOWNLOADED_COL_ACTION_ADD,
+		    G_CALLBACK(gnc_gen_trans_add_toggled_cb), info);
+  add_toggle_column(view, _("R"), DOWNLOADED_COL_ACTION_CLEAR,
+		    G_CALLBACK(gnc_gen_trans_clear_toggled_cb), info);
+  column = add_toggle_column(view, _("Edit"), DOWNLOADED_COL_ACTION_EDIT,
+			     G_CALLBACK(gnc_gen_trans_edit_toggled_cb), info);
+  gtk_tree_view_column_set_visible(column, show_edit);
+
+
+  /* The last column has multiple renderers */
+  renderer = gtk_cell_renderer_pixbuf_new();
+  g_object_set(renderer, "xalign", 0.0, NULL);
+  column = gtk_tree_view_column_new_with_attributes(_("Info"), renderer,
+				      "pixbuf", DOWNLOADED_COL_ACTION_PIXBUF,
+				      "cell-background", DOWNLOADED_COL_COLOR,
+				      NULL);
+  renderer = gtk_cell_renderer_text_new();
+  gtk_tree_view_column_pack_start(column, renderer, TRUE);
+  gtk_tree_view_column_set_attributes(column, renderer,
+				      "text", DOWNLOADED_COL_ACTION_INFO,
+				      "background", DOWNLOADED_COL_COLOR,
+				      NULL);
+  g_object_set(G_OBJECT(column),
+	       "reorderable", TRUE,
+	       "resizable", TRUE,
+	       NULL);
+  gtk_tree_view_append_column(info->view, column);
+
+
+  selection = gtk_tree_view_get_selection(info->view);
+  g_signal_connect(info->view, "row-activated",
+		   G_CALLBACK(gnc_gen_trans_row_activated_cb), info);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(gnc_gen_trans_row_changed_cb), info);
+}
+
 GNCImportMainMatcher *gnc_gen_trans_list_new (GtkWidget *parent, 
 					      const gchar* heading,
 					      gboolean all_from_same_account,
@@ -427,6 +464,7 @@
   GNCImportMainMatcher *info;
   GladeXML *xml;
   GtkWidget *heading_label;
+  gboolean show_edit;
   
   info = g_new0 (GNCImportMainMatcher, 1);
 
@@ -439,8 +477,11 @@
 
   info->dialog = glade_xml_get_widget (xml, "transaction_matcher");
   g_assert (info->dialog != NULL);
-  info->clist = glade_xml_get_widget (xml, "downloaded_clist");
-  g_assert (info->clist != NULL);
+  info->view = GTK_TREE_VIEW(glade_xml_get_widget (xml, "downloaded_view"));
+  g_assert (info->view != NULL);
+
+  show_edit = gnc_import_Settings_get_action_edit_enabled (info->user_settings);
+  gnc_gen_trans_init_view(info, all_from_same_account, show_edit);
   heading_label = glade_xml_get_widget (xml, "heading_label");
   g_assert (heading_label != NULL);
 
@@ -449,9 +490,6 @@
 				  GTK_WINDOW (parent));*/
 
   /* Connect signals */
-  glade_xml_signal_connect_data(xml, "downloaded_transaction_select_cb",
-				G_CALLBACK(clist_select_row_cb), 
-				info);
   glade_xml_signal_connect_data(xml, "on_matcher_ok_clicked", 
 				G_CALLBACK(on_matcher_ok_clicked),
 				info);
@@ -462,68 +500,10 @@
 				G_CALLBACK(on_matcher_help_clicked),
 				info);
 
-  /*Initialise pixmaps*/
-  info->fleche_pixmap =  gdk_pixmap_colormap_create_from_xpm_d (NULL,
-								gtk_widget_get_colormap(info->dialog),
-								NULL,
-								NULL,
-								fleche_xpm);
-  info->checkbox_checked_pixmap =  gdk_pixmap_colormap_create_from_xpm_d (NULL,
-									  gtk_widget_get_colormap(info->dialog),
-									  NULL,
-									  NULL,
-									  checkbox_checked_xpm);
-  info->checkbox_unchecked_pixmap =  gdk_pixmap_colormap_create_from_xpm_d (NULL,
-									    gtk_widget_get_colormap(info->dialog),
-									    NULL,
-									    NULL,
-									    checkbox_unchecked_xpm);
  /*Initialise the colors */
-  info->color_back_red.red=65535;
-  info->color_back_red.green=16383;
-  info->color_back_red.blue=16383;
-  info->color_back_green.red=49151;
-  info->color_back_green.green=65535;
-  info->color_back_green.blue=49151;
-  info->color_back_yellow.red=65535;
-  info->color_back_yellow.green=55255;
-  info->color_back_yellow.blue=0;
-  info->color_back_white.red=65535;
-  info->color_back_white.green=65535;
-  info->color_back_white.blue=65535;
-  /*Ajust column size*/
-  gtk_clist_set_column_auto_resize (GTK_CLIST (info->clist),
-				    DOWNLOADED_CLIST_DATE,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (info->clist),
-				    DOWNLOADED_CLIST_AMOUNT,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (info->clist),
-				    DOWNLOADED_CLIST_ACTION_ADD,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (info->clist),
-				    DOWNLOADED_CLIST_ACTION_CLEAR,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (info->clist),
-				    DOWNLOADED_CLIST_ACTION_EDIT,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (info->clist),
-				    DOWNLOADED_CLIST_ACTION_INFO,
-				    TRUE);
-  /*Set column visibility*/
-  if(all_from_same_account==TRUE)
-    {
-      gtk_clist_set_column_visibility (GTK_CLIST (info->clist),
-				       DOWNLOADED_CLIST_ACCOUNT,
-				       FALSE);
-    }
-  if(gnc_import_Settings_get_action_edit_enabled (info->user_settings)==FALSE)
-    {
-      gtk_clist_set_column_visibility (GTK_CLIST (info->clist),
-				       DOWNLOADED_CLIST_ACTION_EDIT,
-				       FALSE);
-    }
-  
+  gdk_color_parse(COLOR_RED,    &info->color_back_red);
+  gdk_color_parse(COLOR_YELLOW, &info->color_back_yellow);
+  gdk_color_parse(COLOR_GREEN,  &info->color_back_green);
 
   if (heading)
     gtk_label_set_text (GTK_LABEL (heading_label), heading);
@@ -548,109 +528,63 @@
   return result;
 }
 
-/* For cleaning up dangling row data. */
-static void
-trans_clist_row_destroy_cb (gpointer data)
-{
-  GNCImportTransInfo * transaction_info = data;
-  /*DEBUG("Begin");*/
-  gnc_import_TransInfo_delete (transaction_info);
-}
 
-
-static char ** gen_clist_row_text (GNCImportTransInfo *info)
-{
-  static char *text[NUM_COLUMNS_DOWNLOADED_CLIST];
-  gint i;
-  g_assert (info);
-  for(i = 0; i < NUM_COLUMNS_DOWNLOADED_CLIST; i++)
-    {
-      text[i]=g_strdup("");
-    }
-  return text;
-}
-
-
 static void
-refresh_clist_row (GNCImportMainMatcher *gui, 
-		   int row_number, GNCImportTransInfo *info)
+refresh_model_row (GNCImportMainMatcher *gui,
+		   GtkTreeModel *model,
+		   GtkTreeIter *iter,
+		   GNCImportTransInfo *info)
 {
-  char *text[NUM_COLUMNS_DOWNLOADED_CLIST];
-  char **old_text = g_new(char *, NUM_COLUMNS_DOWNLOADED_CLIST);/* Should be g_new?*/
-  gint i;
-  gchar *tmp,*imbalance;
+  GtkListStore *store;
+  GtkTreeSelection *selection;
+  gchar *tmp,*imbalance,*text,*color;
+  const gchar *ro_text;
   g_assert (gui);
+  g_assert (model);
   g_assert (info);
   /*DEBUG("Begin");*/
-  gnc_gen_trans_list_freeze(gui);
   
-  for (i = 0; i < NUM_COLUMNS_DOWNLOADED_CLIST; i++)
-    {
-      gtk_clist_get_text (GTK_CLIST (gui->clist), row_number, 
-	i, 
-	&(old_text[i]));
-      text[i]=NULL;
-    }
+  store = GTK_LIST_STORE(model);
+  gtk_list_store_set(store, iter, DOWNLOADED_COL_DATA, info, -1);
 
-  /* Note that ALL strings must be duplicated with g_strdup or equivalent, so that they can
-     be freed by the widget*/
-  
   /*Account:*/
-  text[DOWNLOADED_CLIST_ACCOUNT] = 
-    g_strdup(xaccAccountGetName(xaccSplitGetAccount(gnc_import_TransInfo_get_fsplit (info))));
-  gtk_clist_set_text (GTK_CLIST (gui->clist), row_number, 
-		      DOWNLOADED_CLIST_ACCOUNT, 
-		      text[DOWNLOADED_CLIST_ACCOUNT]);
+  ro_text =
+    xaccAccountGetName(xaccSplitGetAccount(gnc_import_TransInfo_get_fsplit (info)));
+  gtk_list_store_set(store, iter, DOWNLOADED_COL_ACCOUNT, ro_text, -1);
 
   /*Date*/
 
-  text[DOWNLOADED_CLIST_DATE] = 
+  text =
     qof_print_date ( xaccTransGetDate( gnc_import_TransInfo_get_trans(info) ) );
-  gtk_clist_set_text (GTK_CLIST (gui->clist), row_number, 
-		      DOWNLOADED_CLIST_DATE, 
-		      text[DOWNLOADED_CLIST_DATE]);
+  gtk_list_store_set(store, iter, DOWNLOADED_COL_DATE, text, -1);
+  g_free(text);
   
   /*Amount*/
-  text[DOWNLOADED_CLIST_AMOUNT] = 
-    g_strdup(xaccPrintAmount 
+  ro_text = xaccPrintAmount 
 	     (xaccSplitGetAmount (gnc_import_TransInfo_get_fsplit(info) ), 
 	      gnc_split_amount_print_info(gnc_import_TransInfo_get_fsplit(info), TRUE) 
-	      ) );
-  gtk_clist_set_text (GTK_CLIST (gui->clist), row_number, 
-		      DOWNLOADED_CLIST_AMOUNT, 
-		      text[DOWNLOADED_CLIST_AMOUNT]);
+	      );
+  gtk_list_store_set(store, iter, DOWNLOADED_COL_AMOUNT, ro_text, -1);
   
   /*Description*/
-  text[DOWNLOADED_CLIST_DESCRIPTION] = 
-    g_strdup(xaccTransGetDescription(gnc_import_TransInfo_get_trans(info) ) );
-  gtk_clist_set_text (GTK_CLIST (gui->clist), row_number, 
-		      DOWNLOADED_CLIST_DESCRIPTION, 
-		      text[DOWNLOADED_CLIST_DESCRIPTION]);
+  ro_text = xaccTransGetDescription(gnc_import_TransInfo_get_trans(info) );
+  gtk_list_store_set(store, iter, DOWNLOADED_COL_DESCRIPTION, ro_text, -1);
 
   /*Memo*/
-  text[DOWNLOADED_CLIST_MEMO] = 
-    g_strdup(xaccSplitGetMemo(gnc_import_TransInfo_get_fsplit(info) ) );
-  gtk_clist_set_text (GTK_CLIST (gui->clist), row_number, 
-		      DOWNLOADED_CLIST_MEMO, 
-		      text[DOWNLOADED_CLIST_MEMO]);
+  ro_text = xaccSplitGetMemo(gnc_import_TransInfo_get_fsplit(info) );
+  gtk_list_store_set(store, iter, DOWNLOADED_COL_MEMO, ro_text, -1);
   
   /*Actions*/
-  text[DOWNLOADED_CLIST_ACTION_ADD] = g_strdup("");
-  text[DOWNLOADED_CLIST_ACTION_CLEAR] = g_strdup("");
-  text[DOWNLOADED_CLIST_ACTION_EDIT] = g_strdup("");
   
   /* Action informations */
-  gtk_clist_set_background (GTK_CLIST (gui->clist), row_number, 
-			    &(gui->color_back_white));
+  ro_text = text = color = NULL;
   switch(gnc_import_TransInfo_get_action(info))
     {
     case GNCImport_ADD:
       if(gnc_import_TransInfo_is_balanced(info)==TRUE)
 	{
-	  text[DOWNLOADED_CLIST_ACTION_INFO] = 
-	    g_strdup(_("New, already balanced"));
-	  gtk_clist_set_background (GTK_CLIST (gui->clist), row_number, 
-				    &(gui->color_back_green));
+	  ro_text = _("New, already balanced");
+	  color = COLOR_GREEN;
 	}
       else
 	{
@@ -664,14 +598,13 @@
 	       TRUE) ));
 	  if (gnc_import_TransInfo_get_destacc (info) != NULL)
 	    {
-	      gtk_clist_set_background (GTK_CLIST (gui->clist), row_number, 
-					&(gui->color_back_green));
+	      color = COLOR_GREEN;
 	      tmp = xaccAccountGetFullName 
 		(gnc_import_TransInfo_get_destacc (info));
 	      if(gnc_import_TransInfo_get_destacc_selected_manually(info)
 		 == TRUE)
 		{
-		  text[DOWNLOADED_CLIST_ACTION_INFO] = 
+		  text = 
 		    /* Translators: %1$s is the amount to be 
 		       transferred. %2$s is the destination account. */
 		    g_strdup_printf(_("New, transfer %s to (manual) \"%s\""),
@@ -679,7 +612,7 @@
 		}
 	      else
 		{
-		  text[DOWNLOADED_CLIST_ACTION_INFO] = 
+		  text = 
 		    /* Translators: %1$s is the amount to be 
 		       transferred. %2$s is the destination account. */
 		    g_strdup_printf(_("New, transfer %s to (auto) \"%s\""),
@@ -690,162 +623,102 @@
 	    }
 	  else
 	    {
-	      gtk_clist_set_background (GTK_CLIST (gui->clist), row_number, 
-					&(gui->color_back_yellow));
-	      text[DOWNLOADED_CLIST_ACTION_INFO] = 
+	      color = COLOR_YELLOW;
+	      text = 
 		/* Translators: %s is the amount to be transferred. */
 		g_strdup_printf(_("New, UNBALANCED (need acct to transfer %s)!"),
 				imbalance);
 	    }
-	      g_free (imbalance);
+	  g_free (imbalance);
 	}
       break;
     case GNCImport_CLEAR: 
       if(gnc_import_TransInfo_get_selected_match(info))
 	{
-	  gtk_clist_set_background (GTK_CLIST (gui->clist), row_number, 
-				    &(gui->color_back_green));
+	  color = COLOR_GREEN;
 	  if(gnc_import_TransInfo_get_match_selected_manually(info)==TRUE)
 	    {
-	      text[DOWNLOADED_CLIST_ACTION_INFO] = 
-		g_strdup(_("Reconcile (manual) match"));
+	      ro_text = _("Reconcile (manual) match");
 	    }
 	  else
 	    {
-	      text[DOWNLOADED_CLIST_ACTION_INFO] = 
-		g_strdup(_("Reconcile (auto) match"));
+	      ro_text = _("Reconcile (auto) match");
 	    }
 	}
       else
 	{
-	  gtk_clist_set_background (GTK_CLIST (gui->clist), row_number, 
-				    &(gui->color_back_red));
-	  text[DOWNLOADED_CLIST_ACTION_INFO] = 
-	    g_strdup_printf(_("Match missing!"));
+	  color = COLOR_RED;
+	  ro_text = _("Match missing!");
 	}
       break;
     case GNCImport_EDIT: 
-      text[DOWNLOADED_CLIST_ACTION_INFO] = g_strdup("NOT SUPPORTED YET!");
+      color = "white";
+      ro_text = "NOT SUPPORTED YET!";
       break;
     case GNCImport_SKIP: 
-      text[DOWNLOADED_CLIST_ACTION_INFO] = 
-	g_strdup(_("Do not import (no action selected)"));
-      gtk_clist_set_background (GTK_CLIST (gui->clist), row_number, 
-				&(gui->color_back_red));
+      color = COLOR_RED;
+      ro_text = _("Do not import (no action selected)");
       break;
     default:
-      text[DOWNLOADED_CLIST_ACTION_INFO] = 
-	g_strdup("WRITEME, this is an unknown action");
+      color = "white";
+      ro_text = "WRITEME, this is an unknown action";
     }
-  gtk_clist_set_text (GTK_CLIST (gui->clist), row_number, 
-		      DOWNLOADED_CLIST_ACTION_INFO, 
-		      text[DOWNLOADED_CLIST_ACTION_INFO]);
 
+  gtk_list_store_set(store, iter,
+		     DOWNLOADED_COL_COLOR, color,
+		     DOWNLOADED_COL_ACTION_INFO, ro_text ? ro_text : text,
+		     -1);
+  if (text)
+    g_free(text);
+
   /* Set the pixmaps */
-  if(gnc_import_TransInfo_get_action(info)==GNCImport_ADD)
-    {
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_ADD,
-			     text[DOWNLOADED_CLIST_ACTION_ADD],
-			     3,
-			     gui->checkbox_checked_pixmap,
-			     NULL);
-      
-      if(gnc_import_TransInfo_is_balanced(info)==FALSE)
-	{
-	  /*Show the arrow button*/
-	  gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-				 DOWNLOADED_CLIST_ACTION_INFO,
-				 text[DOWNLOADED_CLIST_ACTION_INFO],
-				 3,
-				 gui->fleche_pixmap,
-				 NULL);
-	}
-    }
-  else
-    {
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_ADD,
-			     text[DOWNLOADED_CLIST_ACTION_ADD],
-			     3,
-			     gui->checkbox_unchecked_pixmap,
-			     NULL);
-    }
-  
+  gtk_list_store_set(store, iter,
+		     DOWNLOADED_COL_ACTION_ADD,
+		     gnc_import_TransInfo_get_action(info)==GNCImport_ADD,
+		     -1);
   if(gnc_import_TransInfo_get_action(info)==GNCImport_SKIP)
     {      
       /*Show the best match's confidence pixmap in the info column*/
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_INFO,
-			     text[DOWNLOADED_CLIST_ACTION_INFO],
-			     3,
-			     gen_probability_pixmap( gnc_import_MatchInfo_get_probability 
+      gtk_list_store_set(store, iter,
+			 DOWNLOADED_COL_ACTION_PIXBUF,
+			 gen_probability_pixbuf( gnc_import_MatchInfo_get_probability 
 						     ( gnc_import_TransInfo_get_selected_match (info)),
 						     gui->user_settings, 
-						     GTK_WIDGET(gui->clist)),
-			     NULL);
+						     GTK_WIDGET(gui->view)),
+			 -1);
     }
   
+  gtk_list_store_set(store, iter,
+		     DOWNLOADED_COL_ACTION_CLEAR,
+		     gnc_import_TransInfo_get_action(info)==GNCImport_CLEAR,
+		     -1);
   if(gnc_import_TransInfo_get_action(info)==GNCImport_CLEAR)
     {
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_CLEAR,
-			     text[DOWNLOADED_CLIST_ACTION_CLEAR],
-			     3,
-			     gui->checkbox_checked_pixmap,
-			     NULL);
       /*Show the best match's confidence pixmap in the info column*/
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_INFO,
-			     text[DOWNLOADED_CLIST_ACTION_INFO],
-			     3,
-			     gen_probability_pixmap( gnc_import_MatchInfo_get_probability 
+      gtk_list_store_set(store, iter,
+			 DOWNLOADED_COL_ACTION_PIXBUF,
+			 gen_probability_pixbuf( gnc_import_MatchInfo_get_probability 
 						     ( gnc_import_TransInfo_get_selected_match (info)),
 						     gui->user_settings, 
-						     GTK_WIDGET(gui->clist)),
-			     NULL);
+						     GTK_WIDGET(gui->view)),
+			 -1);
     }
-  else
-    {
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_CLEAR,
-			     text[DOWNLOADED_CLIST_ACTION_CLEAR],
-			     3,
-			     gui->checkbox_unchecked_pixmap,
-			     NULL);
-    }
   
-  if(gnc_import_TransInfo_get_action(info)==GNCImport_EDIT)
-    {
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_EDIT,
-			     text[DOWNLOADED_CLIST_ACTION_EDIT],
-			     3,
-			     gui->checkbox_checked_pixmap,
-			     NULL);
-    }
-  else
-    {
-      gtk_clist_set_pixtext (GTK_CLIST (gui->clist), row_number,
-			     DOWNLOADED_CLIST_ACTION_EDIT,
-			     text[DOWNLOADED_CLIST_ACTION_EDIT],
-			     3,
-			     gui->checkbox_unchecked_pixmap,
-			     NULL);
-    }
-  
-  gtk_clist_set_row_height        (GTK_CLIST (gui->clist),
-				   24);
-  
-  
-  gnc_gen_trans_list_thaw(gui);
+  gtk_list_store_set(store, iter,
+		     DOWNLOADED_COL_ACTION_EDIT,
+		     gnc_import_TransInfo_get_action(info)==GNCImport_EDIT,
+		     -1);
+
+  selection = gtk_tree_view_get_selection(gui->view);
+  gtk_tree_selection_unselect_all(selection);
 }
 
 
 void gnc_gen_trans_list_add_trans(GNCImportMainMatcher *gui, Transaction *trans)
 {
   GNCImportTransInfo * transaction_info = NULL;
-  gint row_number;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
   g_assert (gui);
   g_assert (trans);
   
@@ -859,37 +732,25 @@
       gnc_import_TransInfo_init_matches (transaction_info, 
 					 gui->user_settings);
 
-      row_number = gtk_clist_append(GTK_CLIST (gui->clist),
-				    gen_clist_row_text (transaction_info));
-      gtk_clist_set_row_data_full(GTK_CLIST (gui->clist),
-				  row_number,
-				  transaction_info,
-				  trans_clist_row_destroy_cb);
-      refresh_clist_row (gui, 
-			 row_number, 
-			 transaction_info);
+      model = gtk_tree_view_get_model(gui->view);
+      gtk_list_store_append(GTK_LIST_STORE(model), &iter);
+      refresh_model_row (gui, model, &iter, transaction_info);
     }
   return;
 }/* end gnc_import_add_trans() */
 
 /* Iterate through the rows of the clist and try to automatch each of them */
-static void automatch_clist_transactions(GNCImportMainMatcher *info, GtkCList *clist, int starting_row)
+static void
+automatch_store_transactions (GNCImportMainMatcher *info,
+			      GtkTreeModel *model,
+			      GtkTreeIter *iter,
+			      GNCImportTransInfo *trans_info)
 {
-  int row;
-  GNCImportTransInfo *trans_info;
-  
-  gtk_clist_freeze(clist);	/* prevent a lot of visual updates at once */
-  for(row = starting_row+1; row < clist->rows; row++)
-    {
-      trans_info = gtk_clist_get_row_data(clist, row);
-      
       /* returns TRUE if we changed this row, so update it */
       if(gnc_import_TransInfo_refresh_destacc(trans_info, NULL))
 	{
-	  refresh_clist_row(info, row, trans_info);
+	  refresh_model_row(info, model, iter, trans_info);
 	}
-    }
-  gtk_clist_thaw(clist);	/* let all the updates be shown */
 }
 
 /** @} */

Modified: gnucash/branches/register-rewrite/src/import-export/import-match-map.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-match-map.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-match-map.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -27,6 +27,7 @@
     "strings" to Gnucash accounts in a generic manner.
     @author Copyright (C) 2002,2003 Derek Atkins <derek at ihtfp.com>
  */
+#include "config.h"
 #include <string.h>
 #include <glib.h>
 #include "import-match-map.h"

Modified: gnucash/branches/register-rewrite/src/import-export/import-match-picker.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-match-picker.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-match-picker.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,11 +23,13 @@
    @brief The transaction match picker dialog 
    implementation
    @author Copyright (C) 2002 Benoit Grégoire
+   @author Copyright (c) 2006 David Hampton <hampton at employees.org>
 */
  
 #include "config.h"
 
 #include <gtk/gtk.h>
+#include <glib/gi18n.h>
 
 #include "import-backend.h"
 #include "import-match-picker.h"
@@ -42,20 +44,27 @@
 
 #define GCONF_SECTION "dialogs/import/generic_matcher/match_picker"
 
-#define NUM_COLUMNS_DOWNLOADED_CLIST 6
-static const int DOWNLOADED_CLIST_ACCOUNT = 0;
-static const int DOWNLOADED_CLIST_DATE = 1;
-static const int DOWNLOADED_CLIST_AMOUNT = 2;
-static const int DOWNLOADED_CLIST_DESCRIPTION = 3;
-static const int DOWNLOADED_CLIST_MEMO = 4;
-static const int DOWNLOADED_CLIST_BALANCED = 5;
+enum downloaded_cols {
+  DOWNLOADED_COL_ACCOUNT = 0,
+  DOWNLOADED_COL_DATE,
+  DOWNLOADED_COL_AMOUNT,
+  DOWNLOADED_COL_DESCRIPTION,
+  DOWNLOADED_COL_MEMO,
+  DOWNLOADED_COL_BALANCED,
+  DOWNLOADED_COL_INFO_PTR,
+  NUM_DOWNLOADED_COLS
+};
 
-#define NUM_COLUMNS_MATCHER_CLIST 5
-static const int MATCHER_CLIST_CONFIDENCE = 0;
-static const int MATCHER_CLIST_DATE = 1;
-static const int MATCHER_CLIST_AMOUNT = 2;
-static const int MATCHER_CLIST_DESCRIPTION = 3;
-static const int MATCHER_CLIST_MEMO = 4;
+enum matcher_cols {
+  MATCHER_COL_CONFIDENCE = 0,
+  MATCHER_COL_CONFIDENCE_PIXBUF,
+  MATCHER_COL_DATE,
+  MATCHER_COL_AMOUNT,
+  MATCHER_COL_DESCRIPTION,
+  MATCHER_COL_MEMO,
+  MATCHER_COL_INFO_PTR,
+  NUM_MATCHER_COLS
+};
 
 /* Needs to be commented in again if any DEBUG() macro is used here. */
 /*static short module = MOD_IMPORT;*/
@@ -72,8 +81,8 @@
 
 struct _transpickerdialog {
   GtkWidget * transaction_matcher;
-  GtkCList * downloaded_clist;
-  GtkCList * match_clist;
+  GtkTreeView * downloaded_view;
+  GtkTreeView * match_view;
   GNCImportSettings * user_settings;
   struct _transactioninfo * selected_trans_info;
   GNCImportMatchInfo * selected_match_info;
@@ -81,57 +90,76 @@
 
 
 
-static gint  
+static void
 downloaded_transaction_append(GNCImportMatchPicker * matcher,
-				   GNCImportTransInfo * transaction_info)
+			      GNCImportTransInfo * transaction_info)
 {
-  gint row_number;
-  const char * clist_text[NUM_COLUMNS_DOWNLOADED_CLIST];
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreeSelection *selection;
+  Transaction *trans;
+  Split *split;
+  gchar *text;
+  const gchar *ro_text;
+  gboolean found = FALSE;
+  GNCImportTransInfo *local_info;
 
   g_assert(matcher);
   g_assert(transaction_info);
+
   /*DEBUG("Begin");*/
-  row_number = gtk_clist_find_row_from_data(matcher->downloaded_clist,
-					    transaction_info);
+
+  /* Has the transaction already been added? */
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(matcher->downloaded_view));
+  if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(store), &iter)) {
+    do {
+      gtk_tree_model_get(GTK_TREE_MODEL(store), &iter,
+			 DOWNLOADED_COL_INFO_PTR, &local_info,
+			 -1);
+      if (local_info == transaction_info) {
+	found = TRUE;
+	break;
+      }
+    } while (gtk_tree_model_iter_next(GTK_TREE_MODEL(store), &iter));
+  }
+  if (!found)
+    gtk_list_store_append(store, &iter);
   
+  split = gnc_import_TransInfo_get_fsplit(transaction_info);
+  trans = gnc_import_TransInfo_get_trans(transaction_info);
+  
   /*Account*/
-  clist_text[DOWNLOADED_CLIST_ACCOUNT] =
-    g_strdup ( xaccAccountGetName
-	       ( xaccSplitGetAccount
-		 ( gnc_import_TransInfo_get_fsplit (transaction_info))));
-  
-  
+  ro_text = xaccAccountGetName(xaccSplitGetAccount(split));
+  gtk_list_store_set(store, &iter, DOWNLOADED_COL_ACCOUNT, ro_text, -1);
+
   /*Date*/
-  clist_text[DOWNLOADED_CLIST_DATE] = 
-    qof_print_date 
-    ( xaccTransGetDate
-      ( gnc_import_TransInfo_get_trans(transaction_info) ) );
+  text = qof_print_date(xaccTransGetDate(trans));
+  gtk_list_store_set(store, &iter, DOWNLOADED_COL_DATE, text, -1);
+  g_free(text);
   
   /*Amount*/
-  clist_text[DOWNLOADED_CLIST_AMOUNT] =
-    g_strdup( xaccPrintAmount( xaccSplitGetAmount ( gnc_import_TransInfo_get_fsplit(transaction_info) ),
-			       gnc_split_amount_print_info( gnc_import_TransInfo_get_fsplit(transaction_info), TRUE) 
-			       ) );
+  ro_text = xaccPrintAmount(xaccSplitGetAmount(split),
+			    gnc_split_amount_print_info(split, TRUE));
+  gtk_list_store_set(store, &iter, DOWNLOADED_COL_AMOUNT, ro_text, -1);
  
   /*Description*/
-  clist_text[DOWNLOADED_CLIST_DESCRIPTION] = g_strdup(xaccTransGetDescription(gnc_import_TransInfo_get_trans(transaction_info) ) );
+  ro_text = xaccTransGetDescription(trans);
+  gtk_list_store_set(store, &iter, DOWNLOADED_COL_DESCRIPTION, ro_text, -1);
   
   /*Memo*/
-  clist_text[DOWNLOADED_CLIST_MEMO] =
-    g_strdup(xaccSplitGetMemo(gnc_import_TransInfo_get_fsplit(transaction_info) ) );
+  ro_text = xaccSplitGetMemo(split);
+  gtk_list_store_set(store, &iter, DOWNLOADED_COL_MEMO, ro_text, -1);
 
   /*Imbalance*/
-  clist_text[DOWNLOADED_CLIST_BALANCED] =
-    g_strdup (xaccPrintAmount (xaccTransGetImbalance(gnc_import_TransInfo_get_trans(transaction_info) ), 
-			       gnc_default_print_info (TRUE) )
-	      );
+  ro_text = xaccPrintAmount(xaccTransGetImbalance(trans), 
+			    gnc_default_print_info(TRUE));
+  gtk_list_store_set(store, &iter, DOWNLOADED_COL_BALANCED, ro_text, -1);
 
-  row_number = gtk_clist_append(matcher->downloaded_clist,
-				(char **)(clist_text));
-  gtk_clist_set_row_data(matcher->downloaded_clist,
-			 row_number,
-			 transaction_info);
-  return row_number;
+  gtk_list_store_set(store, &iter, DOWNLOADED_COL_INFO_PTR,
+		     transaction_info, -1);
+
+  selection = gtk_tree_view_get_selection(matcher->downloaded_view);
+  gtk_tree_selection_select_iter(selection, &iter);
 }
 
 /********************************************************************\
@@ -141,96 +169,100 @@
 \********************************************************************/
 
 static void
-downloaded_transaction_select_cb (GtkCList *clist,
-				  gint row,
-				  gint column,
-				  GdkEventButton *event,
-				  gpointer user_data) {
-  GNCImportMatchPicker * matcher = user_data;
+downloaded_transaction_changed_cb (GtkTreeSelection *selection,
+				   GNCImportMatchPicker *matcher) 
+{
   GNCImportMatchInfo * match_info;
+  GtkTreeModel *dl_model;
+  GtkListStore *match_store;
+  GtkTreeIter iter;
   GList * list_element;
-  gint row_number;
-  const char * clist_text[NUM_COLUMNS_MATCHER_CLIST];
+  gchar *text;
+  const gchar *ro_text;
   /*DEBUG("row: %d%s%d",row,", column: ",column);*/
+
+  /* Get the transaction info from the "downloaded" model.  */
+  if (!gtk_tree_selection_get_selected(selection, &dl_model, &iter)) {
+      matcher->selected_trans_info=NULL;
+      return;
+  }
+  gtk_tree_model_get(dl_model, &iter,
+		     DOWNLOADED_COL_INFO_PTR, &matcher->selected_trans_info,
+		     -1);
   
-  matcher->selected_trans_info = gtk_clist_get_row_data(clist, row);
-  
-
-  gtk_clist_clear(matcher->match_clist);
+  /* Now rewrite the "match" model based on that trans. */
+  match_store = GTK_LIST_STORE(gtk_tree_view_get_model(matcher->match_view));
+  gtk_list_store_clear(match_store);
   list_element = g_list_first (gnc_import_TransInfo_get_match_list
 			       (matcher->selected_trans_info));
   while(list_element!=NULL)
     {
       match_info = list_element->data;
       
+      gtk_list_store_append(match_store, &iter);
+
       /* Print fields. */
 
       /* Probability */
-      clist_text[MATCHER_CLIST_CONFIDENCE] = 
-	g_strdup_printf("%d", gnc_import_MatchInfo_get_probability (match_info));
-      
+      text = g_strdup_printf("%d", gnc_import_MatchInfo_get_probability (match_info));
+      gtk_list_store_set(match_store, &iter, MATCHER_COL_CONFIDENCE, text, -1);
+      g_free(text);
+
       /* Date */
-      clist_text[MATCHER_CLIST_DATE]=
+      text =
 	qof_print_date 
 	( xaccTransGetDate
 	  ( xaccSplitGetParent
 	    ( gnc_import_MatchInfo_get_split(match_info) ) ));
+      gtk_list_store_set(match_store, &iter, MATCHER_COL_DATE, text, -1);
+      g_free(text);
       
       /* Amount */
-      clist_text[MATCHER_CLIST_AMOUNT]=
-	g_strdup(xaccPrintAmount( xaccSplitGetAmount ( gnc_import_MatchInfo_get_split(match_info)  ), 
+      ro_text =
+	xaccPrintAmount( xaccSplitGetAmount ( gnc_import_MatchInfo_get_split(match_info)  ), 
 				  gnc_split_amount_print_info(gnc_import_MatchInfo_get_split(match_info), TRUE) 
-				  ) );
+				  );
+      gtk_list_store_set(match_store, &iter, MATCHER_COL_AMOUNT, ro_text, -1);
       
       /*Description*/
-      clist_text[MATCHER_CLIST_DESCRIPTION] =
-	g_strdup( xaccTransGetDescription
-		  ( xaccSplitGetParent( gnc_import_MatchInfo_get_split(match_info)) ));
+      ro_text = xaccTransGetDescription
+	( xaccSplitGetParent( gnc_import_MatchInfo_get_split(match_info)) );
+      gtk_list_store_set(match_store, &iter, MATCHER_COL_DESCRIPTION, ro_text, -1);
       
       /*Split memo*/    
-      clist_text[MATCHER_CLIST_MEMO]=
-	g_strdup(xaccSplitGetMemo(gnc_import_MatchInfo_get_split(match_info) ) );
+      ro_text = xaccSplitGetMemo(gnc_import_MatchInfo_get_split(match_info) );
+      gtk_list_store_set(match_store, &iter, MATCHER_COL_MEMO, ro_text, -1);
       
-      row_number = gtk_clist_append(matcher->match_clist,
-				    (char **)(clist_text)); 
-      gtk_clist_set_row_data          (matcher->match_clist,
-				       row_number,
-				       match_info);
+      gtk_list_store_set(match_store, &iter, MATCHER_COL_INFO_PTR, match_info, -1);
       if(gnc_import_MatchInfo_get_probability(match_info) != 0)
 	{
 	  if(SHOW_NUMERIC_SCORE==TRUE)
 	    {
-	      gtk_clist_set_pixtext (matcher->match_clist,
-				     row_number,
-				     MATCHER_CLIST_CONFIDENCE,
-				     clist_text[MATCHER_CLIST_CONFIDENCE],
-				     3,
-				     gen_probability_pixmap(gnc_import_MatchInfo_get_probability(match_info), 
+	      gtk_list_store_set(match_store, &iter,
+				     MATCHER_COL_CONFIDENCE_PIXBUF,
+				     gen_probability_pixbuf(gnc_import_MatchInfo_get_probability(match_info), 
 							    matcher->user_settings, 
-							    GTK_WIDGET(matcher->match_clist)),
-				     NULL);
+							    GTK_WIDGET(matcher->match_view)),
+				     -1);
 	    }
 	  else
 	    {
-	      gtk_clist_set_pixmap (matcher->match_clist,
-				    row_number,
-				    MATCHER_CLIST_CONFIDENCE,
-				    gen_probability_pixmap(gnc_import_MatchInfo_get_probability(match_info),
+	      gtk_list_store_set(match_store, &iter,
+				    MATCHER_COL_CONFIDENCE_PIXBUF,
+				    gen_probability_pixbuf(gnc_import_MatchInfo_get_probability(match_info),
 							   matcher->user_settings, 
-							   GTK_WIDGET(matcher->match_clist)),
-				    NULL);
+							   GTK_WIDGET(matcher->match_view)),
+				    -1);
 	    }
 	}
       
-      gtk_clist_set_row_height        (matcher->match_clist,
-				       0);
-
       if(match_info == 
 	 gnc_import_TransInfo_get_selected_match (matcher->selected_trans_info))
 	{
-	  gtk_clist_select_row            (matcher->match_clist,
-					   row_number,
-					   0);
+	  GtkTreeSelection *selection;
+
+	  selection = gtk_tree_view_get_selection(matcher->match_view);
+	  gtk_tree_selection_select_iter(selection, &iter);
 	}
       
       list_element=g_list_next(list_element);
@@ -238,29 +270,105 @@
 }
 
 static void
-match_transaction_select_cb (GtkCList *clist,
-			     gint row,
-			     gint column,
-			     GdkEventButton *event,
-			     gpointer user_data) {
-  GNCImportMatchPicker * matcher = user_data;
-  /*DEBUG("row: %d%s%d",row,", column: ",column);*/
-  matcher->selected_match_info =
-    gtk_clist_get_row_data(clist, row);
+match_transaction_changed_cb (GtkTreeSelection *selection,
+			      GNCImportMatchPicker *matcher) 
+{
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+
+  if (!gtk_tree_selection_get_selected (selection, &model, &iter)) {
+      matcher->selected_match_info=NULL;
+      return;
+  }
+
+  gtk_tree_model_get(model, &iter,
+		     MATCHER_COL_INFO_PTR, &matcher->selected_match_info,
+		     -1);
 }
 
 static void
-match_transaction_unselect_cb(GtkCList *clist,
-			      gint row,
-			      gint column,
-			      GdkEventButton *event,
-			      gpointer user_data) {
-  GNCImportMatchPicker * matcher = user_data;
-  /*DEBUG("row: %d%s%d",row,", column: ",column);*/
-  matcher->selected_match_info=NULL;
+add_column(GtkTreeView *view, const gchar *title, int col_num)
+{
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+ 
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(title, renderer,
+						    "text", col_num,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+  g_object_set(G_OBJECT(column),
+	       "reorderable", TRUE,
+	       "resizable", TRUE,
+	       NULL);
+}
 
+static void
+gnc_import_match_picker_init_downloaded_view (GNCImportMatchPicker * matcher)
+{
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeSelection *selection;
+
+  view = matcher->downloaded_view;
+  store = gtk_list_store_new(NUM_DOWNLOADED_COLS,
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+			     G_TYPE_POINTER);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  add_column(view, _("Account"),     DOWNLOADED_COL_ACCOUNT);
+  add_column(view, _("Date"),        DOWNLOADED_COL_DATE);
+  add_column(view, _("Amount"),      DOWNLOADED_COL_AMOUNT);
+  add_column(view, _("Description"), DOWNLOADED_COL_DESCRIPTION);
+  add_column(view, _("Memo"),        DOWNLOADED_COL_MEMO);
+  add_column(view, _("Balanced"),    DOWNLOADED_COL_BALANCED);
+
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(downloaded_transaction_changed_cb), matcher);
 }
 
+static void
+gnc_import_match_picker_init_match_view (GNCImportMatchPicker * matcher)
+{
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkTreeSelection *selection;
+
+  view = matcher->match_view;
+  store = gtk_list_store_new(NUM_MATCHER_COLS,
+			     G_TYPE_STRING, GDK_TYPE_PIXBUF, G_TYPE_STRING, 
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_STRING,
+			     G_TYPE_POINTER);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_pixbuf_new();
+  g_object_set(renderer, "xalign", 0.0, NULL);
+  column = gtk_tree_view_column_new_with_attributes(_("Confidence"), renderer,
+				      "pixbuf", MATCHER_COL_CONFIDENCE_PIXBUF,
+				      NULL);
+  renderer = gtk_cell_renderer_text_new();
+  gtk_tree_view_column_pack_start(column, renderer, TRUE);
+  gtk_tree_view_column_set_attributes(column, renderer,
+				      "text", MATCHER_COL_CONFIDENCE,
+				      NULL);
+  gtk_tree_view_append_column(view, column);
+
+  add_column(view, _("Date"),        MATCHER_COL_DATE);
+  add_column(view, _("Amount"),      MATCHER_COL_AMOUNT);
+  add_column(view, _("Description"), MATCHER_COL_DESCRIPTION);
+  add_column(view, _("Memo"),        MATCHER_COL_MEMO);
+
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(match_transaction_changed_cb), matcher);
+}
+
 /********************************************************************\
  * init_match_picker_gui()
  * -- GUI initialization for the Match_Picker Dialog
@@ -279,42 +387,13 @@
   xml = gnc_glade_xml_new ("generic-import.glade", "match_picker");
   g_return_if_fail (xml != NULL);
 
-  /* connect the signals in the interface */
-  glade_xml_signal_connect_data(xml,
-				"match_transaction_select_cb", 
-				G_CALLBACK(match_transaction_select_cb),
-				matcher);
-  glade_xml_signal_connect_data(xml,
-				"match_transaction_unselect_cb", 
-				G_CALLBACK(match_transaction_unselect_cb),
-				matcher);
-  
   matcher->transaction_matcher = glade_xml_get_widget (xml, "match_picker");
-  matcher->downloaded_clist = (GtkCList *)glade_xml_get_widget (xml, "downloaded_clist");
-  matcher->match_clist =  (GtkCList *)glade_xml_get_widget (xml, "matched_clist");
+  matcher->downloaded_view = (GtkTreeView *)glade_xml_get_widget (xml, "downloaded_view");
+  matcher->match_view = (GtkTreeView *)glade_xml_get_widget (xml, "matched_view");
 
-  /*Ajust column size*/
-  gtk_clist_set_column_auto_resize (GTK_CLIST (matcher->downloaded_clist),
-				    DOWNLOADED_CLIST_DATE,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (matcher->downloaded_clist),
-				    DOWNLOADED_CLIST_AMOUNT,
-				    TRUE);
+  gnc_import_match_picker_init_downloaded_view(matcher);
+  gnc_import_match_picker_init_match_view(matcher);
 
-  gtk_clist_set_column_auto_resize (GTK_CLIST (matcher->downloaded_clist),
-				    DOWNLOADED_CLIST_BALANCED,
-				    TRUE);
-
-  gtk_clist_set_column_auto_resize (GTK_CLIST (matcher->match_clist),
-				    MATCHER_CLIST_CONFIDENCE,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (matcher->match_clist),
-				    MATCHER_CLIST_DATE,
-				    TRUE);
-  gtk_clist_set_column_auto_resize (GTK_CLIST (matcher->match_clist),
-				    MATCHER_CLIST_AMOUNT,
-				    TRUE);
-
   /* DEBUG("User prefs:%s%d%s%d%s%d%s%d%s%d",
      " action_replace_enabled:",matcher->action_replace_enabled,
      ", action_skip_enabled:",matcher->action_skip_enabled,
@@ -337,7 +416,7 @@
 gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info)
 {
   GNCImportMatchPicker *matcher;
-  gint row_number, response;
+  gint response;
   GNCImportMatchInfo *old;
   g_assert (transaction_info);
   
@@ -347,18 +426,9 @@
   /* DEBUG("Init match_picker"); */
   init_match_picker_gui(matcher);
  
-  /* Append this single transaction to the downloaded_clist */
-  row_number = downloaded_transaction_append(matcher,
-					     transaction_info);
+  /* Append this single transaction to the view and select it */
+  downloaded_transaction_append(matcher, transaction_info);
   
-  /* Now fake a selection of that transaction. */
-  downloaded_transaction_select_cb (matcher->downloaded_clist,
-				    row_number,
-				    2,
-				    NULL,
-				    matcher);
-  gtk_widget_set_sensitive (GTK_WIDGET (matcher->downloaded_clist), FALSE);
-  
   old = gnc_import_TransInfo_get_selected_match(transaction_info);
   
   /* Let this dialog run and close. */

Modified: gnucash/branches/register-rewrite/src/import-export/import-provider-format.glade
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/import-provider-format.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/import-provider-format.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -113,10 +113,9 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkOptionMenu" id="import_format_menu">
+	    <widget class="GtkComboBox" id="import_format_combo">
 	      <property name="visible">True</property>
-	      <property name="can_focus">True</property>
-	      <property name="history">-1</property>
+	      <property name="focus_on_click">True</property>
 	    </widget>
 	    <packing>
 	      <property name="padding">0</property>

Modified: gnucash/branches/register-rewrite/src/import-export/log-replay/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/log-replay/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/log-replay/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -39,5 +39,3 @@
 uidir = $(GNC_UI_DIR)
 dist_ui_DATA = \
 	gnc-plugin-log-replay-ui.xml
-
-CLEANFILES = g-wrapped

Deleted: gnucash/branches/register-rewrite/src/import-export/mt940/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/mt940/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/mt940/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,55 +0,0 @@
-SUBDIRS = . 
-# test
-
-pkglib_LTLIBRARIES=libgncmod-mt940.la
-
-libgncmod_mt940_la_SOURCES = \
-  gnc-mt940-import.c \
-  gncmod-mt940-import.c \
-  gnc-plugin-mt940.c
-
-noinst_HEADERS = \
-  gnc-mt940-import.h \
-  gnc-plugin-mt940.h
-
-libgncmod_mt940_la_LIBADD = \
-  ${top_builddir}/src/import-export/hbci/libgncmod-hbci.la \
-  ${top_builddir}/src/import-export/libgncmod-generic-import.la \
-  ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
-  ${top_builddir}/src/app-utils/libgncmod-app-utils.la \
-  ${top_builddir}/src/core-utils/libcore-utils.la \
-  ${top_builddir}/src/gnc-module/libgncmodule.la \
-  ${GNOME_LIBS} \
-  ${GLADE_LIBS} \
-  ${QOF_LIBS} \
-  ${GLIB_LIBS} \
-  ${HBCI_LIBS}
-
-AM_CFLAGS = \
-  -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/import-export/hbci \
-  -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 \
-  ${G_WRAP_COMPILE_ARGS} \
-  ${GUILE_INCS} \
-  ${GNOME_CFLAGS} \
-  ${GTKHTML_CFLAGS} \
-  ${GLADE_CFLAGS} \
-  ${QOF_CFLAGS} \
-  ${GLIB_CFLAGS} \
-  ${HBCI_CFLAGS}
-
-uidir = $(GNC_UI_DIR)
-ui_DATA = \
-	gnc-plugin-mt940-ui.xml
-
-EXTRA_DIST = $(ui_DATA)

Deleted: gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,302 +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-mt940-import.c
-     @brief MT940 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 <glib.h>
-#include <glib/gi18n.h>
-#include <stdio.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-gconf-utils.h"
-
-#include "gnc-hbci-gettrans.h"
-
-#include "import-main-matcher.h"
-#include "import-account-matcher.h"
-#include "gnc-hbci-gettrans.h"
-
-#include "gnc-mt940-import.h"
-
-#define GCONF_SECTION "dialogs/import/mt940"
-
-static QofLogModule log_module = GNC_MOD_IMPORT;
-
-/* 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);
-
-
-/* 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 */
-
-
-/* Note: The importing here is not yet tested with actual files, see
-   http://bugzilla.gnome.org/show_bug.cgi?id=325170 . */
-
-/* See aqbanking-1.6.0beta/src/tools/aqbanking-tool/import.c for hints
-   on how to program aqbanking. */
-
-/********************************************************************\
- * gnc_file_mt940_import
- * Entry point
-\********************************************************************/
-
-void gnc_file_mt940_import (void)
-{
-  char *selected_filename;
-  char *default_dir;
-  int mt940_fd;
-
-  /* qof_log_check(MOD_IMPORT, QOF_LOG_TRACE); */
-  DEBUG("gnc_file_mt940_import(): Begin...\n");
-
-  default_dir = gnc_gconf_get_string(GCONF_SECTION, KEY_LAST_PATH, NULL);
-  if (default_dir == NULL)
-    gnc_init_default_directory(&default_dir);
-  selected_filename = gnc_file_dialog(_("Select an MT940 file to process"),
-				      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_gconf_set_string(GCONF_SECTION, KEY_LAST_PATH, default_dir, NULL);
-    g_free(default_dir);
-
-    /*strncpy(file,selected_filename, 255);*/
-    DEBUG("Filename found: %s",selected_filename);
-
-    DEBUG("Opening selected file");
-    mt940_fd = open(selected_filename, O_RDONLY);
-    if (mt940_fd == -1) {
-      DEBUG("Could not open file %s", selected_filename);
-      return;
-    }
-
-    {
-      int result;
-      AB_BANKING *ab;
-      AB_IMEXPORTER *importer;
-      AB_IMEXPORTER_CONTEXT *ctx=0;
-      GWEN_BUFFEREDIO *buffio;
-      GWEN_DB_NODE *dbProfiles;
-      GWEN_DB_NODE *dbProfile;
-      const char *importerName = "swift"; /* possible values: csv, swift, dtaus, */
-      const char *profileName = "swift-mt940";
-      /* Possible values for profile: "swiftmt942", but for other
-	 importers: "default" */
-
-      ab = AB_Banking_new("gnucash", 0);
-      AB_Banking_Init(ab);
-
-      /* 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 MT940 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) {
-	DEBUG("Profile \"%s\" for importer \"%s\" not found",
-	      profileName, importerName);
-	printf("Profile \"%s\" for importer \"%s\" not found\n",
-	      profileName, importerName);
-	return;
-      }
-      g_assert(dbProfile);
-
-      /* import new context */
-      ctx=AB_ImExporterContext_new();
-      g_assert(ctx);
-
-      /* Wrap file in gwen_bufferedio */
-      buffio = GWEN_BufferedIO_File_new(mt940_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 */
-	struct trans_list_data data;
-	GNCImportMainMatcher *importer_generic_gui;
-	GtkWidget *parent = NULL;
-
-	/* Create importer GUI */
-	importer_generic_gui = gnc_gen_trans_list_new(parent, NULL, TRUE, 14);
-	data.importer_generic = importer_generic_gui;
-
-	/* Iterate through all accounts */
-	AB_ImExporterContext_AccountInfoForEach(ctx, accountinfolist_cb, &data);
-	/* all accounts finished. */
-	      
-	AB_ImExporterContext_free(ctx);
-
-	/* that's it */
-	result=AB_Banking_Fini(ab);
-	if (result) 
-	  DEBUG("ERROR: Error on deinit (%d)\n",result);
-
-	g_free(selected_filename);
-	AB_Banking_free(ab);
-
-
-	/* and run the gnucash importer. */
-	gnc_gen_trans_list_run (importer_generic_gui);
-      }
-    }
-  }
-}
-
-static AB_IMEXPORTER_ACCOUNTINFO *
-accountinfolist_cb(AB_IMEXPORTER_ACCOUNTINFO *accinfo, void *user_data) {
-  Account *gnc_acc;
-  struct trans_list_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, 
-				      NO_TYPE, NULL, NULL);
-  g_free(online_id);
-  if (gnc_acc) {
-    /* Store chosen gnucash account in callback data */
-    data->gnc_acc = gnc_acc;
-  
-    /* 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) {
-  /* This callback in the hbci module will add the imported
-     transaction to gnucash's importer. */
-  /* The call will use "element" only as const* */
-  gnc_hbci_trans_list_cb( (AB_TRANSACTION*) element, user_data);
-  return NULL;
-}
-
-
-/** @} */

Deleted: gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/mt940/gnc-mt940-import.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,34 +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 mt940 import module interface
-     *
-     gnc-mt940-import.h
-     @author Copyright (c) 2002 Benoit Grégoire <bock at step.polymtl.ca>
- */
-#ifndef MT940_IMPORT_H
-#define MT940_IMPORT_H
-
-/** The gnc_file_mt940_import() routine will pop up a standard file
- *     selection dialogue asking the user to pick an MT940 file. If one
- *     is selected then the MT940 file is opened and read. Its contents
- *     are merged into the existing session (if any). The current
- *     session continues to remain open for editing. */
-void              gnc_file_mt940_import (void);
-#endif

Deleted: gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940-ui.xml
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940-ui.xml	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940-ui.xml	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,11 +0,0 @@
-<ui>
-  <menubar>
-    <menu name="File" action="FileAction">
-      <menu name="FileImport" action="FileImportAction">
-      	<placeholder name="FileImportPlaceholder">
-      	   <menuitem name="FileMt940Import" action="Mt940ImportAction"/>
-      	</placeholder>
-      </menu>
-    </menu>
-  </menubar>
-</ui>

Deleted: gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,162 +0,0 @@
-/* 
- * gnc-plugin-mt940.c -- 
- * 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
- */
-
-#include "config.h"
-
-#include <gtk/gtk.h>
-#include <glib/gi18n.h>
-
-#include "gnc-engine.h"
-#include "gnc-plugin-manager.h"
-#include "gnc-plugin-mt940.h"
-#include "gnc-mt940-import.h"
-#include "gnc-plugin-page-account-tree.h"
-#include "gnc-plugin-page-register.h"
-
-static void gnc_plugin_mt940_class_init (GncPluginMt940Class *klass);
-static void gnc_plugin_mt940_init (GncPluginMt940 *plugin);
-static void gnc_plugin_mt940_finalize (GObject *object);
-
-/* Command callbacks */
-static void gnc_plugin_mt940_cmd_import (GtkAction *action, GncMainWindowActionData *data);
-
-
-#define PLUGIN_ACTIONS_NAME "gnc-plugin-mt940-actions"
-#define PLUGIN_UI_FILENAME  "gnc-plugin-mt940-ui.xml"
-
-static GtkActionEntry gnc_plugin_actions [] = {
-  { "Mt940ImportAction", GTK_STOCK_CONVERT, N_("Import MT940"), NULL,
-    N_("Process an MT940 response file"),
-    G_CALLBACK (gnc_plugin_mt940_cmd_import) },
-};
-static guint gnc_plugin_n_actions = G_N_ELEMENTS (gnc_plugin_actions);
-
-typedef struct GncPluginMt940Private
-{
-  gpointer dummy;
-} GncPluginMt940Private;
-
-#define GNC_PLUGIN_MT940_GET_PRIVATE(o)  \
-   (G_TYPE_INSTANCE_GET_PRIVATE ((o), GNC_TYPE_PLUGIN_MT940, GncPluginMt940Private))
-
-static GObjectClass *parent_class = NULL;
-
-GType
-gnc_plugin_mt940_get_type (void)
-{
-  static GType gnc_plugin_mt940_type = 0;
-
-  if (gnc_plugin_mt940_type == 0) {
-    static const GTypeInfo our_info = {
-		sizeof (GncPluginMt940Class),
-		NULL,		/* base_init */
-		NULL,		/* base_finalize */
-		(GClassInitFunc) gnc_plugin_mt940_class_init,
-		NULL,		/* class_finalize */
-		NULL,		/* class_data */
-		sizeof (GncPluginMt940),
-		0,		/* n_preallocs */
-		(GInstanceInitFunc) gnc_plugin_mt940_init,
-    };
-
-    gnc_plugin_mt940_type = g_type_register_static (GNC_TYPE_PLUGIN,
-						  "GncPluginMt940",
-						  &our_info, 0);
-  }
-
-  return gnc_plugin_mt940_type;
-}
-
-GncPlugin *
-gnc_plugin_mt940_new (void)
-{
-  return GNC_PLUGIN (g_object_new (GNC_TYPE_PLUGIN_MT940, NULL));
-}
-
-static void
-gnc_plugin_mt940_class_init (GncPluginMt940Class *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_mt940_finalize;
-
-  /* plugin info */
-  plugin_class->plugin_name  = GNC_PLUGIN_MT940_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;
-
-  g_type_class_add_private(klass, sizeof(GncPluginMt940Private));
-}
-
-static void
-gnc_plugin_mt940_init (GncPluginMt940 *plugin)
-{
-}
-
-static void
-gnc_plugin_mt940_finalize (GObject *object)
-{
-  GncPluginMt940 *plugin;
-  GncPluginMt940Private *priv;
-
-  g_return_if_fail (GNC_IS_PLUGIN_MT940 (object));
-
-  plugin = GNC_PLUGIN_MT940 (object);
-  priv = GNC_PLUGIN_MT940_GET_PRIVATE(plugin);
-
-  G_OBJECT_CLASS (parent_class)->finalize (object);
-}
-
-/************************************************************
- *              Plugin Function Implementation              *
- ************************************************************/
-
-/************************************************************
- *                    Command Callbacks                     *
- ************************************************************/
-
-static void
-gnc_plugin_mt940_cmd_import (GtkAction *action,
-			   GncMainWindowActionData *data)
-{
-  gnc_file_mt940_import ();
-}
-
-
-/************************************************************
- *                    Plugin Bootstrapping                   *
- ************************************************************/
-
-void
-gnc_plugin_mt940_create_plugin (void)
-{
-  GncPlugin *plugin = gnc_plugin_mt940_new ();
-
-  gnc_plugin_manager_add_plugin (gnc_plugin_manager_get (), plugin);
-}

Deleted: gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.h
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/mt940/gnc-plugin-mt940.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,60 +0,0 @@
-/* 
- * gnc-plugin-mt940.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_MT940_H
-#define __GNC_PLUGIN_MT940_H
-
-#include <gtk/gtkwindow.h>
-
-#include "gnc-plugin.h"
-
-G_BEGIN_DECLS
-
-/* type macros */
-#define GNC_TYPE_PLUGIN_MT940            (gnc_plugin_mt940_get_type ())
-#define GNC_PLUGIN_MT940(obj)            (G_TYPE_CHECK_INSTANCE_CAST ((obj), GNC_TYPE_PLUGIN_MT940, GncPluginMt940))
-#define GNC_PLUGIN_MT940_CLASS(klass)    (G_TYPE_CHECK_CLASS_CAST ((klass), GNC_TYPE_PLUGIN_MT940, GncPluginMt940Class))
-#define GNC_IS_PLUGIN_MT940(obj)         (G_TYPE_CHECK_INSTANCE_TYPE ((obj), GNC_TYPE_PLUGIN_MT940))
-#define GNC_IS_PLUGIN_MT940_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass), GNC_TYPE_PLUGIN_MT940))
-#define GNC_PLUGIN_MT940_GET_CLASS(obj)  (G_TYPE_INSTANCE_GET_CLASS ((obj), GNC_TYPE_PLUGIN_MT940, GncPluginMt940Class))
-
-#define GNC_PLUGIN_MT940_NAME "gnc-plugin-mt940"
-
-/* typedefs & structures */
-typedef struct {
-	GncPlugin gnc_plugin;
-} GncPluginMt940;
-
-typedef struct {
-	GncPluginClass gnc_plugin;
-} GncPluginMt940Class;
-
-/* function prototypes */
-GType      gnc_plugin_mt940_get_type (void);
-
-GncPlugin *gnc_plugin_mt940_new      (void);
-
-void       gnc_plugin_mt940_create_plugin (void);
-
-G_END_DECLS
-
-#endif /* __GNC_PLUGIN_MT940_H */

Deleted: gnucash/branches/register-rewrite/src/import-export/mt940/gncmod-mt940-import.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/mt940/gncmod-mt940-import.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/mt940/gncmod-mt940-import.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,96 +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 gncmod-mt940-import.c
- @brief module definition/initialization for the mt940 importer
- @author Copyright (c) 2002 Benoit Grégoire bock at step.polymtl.ca
- */
-#include "config.h"
-#include <glib.h>
-
-#include <gtk/gtk.h>
-#include <stdio.h>
-#include <libguile.h>
-
-#include "gnc-module.h"
-#include "gnc-module-api.h"
-
-#include "gnc-mt940-import.h"
-#include "gnc-plugin-mt940.h"
-
-/* version of the gnc module system interface we require */
-int libgncmod_mt940_LTX_gnc_module_system_interface = 0;
-
-/* module versioning uses libtool semantics. */
-int libgncmod_mt940_LTX_gnc_module_current  = 0;
-int libgncmod_mt940_LTX_gnc_module_revision = 0;
-int libgncmod_mt940_LTX_gnc_module_age      = 0;
-
-//static GNCModule bus_core;
-//static GNCModule file;
-
-/* forward references */
-char *libgncmod_mt940_LTX_gnc_module_path(void);
-char *libgncmod_mt940_LTX_gnc_module_description(void);
-int libgncmod_mt940_LTX_gnc_module_init(int refcount);
-int libgncmod_mt940_LTX_gnc_module_end(int refcount);
-
-
-char *
-libgncmod_mt940_LTX_gnc_module_path(void)
-{
-  return g_strdup("gnucash/import-export/mt940");
-}
-char *
-libgncmod_mt940_LTX_gnc_module_description(void)
-{
-  return g_strdup("Gnome GUI and C code for MT940 importer");
-}
-int
-libgncmod_mt940_LTX_gnc_module_init(int refcount)
-{
-  if(!gnc_module_load("gnucash/engine", 0))
-  {
-    return FALSE;
-  }
-  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;
-  }
-
-  gnc_plugin_mt940_create_plugin();
-  return TRUE;
-}
-
-int
-libgncmod_mt940_LTX_gnc_module_end(int refcount)
-{
-  return TRUE;
-}
-/** @}*/

Modified: gnucash/branches/register-rewrite/src/import-export/ofx/gnc-ofx-import.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/ofx/gnc-ofx-import.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/ofx/gnc-ofx-import.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -121,8 +121,8 @@
   g_assert(gnc_ofx_importer_gui);
 
   if(data.account_id_valid==true){
-    account = gnc_import_select_account(NULL,
-					data.account_id, 0, NULL, NULL, NO_TYPE, NULL, NULL);
+    account = gnc_import_select_account(NULL, data.account_id, 0, NULL, NULL,
+					ACCT_TYPE_NONE, NULL, NULL);
     if(account!=NULL)
       {
 	/********** Validate the input strings to ensure utf8 ********************/
@@ -340,7 +340,8 @@
 	    else if(data.unique_id_valid==true&&data.security_data_ptr->secname_valid==true)
 	      {
 		/************************ Process an investment transaction ******************************/
-		/* Note that the STOCK account type should be replaced with something derived from data.invtranstype*/
+		/* Note that the ACCT_TYPE_STOCK account type should be replaced with something
+		   derived from data.invtranstype*/
 		investment_commodity = gnc_import_select_commodity(data.unique_id,
 								   0,
 								   NULL,
@@ -358,7 +359,7 @@
 								   1,
 								   investment_account_text, 
 								   investment_commodity,
-								   STOCK,
+								   ACCT_TYPE_STOCK,
 								   NULL,
 								   NULL);
 		    g_free (investment_account_text);
@@ -424,7 +425,7 @@
 								     1,
 								     investment_account_text, 
 								     currency,
-								     INCOME,
+								     ACCT_TYPE_INCOME,
 								     NULL,
 								     NULL);
 			    income_acc_guid = xaccAccountGetGUID(income_account);
@@ -548,7 +549,7 @@
   Account *selected_account;
   gnc_commodity_table * commodity_table;
   gnc_commodity * default_commodity;
-  GNCAccountType default_type=NO_TYPE;
+  GNCAccountType default_type=ACCT_TYPE_NONE;
   gchar * account_description;
   gchar * account_type_name = NULL;
 
@@ -571,31 +572,31 @@
     if(data.account_type_valid==true){
       switch(data.account_type){
       case OFX_CHECKING : 
-	default_type=BANK;
+	default_type=ACCT_TYPE_BANK;
 	account_type_name = g_strdup_printf(_("Unknown OFX checking account"));
 	break;
       case OFX_SAVINGS : 
-	default_type=BANK;
+	default_type=ACCT_TYPE_BANK;
 	account_type_name = g_strdup_printf(_("Unknown OFX savings account"));
 	break;
       case OFX_MONEYMRKT : 
-	default_type=MONEYMRKT;
+	default_type=ACCT_TYPE_MONEYMRKT;
 	account_type_name = g_strdup_printf(_("Unknown OFX money market account"));
 	break;
       case OFX_CREDITLINE : 
-	default_type=CREDITLINE;
+	default_type=ACCT_TYPE_CREDITLINE;
 	account_type_name = g_strdup_printf(_("Unknown OFX credit line account"));
 	break;
       case OFX_CMA : 
-	default_type=NO_TYPE;
+	default_type=ACCT_TYPE_NONE;
 	account_type_name = g_strdup_printf(_("Unknown OFX CMA account"));
 	break;
       case OFX_CREDITCARD : 
-	default_type=CREDIT;
+	default_type=ACCT_TYPE_CREDIT;
 	account_type_name = g_strdup_printf(_("Unknown OFX credit card account"));
 	break;
       case OFX_INVESTMENT :
-	default_type=BANK;
+	default_type=ACCT_TYPE_BANK;
 	account_type_name = g_strdup_printf(_("Unknown OFX investment account"));
 	break;
       default: PERR("WRITEME: ofx_proc_account() This is an unknown account type!");

Modified: gnucash/branches/register-rewrite/src/import-export/qif/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,6 +23,7 @@
   ${top_builddir}/src/import-export/libgncmod-generic-import.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
   ${QOF_LIBS} \
+  ${REGEX_LIBS} \
   ${GLIB_LIBS}
 
 AM_CFLAGS = \
@@ -33,6 +34,5 @@
   -I${top_srcdir}/src/import-export \
   ${GLIB_CFLAGS} \
   ${GUILE_INCS} \
-  ${QOF_CFLAGS} \
-  ${G_WRAP_COMPILE_ARGS}
+  ${QOF_CFLAGS}
 

Modified: gnucash/branches/register-rewrite/src/import-export/qif/qif-parse.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif/qif-parse.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif/qif-parse.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -213,24 +213,30 @@
   qif_atype_map = g_hash_table_new(g_str_hash, g_str_equal);
   g_assert(qif_atype_map);
 
-  QIF_ADD_ATYPE("bank", make_list(1, BANK));
-  QIF_ADD_ATYPE("port", make_list(1, BANK));
-  QIF_ADD_ATYPE("cash", make_list(1, CASH));
-  QIF_ADD_ATYPE("ccard", make_list(1, CREDIT));
-  QIF_ADD_ATYPE("invst", make_list(3, BANK, STOCK, MUTUAL));
-  QIF_ADD_ATYPE("oth a", make_list(3, ASSET, BANK, CASH));
-  QIF_ADD_ATYPE("oth l", make_list(2, LIABILITY, CREDIT));
-  QIF_ADD_ATYPE("mutual", make_list(3, BANK, MUTUAL, STOCK));
+  QIF_ADD_ATYPE("bank", make_list(1, ACCT_TYPE_BANK));
+  QIF_ADD_ATYPE("port", make_list(1, ACCT_TYPE_BANK));
+  QIF_ADD_ATYPE("cash", make_list(1, ACCT_TYPE_CASH));
+  QIF_ADD_ATYPE("ccard", make_list(1, ACCT_TYPE_CREDIT));
+  QIF_ADD_ATYPE("invst", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_STOCK,
+				   ACCT_TYPE_MUTUAL));
+  QIF_ADD_ATYPE("oth a", make_list(3, ACCT_TYPE_ASSET, ACCT_TYPE_BANK,
+				   ACCT_TYPE_CASH));
+  QIF_ADD_ATYPE("oth l", make_list(2, ACCT_TYPE_LIABILITY, ACCT_TYPE_CREDIT));
+  QIF_ADD_ATYPE("mutual", make_list(3, ACCT_TYPE_BANK, ACCT_TYPE_MUTUAL,
+				    ACCT_TYPE_STOCK));
 
   /* Internal types */
-  QIF_ADD_ATYPE("__any_bank__", make_list(5, BANK, CREDIT, CASH, ASSET,
-                                          LIABILITY));
-  QIF_ADD_ATYPE("__all__", make_list(7, BANK, CREDIT, CASH, ASSET, LIABILITY,
-                                      STOCK, MUTUAL));
-  QIF_ADD_ATYPE("__stock__", make_list(2, STOCK, MUTUAL));
-  QIF_ADD_ATYPE("__income__", make_list(1, INCOME));
-  QIF_ADD_ATYPE("__expense__", make_list(1, EXPENSE));
-  QIF_ADD_ATYPE("__equity__", make_list(1, EQUITY));
+  QIF_ADD_ATYPE("__any_bank__", make_list(5, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
+					  ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
+                                          ACCT_TYPE_LIABILITY));
+  QIF_ADD_ATYPE("__all__", make_list(7, ACCT_TYPE_BANK, ACCT_TYPE_CREDIT,
+				     ACCT_TYPE_CASH, ACCT_TYPE_ASSET,
+				     ACCT_TYPE_LIABILITY, ACCT_TYPE_STOCK,
+				     ACCT_TYPE_MUTUAL));
+  QIF_ADD_ATYPE("__stock__", make_list(2, ACCT_TYPE_STOCK, ACCT_TYPE_MUTUAL));
+  QIF_ADD_ATYPE("__income__", make_list(1, ACCT_TYPE_INCOME));
+  QIF_ADD_ATYPE("__expense__", make_list(1, ACCT_TYPE_EXPENSE));
+  QIF_ADD_ATYPE("__equity__", make_list(1, ACCT_TYPE_EQUITY));
 }
 #undef QIF_ADD_ATYPE
 

Modified: gnucash/branches/register-rewrite/src/import-export/qif/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -38,8 +38,6 @@
   --gnc-module-dir ${top_builddir}/src/gnome-utils \
   --gnc-module-dir ${top_builddir}/src/network-utils \
   --gnc-module-dir ${top_builddir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR} \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/import-export \
   --guile-load-dir ${top_srcdir}/src/import-export/qif


Property changes on: gnucash/branches/register-rewrite/src/import-export/qif-import
___________________________________________________________________
Name: svn:ignore
   - .deps
.libs
.scm-links
*.gladep
*.la
*.lo
Makefile
Makefile.in
import-export
gnucash
g-wrapped
qif-import


semantic.cache

TAGS

   + .deps
.libs
.scm-links
*.gladep
*.la
*.lo
Makefile
Makefile.in
import-export
gnucash
qif-import


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,7 +23,6 @@
   ${top_builddir}/src/core-utils/libcore-utils.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
-  ${G_WRAP_LINK_ARGS} \
   ${GUILE_LIBS} \
   ${GNOME_LIBS} \
   ${GLADE_LIBS} \
@@ -59,7 +58,6 @@
   -I${top_srcdir}/src/gnome \
   -I${top_srcdir}/src/gnome-utils \
   -I${top_srcdir}/src/import-export \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GUILE_INCS} \
   ${GLIB_CFLAGS} \
   ${GLADE_CFLAGS} \
@@ -89,17 +87,20 @@
 noinst_DATA = .scm-links
 
 .scm-links: 
-	rm -f g-wrapped gnucash import-export qif-import
-	$(LN_S) -f . qif-import # to fix (load "qif-import/foo.scm")
-	$(LN_S) -f . import-export
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash qif-import
+	mkdir -p  gnucash/import-export
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/import-export; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
+	( cd qif-import; for A in $(gncscm_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
-CLEANFILES += qif-import import-export gnucash g-wrapped .scm-links
+clean-local:
+	$(RM) -rf gnucash qif-import
+
+CLEANFILES += .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/dialog-account-picker.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/dialog-account-picker.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/dialog-account-picker.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * dialog-account-picker.c -- window for picking a Gnucash account  * 
  * from the QIF importer.                                           *
  * Copyright (C) 2000-2001 Bill Gribble <grib at billgribble.com>      *
+ * 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   *
@@ -34,31 +35,36 @@
 #include "gnc-gui-query.h"
 #include "gnc-ui-util.h"
 
+enum account_cols {
+  ACCOUNT_COL_NAME = 0,
+  ACCOUNT_COL_FULLNAME,
+  ACCOUNT_COL_CHECK,
+  NUM_ACCOUNT_COLS
+};
+
 struct _accountpickerdialog {
   GtkWidget       * dialog;
-  GtkWidget       * treeview;
+  GtkTreeView     * treeview;
   QIFImportWindow * qif_wind;
   SCM             map_entry;  
   gchar           * selected_name;
 };
 
 static void
-row_data_destroy_cb(gpointer data) {
-  g_free(data);
-}
-
-static void
-acct_tree_add_accts(SCM accts, GtkCTree * tree, GtkCTreeNode * parent,
-                    char * base_name, int *row)
+acct_tree_add_accts(SCM accts,
+		    GtkTreeStore *store,
+		    GtkTreeIter *parent,
+                    const char *base_name,
+                    const char *selected_name,
+                    GtkTreeRowReference **reference)
 {
-  char         * acctinfo[2];
+  GtkTreeIter  iter;
+  char         * compname;
   char         * acctname;
-  GtkCTreeNode * node; 
   gboolean     leafnode;
   SCM          current;
+  gboolean     checked;
   
-  acctinfo[1] = "";
-
   while(!SCM_NULLP(accts)) {
     current = SCM_CAR(accts);
 
@@ -69,9 +75,9 @@
     }
 
     if (SCM_STRINGP(SCM_CAR(current)))
-      acctinfo[0] = g_strdup(SCM_STRING_CHARS(SCM_CAR(current)));
+      compname = SCM_STRING_CHARS(SCM_CAR(current));
     else
-      acctinfo[0] = g_strdup("");
+      compname = "";
 
     if(!SCM_NULLP(SCM_CADDR(current))) {
       leafnode = FALSE;
@@ -79,72 +85,69 @@
     else {
       leafnode = TRUE;
     }
-    
-    node = gtk_ctree_insert_node(tree, parent, NULL, 
-                                 acctinfo, 2,
-                                 NULL, NULL, NULL, NULL,
-                                 leafnode, TRUE);
 
-    gnc_clist_set_check (GTK_CLIST (tree), (*row)++, 1,
-                         SCM_CADR (current) == SCM_BOOL_T);
-
-    /* set some row data */ 
-    if(base_name && (strlen(base_name) > 0)) {
+    /* compute full name */ 
+    if(base_name && *base_name) {
       acctname =  g_strjoin(gnc_get_account_separator_string(),
-			    base_name, acctinfo[0], (char *)NULL);
+			    base_name, compname, (char *)NULL);
     }
     else {
-      acctname = g_strdup(acctinfo[0]);
+      acctname = g_strdup(compname);
     }
-    gtk_ctree_node_set_row_data_full(tree, node,
-                                     acctname,
-                                     row_data_destroy_cb);
+
+    checked = (SCM_CADR (current) == SCM_BOOL_T);
+
+    gtk_tree_store_append(store, &iter, parent);
+    gtk_tree_store_set(store, &iter,
+		       ACCOUNT_COL_NAME, compname,
+		       ACCOUNT_COL_FULLNAME, acctname,
+		       ACCOUNT_COL_CHECK, checked,
+		       -1);
+
+    if (reference && !*reference &&
+	selected_name && (g_utf8_collate(selected_name, acctname) == 0)) {
+      GtkTreePath *path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+      *reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+      gtk_tree_path_free(path);
+    }
+
     if(!leafnode) {
-      acct_tree_add_accts(SCM_CADDR(current), tree, node, acctname, row);
+      acct_tree_add_accts(SCM_CADDR(current), store, &iter, acctname,
+			  selected_name, reference);
     }
-    
+
+    g_free(acctname);
+
     accts = SCM_CDR(accts);      
   }
 }
 
-static gint
-test_str_cmp(gconstpointer a, gconstpointer b)
-{
-  return strcmp(a, b);
-}
-
 static void
 build_acct_tree(QIFAccountPickerDialog * picker, QIFImportWindow * import)
 {
   SCM  get_accts = scm_c_eval_string("qif-import:get-all-accts");
   SCM  acct_tree = scm_call_1(get_accts, 
 			      gnc_ui_qif_import_druid_get_mappings(import));
-  GtkCTreeNode * new_sel;
-  int row = 0;
+  GtkTreeStore *store;
+  GtkTreePath *path;
+  GtkTreeSelection* selection;
+  GtkTreeRowReference *reference = NULL;
 
-  gtk_clist_freeze(GTK_CLIST(picker->treeview));
-  gtk_clist_clear(GTK_CLIST(picker->treeview));
-  gtk_clist_set_column_justification (GTK_CLIST(picker->treeview),
-                                      1, GTK_JUSTIFY_CENTER);
+  store = GTK_TREE_STORE(gtk_tree_view_get_model(picker->treeview));
+  gtk_tree_store_clear(store);
 
-  acct_tree_add_accts(acct_tree, GTK_CTREE(picker->treeview),
-                      NULL, NULL, &row);
+  acct_tree_add_accts(acct_tree, store, NULL, NULL,
+		      picker->selected_name, &reference);
 
-  if(picker->selected_name) {
-    new_sel =
-      gtk_ctree_find_by_row_data_custom(GTK_CTREE(picker->treeview),
-                                        NULL,
-                                        picker->selected_name,
-                                        &test_str_cmp);
-    
-    gtk_ctree_select(GTK_CTREE(picker->treeview), new_sel);
-    gtk_ctree_node_moveto(GTK_CTREE(picker->treeview), new_sel, 0,
-                          0.5, 0.0);
+  if (reference) {
+    selection = gtk_tree_view_get_selection(picker->treeview);
+    path = gtk_tree_row_reference_get_path(reference);
+    if (path) {
+      gtk_tree_selection_select_path(selection, path);
+      gtk_tree_path_free(path);
+    }
+    gtk_tree_row_reference_free(reference);
   }
-
-  gtk_clist_columns_autosize (GTK_CLIST (picker->treeview));
-  gtk_clist_column_titles_passive (GTK_CLIST (picker->treeview));
-  gtk_clist_thaw(GTK_CLIST(picker->treeview));
 }
 
 static void
@@ -189,35 +192,26 @@
 }
 
 static void
-gnc_ui_qif_account_picker_select_cb(GtkCTree   * tree,
-                                    GtkCTreeNode  * node,
-                                    gint column,
-                                    gpointer  user_data)
+gnc_ui_qif_account_picker_changed_cb (GtkTreeSelection *selection,
+				      gpointer          user_data)
 {
   QIFAccountPickerDialog * wind = user_data;
   SCM name_setter = scm_c_eval_string("qif-map-entry:set-gnc-name!");
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  gchar *name;
 
   g_free(wind->selected_name);
-  wind->selected_name = 
-    g_strdup(gtk_ctree_node_get_row_data(tree, node));
-
-  scm_call_2(name_setter, wind->map_entry, scm_makfrom0str(wind->selected_name));
+  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
+    gtk_tree_model_get(model, &iter, ACCOUNT_COL_FULLNAME, &name, -1);
+    wind->selected_name = g_strdup(name);
+    scm_call_2(name_setter, wind->map_entry, scm_makfrom0str(wind->selected_name));
+  } else {
+    wind->selected_name = NULL;
+  }
 }
 
 
-static void
-gnc_ui_qif_account_picker_unselect_cb(GtkCTree   * tree,
-                                      GtkCTreeNode  * node,
-                                      gint column,
-                                      gpointer  user_data)
-{
-  QIFAccountPickerDialog * wind = user_data;
-
-  g_free(wind->selected_name);
-  wind->selected_name = NULL;
-}
-
-
 static int
 gnc_ui_qif_account_picker_map_cb(GtkWidget * w, gpointer user_data)
 {
@@ -259,7 +253,7 @@
      G_CALLBACK (gnc_ui_qif_account_picker_new_cb), wind);
 
   wind->dialog     = glade_xml_get_widget (xml, "QIF Import Account Picker");
-  wind->treeview   = glade_xml_get_widget (xml, "account_tree");
+  wind->treeview   = GTK_TREE_VIEW(glade_xml_get_widget (xml, "account_tree"));
   wind->qif_wind   = qif_wind;
 
   wind->map_entry  = map_entry;
@@ -269,14 +263,36 @@
 
   scm_gc_protect_object(wind->map_entry);
 
-  g_signal_connect(wind->treeview, "tree_select_row",
-		   G_CALLBACK(gnc_ui_qif_account_picker_select_cb),
-		   wind);
+  {
+    GtkTreeStore *store;
+    GtkCellRenderer *renderer;
+    GtkTreeViewColumn *column;
+    GtkTreeSelection *selection;
 
-  g_signal_connect(wind->treeview, "tree_unselect_row",
-		   G_CALLBACK(gnc_ui_qif_account_picker_unselect_cb),
-		   wind);
+    store = gtk_tree_store_new(NUM_ACCOUNT_COLS, G_TYPE_STRING, G_TYPE_STRING,
+			       G_TYPE_BOOLEAN);
+    gtk_tree_view_set_model(wind->treeview, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Account"), renderer,
+						      "text", ACCOUNT_COL_NAME,
+						      NULL);
+    g_object_set(column, "expand", TRUE, NULL);
+    gtk_tree_view_append_column(wind->treeview, column);
+
+    renderer = gtk_cell_renderer_toggle_new();
+    g_object_set(renderer, "activatable", FALSE, NULL);
+    column = gtk_tree_view_column_new_with_attributes(_("New?"), renderer,
+						      "active", ACCOUNT_COL_CHECK,
+						      NULL);
+    gtk_tree_view_append_column(wind->treeview, column);
+
+    selection = gtk_tree_view_get_selection(wind->treeview);
+    g_signal_connect(selection, "changed",
+		     G_CALLBACK(gnc_ui_qif_account_picker_changed_cb), wind);
+  }
+
   g_signal_connect_after(wind->dialog, "map",
 			 G_CALLBACK(gnc_ui_qif_account_picker_map_cb),
 			 wind);

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/druid-qif-import.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/druid-qif-import.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/druid-qif-import.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,8 @@
 /********************************************************************\
- * druid-qif-import.c -- window for importing QIF files            *
+ * druid-qif-import.c -- window for importing QIF files             *
  *                        (GnuCash)                                 *
  * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
+ * 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   *
@@ -43,29 +44,53 @@
 #include "gnc-gui-query.h"
 #include "gnc-ui-util.h"
 #include "gnc-gconf-utils.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-ui.h"
 #include "guile-mappings.h"
 
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #define DRUID_QIF_IMPORT_CM_CLASS "druid-qif-import"
 #define GCONF_SECTION "dialogs/import/qif"
 
+#define PREV_ROW "prev_row"
+
+enum filename_cols {
+  FILENAME_COL_INDEX = 0,
+  FILENAME_COL_NAME,
+  NUM_FILENAME_COLS
+};
+
+enum account_cols {
+  ACCOUNT_COL_INDEX = 0,
+  ACCOUNT_COL_QIF_NAME,
+  ACCOUNT_COL_GNC_NAME,
+  ACCOUNT_COL_NEW,
+  NUM_ACCOUNT_COLS
+};
+
+enum qif_trans_cols {
+  QIF_TRANS_COL_INDEX = 0,
+  QIF_TRANS_COL_DATE,
+  QIF_TRANS_COL_DESCRIPTION,
+  QIF_TRANS_COL_AMOUNT,
+  QIF_TRANS_COL_CHECKED,
+  NUM_QIF_TRANS_COLS
+};
+
 struct _qifimportwindow {
   GtkWidget * window;
   GtkWidget * druid;
   GtkWidget * filename_entry;
   GtkWidget * acct_entry;
   GtkWidget * date_format_combo;
-  GtkWidget * date_format_entry;
-  GtkWidget * selected_file_list;
-  GtkWidget * acct_list;
-  GtkWidget * cat_list;
-  GtkWidget * memo_list;
+  GtkWidget * selected_file_view;
+  GtkWidget * acct_view;
+  GtkWidget * cat_view;
+  GtkWidget * memo_view;
   GtkWidget * currency_picker;
-  GtkWidget * currency_entry;
-  GtkWidget * new_transaction_list;
-  GtkWidget * old_transaction_list;
+  GtkWidget * new_transaction_view;
+  GtkWidget * old_transaction_view;
   
   GList     * pre_comm_pages;
   GList     * commodity_pages;
@@ -113,7 +138,7 @@
 static void update_memo_page(QIFImportWindow * win);
 
 static void update_account_picker_page(QIFImportWindow * wind,
-				       SCM make_display, GtkWidget *list,
+				       SCM make_display, GtkWidget *view,
 				       SCM map_info, SCM * display_info);
 
 static void gnc_ui_qif_import_commodity_prepare_cb(GnomeDruidPage * page,
@@ -427,9 +452,6 @@
   const char * path_to_load;
   const gchar * default_acctname = NULL;
 
-  GList * format_strings;
-  GList * listit;
-
   SCM make_qif_file   = scm_c_eval_string("make-qif-file");
   SCM qif_file_load   = scm_c_eval_string("qif-file:read-file");
   SCM qif_file_parse  = scm_c_eval_string("qif-file:parse-fields");
@@ -438,7 +460,6 @@
   SCM check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
   SCM default_acct    = scm_c_eval_string("qif-file:path-to-accountname");
   SCM qif_file_parse_results  = scm_c_eval_string("qif-file:parse-fields-results");
-  SCM window_type     = scm_c_eval_string ("<gnc:UIWidget>");
   SCM date_formats;
   SCM scm_filename;
   SCM scm_qiffile;
@@ -449,7 +470,7 @@
 
   /* get the file name */ 
   path_to_load = gtk_entry_get_text(GTK_ENTRY(wind->filename_entry));
-  window = gw_wcp_assimilate_ptr(wind->window, window_type);
+  window = SWIG_NewPointerObj(wind->window, SWIG_TypeQuery("_p_GtkWidget"), 0);
 
   /* check a few error conditions before we get started */
   if(strlen(path_to_load) == 0) {
@@ -548,24 +569,16 @@
       if(SCM_LISTP(parse_return) && 
          (SCM_CAR(parse_return) == SCM_BOOL_T)) {
 
+	gtk_combo_box_remove_text(GTK_COMBO_BOX(wind->date_format_combo), 0);
 	if ((date_formats = scm_call_2(qif_file_parse_results,
 				       SCM_CDR(parse_return),
 				       scm_str2symbol("date"))) != SCM_BOOL_F) {
-	  format_strings = NULL;
 	  while(SCM_LISTP(date_formats) && !SCM_NULLP(date_formats)) {
-	    format_strings = 
-	      g_list_append(format_strings, 
-			    g_strdup(SCM_SYMBOL_CHARS(SCM_CAR(date_formats))));
+	    gtk_combo_box_append_text(GTK_COMBO_BOX(wind->date_format_combo),
+				      SCM_SYMBOL_CHARS(SCM_CAR(date_formats)));
 	    date_formats = SCM_CDR(date_formats);
 	  }
-	  gtk_combo_set_popdown_strings(GTK_COMBO(wind->date_format_combo),
-					format_strings);
-
-	  for(listit = format_strings; listit; listit=listit->next) {
-	    free(listit->data);
-	    listit->data = NULL;
-	  }
-	  g_list_free(format_strings);
+	gtk_combo_box_set_active(GTK_COMBO_BOX(wind->date_format_combo), 0);
         
 	  ask_date_format = TRUE;
 
@@ -639,9 +652,12 @@
 
   SCM  reparse_dates   = scm_c_eval_string("qif-file:reparse-dates");
   SCM  check_from_acct = scm_c_eval_string("qif-file:check-from-acct");
-  SCM  format_sym = 
-    scm_str2symbol(gtk_entry_get_text(GTK_ENTRY(wind->date_format_entry)));
+  SCM  format_sym;
+  gchar *text;
   
+  text = gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->date_format_combo));
+  format_sym = scm_str2symbol(text);
+  g_free(text);
   scm_call_2(reparse_dates, wind->selected_file, format_sym);
   
   if(scm_call_1(check_from_acct, wind->selected_file) != SCM_BOOL_T) {
@@ -670,20 +686,28 @@
  ****************************************************************/
 
 static void
-gnc_ui_qif_import_select_loaded_file_cb(GtkCList   * list,
-                                        int row, int column,
-                                        GdkEvent   * event,
-                                        gpointer  user_data)
+gnc_ui_qif_import_select_loaded_file_cb (GtkTreeSelection *selection,
+					 gpointer          user_data)   
 {
   QIFImportWindow * wind = user_data;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  gint row;
 
-  if(SCM_LISTP(wind->imported_files) && 
-     (scm_ilength(wind->imported_files) > row)) {
+  if (gtk_tree_selection_get_selected(selection, &model, &iter)) {
+    gtk_tree_model_get(model, &iter, FILENAME_COL_INDEX, &row, -1);
+    if(SCM_LISTP(wind->imported_files) && 
+       (scm_ilength(wind->imported_files) > row)) {
+      scm_gc_unprotect_object(wind->selected_file);
+      wind->selected_file = scm_list_ref(wind->imported_files,
+					 scm_int2num(row));   
+      scm_gc_protect_object(wind->selected_file);
+    } 
+  } else {
     scm_gc_unprotect_object(wind->selected_file);
-    wind->selected_file = scm_list_ref(wind->imported_files,
-				       scm_int2num(row));   
+    wind->selected_file = SCM_BOOL_F;
     scm_gc_protect_object(wind->selected_file);
-  } 
+  }
 }
 
 /********************************************************************
@@ -768,38 +792,47 @@
   SCM       loaded_file_list = wind->imported_files;
   SCM       scm_qiffile = SCM_BOOL_F;
   SCM       qif_file_path;
-  int       row;
-  int       sel_item=-1;
+  int       row = 0;
   char      * row_text;
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeRowReference *reference = NULL;
 
   /* clear the list */
-  gtk_clist_clear(GTK_CLIST(wind->selected_file_list));
+  view = GTK_TREE_VIEW(wind->selected_file_view);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+  gtk_list_store_clear(store);
   qif_file_path = scm_c_eval_string("qif-file:path");
   
-  /* iterate over all the imported files */
-  gtk_clist_freeze(GTK_CLIST(wind->selected_file_list));
-  
   while(!SCM_NULLP(loaded_file_list)) {  
     scm_qiffile = SCM_CAR(loaded_file_list);
     row_text    = SCM_STRING_CHARS(scm_call_1(qif_file_path, scm_qiffile));
 
-    row = gtk_clist_append(GTK_CLIST(wind->selected_file_list),
-                           &row_text);
-
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       FILENAME_COL_INDEX, row++,
+		       FILENAME_COL_NAME, row_text,
+		       -1);
     if(scm_qiffile == wind->selected_file) {
-      sel_item = row;
+      path = gtk_tree_model_get_path(GTK_TREE_MODEL(store), &iter);
+      reference = gtk_tree_row_reference_new(GTK_TREE_MODEL(store), path);
+      gtk_tree_path_free(path);
     }
 
     loaded_file_list = SCM_CDR(loaded_file_list);
   }
-  gtk_clist_thaw(GTK_CLIST(wind->selected_file_list));
 
-  if(sel_item >= 0) {
-    gtk_clist_select_row(GTK_CLIST(wind->selected_file_list), sel_item, 0);
+  if (reference) {
+    GtkTreeSelection* selection = gtk_tree_view_get_selection(view);
+    path = gtk_tree_row_reference_get_path(reference);
+    if (path) {
+      gtk_tree_selection_select_path(selection, path);
+      gtk_tree_path_free(path);
+    }
+    gtk_tree_row_reference_free(reference);
   }
-
-  /* Wheee! Look at me! I'm a little one-line hack to make stuff work! */
-  gtk_widget_queue_resize (wind->window);
 }
 
 
@@ -868,28 +901,32 @@
  * update_account_picker_page 
  * Generic function to update an account_picker page.  This
  * generalizes the code shared whenever any QIF -> GNC mapper is
- * updating it's CLIST.  It asks the Scheme side to guess some account
+ * updating it's LIST STORE.  It asks the Scheme side to guess some account
  * translations and then shows the account name and suggested
- * translation in the Accounts page clist (acount picker list).
+ * translation in the Accounts page view (acount picker list).
  ****************************************************************/
 
 static void
 update_account_picker_page(QIFImportWindow * wind, SCM make_display,
-			   GtkWidget *list, SCM map_info, SCM * display_info)
+			   GtkWidget *view, SCM map_info, SCM * display_info)
 {
 
   SCM  get_qif_name = scm_c_eval_string("qif-map-entry:qif-name");
   SCM  get_gnc_name = scm_c_eval_string("qif-map-entry:gnc-name");
   SCM  get_new      = scm_c_eval_string("qif-map-entry:new-acct?");
   SCM  accts_left;
-  int  sel_row=0;
-  char * row_text[3];
-  int  row;
+  const gchar *qif_name, *gnc_name;
+  gboolean checked;
+  gint row = 0;
+  gint prev_row;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeSelection *selection;
 
-  /* get the old selection row */
-  sel_row = (GTK_CLIST(list))->focus_row;
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(GTK_TREE_VIEW(view)));
 
-  /* now get the list of strings to display in the clist widget */
+  /* now get the list of strings to display in the gtk_list_store widget */
   accts_left = scm_call_3(make_display,
 			  wind->imported_files,
 			  map_info, 
@@ -899,37 +936,32 @@
   *display_info = accts_left;  
   scm_gc_protect_object(*display_info);
   
-  gtk_clist_column_titles_passive (GTK_CLIST(list));
-
   /* clear the list */
-  gtk_clist_clear(GTK_CLIST(list));
+  gtk_list_store_clear(store);
 
-  /* update the text in the boxes */
-  gtk_clist_freeze(GTK_CLIST(list));
-
-  gtk_clist_set_column_justification(GTK_CLIST(list),
-                                     2,
-                                     GTK_JUSTIFY_CENTER);
-
-  row_text[2] = "";
-
   while(!SCM_NULLP(accts_left)) {
-    row_text[0] = SCM_STRING_CHARS(scm_call_1(get_qif_name, SCM_CAR(accts_left)));
-    row_text[1] = SCM_STRING_CHARS(scm_call_1(get_gnc_name, SCM_CAR(accts_left)));
-    
-    row = gtk_clist_append(GTK_CLIST(list), row_text);
+    qif_name = SCM_STRING_CHARS(scm_call_1(get_qif_name, SCM_CAR(accts_left)));
+    gnc_name = SCM_STRING_CHARS(scm_call_1(get_gnc_name, SCM_CAR(accts_left)));
+    checked  = (scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
 
-    gnc_clist_set_check (GTK_CLIST(list), row, 2,
-                         scm_call_1(get_new, SCM_CAR(accts_left)) == SCM_BOOL_T);
-
+    gtk_list_store_append(store, &iter);
+    gtk_list_store_set(store, &iter,
+		       ACCOUNT_COL_INDEX,    row++,
+		       ACCOUNT_COL_QIF_NAME, qif_name,
+		       ACCOUNT_COL_GNC_NAME, gnc_name,
+		       ACCOUNT_COL_NEW,      checked,
+		       -1);
     accts_left = SCM_CDR(accts_left);
   }
 
-  gtk_clist_thaw(GTK_CLIST(list));
-
   /* move to the old selected row */
-  (GTK_CLIST(list))->focus_row = sel_row;
-  gtk_clist_moveto(GTK_CLIST(list), sel_row, 0, 0.0, 0.0);
+  prev_row = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(store), PREV_ROW));
+  if (prev_row != -1) {
+    selection = gtk_tree_view_get_selection(GTK_TREE_VIEW(view));
+    path = gtk_tree_path_new_from_indices (prev_row, -1);
+    gtk_tree_selection_select_path(selection, path);
+    gtk_tree_path_free(path);
+  }
 }
 
 
@@ -944,7 +976,7 @@
 
   SCM  make_account_display = scm_c_eval_string("qif-dialog:make-account-display");
 
-  update_account_picker_page (wind, make_account_display, wind->acct_list,
+  update_account_picker_page (wind, make_account_display, wind->acct_view,
 			      wind->acct_map_info, &(wind->acct_display_info));
 }
 
@@ -958,7 +990,7 @@
 {
   SCM  make_category_display = scm_c_eval_string("qif-dialog:make-category-display");
 
-  update_account_picker_page (wind, make_category_display, wind->cat_list,
+  update_account_picker_page (wind, make_category_display, wind->cat_view,
 			      wind->cat_map_info, &(wind->cat_display_info));
 }
 
@@ -972,11 +1004,58 @@
 {
   SCM  make_memo_display = scm_c_eval_string("qif-dialog:make-memo-display");
 
-  update_account_picker_page (wind, make_memo_display, wind->memo_list,
+  update_account_picker_page (wind, make_memo_display, wind->memo_view,
 			      wind->memo_map_info, &(wind->memo_display_info));
 }
 
+
 /********************************************************************
+ ********************************************************************/
+
+static void
+create_account_picker_view(GtkWidget *widget,
+			   const gchar *col_name,
+			   GCallback callback,
+			   gpointer user_data)
+{
+  GtkTreeView *view = GTK_TREE_VIEW(widget);
+  GtkListStore *store;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkTreeSelection *selection;
+
+  store = gtk_list_store_new(NUM_ACCOUNT_COLS, G_TYPE_INT, G_TYPE_STRING,
+			     G_TYPE_STRING, G_TYPE_BOOLEAN);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(col_name, renderer,
+						    "text", ACCOUNT_COL_QIF_NAME,
+						    NULL);
+  g_object_set(column, "expand", TRUE, NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("GnuCash account name"), renderer,
+						    "text", ACCOUNT_COL_GNC_NAME,
+						    NULL);
+  g_object_set(column, "expand", TRUE, NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_toggle_new();
+  g_object_set(renderer, "activatable", FALSE, NULL);
+  column = gtk_tree_view_column_new_with_attributes(_("New?"), renderer,
+						    "active", ACCOUNT_COL_NEW,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  g_object_set_data(G_OBJECT(store), PREV_ROW, GINT_TO_POINTER(-1));
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed", callback, user_data);
+}
+
+/********************************************************************
  * select_line
  * generic function to process the selection when a user tries to edit
  * an account mapping in one of the "map QIF * to GNC" pages.  This
@@ -985,12 +1064,26 @@
  * function.
  ********************************************************************/
 static void
-select_line (QIFImportWindow *wind, gint row, SCM display_info, SCM map_info,
+select_line (QIFImportWindow *wind, GtkTreeSelection *selection,
+	     SCM display_info, SCM map_info,
 	     void (*update_page)(QIFImportWindow *))
 {
   SCM   get_name = scm_c_eval_string("qif-map-entry:qif-name");
   SCM   selected_acct;
-  
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  gint row, prev_row;
+
+  if (!gtk_tree_selection_get_selected (selection, &model, &iter))
+    return;
+  gtk_tree_model_get(model, &iter, ACCOUNT_COL_INDEX, &row, -1);
+  prev_row = GPOINTER_TO_INT(g_object_get_data(G_OBJECT(model), PREV_ROW));
+  if (row == prev_row)
+    return;
+  g_object_set_data(G_OBJECT(model), PREV_ROW, GINT_TO_POINTER(row));
+  if (row == -1)
+    return;
+
   /* find the <qif-map-entry> corresponding to the selected row */
   selected_acct = scm_list_ref(display_info, scm_int2num(row));
   
@@ -1010,13 +1103,11 @@
  ********************************************************************/
 
 static void
-gnc_ui_qif_import_account_line_select_cb(GtkCList * clist, gint row,
-                                         gint column, GdkEvent * event,
-                                         gpointer user_data)
+gnc_ui_qif_import_account_line_select_cb(GtkTreeSelection *selection,
+					 gpointer          user_data)   
 {
   QIFImportWindow * wind = user_data;
-
-  select_line (wind, row, wind->acct_display_info, wind->acct_map_info,
+  select_line (wind, selection, wind->acct_display_info, wind->acct_map_info,
 	       update_accounts_page);
 }
 
@@ -1027,13 +1118,11 @@
  ********************************************************************/
 
 static void
-gnc_ui_qif_import_category_line_select_cb(GtkCList * clist, gint row,
-                                          gint column, GdkEvent * event,
-                                          gpointer user_data)
+gnc_ui_qif_import_category_line_select_cb(GtkTreeSelection *selection,
+					  gpointer          user_data)   
 {
   QIFImportWindow * wind = user_data;
-
-  select_line (wind, row, wind->cat_display_info, wind->cat_map_info,
+  select_line (wind, selection, wind->acct_display_info, wind->acct_map_info,
 	       update_categories_page);
 }
 
@@ -1044,13 +1133,11 @@
  ********************************************************************/
 
 static void
-gnc_ui_qif_import_memo_line_select_cb(GtkCList * clist, gint row,
-                                      gint column, GdkEvent * event,
-                                      gpointer user_data)
+gnc_ui_qif_import_memo_line_select_cb(GtkTreeSelection *selection,
+				      gpointer          user_data)   
 {
   QIFImportWindow * wind = user_data;
-
-  select_line (wind, row, wind->memo_display_info, wind->memo_map_info,
+  select_line (wind, selection, wind->acct_display_info, wind->acct_map_info,
 	       update_memo_page);
 }
 
@@ -1117,7 +1204,6 @@
 
   SCM   qif_to_gnc      = scm_c_eval_string("qif-import:qif-to-gnc");
   SCM   find_duplicates = scm_c_eval_string("gnc:group-find-duplicates");
-  SCM   window_type     = scm_c_eval_string ("<gnc:UIWidget>");
   SCM   retval;
   SCM   current_xtn;
   SCM   window;
@@ -1127,15 +1213,21 @@
   GList        * pageptr;
   Transaction  * gnc_xtn;
   Split        * gnc_split;
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeSelection* selection;
 
   const char * mnemonic = NULL; 
-  const char * namespace = NULL;
+  gchar * namespace = NULL;
   const char * fullname = NULL;
-  const gchar * row_text[4] = { NULL, NULL, NULL, NULL };
-  int  rownum;
+  const gchar * amount_str;
+  int  rownum = 0;
 
   /* get the default currency */
-  const char * currname = gtk_entry_get_text(GTK_ENTRY(wind->currency_entry));
+  const char * currname =
+    gtk_combo_box_get_active_text(GTK_COMBO_BOX(wind->currency_picker));
 
   /* busy cursor */
   gnc_suspend_gui_refresh ();
@@ -1147,17 +1239,18 @@
     page      = g_object_get_data(G_OBJECT(gtkpage), "page_struct");
     
     mnemonic  = gtk_entry_get_text(GTK_ENTRY(page->new_mnemonic_entry));
-    namespace = gnc_ui_namespace_picker_ns((page->new_type_combo));
+    namespace = gnc_ui_namespace_picker_ns(page->new_type_combo);
     fullname  = gtk_entry_get_text(GTK_ENTRY(page->new_name_entry));
     
     gnc_commodity_set_namespace_and_mnemonic(page->commodity, 
                                              namespace, mnemonic);
     gnc_commodity_set_fullname(page->commodity, fullname);
+    g_free(namespace);
   }
 
   /* call a scheme function to do the work.  The return value is an
    * account group containing all the new accounts and transactions */
-  window = gw_wcp_assimilate_ptr(wind->window, window_type);
+  window = SWIG_NewPointerObj(wind->window, SWIG_TypeQuery("_p_GtkWidget"), 0);
   retval = scm_apply(qif_to_gnc, 
 		     SCM_LIST7(wind->imported_files,
 			       wind->acct_map_info, 
@@ -1187,7 +1280,7 @@
     /* now detect duplicate transactions */ 
     gnc_set_busy_cursor(NULL, TRUE);
     retval = scm_call_3(find_duplicates, 
-			scm_c_eval_string("(gnc:get-current-group)"),
+			scm_c_eval_string("(gnc-get-current-group)"),
 			wind->imported_account_group, window);
     gnc_unset_busy_cursor(NULL);
     
@@ -1204,42 +1297,46 @@
       return FALSE;
     }
 
-    gtk_clist_column_titles_passive (GTK_CLIST(wind->new_transaction_list));
-
     /* otherwise, make up the display for the duplicates page */
-    gtk_clist_clear(GTK_CLIST(wind->new_transaction_list));
-    gtk_clist_freeze(GTK_CLIST(wind->new_transaction_list));
+    view = GTK_TREE_VIEW(wind->new_transaction_view);
+    store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+    gtk_list_store_clear(store);
 
     while(!SCM_NULLP(retval)) {
       current_xtn = SCM_CAAR(retval);
-      gnc_xtn     = (Transaction *)gw_wcp_get_ptr(current_xtn);
-      gnc_split   = xaccTransGetSplit(gnc_xtn, 0);  
-
-      row_text[0] = gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn));
-      row_text[1] = xaccTransGetDescription(gnc_xtn);
-
+      #define FUNC_NAME "xaccTransCountSplits"
+      gnc_xtn     = SWIG_MustGetPtr(current_xtn,
+                                    SWIG_TypeQuery("_p_Transaction"), 1, 0);
+      #undef FUNC_NAME
       if(xaccTransCountSplits(gnc_xtn) > 2) {
-        row_text[2] = g_strdup(_("(split)")); 
+        amount_str = _("(split)"); 
       }
       else {
-        row_text[2] = 
+	gnc_split = xaccTransGetSplit(gnc_xtn, 0);  
+        amount_str = 
           xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
                           gnc_account_print_info
                           (xaccSplitGetAccount(gnc_split), TRUE));
       }
 
-      rownum = gtk_clist_append(GTK_CLIST(wind->new_transaction_list),
-                                (gchar **) row_text);      
-      
+      gtk_list_store_append(store, &iter);
+      gtk_list_store_set
+	(store, &iter,
+	 QIF_TRANS_COL_INDEX, rownum++,
+	 QIF_TRANS_COL_DATE, gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
+	 QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
+	 QIF_TRANS_COL_AMOUNT, amount_str,
+	 -1);
+
       retval      = SCM_CDR(retval); 
     }
 
-    gtk_clist_columns_autosize(GTK_CLIST(wind->new_transaction_list));
+    selection = gtk_tree_view_get_selection(view);
+    path = gtk_tree_path_new_from_indices (0, -1);
+    gtk_tree_selection_select_path(selection, path);
+    gtk_tree_path_free(path);
+  }
 
-    gtk_clist_thaw(GTK_CLIST(wind->new_transaction_list));        
-    gtk_clist_select_row(GTK_CLIST(wind->new_transaction_list), 0, 0);
-  }  
-
   gnc_resume_gui_refresh();
   return TRUE;
 }
@@ -1376,7 +1473,7 @@
   QIFImportWindow * wind = user_data;
   QIFDruidPage    * qpage = g_object_get_data(G_OBJECT(page), "page_struct");
   
-  const char * namespace = gnc_ui_namespace_picker_ns(qpage->new_type_combo);
+  gchar *namespace       = gnc_ui_namespace_picker_ns(qpage->new_type_combo);
   const char * name      = gtk_entry_get_text(GTK_ENTRY(qpage->new_name_entry));
   const char * mnemonic  = gtk_entry_get_text(GTK_ENTRY(qpage->new_mnemonic_entry));
   int  show_matches;
@@ -1384,6 +1481,8 @@
   if(!namespace || (namespace[0] == 0)) {
     gnc_warning_dialog(wind->window,
 		       _("You must enter a Type for the commodity."));
+    if (namespace)
+      g_free(namespace);
     return TRUE;
   }
   else if(!name || (name[0] == 0)) {
@@ -1405,8 +1504,10 @@
 		       _("You must enter an existing national "
 			 "currency or enter a different type."));
 
+    g_free(namespace);
     return TRUE;
   }
+  g_free(namespace);
 
   if(page == (g_list_last(wind->commodity_pages))->data) {
     /* it's time to import the accounts. */
@@ -1489,8 +1590,10 @@
   stocks = wind->new_stocks;
   while(!SCM_NULLP(stocks) && (stocks != SCM_BOOL_F)) {
     comm_ptr_token = scm_call_2(hash_ref, wind->stock_hash, SCM_CAR(stocks));
-    commodity      = gw_wcp_get_ptr(comm_ptr_token);
-    
+    #define FUNC_NAME "make_qif_druid_page"
+    commodity      = SWIG_MustGetPtr(comm_ptr_token,
+                                     SWIG_TypeQuery("_p_gnc_commodity"), 1, 0);
+    #undef FUNC_NAME
     new_page = make_qif_druid_page(commodity);
 
     g_signal_connect(new_page->page, "next",
@@ -1560,9 +1663,9 @@
   info_label = gtk_label_new("");
   gtk_box_pack_start(GTK_BOX(temp), info_label, TRUE, TRUE, 0);
 
-  retval->new_type_combo = gtk_combo_new(); 
-  gtk_box_pack_start(GTK_BOX(temp),
-                     retval->new_type_combo, TRUE, TRUE, 0);
+  retval->new_type_combo = gtk_combo_box_entry_new_text();
+  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(retval->new_type_combo));
+  gtk_box_pack_start(GTK_BOX(temp), retval->new_type_combo, TRUE, TRUE, 0);
 
   info_label = gtk_label_new("");
   gtk_box_pack_start(GTK_BOX(temp), info_label, TRUE, TRUE, 0);
@@ -1633,77 +1736,105 @@
   SCM          selected;
   Transaction  * gnc_xtn;
   Split        * gnc_split;
-  const gchar  * row_text[4] = { NULL, NULL, NULL, NULL };
-  int          rownum;
+  const gchar  * amount_str;
+  int          rownum = 0;
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkTreeIter iter;
 
-  gtk_clist_column_titles_passive (GTK_CLIST(wind->old_transaction_list));
+  view = GTK_TREE_VIEW(wind->old_transaction_view);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view));
+  gtk_list_store_clear(store);
 
-  gtk_clist_clear(GTK_CLIST(wind->old_transaction_list));
-  gtk_clist_freeze(GTK_CLIST(wind->old_transaction_list));
-
-  gtk_clist_set_column_justification(GTK_CLIST(wind->old_transaction_list),
-                                     3,
-                                     GTK_JUSTIFY_CENTER);
-
   if(wind->match_transactions != SCM_BOOL_F) {
     possible_matches = SCM_CDR(scm_list_ref(wind->match_transactions,
                                   scm_int2num(wind->selected_transaction)));
     scm_call_2(scm_c_eval_string("qif-import:refresh-match-selection"),
 	       possible_matches, scm_int2num(selection));
 
-    row_text[3] = "";
-
     while(!SCM_NULLP(possible_matches)) {
       current_xtn = SCM_CAR(possible_matches);
-      gnc_xtn     = (Transaction *)gw_wcp_get_ptr(SCM_CAR(current_xtn));
+      #define FUNC_NAME "make_qif_druid_page"
+      gnc_xtn     = SWIG_MustGetPtr(SCM_CAR(current_xtn),
+                                    SWIG_TypeQuery("_p_Transaction"), 1, 0);
+      #undef FUNC_NAME
       selected    = SCM_CDR(current_xtn);
-      gnc_split   = xaccTransGetSplit(gnc_xtn, 0);  
       
-      row_text[0] = gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn));
-      row_text[1] = xaccTransGetDescription(gnc_xtn);
-      
       if(xaccTransCountSplits(gnc_xtn) > 2) {
-        row_text[2] = _("(split)");
+        amount_str = _("(split)"); 
       }
       else {
-        row_text[2] = 
+	gnc_split = xaccTransGetSplit(gnc_xtn, 0);  
+        amount_str = 
           xaccPrintAmount(gnc_numeric_abs(xaccSplitGetValue(gnc_split)),
                           gnc_account_print_info
                           (xaccSplitGetAccount(gnc_split), TRUE));
       }
-      
-      rownum = gtk_clist_append(GTK_CLIST(wind->old_transaction_list),
-                                (gchar **) row_text);
 
-      gnc_clist_set_check (GTK_CLIST(wind->old_transaction_list),
-                           rownum, 3, selected != SCM_BOOL_F);
+      gtk_list_store_append(store, &iter);
+      gtk_list_store_set
+	(store, &iter,
+	 QIF_TRANS_COL_INDEX, rownum++,
+	 QIF_TRANS_COL_DATE, gnc_print_date(xaccTransRetDatePostedTS(gnc_xtn)),
+	 QIF_TRANS_COL_DESCRIPTION, xaccTransGetDescription(gnc_xtn),
+	 QIF_TRANS_COL_AMOUNT, amount_str,
+	 QIF_TRANS_COL_CHECKED, selected != SCM_BOOL_F,
+	 -1);
 
       possible_matches = SCM_CDR(possible_matches);
     }
   }
-
-  gtk_clist_columns_autosize (GTK_CLIST(wind->old_transaction_list));
-
-  gtk_clist_thaw(GTK_CLIST(wind->old_transaction_list));
 }
 
 static void
-gnc_ui_qif_import_duplicate_new_select_cb(GtkCList * clist, int row, int col, 
-                                          GdkEvent * ev, gpointer user_data)
+gnc_ui_qif_import_duplicate_new_select_cb (GtkTreeSelection *selection,
+					   QIFImportWindow  *wind)
 {
-  QIFImportWindow * wind = user_data;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
 
-  wind->selected_transaction = row;
+  if (gtk_tree_selection_get_selected(selection, &model, &iter))
+    gtk_tree_model_get(model, &iter,
+		       QIF_TRANS_COL_INDEX, &wind->selected_transaction,
+		       -1);
   refresh_old_transactions(wind, -1);
 }
 
+static gboolean
+reset_ignore_old_select(gboolean *ignore)
+{
+  *ignore = FALSE;
+  return FALSE;
+}
 
 static void
-gnc_ui_qif_import_duplicate_old_select_cb(GtkCList * clist, int row, int col, 
-                                          GdkEvent * ev, gpointer user_data)
+gnc_ui_qif_import_duplicate_old_select_cb (GtkTreeSelection *selection,
+					   QIFImportWindow  *wind)
 {
-  QIFImportWindow * wind = user_data;
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+  gint row;
+  static gboolean ignore_old_select = FALSE;
 
+  /* Get the current selection then clear it.  We're about to clear
+   * the entire list store and rebuild it so this prevents errors. */
+  if (!gtk_tree_selection_get_selected(selection, &model, &iter))
+    return;
+  gtk_tree_selection_unselect_all(selection);
+
+  /* Getting a weird double call the first time a line is clicked.
+   * Once via gtk_tree_view_button_press and then again via
+   * gtk_tree_view_grab_focus. */
+  if (ignore_old_select)
+    return;
+  ignore_old_select = TRUE;
+  g_idle_add((GSourceFunc)reset_ignore_old_select, &ignore_old_select);
+
+  /* Get the row the user clicked on and update the scheme
+   * code/rebuild the list store.  */
+  gtk_tree_model_get(model, &iter,
+		     QIF_TRANS_COL_INDEX, &row,
+		     -1);
   refresh_old_transactions(wind, row);
 }
 
@@ -1728,7 +1859,7 @@
 
   /* actually add in the new transactions. */
   scm_call_2(cat_and_merge, 
-	     scm_c_eval_string("(gnc:get-current-group)"),
+	     scm_c_eval_string("(gnc-get-current-group)"),
 	     wind->imported_account_group);
   
   gnc_resume_gui_refresh();
@@ -1800,7 +1931,13 @@
   SCM  mapping_info;
   SCM  create_ticker_map;
   int  i;
+  GtkTreeView *view;
+  GtkListStore *store;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkTreeSelection *selection;
 
+
   char * pre_page_names[NUM_PRE_PAGES] = {
     "start_page", "load_file_page", "date_format_page", "account_name_page",
     "loaded_files_page", "account_doc_page", "account_match_page", 
@@ -1850,10 +1987,6 @@
      G_CALLBACK (gnc_ui_qif_import_date_format_next_cb), retval);
 
   glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_select_loaded_file_cb",
-     G_CALLBACK (gnc_ui_qif_import_select_loaded_file_cb), retval);
-
-  glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_loaded_files_prepare_cb",
      G_CALLBACK (gnc_ui_qif_import_loaded_files_prepare_cb), retval);
 
@@ -1874,18 +2007,6 @@
      G_CALLBACK (gnc_ui_qif_import_default_acct_back_cb), retval);
 
   glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_account_line_select_cb",
-     G_CALLBACK (gnc_ui_qif_import_account_line_select_cb), retval);
-
-  glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_category_line_select_cb",
-     G_CALLBACK (gnc_ui_qif_import_category_line_select_cb), retval);
-
-  glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_memo_line_select_cb",
-     G_CALLBACK (gnc_ui_qif_import_memo_line_select_cb), retval);
-
-  glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_accounts_prepare_cb",
      G_CALLBACK (gnc_ui_qif_import_accounts_prepare_cb), retval);
 
@@ -1910,14 +2031,6 @@
      G_CALLBACK (gnc_ui_qif_import_commodity_prepare_cb), retval);
 
   glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_duplicate_new_select_cb",
-     G_CALLBACK (gnc_ui_qif_import_duplicate_new_select_cb), retval);
-
-  glade_xml_signal_connect_data
-    (xml, "gnc_ui_qif_import_duplicate_old_select_cb",
-     G_CALLBACK (gnc_ui_qif_import_duplicate_old_select_cb), retval);
-
-  glade_xml_signal_connect_data
     (xml, "gnc_ui_qif_import_finish_cb",
      G_CALLBACK (gnc_ui_qif_import_finish_cb), retval);
 
@@ -1942,18 +2055,16 @@
   retval->druid          = glade_xml_get_widget (xml, "qif_import_druid");
   retval->filename_entry = glade_xml_get_widget (xml, "qif_filename_entry");
   retval->acct_entry     = glade_xml_get_widget (xml, "qif_account_entry");
-  retval->date_format_combo = glade_xml_get_widget (xml, "date_format_combo");
-  retval->date_format_entry = glade_xml_get_widget (xml, "date_format_entry");
-  retval->selected_file_list = glade_xml_get_widget(xml, "selected_file_list");
-  retval->currency_picker = glade_xml_get_widget (xml, "currency_combo");
-  retval->currency_entry = glade_xml_get_widget (xml, "currency_entry");
-  retval->acct_list      = glade_xml_get_widget (xml, "account_page_list");
-  retval->cat_list       = glade_xml_get_widget (xml, "category_page_list");
-  retval->memo_list      = glade_xml_get_widget (xml, "memo_page_list");
-  retval->new_transaction_list = 
-    glade_xml_get_widget (xml, "new_transaction_list");
-  retval->old_transaction_list = 
-    glade_xml_get_widget (xml, "old_transaction_list");
+  retval->date_format_combo = glade_xml_get_widget (xml, "date_format_combobox");
+  retval->selected_file_view = glade_xml_get_widget(xml, "selected_file_view");
+  retval->currency_picker = glade_xml_get_widget (xml, "currency_comboboxentry");
+  retval->acct_view      = glade_xml_get_widget (xml, "account_page_view");
+  retval->cat_view       = glade_xml_get_widget (xml, "category_page_view");
+  retval->memo_view      = glade_xml_get_widget (xml, "memo_page_view");
+  retval->new_transaction_view = 
+    glade_xml_get_widget (xml, "new_transaction_view");
+  retval->old_transaction_view = 
+    glade_xml_get_widget (xml, "old_transaction_view");
   
   retval->pre_comm_pages   = NULL;
   retval->post_comm_pages  = NULL;
@@ -1979,6 +2090,103 @@
                     glade_xml_get_widget (xml, doc_page_names[i]));
   }
   
+  /* Set up the selected file view */
+  view = GTK_TREE_VIEW(retval->selected_file_view);
+  store = gtk_list_store_new(NUM_FILENAME_COLS, G_TYPE_INT, G_TYPE_STRING);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Account"), renderer,
+						    "text", FILENAME_COL_NAME,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(gnc_ui_qif_import_select_loaded_file_cb),
+		   retval);
+  
+  create_account_picker_view(retval->acct_view, _("QIF account name"),
+			     G_CALLBACK(gnc_ui_qif_import_account_line_select_cb),
+			     retval);
+  create_account_picker_view(retval->cat_view,  _("QIF category name"),
+			     G_CALLBACK(gnc_ui_qif_import_category_line_select_cb),
+			     retval);
+  create_account_picker_view(retval->memo_view, _("QIF payee/memo"),
+			     G_CALLBACK(gnc_ui_qif_import_memo_line_select_cb),
+			     retval);
+
+  /* Set up the new transaction view */
+  view = GTK_TREE_VIEW(retval->new_transaction_view);
+  store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer,
+						    "text", QIF_TRANS_COL_DATE,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Description"), renderer,
+						    "text", QIF_TRANS_COL_DESCRIPTION,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+  gtk_tree_view_column_set_expand(column, TRUE);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Amount"), renderer,
+						    "text", QIF_TRANS_COL_AMOUNT,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(gnc_ui_qif_import_duplicate_new_select_cb),
+		   retval);
+
+
+  /* Set up the old transaction view */
+  view = GTK_TREE_VIEW(retval->old_transaction_view);
+  store = gtk_list_store_new(NUM_QIF_TRANS_COLS, G_TYPE_INT, G_TYPE_STRING,
+			     G_TYPE_STRING, G_TYPE_STRING, G_TYPE_BOOLEAN);
+  gtk_tree_view_set_model(view, GTK_TREE_MODEL(store));
+  g_object_unref(store);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Date"), renderer,
+						    "text", QIF_TRANS_COL_DATE,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Description"), renderer,
+						    "text", QIF_TRANS_COL_DESCRIPTION,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+  gtk_tree_view_column_set_expand(column, TRUE);
+
+  renderer = gtk_cell_renderer_text_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Amount"), renderer,
+						    "text", QIF_TRANS_COL_AMOUNT,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  renderer = gtk_cell_renderer_toggle_new();
+  column = gtk_tree_view_column_new_with_attributes(_("Dup?"), renderer,
+						    "active", QIF_TRANS_COL_CHECKED,
+						    NULL);
+  gtk_tree_view_append_column(view, column);
+
+  selection = gtk_tree_view_get_selection(view);
+  g_signal_connect(selection, "changed",
+		   G_CALLBACK(gnc_ui_qif_import_duplicate_old_select_cb),
+		   retval);
+
+
   /* load the saved-state of the mappings from Quicken accounts and
    * categories to gnucash accounts */
   load_map_prefs = scm_c_eval_string("qif-import:load-map-prefs");
@@ -2009,6 +2217,7 @@
   scm_gc_protect_object(retval->match_transactions);
   
   /* set a default currency for new accounts */
+  gnc_cbe_require_list_item(GTK_COMBO_BOX_ENTRY(retval->currency_picker));
   gnc_ui_update_commodity_picker(retval->currency_picker,
                                  GNC_COMMODITY_NS_CURRENCY, 
                                  gnc_commodity_get_printname

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-dialog-utils.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-dialog-utils.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-dialog-utils.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -9,39 +9,39 @@
 (use-modules (ice-9 regex))
 
 (define (default-stock-acct brokerage security)
-  (string-append brokerage (gnc:account-separator-string) security))
+  (string-append brokerage (gnc-get-account-separator-string) security))
 
 (define (default-dividend-acct brokerage security)
-  (string-append (_ "Dividends") (gnc:account-separator-string) 
-                 brokerage (gnc:account-separator-string) 
+  (string-append (_ "Dividends") (gnc-get-account-separator-string)
+                 brokerage (gnc-get-account-separator-string)
                  security))
 
 (define (default-interest-acct brokerage security) 
-  (string-append (_ "Interest") (gnc:account-separator-string) 
+  (string-append (_ "Interest") (gnc-get-account-separator-string)
                  brokerage
 		 (if (string=? security "")
 		  ""
-		  (string-append (gnc:account-separator-string)  
+		  (string-append (gnc-get-account-separator-string)
 				  security))))
 
 (define (default-capital-return-acct brokerage security) 
-  (string-append (_ "Cap Return") (gnc:account-separator-string) 
-                 brokerage (gnc:account-separator-string)  
+  (string-append (_ "Cap Return") (gnc-get-account-separator-string)
+                 brokerage (gnc-get-account-separator-string)
                  security))
 
 (define (default-cglong-acct brokerage security)
-  (string-append (_ "Cap. gain (long)") (gnc:account-separator-string) 
-                 brokerage (gnc:account-separator-string) 
+  (string-append (_ "Cap. gain (long)") (gnc-get-account-separator-string)
+                 brokerage (gnc-get-account-separator-string)
                  security))
 
 (define (default-cgmid-acct brokerage security)
-  (string-append (_ "Cap. gain (mid)") (gnc:account-separator-string) 
-                 brokerage (gnc:account-separator-string) 
+  (string-append (_ "Cap. gain (mid)") (gnc-get-account-separator-string)
+                 brokerage (gnc-get-account-separator-string)
                  security))
 
 (define (default-cgshort-acct brokerage security)
-  (string-append (_ "Cap. gain (short)") (gnc:account-separator-string) 
-                 brokerage (gnc:account-separator-string) 
+  (string-append (_ "Cap. gain (short)") (gnc-get-account-separator-string)
+                 brokerage (gnc-get-account-separator-string)
                  security))
 
 (define (default-equity-holding security) (_ "Retained Earnings"))
@@ -49,11 +49,11 @@
 (define (default-equity-account) (_ "Retained Earnings"))  
 
 (define (default-commission-acct brokerage) 
-  (string-append (_ "Commissions") (gnc:account-separator-string) 
+  (string-append (_ "Commissions") (gnc-get-account-separator-string)
                  brokerage))
 
 (define (default-margin-interest-acct brokerage) 
-  (string-append (_ "Margin Interest") (gnc:account-separator-string) 
+  (string-append (_ "Margin Interest") (gnc-get-account-separator-string)
                  brokerage))
 
 (define (default-unspec-acct)
@@ -417,7 +417,7 @@
                          (set! entry 
                                (qif-import:guess-acct
                                 xtn-cat
-                                (if (gnc:numeric-positive-p 
+                                (if (gnc-numeric-positive-p
                                      (qif-split:amount split))
                                     (list GNC-INCOME-TYPE GNC-EXPENSE-TYPE)
                                     (list GNC-EXPENSE-TYPE GNC-INCOME-TYPE))
@@ -494,7 +494,7 @@
                               entry (default-unspec-acct))
                              (qif-map-entry:set-allowed-types!
                               entry 
-                              (if (gnc:numeric-positive-p
+                              (if (gnc-numeric-positive-p
                                    (qif-split:amount split))
                                   (list GNC-INCOME-TYPE GNC-EXPENSE-TYPE
                                         GNC-BANK-TYPE GNC-CCARD-TYPE 
@@ -567,7 +567,7 @@
   (if (not qif-import:account-name-regexp)
       (let* ((rstr ":([^:]+)$|^([^:]+)$")
              (newstr (regexp-substitute/global 
-                      #f ":" rstr 'pre (gnc:account-separator-string) 'post)))
+                      #f ":" rstr 'pre (gnc-get-account-separator-string) 'post)))
         
         (set! qif-import:account-name-regexp (make-regexp newstr))))
   
@@ -604,21 +604,21 @@
                   (memv GNC-MUTUAL-TYPE 
                         (qif-map-entry:allowed-types map-entry)))
               (not (hash-ref stock-hash stock-name)))
-             (let* ((separator (string-ref (gnc:account-separator-string) 0))
+             (let* ((separator (string-ref (gnc-get-account-separator-string) 0))
                     (existing-gnc-acct 
-                     (gnc:get-account-from-full-name 
-                      (gnc:get-current-group)
+                     (xaccGetAccountFromFullName
+                      (gnc-get-current-group)
                       (qif-map-entry:gnc-name map-entry)))
-		    (book (gnc:group-get-book (gnc:get-current-group)))
+		    (book (xaccGroupGetBook (gnc-get-current-group)))
                     (existing-type 
-                     (gnc:account-get-type existing-gnc-acct)))
+                     (xaccAccountGetType existing-gnc-acct)))
                (if (and existing-gnc-acct 
                         (memv existing-type (list GNC-STOCK-TYPE 
                                                   GNC-MUTUAL-TYPE)))
                    ;; gnc account already exists... we *know* what the 
                    ;; security is supposed to be 
                    (let ((commodity 
-                          (gnc:account-get-commodity existing-gnc-acct)))
+                          (xaccAccountGetCommodity existing-gnc-acct)))
                      (hash-set! stock-hash stock-name commodity))
                    
                    ;; we know nothing about this security.. we need to 
@@ -628,9 +628,9 @@
                      (if (not ticker-symbol)
 			 (set! ticker-symbol stock-name))
                      (set! names (cons stock-name names))
-                     (set! c (gnc:commodity-create book
-                                            GNC_COMMODITY_NS_NYSE
-                                            ticker-symbol))
+                     (set! c (gnc-commodity-new book
+                                                GNC_COMMODITY_NS_NYSE
+                                                ticker-symbol))
                      (gnc:commodity-set-fullname c stock-name)
                      (gnc:commodity-set-cusip c "")
                      (gnc:commodity-set-fraction c 100000)
@@ -685,7 +685,7 @@
 
   (let ((accts '())
         (acct-tree '())
-        (separator (string-ref (gnc:account-separator-string) 0)))
+        (separator (string-ref (gnc-get-account-separator-string) 0)))
     ;; get the new accounts from the account map
     (for-each 
      (lambda (acctmap)
@@ -709,11 +709,11 @@
        (set! accts 
              (cons 
               (cons (string-split 
-                     (gnc:account-get-full-name acct)
+                     (gnc-account-get-full-name acct)
                      separator)
                     #f)
               accts)))
-     (gnc:group-get-subaccounts (gnc:get-current-group)))
+     (xaccGroupGetSubAccountsSorted (gnc-get-current-group)))
 
     ;; now build a tree structure 
     (for-each 

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-file.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-file.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-file.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -11,7 +11,7 @@
 ;;  just store the fields "raw".
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
-(use-modules (g-wrapped gw-core-utils))
+(use-modules (gnucash core-utils))
 
 (cond
  ((or (string=? "1.3.4" (version))
@@ -53,9 +53,9 @@
 
      (if (> file-size 10000)
          (begin
-           (set! progress-dialog (gnc:progress-dialog-new window #f))
-           (gnc:progress-dialog-set-title progress-dialog (_ "Progress"))
-           (gnc:progress-dialog-set-heading progress-dialog
+           (set! progress-dialog (gnc-progress-dialog-new window #f))
+           (gnc-progress-dialog-set-title progress-dialog (_ "Progress"))
+           (gnc-progress-dialog-set-heading progress-dialog
                                             (_ "Loading QIF file..."))))
 
      (with-input-from-file path
@@ -74,7 +74,7 @@
                  ;; pick the 1-char tag off from the remainder of the line 
                  (set! tag (string-ref line 0))
                  (set! value (substring line 1))
-		 (gnc:utf8-strip-invalid value)
+		 (gnc-utf8-strip-invalid value) ;; changes value in-place
                  
                  ;; now do something with the line 
                  (if
@@ -388,9 +388,9 @@
 		 ;; update the progress bar for each line read
 		 (if progress-dialog 
 		     (begin 
-		       (gnc:progress-dialog-set-value 
+		       (gnc-progress-dialog-set-value
 			progress-dialog (/ bytes-read file-size))
-		       (gnc:progress-dialog-update progress-dialog)))
+		       (gnc-progress-dialog-update progress-dialog)))
                  
                  ;; this is if we read a normal (non-null, non-eof) line...
                  (if (not heinous-error)
@@ -406,7 +406,7 @@
      (qif-file:set-xtns! self (reverse (qif-file:xtns self)))
 
      (if progress-dialog
-         (gnc:progress-dialog-destroy progress-dialog))
+         (gnc-progress-dialog-destroy progress-dialog))
 
      return-val)))
 
@@ -520,7 +520,7 @@
      (and 
       ;; fields of categories. 
       (check-and-parse-field 
-       qif-cat:tax-class qif-cat:set-tax-class! gnc:numeric-equal
+       qif-cat:tax-class qif-cat:set-tax-class! gnc-numeric-equal
        qif-parse:check-number-format '(decimal comma)
        qif-parse:parse-number/format (qif-file:cats self)
        qif-parse:print-number
@@ -528,7 +528,7 @@
        set-error 'tax-class)
       
       (check-and-parse-field 
-       qif-cat:budget-amt qif-cat:set-budget-amt! gnc:numeric-equal
+       qif-cat:budget-amt qif-cat:set-budget-amt! gnc-numeric-equal
        qif-parse:check-number-format '(decimal comma) 
        qif-parse:parse-number/format (qif-file:cats self)
        qif-parse:print-number
@@ -537,7 +537,7 @@
       
       ;; fields of accounts 
       (check-and-parse-field 
-       qif-acct:limit qif-acct:set-limit! gnc:numeric-equal
+       qif-acct:limit qif-acct:set-limit! gnc-numeric-equal
        qif-parse:check-number-format '(decimal comma) 
        qif-parse:parse-number/format (qif-file:accounts self)
        qif-parse:print-number
@@ -545,7 +545,7 @@
        set-error 'limit)
       
       (check-and-parse-field 
-       qif-acct:budget qif-acct:set-budget! gnc:numeric-equal
+       qif-acct:budget qif-acct:set-budget! gnc-numeric-equal
        qif-parse:check-number-format '(decimal comma) 
        qif-parse:parse-number/format (qif-file:accounts self)
        qif-parse:print-number
@@ -576,7 +576,7 @@
        qif-parse:parse-action-field (qif-file:xtns self) set-error)
       
       (check-and-parse-field 
-       qif-xtn:share-price qif-xtn:set-share-price! gnc:numeric-equal
+       qif-xtn:share-price qif-xtn:set-share-price! gnc-numeric-equal
        qif-parse:check-number-format '(decimal comma) 
        qif-parse:parse-number/format (qif-file:xtns self)
        qif-parse:print-number
@@ -584,7 +584,7 @@
        set-error 'share-price)
       
       (check-and-parse-field 
-       qif-xtn:num-shares qif-xtn:set-num-shares! gnc:numeric-equal
+       qif-xtn:num-shares qif-xtn:set-num-shares! gnc-numeric-equal
        qif-parse:check-number-format '(decimal comma) 
        qif-parse:parse-number/format (qif-file:xtns self)
        qif-parse:print-number
@@ -592,7 +592,7 @@
        set-error 'num-shares)
       
       (check-and-parse-field 
-       qif-xtn:commission qif-xtn:set-commission! gnc:numeric-equal
+       qif-xtn:commission qif-xtn:set-commission! gnc-numeric-equal
        qif-parse:check-number-format '(decimal comma) 
        qif-parse:parse-number/format (qif-file:xtns self)
        qif-parse:print-number
@@ -602,7 +602,7 @@
       ;; this one's a little tricky... it checks and sets all the 
       ;; split amounts for the transaction together.     
       (check-and-parse-field 
-       qif-xtn:split-amounts qif-xtn:set-split-amounts! gnc:numeric-equal
+       qif-xtn:split-amounts qif-xtn:set-split-amounts! gnc-numeric-equal
        qif-parse:check-number-formats '(decimal comma) 
        qif-parse:parse-numbers/format (qif-file:xtns self)
        qif-parse:print-numbers
@@ -640,7 +640,7 @@
 ;;  this is a semi-generic routine to apply a format check and 
 ;;  parsing routine to fields that can have multiple possible 
 ;;  formats.  In this case, any amount field cam be decimal or 
-;;  comma radix and the date firled can be any of several possible
+;;  comma radix and the date field can be any of several possible
 ;;  types. 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-guess-map.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-guess-map.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-guess-map.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -28,23 +28,23 @@
   (define (extract-all-account-info agroup root-name)
     (if (not agroup)
         '()
-        (let ((children-list (gnc:group-get-account-list agroup))
+        (let ((children-list (xaccGroupGetAccountListSorted agroup))
               (names '()))
           
           ;; now descend the tree of child accounts.
           (for-each 
            (lambda (child-acct)
-             (let* ((name (gnc:account-get-name child-acct))
+             (let* ((name (xaccAccountGetName child-acct))
                     (fullname 
                      (if (string? root-name)
                          (string-append root-name 
-                                        (gnc:account-separator-string)
+                                        (gnc-get-account-separator-string)
                                         name)
                          name)))
                (set! names 
                      (append (cons (list name fullname child-acct)
                                    (extract-all-account-info 
-                                    (gnc:account-get-children child-acct)
+                                    (xaccAccountGetChildren child-acct)
                                     fullname))
                              names))))
            children-list)
@@ -63,7 +63,7 @@
   ;;    (older saved prefs may not have this one)
   ;;  - a hash of QIF stock name to gnc-commodity*
   ;;    (older saved prefs may not have this one)
-  (let* ((pref-filename (gnc:build-dotgnucash-path "qif-accounts-map"))
+  (let* ((pref-filename (gnc-build-dotgnucash-path "qif-accounts-map"))
          (results '()))
     
     ;; first, read the account map and category map from the 
@@ -110,7 +110,7 @@
                               (make-hash-table 20)))))
     
     ;; now build the list of all known account names 
-    (let* ((all-accounts (gnc:get-current-group))
+    (let* ((all-accounts (gnc-get-current-group))
            (all-account-info (extract-all-account-info all-accounts #f)))
       (set! results (cons all-account-info results)))
     results))
@@ -153,8 +153,8 @@
                  (namespace (cadr entry))
                  (mnemonic (caddr entry)))
              (hash-set! table name
-                        (gnc:commodity-table-lookup
-                         (gnc:book-get-commodity-table (gnc:get-current-book))
+                        (gnc-commodity-table-lookup
+                         (gnc-commodity-table-get-table (gnc-get-current-book))
                          namespace mnemonic)))))
      commlist)
     table))
@@ -163,11 +163,13 @@
   (let ((table '()))
     (hash-fold
      (lambda (key value p)
-       (if (and value (gw:wcp-is-of-type? <gnc:commodity*> value))
+       ;;FIXME: we used to type-check the values, like:
+       ;; (gw:wcp-is-of-type? <gnc:commodity*> value)
+       (if (and value #t)
            (set! table
                  (cons (list key 
-                             (gnc:commodity-get-namespace value)
-                             (gnc:commodity-get-mnemonic value))
+                             (gnc-commodity-get-namespace value)
+                             (gnc-commodity-get-mnemonic value))
                        table))
            (display "write-commodities: something funny in hash table.\n"))
        #f) #f hashtab)
@@ -175,7 +177,7 @@
 
 
 (define (qif-import:save-map-prefs acct-map cat-map memo-map stock-map)
-  (let* ((pref-filename (gnc:build-dotgnucash-path "qif-accounts-map")))
+  (let* ((pref-filename (gnc-build-dotgnucash-path "qif-accounts-map")))
     ;; does the file exist? if not, create it; in either case,
     ;; make sure it's a directory and we have write and execute 
     ;; permission. 
@@ -264,7 +266,7 @@
        (let ((acct-matches? #f))
          (for-each
           (lambda (type)
-            (if (= type (gnc:account-get-type (caddr gnc-acct)))
+            (if (= type (xaccAccountGetType (caddr gnc-acct)))
                 (set! acct-matches? #t)))
           allowed-types)
          (if acct-matches? 
@@ -285,7 +287,7 @@
     (if (not (null? matching-name-accts))
         (set! retval (list 
                       (cadr (car matching-name-accts))
-                      (list (gnc:account-get-type 
+                      (list (xaccAccountGetType
                              (caddr (car matching-name-accts))))))
         #f)
     retval))

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-import.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-import.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-import.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,13 +6,16 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define-module (gnucash import-export qif-import))
-(use-modules (gnucash main) (g-wrapped gw-gnc)) ;; FIXME: delete after we finish modularizing.
+(use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 
+;; We do this initialization here because src/gnome isn't a real module.
+(load-extension "libgncgnome" "scm_init_sw_gnome_module")
+(use-modules (sw_gnome))
+
 (use-modules (gnucash gnc-module))
 (use-modules (ice-9 slib))
 (use-modules (ice-9 regex))
 (use-modules (srfi srfi-1))
-(use-modules (g-wrap gw-wct))
 
 (debug-enable 'debug)
 (debug-enable 'backtrace)

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-merge-groups.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-merge-groups.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-merge-groups.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,21 +6,21 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define (gnc:group-get-transactions group)
-  (let ((query (gnc:malloc-query))
+  (let ((query (qof-query-create-for-splits))
         (xtns #f))
 
-    (gnc:query-set-book query (gnc:group-get-book group))
+    (qof-query-set-book query (xaccGroupGetBook group))
 
     ;; we want to find all transactions with every split inside the
     ;; account group.
-    (gnc:query-add-account-match query
-                                 (gnc:group-get-subaccounts group)
-                                 'guid-match-any 'query-and)
+    (xaccQueryAddAccountMatch query
+                                 (xaccGroupGetSubAccountsSorted group)
+                                 QOF-GUID-MATCH-ANY QOF-QUERY-AND)
 
-    (set! xtns (gnc:query-get-transactions query 'query-txn-match-all))
+    (set! xtns (xaccQueryGetTransactions query QUERY-TXN-MATCH-ALL))
     
     ;; lose the query 
-    (gnc:free-query query)
+    (qof-query-destroy query)
     xtns))
 
 
@@ -42,84 +42,84 @@
     
     (if (> work-to-do 100)
 	(begin 
-	  (set! progress-dialog (gnc:progress-dialog-new window #f))
-	  (gnc:progress-dialog-set-title progress-dialog (_ "Progress"))
-	  (gnc:progress-dialog-set-heading progress-dialog
+	  (set! progress-dialog (gnc-progress-dialog-new window #f))
+	  (gnc-progress-dialog-set-title progress-dialog (_ "Progress"))
+	  (gnc-progress-dialog-set-heading progress-dialog
 					   (_ "Finding duplicate transactions..."))))
 
     ;; for each transaction in the new group, build a query that could
     ;; match possibly similar transactions.
     (for-each
      (lambda (xtn) 
-       (let ((query (gnc:malloc-query)))         
+       (let ((query (qof-query-create-for-splits)))
 	 (set! work-done (+ 1 work-done))
 	 (if progress-dialog 
 	     (begin 
-	       (gnc:progress-dialog-set-value 
+	       (gnc-progress-dialog-set-value
 		progress-dialog (/ work-done work-to-do))
-	       (gnc:progress-dialog-update progress-dialog))) 
+	       (gnc-progress-dialog-update progress-dialog)))
 
-	 (gnc:query-set-book query (gnc:group-get-book old-group))
+	 (qof-query-set-book query (xaccGroupGetBook old-group))
 
 	 ;; first, we want to find only transactions from the old group.
-	 (gnc:query-add-account-match query
-				      (gnc:group-get-subaccounts old-group)
-				      'guid-match-any 'query-and)
+	 (xaccQueryAddAccountMatch query
+				      (xaccGroupGetSubAccountsSorted old-group)
+				      QOF-GUID-MATCH-ANY QOF-QUERY-AND)
          
          ;; the date should be close to the same.. +/- a week. 
-         (let ((date (gnc:transaction-get-date-posted xtn)))               
-           (gnc:query-add-date-match-timepair
+         (let ((date (gnc-transaction-get-date-posted xtn)))
+           (xaccQueryAddDateMatchTS
             query #t (decdate date WeekDelta) #t (incdate date WeekDelta)
-            'query-and))
+            QOF-QUERY-AND))
          
          ;; for each split in the transaction, add a term to match the 
          ;; properties of one split 
-         (let ((q-splits (gnc:malloc-query)))
+         (let ((q-splits (qof-query-create-for-splits)))
            (for-each 
             (lambda (split)
-              (let ((sq (gnc:malloc-query)))
-		(gnc:query-set-book sq (gnc:group-get-book old-group))
+              (let ((sq (qof-query-create-for-splits)))
+		(qof-query-set-book sq (xaccGroupGetBook old-group))
                 
                 ;; we want to match the account in the old group that
                 ;; has the same name as an account in the new group.  If
                 ;; there's not one (new account), the match will be NULL
                 ;; and we know the query won't find anything.  optimize
                 ;; this later.
-                (gnc:query-add-single-account-match 
+                (xaccQueryAddSingleAccountMatch
                  sq 
-                 (gnc:get-account-from-full-name
-                  old-group (gnc:account-get-full-name 
-                             (gnc:split-get-account split)))
-                 'query-and)
+                 (xaccGetAccountFromFullName
+                  old-group (gnc-account-get-full-name
+                             (xaccSplitGetAccount split)))
+                 QOF-QUERY-AND)
                 
                 ;; we want the value for the split to match the value
                 ;; the old-group split.  We should really check for
                 ;; fuzziness.
-                (gnc:query-add-value-match 
-                 sq (gnc:split-get-value split)
-                 'amt-sgn-match-either 'query-compare-equal
-                 'query-and)
+                (xaccQueryAddValueMatch
+                 sq (xaccSplitGetValue split)
+                 QOF-NUMERIC-MATCH-ANY QOF-COMPARE-EQUAL
+                 QOF-QUERY-AND)
                 
                 ;; now merge into the split query.  Reminder: q-splits
                 ;; is set up to match any split that matches any split
                 ;; in the current xtn; every split in an old transaction
                 ;; must pass that filter.
-                (let ((q-new (gnc:query-merge q-splits sq 'query-or)))
-                  (gnc:free-query q-splits)
-                  (gnc:free-query sq)
+                (let ((q-new (qof-query-merge q-splits sq QOF-QUERY-OR)))
+                  (qof-query-destroy q-splits)
+                  (qof-query-destroy sq)
                   (set! q-splits q-new))))
-            (gnc:transaction-get-splits xtn))
+            (xaccTransGetSplitList xtn))
            
            ;; now q-splits will match any split that is the same as one
            ;; split in the old-group xtn.  Merge it in.
-           (let ((q-new (gnc:query-merge query q-splits 'query-and)))
-             (gnc:free-query query)
-             (gnc:free-query q-splits)
+           (let ((q-new (qof-query-merge query q-splits QOF-QUERY-AND)))
+             (qof-query-destroy query)
+             (qof-query-destroy q-splits)
              (set! query q-new)))
          
          ;; now that we have built a query, get transactions in the old
          ;; account group that matches it.
-         (let ((old-xtns (gnc:query-get-transactions query 'query-txn-match-all)))
+         (let ((old-xtns (xaccQueryGetTransactions query QUERY-TXN-MATCH-ALL)))
            (set! old-xtns (map 
                            (lambda (elt)
                              (cons elt #f)) old-xtns))
@@ -128,12 +128,12 @@
            ;; along with the transaction
            (if (not (null? old-xtns))
                (set! matches (cons (cons xtn old-xtns) matches))))
-         (gnc:free-query query)))
+         (qof-query-destroy query)))
      new-xtns)
     
     ;; get rid of the progress dialog 
     (if progress-dialog
-	(gnc:progress-dialog-destroy progress-dialog))
+	(gnc-progress-dialog-destroy progress-dialog))
 
     ;; return the matches 
     matches))
@@ -151,14 +151,14 @@
         matches)
        (if do-delete 
            (begin 
-             (gnc:transaction-begin-edit new-xtn)
-             (gnc:transaction-destroy new-xtn)
-             (gnc:transaction-commit-edit new-xtn)))))
+             (xaccTransBeginEdit new-xtn)
+             (xaccTransDestroy new-xtn)
+             (xaccTransCommitEdit new-xtn)))))
    match-list))
 
 (define (gnc:group-catenate-and-merge old-group new-group)
   ;; stuff the new accounts into the old group and merge the accounts
-  (gnc:group-concat-group old-group new-group)
-  (gnc:account-group-begin-edit new-group)
-  (gnc:account-group-destroy new-group)
-  (gnc:group-merge-accounts old-group))
+  (xaccGroupConcatGroup old-group new-group)
+  (xaccAccountGroupBeginEdit new-group)
+  (xaccAccountGroupDestroy new-group)
+  (xaccGroupMergeAccounts old-group))

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-objects.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-objects.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-objects.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -296,16 +296,16 @@
   (define (set-amounts neg? amounts)
     (map 
      (lambda (split amount)
-       (qif-split:set-amount! split (if neg? (gnc:numeric-neg amount) amount)))
+       (qif-split:set-amount! split (if neg? (gnc-numeric-neg amount) amount)))
      (qif-xtn:splits self) amounts))
 
   (define (need-neg amounts)
-    (let ((sum (gnc:numeric-zero)))
+    (let ((sum (gnc-numeric-zero)))
       (for-each
        (lambda (amt)
-	 (set! sum (gnc:numeric-add sum amt 0 GNC-DENOM-LCD)))
+	 (set! sum (gnc-numeric-add sum amt 0 GNC-DENOM-LCD)))
        amounts)
-      (gnc:numeric-zero-p sum)))
+      (gnc-numeric-zero-p sum)))
 
   (let ((def-spl (qif-xtn:default-split self)))
     (if def-spl

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-parse.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-parse.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-parse.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -270,7 +270,7 @@
 ;          ((vest) 
 ;           'vest)
           (else
-           (gnc:warning-dialog #f
+           (gnc:warning-dialog '()
             (string-append
              (sprintf #f (_ "The file contains an unknown Action '%s'.")
                       read-value)
@@ -567,12 +567,12 @@
              (with-input-from-string filtered-string
                (lambda () (read)))))
        (if (number? read-val)
-           (gnc:double-to-gnc-numeric
+           (double-to-gnc-numeric
             (+ 0.0 read-val) GNC-DENOM-AUTO
             (logior (GNC-DENOM-SIGFIGS 
 		     (string-length (string-remove-char filtered-string #\.)))
                     GNC-RND-ROUND))
-           (gnc:numeric-zero))))
+           (gnc-numeric-zero))))
     ((comma)
      (let* ((filtered-string 
              (string-remove-char 
@@ -584,21 +584,21 @@
              (with-input-from-string filtered-string
                (lambda () (read)))))
        (if (number? read-val)
-           (gnc:double-to-gnc-numeric
+           (double-to-gnc-numeric
             (+ 0.0 read-val) GNC-DENOM-AUTO
             (logior (GNC-DENOM-SIGFIGS
 		     (string-length (string-remove-char filtered-string #\.)))
                     GNC-RND-ROUND))
-           (gnc:numeric-zero))))
+           (gnc-numeric-zero))))
     ((integer)
      (let ((read-val
             (with-input-from-string 
                 (string-remove-char value-string #\$)
               (lambda () (read)))))
        (if (number? read-val)
-           (gnc:double-to-gnc-numeric
+           (double-to-gnc-numeric
             (+ 0.0 read-val) 1 GNC-RND-ROUND)
-           (gnc:numeric-zero))))))
+           (gnc-numeric-zero))))))
 
 (define (qif-parse:check-number-formats amt-strings formats)
   (let ((retval formats))
@@ -621,7 +621,7 @@
                    (if (not tmp)
                        (set! all-ok #f))
                    tmp)
-                 (gnc:numeric-zero)))
+                 (gnc-numeric-zero)))
            amt-strings)))
     (if all-ok parsed #f)))
 

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif-to-gnc.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif-to-gnc.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif-to-gnc.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,35 +15,35 @@
 (define (qif-import:find-or-make-acct acct-info check-types? commodity
 				      check-commodity? default-currency
                                       gnc-acct-hash old-group new-group)
-  (let* ((separator (string-ref (gnc:account-separator-string) 0))
+  (let* ((separator (string-ref (gnc-get-account-separator-string) 0))
          (gnc-name (qif-map-entry:gnc-name acct-info))
          (existing-account (hash-ref gnc-acct-hash gnc-name))
          (same-gnc-account 
-          (gnc:get-account-from-full-name old-group gnc-name))
+          (xaccGetAccountFromFullName old-group gnc-name))
          (allowed-types 
           (qif-map-entry:allowed-types acct-info))
          (make-new-acct #f)
          (incompatible-acct #f))
     
     (define (compatible? account)
-      (let ((acc-type (gnc:account-get-type account))
-            (acc-commodity (gnc:account-get-commodity account)))
+      (let ((acc-type (xaccAccountGetType account))
+            (acc-commodity (xaccAccountGetCommodity account)))
         (and
          (if check-types? 
              (and (list? allowed-types)
                   (memv acc-type allowed-types))
              #t)
 	 (if check-commodity?
-	     (gnc:commodity-equiv? acc-commodity commodity)
+	     (gnc-commodity-equiv acc-commodity commodity)
 	     #t))))
     
     (define (make-unique-name-variant long-name short-name)
-      (if (gnc:get-account-from-full-name old-group long-name)
+      (if (xaccGetAccountFromFullName old-group long-name)
           (let loop ((count 2))
             (let* ((test-name 
                     (string-append long-name (sprintf #f " %a" count)))
                    (test-acct 
-                    (gnc:get-account-from-full-name old-group test-name)))
+                    (xaccGetAccountFromFullName old-group test-name)))
               (if (and test-acct (not (compatible? test-acct)))
                   (loop (+ 1 count))
                   (string-append short-name (sprintf #f " %a" count)))))
@@ -61,7 +61,7 @@
               (set! make-new-acct #f)
               (set! incompatible-acct #f)
               (set! allowed-types 
-                    (list (gnc:account-get-type same-gnc-account))))
+                    (list (xaccAccountGetType same-gnc-account))))
             (begin 
               ;; there's an existing account with that name, so we
               ;; have to make a new acct with different properties and
@@ -79,32 +79,32 @@
     ;; acct)
     (if (and existing-account (compatible? existing-account))
         existing-account 
-        (let ((new-acct (gnc:malloc-account (gnc:get-current-book)))
+        (let ((new-acct (xaccMallocAccount (gnc-get-current-book)))
               (parent-acct #f)
               (parent-name #f)
               (acct-name #f)
               (last-colon #f))
           (set! last-colon (string-rindex gnc-name separator))
           
-          (gnc:account-begin-edit new-acct)
+          (xaccAccountBeginEdit new-acct)
           
           ;; if this is a copy of an existing gnc account, copy the
           ;; account properties.  For incompatible existing accts,
           ;; we'll do something different later.
           (if same-gnc-account
               (begin 
-                (gnc:account-set-name 
-                 new-acct (gnc:account-get-name same-gnc-account))
-                (gnc:account-set-description
-                 new-acct (gnc:account-get-description same-gnc-account))
-                (gnc:account-set-type
-                 new-acct (gnc:account-get-type same-gnc-account))
-                (gnc:account-set-commodity
-                 new-acct (gnc:account-get-commodity same-gnc-account))
-                (gnc:account-set-notes 
-                 new-acct (gnc:account-get-notes same-gnc-account))
-                (gnc:account-set-code 
-                 new-acct (gnc:account-get-code same-gnc-account))))
+                (xaccAccountSetName
+                 new-acct (xaccAccountGetName same-gnc-account))
+                (xaccAccountSetDescription
+                 new-acct (xaccAccountGetDescription same-gnc-account))
+                (xaccAccountSetType
+                 new-acct (xaccAccountGetType same-gnc-account))
+                (xaccAccountSetCommodity
+                 new-acct (xaccAccountGetCommodity same-gnc-account))
+                (xaccAccountSetNotes
+                 new-acct (xaccAccountGetNotes same-gnc-account))
+                (xaccAccountSetCode
+                 new-acct (xaccAccountGetCode same-gnc-account))))
           
           ;; make sure that if this is a nested account foo:bar:baz,
           ;; foo:bar and foo exist also.
@@ -121,11 +121,11 @@
           (if make-new-acct
               (begin 
                 ;; set the name, description, etc.
-                (gnc:account-set-name new-acct acct-name)
+                (xaccAccountSetName new-acct acct-name)
                 (if (qif-map-entry:description acct-info)
-                    (gnc:account-set-description 
+                    (xaccAccountSetDescription
                      new-acct (qif-map-entry:description acct-info)))
-                (gnc:account-set-commodity new-acct commodity)
+                (xaccAccountSetCommodity new-acct commodity)
                 
                 ;; if it's an incompatible account, set the
                 ;; name to be unique, and a description that 
@@ -133,23 +133,23 @@
                 (if incompatible-acct
                     (let ((new-name (make-unique-name-variant 
                                      gnc-name acct-name)))
-                      (gnc:account-set-name new-acct new-name)
-                      (gnc:account-set-description 
+                      (xaccAccountSetName new-acct new-name)
+                      (xaccAccountSetDescription
                        new-acct 
                        (_ "QIF import: Name conflict with another account."))))
                 
                 ;; set the account type.  this could be smarter. 
                 (if (qif-map-entry:allowed-types acct-info)
-                    (gnc:account-set-type 
+                    (xaccAccountSetType
                      new-acct (car (qif-map-entry:allowed-types acct-info))))))
-          (gnc:account-commit-edit new-acct)
+          (xaccAccountCommitEdit new-acct)
 
           (if last-colon
               (let ((pinfo (make-qif-map-entry)))
                 (qif-map-entry:set-qif-name! pinfo parent-name)
                 (qif-map-entry:set-gnc-name! pinfo parent-name)
                 (qif-map-entry:set-allowed-types! 
-                 acct-info (list (gnc:account-get-type new-acct)))
+                 acct-info (list (xaccAccountGetType new-acct)))
                 (qif-map-entry:set-allowed-types! 
                  pinfo (qif-map-entry:allowed-parent-types acct-info))
                 
@@ -157,8 +157,8 @@
                                    pinfo #t default-currency #f default-currency
                                    gnc-acct-hash old-group new-group))))
           (if parent-acct
-              (gnc:account-insert-subaccount parent-acct new-acct)
-              (gnc:group-insert-account new-group new-acct))
+              (xaccAccountInsertSubAccount parent-acct new-acct)
+              (xaccGroupInsertAccount new-group new-acct))
           
           (hash-set! gnc-acct-hash gnc-name new-acct)
           new-acct))))
@@ -177,13 +177,13 @@
                                default-currency-name window)
   (gnc:backtrace-if-exception 
    (lambda ()
-     (let* ((old-group (gnc:get-current-group))
-            (new-group (gnc:malloc-account-group (gnc:get-current-book)))
+     (let* ((old-group (gnc-get-current-group))
+            (new-group (xaccMallocAccountGroup (gnc-get-current-book)))
             (gnc-acct-hash (make-hash-table 20))
-            (separator (string-ref (gnc:account-separator-string) 0))
+            (separator (string-ref (gnc-get-account-separator-string) 0))
             (default-currency 
-              (gnc:commodity-table-find-full 
-               (gnc:book-get-commodity-table (gnc:get-current-book))
+              (gnc-commodity-table-find-full
+               (gnc-commodity-table-get-table (gnc-get-current-book))
                GNC_COMMODITY_NS_CURRENCY default-currency-name))
             (sorted-accounts-list '())
             (markable-xtns '())
@@ -267,7 +267,7 @@
                                                  gnc-acct-hash 
                                                  old-group new-group))
                   ((and security (or stock?
-				     (gnc:commodity-is-currency? security)))
+				     (gnc-commodity-is-currency security)))
                    (qif-import:find-or-make-acct 
                     acctinfo #f security #t default-currency
                     gnc-acct-hash old-group new-group))
@@ -296,9 +296,9 @@
        
        (if (> work-to-do 100)
            (begin 
-             (set! progress-dialog (gnc:progress-dialog-new window #f))
-             (gnc:progress-dialog-set-title progress-dialog (_ "Progress"))
-             (gnc:progress-dialog-set-heading progress-dialog
+             (set! progress-dialog (gnc-progress-dialog-new window #f))
+             (gnc-progress-dialog-set-title progress-dialog (_ "Progress"))
+             (gnc-progress-dialog-set-heading progress-dialog
                                               (_ "Importing transactions..."))))
        
 
@@ -310,9 +310,9 @@
              (set! work-done (+ 1 work-done))
              (if progress-dialog 
                  (begin 
-                   (gnc:progress-dialog-set-value 
+                   (gnc-progress-dialog-set-value
                     progress-dialog (/ work-done work-to-do))
-                   (gnc:progress-dialog-update progress-dialog))) 
+                   (gnc-progress-dialog-update progress-dialog)))
              (if (not (qif-xtn:mark xtn))
                  (qif-import:mark-matching-xtns xtn rest))
              (if (not (null? (cdr rest)))
@@ -327,19 +327,19 @@
              (set! work-done (+ 1 work-done))
              (if progress-dialog 
                  (begin 
-                   (gnc:progress-dialog-set-value 
+                   (gnc-progress-dialog-set-value
                     progress-dialog (/ work-done work-to-do))
-                   (gnc:progress-dialog-update progress-dialog))) 
+                   (gnc-progress-dialog-update progress-dialog)))
              (if (not (qif-xtn:mark xtn))
                  (begin 
                    ;; create and fill in the GNC transaction
-                   (let ((gnc-xtn (gnc:transaction-create
-                                   (gnc:get-current-book))))
-                     (gnc:transaction-begin-edit gnc-xtn)
+                   (let ((gnc-xtn (xaccMallocTransaction
+                                   (gnc-get-current-book))))
+                     (xaccTransBeginEdit gnc-xtn)
 
                      ;; FIXME. This is probably wrong
-                     (gnc:transaction-set-currency gnc-xtn
-                                                   (gnc:default-currency))
+                     (xaccTransSetCurrency gnc-xtn
+                                                   (gnc-default-currency))
 
                      ;; build the transaction
                      (qif-import:qif-xtn-to-gnc-xtn 
@@ -347,13 +347,13 @@
                       qif-acct-map qif-cat-map qif-memo-map)
                      
                      ;; rebalance and commit everything
-                     (gnc:transaction-commit-edit gnc-xtn)))))
+                     (xaccTransCommitEdit gnc-xtn)))))
            (qif-file:xtns qif-file)))
         sorted-qif-files-list)
        
        ;; get rid of the progress dialog 
        (if progress-dialog
-           (gnc:progress-dialog-destroy progress-dialog))
+           (gnc-progress-dialog-destroy progress-dialog))
        
        new-group))))
 
@@ -367,8 +367,8 @@
                                        gnc-acct-hash 
                                        qif-acct-map qif-cat-map qif-memo-map)
   (let ((splits (qif-xtn:splits qif-xtn))
-        (gnc-near-split (gnc:split-create (gnc:get-current-book)))
-        (near-split-total (gnc:numeric-zero))
+        (gnc-near-split (xaccMallocSplit (gnc-get-current-book)))
+        (near-split-total (gnc-numeric-zero))
         (near-acct-info #f)
         (near-acct-name #f)
         (near-acct #f)
@@ -379,31 +379,31 @@
         (qif-memo (qif-split:memo (car (qif-xtn:splits qif-xtn))))
         (qif-from-acct (qif-xtn:from-acct qif-xtn))
         (qif-cleared (qif-xtn:cleared qif-xtn))
-        (n- (lambda (n) (gnc:numeric-neg n)))
-        (nsub (lambda (a b) (gnc:numeric-sub a b 0 GNC-DENOM-LCD)))
-        (n+ (lambda (a b) (gnc:numeric-add a b 0 GNC-DENOM-LCD)))
-        (n* (lambda (a b) (gnc:numeric-mul a b 0 GNC-DENOM-REDUCE)))
-        (n/ (lambda (a b) (gnc:numeric-div a b 0 GNC-DENOM-REDUCE))))
+        (n- (lambda (n) (gnc-numeric-neg n)))
+        (nsub (lambda (a b) (gnc-numeric-sub a b 0 GNC-DENOM-LCD)))
+        (n+ (lambda (a b) (gnc-numeric-add a b 0 GNC-DENOM-LCD)))
+        (n* (lambda (a b) (gnc-numeric-mul a b 0 GNC-DENOM-REDUCE)))
+        (n/ (lambda (a b) (gnc-numeric-div a b 0 GNC-DENOM-REDUCE))))
     
     ;; set properties of the whole transaction     
-    (apply gnc:transaction-set-date gnc-xtn (qif-xtn:date qif-xtn))
+    (apply xaccTransSetDate gnc-xtn (qif-xtn:date qif-xtn))
     
     ;; fixme: bug #105 
     (if qif-payee
-        (gnc:transaction-set-description gnc-xtn qif-payee))
+        (xaccTransSetDescription gnc-xtn qif-payee))
     (if qif-number
-        (gnc:transaction-set-xnum gnc-xtn qif-number))
+        (xaccTransSetNum gnc-xtn qif-number))
     (if qif-memo
 	(begin
-	  (gnc:split-set-memo gnc-near-split qif-memo)
+	  (xaccSplitSetMemo gnc-near-split qif-memo)
 	  (if (or (not qif-payee)
 		  (equal? qif-payee ""))
-	      (gnc:transaction-set-description gnc-xtn qif-memo))))
+	      (xaccTransSetDescription gnc-xtn qif-memo))))
     
     (if (eq? qif-cleared 'cleared)        
-        (gnc:split-set-reconcile gnc-near-split #\c))
+        (xaccSplitSetReconcile gnc-near-split #\c))
     (if (eq? qif-cleared 'reconciled)
-        (gnc:split-set-reconcile gnc-near-split #\y))
+        (xaccSplitSetReconcile gnc-near-split #\y))
     
     (if (not qif-security)
         (begin 
@@ -420,8 +420,8 @@
           (for-each 
            (lambda (qif-split)
              (if (not (qif-split:mark qif-split))
-                 (let ((gnc-far-split (gnc:split-create
-                                       (gnc:get-current-book)))
+                 (let ((gnc-far-split (xaccMallocSplit
+                                       (gnc-get-current-book)))
                        (far-acct-info #f)
                        (far-acct-name #f)
                        (far-acct-type #f)
@@ -430,15 +430,15 @@
                        (memo (qif-split:memo qif-split))
                        (cat (qif-split:category qif-split)))
                    
-                   (if (not split-amt) (set! split-amt (gnc:numeric-zero)))
+                   (if (not split-amt) (set! split-amt (gnc-numeric-zero)))
                    ;; fill the splits in (near first).  This handles
                    ;; files in multiple currencies by pulling the
                    ;; currency value from the file import.
                    (set! near-split-total (n+ near-split-total split-amt))
-                   (gnc:split-set-value gnc-far-split (n- split-amt))
-                   (gnc:split-set-amount gnc-far-split (n- split-amt))
+                   (xaccSplitSetValue gnc-far-split (n- split-amt))
+                   (xaccSplitSetAmount gnc-far-split (n- split-amt))
 
-                   (if memo (gnc:split-set-memo gnc-far-split memo))
+                   (if memo (xaccSplitSetMemo gnc-far-split memo))
                    
                    ;; figure out what the far acct is
                    (cond 
@@ -475,20 +475,20 @@
                    ;; set the reconcile status. 
                    (let ((cleared (qif-split:matching-cleared qif-split)))
                      (if (eq? 'cleared cleared)
-                         (gnc:split-set-reconcile gnc-far-split #\c))
+                         (xaccSplitSetReconcile gnc-far-split #\c))
                      (if (eq? 'reconciled cleared)
-                         (gnc:split-set-reconcile gnc-far-split #\y)))
+                         (xaccSplitSetReconcile gnc-far-split #\y)))
                    
                    ;; finally, plug the split into the account 
-                   (gnc:account-insert-split far-acct gnc-far-split)
-                   (gnc:transaction-append-split gnc-xtn gnc-far-split))))
+                   (xaccSplitSetAccount gnc-far-split far-acct)
+                   (xaccSplitSetParent gnc-far-split gnc-xtn))))
            splits)
           
           ;; the value of the near split is the total of the far splits.
-          (gnc:split-set-value gnc-near-split near-split-total)
-          (gnc:split-set-amount gnc-near-split near-split-total)
-          (gnc:transaction-append-split gnc-xtn gnc-near-split)
-          (gnc:account-insert-split near-acct gnc-near-split))
+          (xaccSplitSetValue gnc-near-split near-split-total)
+          (xaccSplitSetAmount gnc-near-split near-split-total)
+          (xaccSplitSetParent gnc-near-split gnc-xtn)
+          (xaccSplitSetAccount gnc-near-split near-acct))
         
         ;; STOCK TRANSACTIONS: the near/far accounts depend on the
         ;; "action" encoded in the Number field.  It's generally the
@@ -509,10 +509,10 @@
                (commission-amt (qif-xtn:commission qif-xtn))
                (commission-split #f)
                (defer-share-price #f)
-               (gnc-far-split (gnc:split-create (gnc:get-current-book))))
+               (gnc-far-split (xaccMallocSplit (gnc-get-current-book))))
           
-          (if (not num-shares) (set! num-shares (gnc:numeric-zero)))
-          (if (not share-price) (set! share-price (gnc:numeric-zero)))
+          (if (not num-shares) (set! num-shares (gnc-numeric-zero)))
+          (if (not share-price) (set! share-price (gnc-numeric-zero)))
           (if (not split-amt) (set! split-amt (n* num-shares share-price)))
           
           ;; I don't think this should ever happen, but I want 
@@ -549,46 +549,46 @@
           ;; are amounts currency or shares? 
           (case qif-action
             ((buy buyx reinvint reinvdiv reinvsg reinvsh reinvmd reinvlg)
-             (if (not share-price) (set! share-price (gnc:numeric-zero)))
-             (gnc:split-set-amount gnc-near-split num-shares)
-             (gnc:split-set-value gnc-near-split split-amt)
-             (gnc:split-set-value gnc-far-split (n- xtn-amt))
-             (gnc:split-set-amount gnc-far-split (n- xtn-amt)))
+             (if (not share-price) (set! share-price (gnc-numeric-zero)))
+             (xaccSplitSetAmount gnc-near-split num-shares)
+             (xaccSplitSetValue gnc-near-split split-amt)
+             (xaccSplitSetValue gnc-far-split (n- xtn-amt))
+             (xaccSplitSetAmount gnc-far-split (n- xtn-amt)))
             
             ((sell sellx) 
-             (if (not share-price) (set! share-price (gnc:numeric-zero)))
-             (gnc:split-set-amount gnc-near-split (n- num-shares))
-             (gnc:split-set-value gnc-near-split (n- split-amt))
-             (gnc:split-set-value gnc-far-split xtn-amt)
-             (gnc:split-set-amount gnc-far-split xtn-amt))
+             (if (not share-price) (set! share-price (gnc-numeric-zero)))
+             (xaccSplitSetAmount gnc-near-split (n- num-shares))
+             (xaccSplitSetValue gnc-near-split (n- split-amt))
+             (xaccSplitSetValue gnc-far-split xtn-amt)
+             (xaccSplitSetAmount gnc-far-split xtn-amt))
             
             ((cgshort cgshortx cgmid cgmidx cglong cglongx intinc intincx 
                       div divx miscinc miscincx xin rtrncap rtrncapx)
-             (gnc:split-set-value gnc-near-split xtn-amt)
-             (gnc:split-set-amount gnc-near-split xtn-amt)
-             (gnc:split-set-value gnc-far-split (n- xtn-amt))
-             (gnc:split-set-amount gnc-far-split (n- xtn-amt)))
+             (xaccSplitSetValue gnc-near-split xtn-amt)
+             (xaccSplitSetAmount gnc-near-split xtn-amt)
+             (xaccSplitSetValue gnc-far-split (n- xtn-amt))
+             (xaccSplitSetAmount gnc-far-split (n- xtn-amt)))
             
             ((xout miscexp miscexpx margint margintx)
-             (gnc:split-set-value gnc-near-split (n- xtn-amt))
-             (gnc:split-set-amount gnc-near-split (n- xtn-amt))
-             (gnc:split-set-value gnc-far-split  xtn-amt)
-             (gnc:split-set-amount gnc-far-split  xtn-amt))
+             (xaccSplitSetValue gnc-near-split (n- xtn-amt))
+             (xaccSplitSetAmount gnc-near-split (n- xtn-amt))
+             (xaccSplitSetValue gnc-far-split  xtn-amt)
+             (xaccSplitSetAmount gnc-far-split  xtn-amt))
             
             ((shrsin)
              ;; getting rid of the old equity-acct-per-stock trick.
              ;; you must now have a cash/basis value for the stock.
-             (gnc:split-set-amount gnc-near-split num-shares)
-             (gnc:split-set-value gnc-near-split split-amt)
-             (gnc:split-set-value gnc-far-split (n- xtn-amt))
-             (gnc:split-set-amount gnc-far-split (n- xtn-amt)))
+             (xaccSplitSetAmount gnc-near-split num-shares)
+             (xaccSplitSetValue gnc-near-split split-amt)
+             (xaccSplitSetValue gnc-far-split (n- xtn-amt))
+             (xaccSplitSetAmount gnc-far-split (n- xtn-amt)))
             
             ((shrsout)
              ;; shrsout is like shrsin             
-             (gnc:split-set-amount gnc-near-split (n- num-shares))
-             (gnc:split-set-value gnc-near-split (n- split-amt))
-             (gnc:split-set-value gnc-far-split xtn-amt)
-             (gnc:split-set-amount gnc-far-split xtn-amt))
+             (xaccSplitSetAmount gnc-near-split (n- num-shares))
+             (xaccSplitSetValue gnc-near-split (n- split-amt))
+             (xaccSplitSetValue gnc-far-split xtn-amt)
+             (xaccSplitSetAmount gnc-far-split xtn-amt))
             
             ;; stock splits: QIF just specifies the split ratio, not
             ;; the number of shares in and out, so we have to fetch
@@ -597,21 +597,21 @@
             ;; FIXME : this could be wrong.  Make sure the
             ;; share-amount is at the correct time.
             ((stksplit)
-             (let* ((splitratio (n/ num-shares (gnc:numeric-create 10 1)))
+             (let* ((splitratio (n/ num-shares (gnc-numeric-create 10 1)))
                     (in-shares 
-                     (gnc:account-get-balance near-acct))
+                     (xaccAccountGetBalance near-acct))
                     (out-shares (n* in-shares splitratio)))
-               (gnc:split-set-amount gnc-near-split out-shares)
-               (gnc:split-set-amount gnc-far-split (n- in-shares))
-               (gnc:split-set-value gnc-near-split (n- split-amt))
-               (gnc:split-set-value gnc-far-split split-amt))))
+               (xaccSplitSetAmount gnc-near-split out-shares)
+               (xaccSplitSetAmount gnc-far-split (n- in-shares))
+               (xaccSplitSetValue gnc-near-split (n- split-amt))
+               (xaccSplitSetValue gnc-far-split split-amt))))
           
           (let ((cleared (qif-split:matching-cleared 
                           (car (qif-xtn:splits qif-xtn)))))
             (if (eq? 'cleared cleared)
-                (gnc:split-set-reconcile gnc-far-split #\c))
+                (xaccSplitSetReconcile gnc-far-split #\c))
             (if (eq? 'reconciled cleared)
-                (gnc:split-set-reconcile gnc-far-split #\y)))
+                (xaccSplitSetReconcile gnc-far-split #\y)))
           
           (if qif-commission-acct
               (let* ((commission-acct-info 
@@ -624,24 +624,24 @@
           
           (if (and commission-amt commission-acct)
               (begin 
-                (set! commission-split (gnc:split-create
-                                        (gnc:get-current-book)))
-                (gnc:split-set-value commission-split commission-amt)
-                (gnc:split-set-amount commission-split commission-amt)))
+                (set! commission-split (xaccMallocSplit
+                                        (gnc-get-current-book)))
+                (xaccSplitSetValue commission-split commission-amt)
+                (xaccSplitSetAmount commission-split commission-amt)))
 
           (if (and qif-near-acct qif-far-acct)
               (begin 
-                (gnc:transaction-append-split gnc-xtn gnc-near-split)
-                (gnc:account-insert-split near-acct gnc-near-split)
+                (xaccSplitSetParent gnc-near-split gnc-xtn)
+                (xaccSplitSetAccount gnc-near-split near-acct)
                 
-                (gnc:transaction-append-split gnc-xtn gnc-far-split)
-                (gnc:account-insert-split far-acct gnc-far-split)
+                (xaccSplitSetParent gnc-far-split gnc-xtn)
+                (xaccSplitSetAccount gnc-far-split far-acct)
                 
                 (if commission-split
                     (begin 
-                      (gnc:transaction-append-split gnc-xtn commission-split)
-                      (gnc:account-insert-split commission-acct 
-                                                commission-split)))))))
+                      (xaccSplitSetParent commission-split gnc-xtn)
+                      (xaccSplitSetAccount commission-split
+                                           commission-acct)))))))
     ;; return the modified transaction (though it's ignored).
     gnc-xtn))
 
@@ -678,11 +678,11 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define (qif-import:mark-some-splits splits xtn candidate-xtns)
-  (let* ((n- (lambda (n) (gnc:numeric-neg n)))
-         (nsub (lambda (a b) (gnc:numeric-sub a b 0 GNC-DENOM-LCD)))
-         (n+ (lambda (a b) (gnc:numeric-add a b 0 GNC-DENOM-LCD)))
-         (n* (lambda (a b) (gnc:numeric-mul a b 0 GNC-DENOM-REDUCE)))
-         (n/ (lambda (a b) (gnc:numeric-div a b 0 GNC-DENOM-REDUCE)))    
+  (let* ((n- (lambda (n) (gnc-numeric-neg n)))
+         (nsub (lambda (a b) (gnc-numeric-sub a b 0 GNC-DENOM-LCD)))
+         (n+ (lambda (a b) (gnc-numeric-add a b 0 GNC-DENOM-LCD)))
+         (n* (lambda (a b) (gnc-numeric-mul a b 0 GNC-DENOM-REDUCE)))
+         (n/ (lambda (a b) (gnc-numeric-div a b 0 GNC-DENOM-REDUCE)))
          (split (car splits))
          (near-acct-name #f)
          (far-acct-name #f)
@@ -703,7 +703,7 @@
         (begin 
           (set! near-acct-name (qif-xtn:from-acct xtn))
           (set! far-acct-name (qif-split:category split))
-          (set! group-amount (gnc:numeric-zero))
+          (set! group-amount (gnc-numeric-zero))
           
           ;; group-amount is the sum of all the splits in this xtn
           ;; going to the same account as 'split'.  We might be able
@@ -789,7 +789,7 @@
 (define (qif-import:xtn-has-matches? xtn acct-name date amount group-amt)
   (let ((matching-splits '())
         (same-acct-splits '())
-        (this-group-amt (gnc:numeric-zero))
+        (this-group-amt (gnc-numeric-zero))
         (how #f)
         (date-matches 
          (let ((self-date (qif-xtn:date xtn)))
@@ -800,11 +800,11 @@
                 (= (car self-date) (car date))
                 (= (cadr self-date) (cadr date))
                 (= (caddr self-date) (caddr date)))))
-        (n- (lambda (n) (gnc:numeric-neg n)))
-        (nsub (lambda (a b) (gnc:numeric-sub a b 0 GNC-DENOM-LCD)))
-        (n+ (lambda (a b) (gnc:numeric-add a b 0 GNC-DENOM-LCD)))
-        (n* (lambda (a b) (gnc:numeric-mul a b 0 GNC-DENOM-REDUCE)))
-        (n/ (lambda (a b) (gnc:numeric-div a b 0 GNC-DENOM-REDUCE))))
+        (n- (lambda (n) (gnc-numeric-neg n)))
+        (nsub (lambda (a b) (gnc-numeric-sub a b 0 GNC-DENOM-LCD)))
+        (n+ (lambda (a b) (gnc-numeric-add a b 0 GNC-DENOM-LCD)))
+        (n* (lambda (a b) (gnc-numeric-mul a b 0 GNC-DENOM-REDUCE)))
+        (n/ (lambda (a b) (gnc-numeric-div a b 0 GNC-DENOM-REDUCE))))
     
     (if date-matches 
         (begin 
@@ -831,10 +831,10 @@
                     ;; we might be done if this-amt is either equal 
                     ;; to the split amount or the group amount.
                     (cond 
-                     ((gnc:numeric-equal this-amt amount)
+                     ((gnc-numeric-equal this-amt amount)
                       (set! how 
                             (cons 'one-to-one (list split))))
-                     ((and group-amt (gnc:numeric-equal this-amt group-amt))
+                     ((and group-amt (gnc-numeric-equal this-amt group-amt))
                       (set! how
                             (cons 'one-to-many (list split))))
                      (#t
@@ -850,7 +850,7 @@
           ;; now we're out of the loop.  if 'how' isn't set, 
           ;; we can still have a many-to-one match.
           (if (and (not how)
-                   (gnc:numeric-equal this-group-amt amount))
+                   (gnc-numeric-equal this-group-amt amount))
               (begin 
                 (set! how 
                       (cons 'many-to-one same-acct-splits))))))

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/qif.glade
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/qif.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/qif.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -102,44 +102,14 @@
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkCTree" id="account_tree">
+		    <widget class="GtkTreeView" id="account_tree">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="n_columns">2</property>
-		      <property name="column_widths">214,48</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="label847711">
-			  <property name="label" translatable="yes">Account</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="label847712">
-			  <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>
+		      <property name="headers_visible">True</property>
+		      <property name="rules_hint">True</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
 		    </widget>
 		  </child>
 		</widget>
@@ -330,7 +300,7 @@
 		  <property name="visible">True</property>
 		  <property name="label" translatable="yes">The QIF file format does not specify which order the day, month, and year components of a date are printed.  In most cases, it is possible to automatically determine which format is in use in a particular file. However, in the file you have just imported there exist more than one possible format that fits the data.  
 
-Please select a date format for the file.  QIF files created by European software are likely  to be in &quot;d-m-y&quot; or day-month-year format, where US QIF files are likely to be &quot;m-d-y&quot; or month-year-day.    
+Please select a date format for the file.  QIF files created by European software are likely  to be in &quot;d-m-y&quot; or day-month-year format, where US QIF files are likely to be &quot;m-d-y&quot; or month-day-year.    
 </property>
 		  <property name="use_underline">False</property>
 		  <property name="use_markup">False</property>
@@ -350,56 +320,10 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkCombo" id="date_format_combo">
+		<widget class="GtkComboBox" id="date_format_combobox">
 		  <property name="visible">True</property>
-		  <property name="value_in_list">True</property>
-		  <property name="allow_empty">False</property>
-		  <property name="case_sensitive">False</property>
-		  <property name="enable_arrow_keys">True</property>
-		  <property name="enable_arrows_always">False</property>
-
-		  <child internal-child="entry">
-		    <widget class="GtkEntry" id="date_format_entry">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="editable">False</property>
-		      <property name="visibility">True</property>
-		      <property name="max_length">0</property>
-		      <property name="text" translatable="yes"></property>
-		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
-		      <property name="activates_default">False</property>
-		    </widget>
-		  </child>
-
-		  <child internal-child="list">
-		    <widget class="GtkList" id="convertwidget3">
-		      <property name="visible">True</property>
-		      <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
-		      <child>
-			<widget class="GtkListItem" id="convertwidget4">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkLabel" id="convertwidget5">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes"></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>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
+		  <property name="items">Dummy Date Entry</property>
+		  <property name="focus_on_click">True</property>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
@@ -569,38 +493,23 @@
 	      <property name="spacing">4</property>
 
 	      <child>
-		<widget class="GtkScrolledWindow" id="scrolledwindow10">
+		<widget class="GtkScrolledWindow" id="scrolledwindow26">
 		  <property name="visible">True</property>
+		  <property name="can_focus">True</property>
 		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		  <property name="shadow_type">GTK_SHADOW_IN</property>
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkCList" id="selected_file_list">
+		    <widget class="GtkTreeView" id="selected_file_view">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="n_columns">1</property>
-		      <property name="column_widths">80</property>
-		      <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-		      <property name="show_titles">False</property>
-		      <property name="shadow_type">GTK_SHADOW_IN</property>
-		      <signal name="select_row" handler="gnc_ui_qif_import_select_loaded_file_cb"/>
-
-		      <child>
-			<widget class="GtkLabel" id="label827">
-			  <property name="label" translatable="no">labe82l7</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>
+		      <property name="headers_visible">False</property>
+		      <property name="rules_hint">True</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
 		    </widget>
 		  </child>
 		</widget>
@@ -737,66 +646,21 @@
 	      <child>
 		<widget class="GtkScrolledWindow" id="scrolledwindow11">
 		  <property name="visible">True</property>
-		  <property name="hscrollbar_policy">GTK_POLICY_NEVER</property>
+		  <property name="can_focus">True</property>
+		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		  <property name="shadow_type">GTK_SHADOW_IN</property>
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkCList" id="account_page_list">
+		    <widget class="GtkTreeView" id="account_page_view">
 		      <property name="visible">True</property>
 		      <property name="can_focus">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>
-		      <signal name="select_row" handler="gnc_ui_qif_import_account_line_select_cb"/>
-
-		      <child>
-			<widget class="GtkLabel" id="label834">
-			  <property name="label" translatable="yes">QIF 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>
+		      <property name="headers_visible">True</property>
+		      <property name="rules_hint">True</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
 		    </widget>
 		  </child>
 		</widget>
@@ -901,60 +765,14 @@
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkCList" id="category_page_list">
+		    <widget class="GtkTreeView" id="category_page_view">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="n_columns">3</property>
-		      <property name="column_widths">243,250,72</property>
-		      <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-		      <property name="show_titles">True</property>
-		      <property name="shadow_type">GTK_SHADOW_IN</property>
-		      <signal name="select_row" handler="gnc_ui_qif_import_category_line_select_cb"/>
-
-		      <child>
-			<widget class="GtkLabel" id="label837">
-			  <property name="label" translatable="yes">QIF category 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="label838">
-			  <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="label839">
-			  <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>
+		      <property name="headers_visible">True</property>
+		      <property name="rules_hint">True</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
 		    </widget>
 		  </child>
 		</widget>
@@ -1049,7 +867,7 @@
 	      <property name="spacing">0</property>
 
 	      <child>
-		<widget class="GtkScrolledWindow" id="scrolledwindow25">
+		<widget class="GtkScrolledWindow" id="scrolledwindow12">
 		  <property name="visible">True</property>
 		  <property name="hscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
 		  <property name="vscrollbar_policy">GTK_POLICY_AUTOMATIC</property>
@@ -1057,60 +875,14 @@
 		  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 		  <child>
-		    <widget class="GtkCList" id="memo_page_list">
+		    <widget class="GtkTreeView" id="memo_page_view">
 		      <property name="visible">True</property>
 		      <property name="can_focus">True</property>
-		      <property name="n_columns">3</property>
-		      <property name="column_widths">285,228,72</property>
-		      <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-		      <property name="show_titles">True</property>
-		      <property name="shadow_type">GTK_SHADOW_IN</property>
-		      <signal name="select_row" handler="gnc_ui_qif_import_memo_line_select_cb"/>
-
-		      <child>
-			<widget class="GtkLabel" id="label847708">
-			  <property name="label" translatable="yes">QIF payee/memo</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="label847709">
-			  <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="label847710">
-			  <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>
+		      <property name="headers_visible">True</property>
+		      <property name="rules_hint">True</property>
+		      <property name="reorderable">False</property>
+		      <property name="enable_search">True</property>
+		      <property name="fixed_height_mode">False</property>
 		    </widget>
 		  </child>
 		</widget>
@@ -1165,56 +937,11 @@
 	      </child>
 
 	      <child>
-		<widget class="GtkCombo" id="currency_combo">
+		<widget class="GtkComboBoxEntry" id="currency_comboboxentry">
 		  <property name="visible">True</property>
-		  <property name="value_in_list">True</property>
-		  <property name="allow_empty">False</property>
-		  <property name="case_sensitive">False</property>
-		  <property name="enable_arrow_keys">True</property>
-		  <property name="enable_arrows_always">False</property>
-
-		  <child internal-child="entry">
-		    <widget class="GtkEntry" id="currency_entry">
-		      <property name="visible">True</property>
-		      <property name="can_focus">True</property>
-		      <property name="editable">True</property>
-		      <property name="visibility">True</property>
-		      <property name="max_length">0</property>
-		      <property name="text" translatable="yes"></property>
-		      <property name="has_frame">True</property>
-		      <property name="invisible_char">*</property>
-		      <property name="activates_default">False</property>
-		    </widget>
-		  </child>
-
-		  <child internal-child="list">
-		    <widget class="GtkList" id="convertwidget14">
-		      <property name="visible">True</property>
-		      <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
-		      <child>
-			<widget class="GtkListItem" id="convertwidget15">
-			  <property name="visible">True</property>
-
-			  <child>
-			    <widget class="GtkLabel" id="convertwidget16">
-			      <property name="visible">True</property>
-			      <property name="label" translatable="yes"></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>
-			    </widget>
-			  </child>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
+		  <property name="items">Dummy currency entry</property>
+		  <property name="has_frame">True</property>
+		  <property name="focus_on_click">True</property>
 		</widget>
 		<packing>
 		  <property name="padding">0</property>
@@ -1358,7 +1085,7 @@
 	      <child>
 		<widget class="GtkHBox" id="hbox94">
 		  <property name="visible">True</property>
-		  <property name="homogeneous">True</property>
+		  <property name="homogeneous">False</property>
 		  <property name="spacing">2</property>
 
 		  <child>
@@ -1377,60 +1104,14 @@
 			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 			  <child>
-			    <widget class="GtkCList" id="new_transaction_list">
+			    <widget class="GtkTreeView" id="new_transaction_view">
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
-			      <property name="n_columns">3</property>
-			      <property name="column_widths">53,172,56</property>
-			      <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-			      <property name="show_titles">True</property>
-			      <property name="shadow_type">GTK_SHADOW_IN</property>
-			      <signal name="select_row" handler="gnc_ui_qif_import_duplicate_new_select_cb"/>
-
-			      <child>
-				<widget class="GtkLabel" id="label847700">
-				  <property name="label" translatable="yes">Date</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="label847700">
-				  <property name="label" translatable="yes">Description</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="label847702">
-				  <property name="label" translatable="yes">Amount</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>
+			      <property name="headers_visible">True</property>
+			      <property name="rules_hint">True</property>
+			      <property name="reorderable">False</property>
+			      <property name="enable_search">True</property>
+			      <property name="fixed_height_mode">False</property>
 			    </widget>
 			  </child>
 			</widget>
@@ -1478,75 +1159,14 @@
 			  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 			  <child>
-			    <widget class="GtkCList" id="old_transaction_list">
+			    <widget class="GtkTreeView" id="old_transaction_view">
 			      <property name="visible">True</property>
 			      <property name="can_focus">True</property>
-			      <property name="n_columns">4</property>
-			      <property name="column_widths">50,133,55,32</property>
-			      <property name="selection_mode">GTK_SELECTION_SINGLE</property>
-			      <property name="show_titles">True</property>
-			      <property name="shadow_type">GTK_SHADOW_IN</property>
-			      <signal name="select_row" handler="gnc_ui_qif_import_duplicate_old_select_cb"/>
-
-			      <child>
-				<widget class="GtkLabel" id="label847703">
-				  <property name="label" translatable="yes">Date</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="label847704">
-				  <property name="label" translatable="yes">Description</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="label847705">
-				  <property name="label" translatable="yes">Amount</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="label847706">
-				  <property name="label" translatable="yes">Dup?</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>
+			      <property name="headers_visible">True</property>
+			      <property name="rules_hint">True</property>
+			      <property name="reorderable">False</property>
+			      <property name="enable_search">True</property>
+			      <property name="fixed_height_mode">False</property>
 			    </widget>
 			  </child>
 			</widget>

Modified: gnucash/branches/register-rewrite/src/import-export/qif-import/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-import/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-import/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -6,6 +6,7 @@
   test-link.c
 
 test_link_LDADD=../libgncmod-qif-import.la \
+  ${top_builddir}/src/core-utils/libcore-utils.la \
   ${top_builddir}/src/gnome/libgncgnome.la \
   ${top_builddir}/src/engine/libgncmod-engine.la \
   ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,18 +25,22 @@
 endif
 
 .scm-links:
-	rm -f gnucash import-export 
-	$(LN_S) -f . gnucash
-	$(LN_S) -f . import-export
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/import-export
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/import-export; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
 gncscmmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/import-export/
 gncscmmod_DATA = qif-io-core.scm
 
-CLEANFILES = gnucash import-export .scm-links
+clean-local:
+	$(RM) -rf qif-import
+
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-acct-table.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-acct-table.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-acct-table.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -49,7 +49,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define (qif-io:acct-table-make-gnc-group acct-table qif-file commodity)
-  (let ((group (gnc:malloc-account-group (gnc:get-current-book))))
+  (let ((group (xaccMallocAccountGroup (gnc-get-current-book))))
     ;; poke through the qif-file accounts to see if any of them
     ;; show up in the data 
     (let ((qif-acct-table (qif-io:acct-table-accounts acct-table)))
@@ -61,27 +61,27 @@
                 (gnc-acct (hash-ref qif-acct-table name)))
            (if gnc-acct
                (let ((gnc-type (qif-io:parse-acct-type type)))
-                 (gnc:account-begin-edit gnc-acct)
+                 (xaccAccountBeginEdit gnc-acct)
                  (if gnc-type 
-                     (gnc:account-set-type gnc-acct gnc-type)
-                     (gnc:account-set-type gnc-acct GNC-BANK-TYPE))
+                     (xaccAccountSetType gnc-acct gnc-type)
+                     (xaccAccountSetType gnc-acct GNC-BANK-TYPE))
                  (if desc 
-                     (gnc:account-set-description gnc-acct desc))
-                 (gnc:account-commit-edit gnc-acct)))))
+                     (xaccAccountSetDescription gnc-acct desc))
+                 (xaccAccountCommitEdit gnc-acct)))))
        (qif-io:file-accounts qif-file))
       
       (hash-fold
        (lambda (name acct p)
-         (let ((cmdty (gnc:account-get-commodity acct)))
+         (let ((cmdty (xaccAccountGetCommodity acct)))
            (if (not cmdty)
                (begin 
-                 (gnc:account-begin-edit acct)
-                 (gnc:account-set-commodity acct commodity)
-                 (gnc:account-commit-edit acct))))
-         (let ((type (gnc:account-get-type acct)))
+                 (xaccAccountBeginEdit acct)
+                 (xaccAccountSetCommodity acct commodity)
+                 (xaccAccountCommitEdit acct))))
+         (let ((type (xaccAccountGetType acct)))
            (if (= type -1)
-               (gnc:account-set-type acct GNC-BANK-TYPE)))
-         (gnc:group-insert-account group acct)
+               (xaccAccountSetType acct GNC-BANK-TYPE)))
+         (xaccGroupInsertAccount group acct)
          #t) #t (qif-io:acct-table-accounts acct-table)))
 
     ;; now the categories 
@@ -96,27 +96,27 @@
                 (gnc-acct (hash-ref qif-cat-table name)))
            (if gnc-acct
                (begin 
-                 (gnc:account-begin-edit gnc-acct)
+                 (xaccAccountBeginEdit gnc-acct)
                  (cond (income?
-                        (gnc:account-set-type gnc-acct GNC-INCOME-TYPE))
+                        (xaccAccountSetType gnc-acct GNC-INCOME-TYPE))
                        (#t
-                        (gnc:account-set-type gnc-acct GNC-EXPENSE-TYPE)))
-                 (gnc:account-set-description gnc-acct desc)
-                 (gnc:account-commit-edit gnc-acct)))))
+                        (xaccAccountSetType gnc-acct GNC-EXPENSE-TYPE)))
+                 (xaccAccountSetDescription gnc-acct desc)
+                 (xaccAccountCommitEdit gnc-acct)))))
        (qif-io:file-categories qif-file))
 
       (hash-fold
        (lambda (name acct p)
-         (let ((cmdty (gnc:account-get-commodity acct)))
+         (let ((cmdty (xaccAccountGetCommodity acct)))
            (if (not cmdty)
                (begin 
-                 (gnc:account-begin-edit acct)
-                 (gnc:account-set-commodity acct commodity)
-                 (gnc:account-commit-edit acct))))
-         (let ((type (gnc:account-get-type acct)))
+                 (xaccAccountBeginEdit acct)
+                 (xaccAccountSetCommodity acct commodity)
+                 (xaccAccountCommitEdit acct))))
+         (let ((type (xaccAccountGetType acct)))
            (if (= type -1)
-               (gnc:account-set-type acct GNC-EXPENSE-TYPE)))
-         (gnc:group-insert-account group acct)
+               (xaccAccountSetType acct GNC-EXPENSE-TYPE)))
+         (xaccGroupInsertAccount group acct)
          #t) #t (qif-io:acct-table-categories acct-table)))
 
     ;; the securities 

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-bank-xtn-import.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-bank-xtn-import.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-bank-xtn-import.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -35,7 +35,7 @@
 (define (qif-io:bank-xtn-import qif-xtn qif-file gnc-acct-info commodity)
   (let* ((format-info 
           (qif-io:file-bank-xtn-format qif-file))
-         (gnc-xtn (gnc:transaction-create (gnc:get-current-book)))
+         (gnc-xtn (xaccMallocTransaction (gnc-get-current-book)))
          (near-split-amt
           ;; the u-amount has a larger range and is more correct,
           ;; but is optional
@@ -54,40 +54,40 @@
              (acct-type (cdr acct-info))
              (acct (qif-io:acct-table-lookup 
                     gnc-acct-info acct-name acct-type))
-             (split (gnc:split-create (gnc:get-current-book))))
+             (split (xaccMallocSplit (gnc-get-current-book))))
         ;; make the account if necessary 
         (if (not acct)
             (begin 
-              (set! acct (gnc:malloc-account (gnc:get-current-book)))
-              (gnc:account-begin-edit acct)
-              (gnc:account-set-name acct acct-name)
-              (gnc:account-commit-edit acct)
+              (set! acct (xaccMallocAccount (gnc-get-current-book)))
+              (xaccAccountBeginEdit acct)
+              (xaccAccountSetName acct acct-name)
+              (xaccAccountCommitEdit acct)
               (qif-io:acct-table-insert! gnc-acct-info 
                                          acct-name acct-type acct)))
         ;; fill in the split 
-        (gnc:split-set-amount split amount)
-        (gnc:split-set-value split amount)
-        (gnc:split-set-memo split memo)
-        (gnc:split-set-reconcile split reconcile)
+        (xaccSplitSetAmount split amount)
+        (xaccSplitSetValue split amount)
+        (xaccSplitSetMemo split memo)
+        (xaccSplitSetReconcile split reconcile)
         
         ;; add it to the account and the transaction
-        (gnc:account-begin-edit acct)
-        (gnc:account-insert-split acct split)
-        (gnc:account-commit-edit acct)
-        (gnc:transaction-append-split gnc-xtn split)
+        (xaccAccountBeginEdit acct)
+        (xaccSplitSetAccount split acct)
+        (xaccAccountCommitEdit acct)
+        (xaccSplitSetParent split gnc-xtn)
         split))
 
-    (gnc:transaction-begin-edit gnc-xtn)
-    (gnc:transaction-set-currency gnc-xtn commodity)
+    (xaccTransBeginEdit gnc-xtn)
+    (xaccTransSetCurrency gnc-xtn commodity)
 
     ;; set the transaction date, number and description 
     (let ((date (qif-io:parse-date/format 
                  (qif-io:bank-xtn-date qif-xtn) 
                  (qif-io:bank-xtn-date format-info))))
-      (apply gnc:transaction-set-date gnc-xtn date))    
+      (apply xaccTransSetDate gnc-xtn date))
     
-    (gnc:transaction-set-xnum gnc-xtn (qif-io:bank-xtn-number qif-xtn))
-    (gnc:transaction-set-description gnc-xtn (qif-io:bank-xtn-payee qif-xtn))
+    (xaccTransSetNum gnc-xtn (qif-io:bank-xtn-number qif-xtn))
+    (xaccTransSetDescription gnc-xtn (qif-io:bank-xtn-payee qif-xtn))
     
     ;; create the near split (the one that goes to the source-acct)
     (let* ((near-acct-name (qif-io:bank-xtn-source-acct qif-xtn)))
@@ -114,7 +114,7 @@
                   (if parsed-cat (list-ref parsed-cat 1) #f)))
             (add-split (cons acct-name 
                              (if acct-is-acct 'account 'category))
-                       (gnc:numeric-neg near-split-amt)
+                       (gnc-numeric-neg near-split-amt)
                        (qif-io:bank-xtn-memo qif-xtn) #\n))
           
           ;; split case: iterate over a list of qif splits and make a
@@ -136,11 +136,11 @@
                         (qif-io:split-amount split) amt-format)))
                  (add-split (cons acct-name 
                                   (if acct-is-acct 'account 'category))
-                            (gnc:numeric-neg amount)
+                            (gnc-numeric-neg amount)
                             (qif-io:split-memo split) #\n)))
              qif-splits))))
     
     ;; we're done.  
-    (gnc:transaction-commit-edit gnc-xtn)
+    (xaccTransCommitEdit gnc-xtn)
     gnc-xtn))
 

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-format-check.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-format-check.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-format-check.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -143,14 +143,14 @@
     (qif-io:bank-xtn-set-t-amount! 
      bank-formats
      (check-field-formats 
-      qif-io:bank-xtn-t-amount gnc:numeric-equal
+      qif-io:bank-xtn-t-amount gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-bank-xtns file)))
     
     (qif-io:bank-xtn-set-u-amount! 
      bank-formats
      (check-field-formats 
-      qif-io:bank-xtn-u-amount gnc:numeric-equal
+      qif-io:bank-xtn-u-amount gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-bank-xtns file)))
     
@@ -162,7 +162,7 @@
       (qif-io:split-set-amount! 
        split
        (check-field-formats 
-        get-split-amounts gnc:numeric-equal
+        get-split-amounts gnc-numeric-equal
         qif-io:check-multi-number-format '(decimal comma)
         (qif-io:file-bank-xtns file)))
       (qif-io:bank-xtn-set-splits! bank-formats (list split)))
@@ -182,42 +182,42 @@
     (qif-io:invst-xtn-set-t-amount! 
      invst-formats
      (check-field-formats 
-      qif-io:invst-xtn-t-amount gnc:numeric-equal
+      qif-io:invst-xtn-t-amount gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-invst-xtns file)))
     
     (qif-io:invst-xtn-set-u-amount! 
      invst-formats
      (check-field-formats 
-      qif-io:invst-xtn-u-amount gnc:numeric-equal
+      qif-io:invst-xtn-u-amount gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-invst-xtns file)))
     
     (qif-io:invst-xtn-set-$-amount! 
      invst-formats
      (check-field-formats 
-      qif-io:invst-xtn-$-amount gnc:numeric-equal
+      qif-io:invst-xtn-$-amount gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-invst-xtns file)))
     
     (qif-io:invst-xtn-set-share-amount! 
      invst-formats
      (check-field-formats 
-      qif-io:invst-xtn-share-amount gnc:numeric-equal
+      qif-io:invst-xtn-share-amount gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-invst-xtns file)))
     
     (qif-io:invst-xtn-set-share-price! 
      invst-formats
      (check-field-formats 
-      qif-io:invst-xtn-share-price gnc:numeric-equal
+      qif-io:invst-xtn-share-price gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-invst-xtns file)))
     
     (qif-io:invst-xtn-set-commission! 
      invst-formats
      (check-field-formats 
-      qif-io:invst-xtn-commission gnc:numeric-equal
+      qif-io:invst-xtn-commission gnc-numeric-equal
       qif-io:check-number-format '(decimal comma)
       (qif-io:file-invst-xtns file)))
     

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-invst-xtn-import.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-invst-xtn-import.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-invst-xtn-import.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -145,7 +145,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define (qif-io:invst-xtn-import qif-xtn qif-file gnc-acct-info commodity)
-  (let ((gnc-xtn (gnc:transaction-create (gnc:get-current-book)))
+  (let ((gnc-xtn (xaccMallocTransaction (gnc-get-current-book)))
         (format-info (qif-io:file-invst-xtn-format qif-file)))
     ;; utility to make a new split and add it both to an 
     ;; account and to the transaction
@@ -154,47 +154,47 @@
              (acct-type (cdr acct-info))
              (acct (qif-io:acct-table-lookup 
                     gnc-acct-info acct-name acct-type))
-             (split (gnc:split-create (gnc:get-current-book))))
+             (split (xaccMallocSplit (gnc-get-current-book))))
         ;; make the account if necessary 
         (if (not acct)
             (begin 
-              (set! acct (gnc:malloc-account (gnc:get-current-book)))
-              (gnc:account-set-name acct acct-name)
+              (set! acct (xaccMallocAccount (gnc-get-current-book)))
+              (xaccAccountSetName acct acct-name)
               (qif-io:acct-table-insert! gnc-acct-info 
                                          acct-name acct-type acct)))
         ;; fill in the split 
-        (gnc:split-set-amount split amount)
-        (gnc:split-set-value split value)
-        (gnc:split-set-memo split memo)
-        (gnc:split-set-reconcile split reconcile)
+        (xaccSplitSetAmount split amount)
+        (xaccSplitSetValue split value)
+        (xaccSplitSetMemo split memo)
+        (xaccSplitSetReconcile split reconcile)
         
         ;; add it to the account and the transaction
-        (gnc:account-begin-edit acct)
-        (gnc:account-insert-split acct split)
-        (gnc:account-commit-edit acct)
-        (gnc:transaction-append-split gnc-xtn split)
+        (xaccAccountBeginEdit acct)
+        (xaccSplitSetAccount split acct)
+        (xaccAccountCommitEdit acct)
+        (xaccSplitSetParent split gnc-xtn)
         split))
 
     (define (lookup-balance acct-info)
       (let ((acct (qif-io:acct-table-lookup gnc-acct-info 
                                             (car acct-info) (cdr acct-info))))
-        (gnc:account-get-balance acct)))
+        (xaccAccountGetBalance acct)))
     
     (if (not (qif-io:invst-xtn-source-acct qif-xtn))
         (qif-io:invst-xtn-set-source-acct! 
          qif-xtn (qif-io:file-default-src-acct qif-file)))
     
-    (gnc:transaction-begin-edit gnc-xtn)
-    (gnc:transaction-set-currency gnc-xtn commodity)
+    (xaccTransBeginEdit gnc-xtn)
+    (xaccTransSetCurrency gnc-xtn commodity)
     
     ;; set the transaction date, number and description 
     (let ((date (qif-io:parse-date/format 
                  (qif-io:invst-xtn-date qif-xtn) 
                  (qif-io:invst-xtn-date format-info))))
-      (apply gnc:transaction-set-date gnc-xtn date))    
+      (apply xaccTransSetDate gnc-xtn date))
     
-    (gnc:transaction-set-xnum gnc-xtn (qif-io:invst-xtn-action qif-xtn))
-    (gnc:transaction-set-description gnc-xtn (qif-io:invst-xtn-payee qif-xtn))
+    (xaccTransSetNum gnc-xtn (qif-io:invst-xtn-action qif-xtn))
+    (xaccTransSetDescription gnc-xtn (qif-io:invst-xtn-payee qif-xtn))
     
     ;; get the relevant info, including 'near-acct' and 'far-acct', 
     ;; the accounts affected by the transaction
@@ -232,13 +232,13 @@
                ($amt 
                 (qif-io:parse-number/format 
                  $amt (qif-io:invst-xtn-$-amount format-info)))
-               (#t (gnc:numeric-zero)))))
+               (#t (gnc-numeric-zero)))))
            (action-val 
             (if (and num-shares share-price)
-                (gnc:numeric-mul num-shares share-price 
-                                 (gnc:numeric-denom total-val) 
+                (gnc-numeric-mul num-shares share-price
+                                 (gnc-numeric-denom total-val)
                                  GNC-RND-ROUND)
-                (gnc:numeric-zero)))
+                (gnc-numeric-zero)))
            (cleared 
             (qif-io:parse-cleared-field (qif-io:invst-xtn-cleared qif-xtn)))
            (payee (qif-io:invst-xtn-payee qif-xtn))
@@ -250,7 +250,7 @@
            (commission-acct 
             (cons (default-commission-acct 
                     (qif-io:invst-xtn-source-acct qif-xtn)) 'brokerage))
-           (n- (lambda (n) (gnc:numeric-neg n))))
+           (n- (lambda (n) (gnc-numeric-neg n))))
       
       ;; now build the splits.  We have to switch on the action 
       ;; again to get the signs of the amounts, and whether we use the 
@@ -293,8 +293,8 @@
              (add-split commission-acct commission-val commission-val
                         memo cleared)))
         ((stksplit)
-         (let* ((splitratio (gnc:numeric-div 
-                             num-shares (gnc:numeric-create 10 1)
+         (let* ((splitratio (gnc-numeric-div
+                             num-shares (gnc-numeric-create 10 1)
                              GNC-DENOM-AUTO GNC-DENOM-REDUCE))
                 (in-shares (lookup-balance near-acct))
                 (out-shares (n* in-shares splitratio)))
@@ -303,7 +303,7 @@
         (else 
          (throw 'qif-io:unhandled-action action))))
     
-    (gnc:transaction-commit-edit gnc-xtn)
+    (xaccTransCommitEdit gnc-xtn)
     gnc-xtn))
 
 

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-parse.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-parse.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/qif-parse.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -572,12 +572,12 @@
              (with-input-from-string filtered-string
                (lambda () (read)))))
        (if (number? read-val)
-           (gnc:double-to-gnc-numeric
+           (double-to-gnc-numeric
             (+ 0.0 read-val) GNC-DENOM-AUTO
             (logior (GNC-DENOM-SIGFIGS 
                      (string-length (string-remove-char filtered-string #\.)))
                     GNC-RND-ROUND))
-           (gnc:numeric-zero))))
+           (gnc-numeric-zero))))
     ((comma)
      (let* ((filtered-string 
              (string-remove-char 
@@ -589,21 +589,21 @@
              (with-input-from-string filtered-string
                (lambda () (read)))))
        (if (number? read-val)
-           (gnc:double-to-gnc-numeric
+           (double-to-gnc-numeric
             (+ 0.0 read-val) GNC-DENOM-AUTO
             (logior (GNC-DENOM-SIGFIGS
                      (string-length (string-remove-char filtered-string #\.)))
                     GNC-RND-ROUND))
-           (gnc:numeric-zero))))
+           (gnc-numeric-zero))))
     ((integer)
      (let ((read-val
             (with-input-from-string 
                 (string-remove-char value-string #\$)
               (lambda () (read)))))
        (if (number? read-val)
-           (gnc:double-to-gnc-numeric
+           (double-to-gnc-numeric
             (+ 0.0 read-val) 1 GNC-RND-ROUND)
-           (gnc:numeric-zero))))
+           (gnc-numeric-zero))))
     (else 
      (throw 'qif-io:arg-type 'qif-io:parse-number/format 
             'number-format format))))

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -14,13 +14,11 @@
   --gnc-module-dir ${top_builddir}/src/import-export/qif-io-core \
   --guile-load-dir ${top_srcdir}/src/import-export/qif-io-core/test \
   --guile-load-dir ${top_srcdir}/lib \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_builddir}/src/gnome-utils \
   --guile-load-dir ${top_builddir}/src/gnome \
   --guile-load-dir ${top_builddir}/src/scm \
   --library-dir    ${top_builddir}/src/gnome-utils \
-  --library-dir    ${top_srcdir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_srcdir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   SRCDIR=${srcdir} \

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-import-phase-1.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-import-phase-1.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-import-phase-1.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -17,10 +17,10 @@
   (let ((qiffile (qif-io:make-empty-file))
         (acct-table (qif-io:make-empty-acct-table))
 	(session (gnc:get-current-session))
-	(book (gnc:session-get-book session))
-	(com-table (gnc:commodity-table-new)))
+	(book (qof-session-get-book session))
+	(com-table (gnc-commodity-table-new)))
 
-    (gnc:commodity-table-add-default-data com-table book)
+    (gnc-commodity-table-add-default-data com-table book)
 
     ;; read the file and look at data formats. we need to do this
     ;; immediately when loading a file.
@@ -42,7 +42,7 @@
     (if (qif-io:file-xtns-need-acct? qiffile)
         (qif-io:file-set-default-src-acct! qiffile filename))
 
-    (let ((commodity (gnc:commodity-table-lookup com-table "ISO4217" "USD")))
+    (let ((commodity (gnc-commodity-table-lookup com-table "ISO4217" "USD")))
 
       ;; import the bank transactions 
       (for-each 
@@ -62,8 +62,8 @@
         ;; write the file
         (let* ((name (simple-format #f "file:~A.gnc" filename)))
           (simple-format #t "using book name='~A'\n" name)
-          (gnc:group-concat-group (gnc:book-get-group book) group)
-	  (gnc:account-group-destroy group)
+          (xaccGroupConcatGroup (xaccGetAccountGroup book) group)
+	  (xaccAccountGroupDestroy group)
           (gnc:session-begin session name #t #t)
           (gnc:session-save session)
           (gnc:session-end session)

Modified: gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-parser.scm
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-parser.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/qif-io-core/test/test-parser.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -54,7 +54,7 @@
   (let ((all-pass #t))
     (define (parse-number/format num fmt)
       (let* ((gncn (qif-io:parse-number/format num fmt))
-             (nstr (gnc:numeric-to-string gncn)))
+             (nstr (gnc-numeric-to-string gncn)))
         nstr))
     
     ;; test category reading 

Modified: gnucash/branches/register-rewrite/src/import-export/schemas/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/schemas/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/schemas/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,10 +12,10 @@
 install-data-local:
 if GCONF_SCHEMAS_INSTALL
 	-mkdir -p $(DESTDIR)$(GCONF_SCHEMA_CONFIG_SOURCE_DIRONLY)
-	-GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) gconftool-2 --makefile-install-rule $(srcdir)/$(schema_DATA)
+	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-2 --makefile-uninstall-rule $(srcdir)/$(schema_DATA)
+	GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-uninstall-rule $(schema_DATA)
 endif

Modified: gnucash/branches/register-rewrite/src/import-export/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -14,6 +14,7 @@
   ${top_builddir}/src/test-core/libgncmod-test.la \
   ../libgncmod-generic-import.la \
   ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
+  ${top_builddir}/src/engine/libgncmod-engine.la \
   ${GLIB_LIBS} ${QOF_LIBS}
 
 TESTS = \
@@ -34,8 +35,7 @@
   --gnc-module-dir ${top_srcdir}/src/engine \
   --gnc-module-dir ${top_srcdir}/src/app-utils \
   --gnc-module-dir ${top_srcdir}/src/gnome-utils \
-  --library-dir    ${G_WRAP_LIB_DIR} \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
+  --library-dir    ${top_builddir}/lib/libqof/qof \
   --guile-load-dir ${top_builddir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/import-export

Modified: gnucash/branches/register-rewrite/src/import-export/test/test-import-parse.c
===================================================================
--- gnucash/branches/register-rewrite/src/import-export/test/test-import-parse.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/import-export/test/test-import-parse.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,6 +22,7 @@
  * Boston, MA  02110-1301,  USA       gnu at gnu.org
  */
 
+#include "config.h"
 #include <glib.h>
 #include <libguile.h>
 

Modified: gnucash/branches/register-rewrite/src/network-utils/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/network-utils/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/network-utils/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -8,9 +8,8 @@
 
 GNC_TEST_DEPS := \
   --gnc-module-dir ${top_builddir}/src/gnc-module \
-  --gnc-module-dir ${top_builddir}/src/network-utils \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --gnc-module-dir ${top_builddir}/src/network-utils
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/optional/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/optional/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/optional/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1 @@
-
-# N.B. Do *not* specify swig in subdirs, we do *not* want the swig subdirs
-# built by default, since many folks may not have swig installed, and this
-# is, after all, optional. But do put them in the dist.
-
 SUBDIRS = xsl
-DIST_SUBDIRS = swig xsl

Modified: gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -196,12 +196,12 @@
 gnc_get_default_register_style (GNCAccountType type)
 {
   SplitRegisterStyle new_style = REG_STYLE_LEDGER;
-  char *style_string;
+  gchar *style_string;
 
   switch (type) {
 #if 0
-  case PAYABLE:
-  case RECEIVABLE:
+  case ACCT_TYPE_PAYABLE:
+  case ACCT_TYPE_RECEIVABLE:
     new_style = REG_STYLE_LEDGER;
     break;
 #endif
@@ -215,9 +215,9 @@
       new_style = REG_STYLE_AUTO_LEDGER;
     else
       new_style = REG_STYLE_LEDGER;
-    
+
     if (style_string != NULL)
-      free(style_string);
+      g_free(style_string);
 
     break;
   }
@@ -246,41 +246,41 @@
   {
     switch (account_type)
     {
-      case BANK:
+      case ACCT_TYPE_BANK:
         return BANK_REGISTER;
 
-      case CASH:
+      case ACCT_TYPE_CASH:
         return CASH_REGISTER;
 
-      case ASSET:
+      case ACCT_TYPE_ASSET:
         return ASSET_REGISTER;
 
-      case CREDIT:
+      case ACCT_TYPE_CREDIT:
         return CREDIT_REGISTER;
 
-      case LIABILITY:
+      case ACCT_TYPE_LIABILITY:
         return LIABILITY_REGISTER;
 
-      case PAYABLE:
+      case ACCT_TYPE_PAYABLE:
         return PAYABLE_REGISTER;
 
-      case RECEIVABLE:
+      case ACCT_TYPE_RECEIVABLE:
         return RECEIVABLE_REGISTER;
 
-      case STOCK:
-      case MUTUAL:
+      case ACCT_TYPE_STOCK:
+      case ACCT_TYPE_MUTUAL:
         return STOCK_REGISTER;
 
-      case INCOME:
+      case ACCT_TYPE_INCOME:
         return INCOME_REGISTER;
 
-      case EXPENSE:
+      case ACCT_TYPE_EXPENSE:
         return EXPENSE_REGISTER;
 
-      case EQUITY:
+      case ACCT_TYPE_EQUITY:
         return EQUITY_REGISTER;
 
-      case CURRENCY:
+      case ACCT_TYPE_CURRENCY:
         return CURRENCY_REGISTER;
 
       default:
@@ -297,17 +297,17 @@
 
   switch (account_type)
   {
-    case BANK:
-    case CASH:
-    case ASSET:
-    case CREDIT:
-    case LIABILITY:
-    case RECEIVABLE:
-    case PAYABLE:
+    case ACCT_TYPE_BANK:
+    case ACCT_TYPE_CASH:
+    case ACCT_TYPE_ASSET:
+    case ACCT_TYPE_CREDIT:
+    case ACCT_TYPE_LIABILITY:
+    case ACCT_TYPE_RECEIVABLE:
+    case ACCT_TYPE_PAYABLE:
     {
-      /* If any of the sub-accounts have STOCK or MUTUAL types,
-       * then we must use the PORTFOLIO_LEDGER ledger. Otherwise,
-       * a plain old GENERAL_LEDGER will do. */
+      /* If any of the sub-accounts have ACCT_TYPE_STOCK or
+       * ACCT_TYPE_MUTUAL types, then we must use the PORTFOLIO_LEDGER
+       * ledger. Otherwise, a plain old GENERAL_LEDGER will do. */
       gpointer ret;
       reg_type = GENERAL_LEDGER;
 
@@ -318,18 +318,18 @@
       break;
     }
 
-    case STOCK:
-    case MUTUAL:
-    case CURRENCY:
+    case ACCT_TYPE_STOCK:
+    case ACCT_TYPE_MUTUAL:
+    case ACCT_TYPE_CURRENCY:
       reg_type = PORTFOLIO_LEDGER;
       break;
 
-    case INCOME:
-    case EXPENSE:
+    case ACCT_TYPE_INCOME:
+    case ACCT_TYPE_EXPENSE:
       reg_type = INCOME_LEDGER;
       break;
 
-    case EQUITY:
+    case ACCT_TYPE_EQUITY:
       reg_type = GENERAL_LEDGER;
       break;
 
@@ -360,8 +360,8 @@
   gboolean use_double_line;
 
   switch (acc_type) {
-  case PAYABLE:
-  case RECEIVABLE:
+  case ACCT_TYPE_PAYABLE:
+  case ACCT_TYPE_RECEIVABLE:
     use_double_line = TRUE;
     break;
   default:

Modified: gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.h
===================================================================
--- gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/ledger-core/gnc-ledger-display.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -36,14 +36,15 @@
 
 /** Definitions *****************************************************/
 
-/* The xaccLedgerDisplay struct describes a single register/ledger
- * instance. */
+/* The GNCLedgerDisplay struct describes a single register/ledger
+ * instance.  It has a SplitRegister specially configured for
+ * displaying the results of a Query.  It also stores the Query.  */
 typedef struct gnc_ledger_display GNCLedgerDisplay;
 
 typedef void (*GNCLedgerDisplayDestroy) (GNCLedgerDisplay *ld);
 typedef gncUIWidget (*GNCLedgerDisplayGetParent) (GNCLedgerDisplay *ld);
 typedef void (*GNCLedgerDisplaySetHelp) (GNCLedgerDisplay *ld,
-                                      const char *help_str);
+                                         const char *help_str);
 
 typedef enum
 {
@@ -70,7 +71,7 @@
                                       GNCLedgerDisplayDestroy destroy,
                                       GNCLedgerDisplayGetParent get_parent);
 
-/** Returns the parent of a given */
+/** Returns the parent of a given ledger display */
 gncUIWidget gnc_ledger_display_get_parent( GNCLedgerDisplay *ld );
 
 /* return the split register associated with a ledger display */

Modified: gnucash/branches/register-rewrite/src/register/ledger-core/split-register-control.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/ledger-core/split-register-control.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/ledger-core/split-register-control.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -674,18 +674,27 @@
         if (auto_trans == NULL)
           return FALSE;
 
+	gnc_suspend_gui_refresh ();
+
+        /* We are guaranteed to be on the blank trans, so we can
+           discount the possibility that the current transaction is
+           being edited in another register. */
         /* now perform the completion */
-        if ((pending_trans != NULL) && (pending_trans != trans)) {
-            if (gnc_split_register_begin_edit_or_warn(info, trans))
-                return TRUE;
-
-            if (xaccTransIsOpen (pending_trans))
-                xaccTransCommitEdit (pending_trans);
-            else g_assert_not_reached();
+        if (pending_trans != trans) {
+            if (!xaccTransIsOpen(trans))
+                xaccTransBeginEdit(trans);
+            /* This is now the pending transaction */
+            info->pending_trans_guid = *xaccTransGetGUID(trans);
+            if (pending_trans != NULL) {
+                if (xaccTransIsOpen (pending_trans))
+                    xaccTransCommitEdit (pending_trans);
+                else g_assert_not_reached();
+            }
         }
         g_assert(xaccTransIsOpen(trans));
-        pending_trans = trans;
-        gnc_suspend_gui_refresh ();
+        pending_trans = xaccTransLookup(&info->pending_trans_guid,
+                                        gnc_get_current_book ());
+        g_assert(pending_trans == trans);
 
         gnc_copy_trans_onto_trans (auto_trans, trans, FALSE, FALSE);
         blank_split = NULL;

Modified: gnucash/branches/register-rewrite/src/register/ledger-core/split-register-load.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/ledger-core/split-register-load.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/ledger-core/split-register-load.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -270,7 +270,7 @@
   /* figure out where we are going to. */
   if (info->traverse_to_new)
   {
-    find_trans = xaccSplitGetParent (blank_split);
+    find_trans = blank_trans;
     find_split = NULL;
     find_trans_split = blank_split;
   }
@@ -355,9 +355,6 @@
 
   table->model->dividing_row = -1;
 
-  if (multi_line)
-    trans_table = g_hash_table_new (g_direct_hash, g_direct_equal);
-
   // Ensure that the transaction and splits being edited are in the split
   // list we're about to load.
   if (pending_trans != NULL)
@@ -382,6 +379,9 @@
     }
   }
 
+  if (multi_line)
+    trans_table = g_hash_table_new (g_direct_hash, g_direct_equal);
+
   /* populate the table */
   for (node = slist; node; node = node->next) 
   {
@@ -443,17 +443,28 @@
     g_hash_table_destroy (trans_table);
 
   /* add the blank split at the end. */
-  split = blank_split;
-  trans = xaccSplitGetParent (split);
-  if (pending_trans == trans)
+  if (pending_trans == blank_trans)
     found_pending = TRUE;
 
-  if (trans == find_trans)
+  if (blank_trans == find_trans)
     new_trans_row = vcell_loc.virt_row;
 
-  if (split == find_trans_split)
+  if (blank_split == find_trans_split)
     new_trans_split_row = vcell_loc.virt_row;
 
+  /* If we didn't find the pending transaction, it was removed
+   * from the account. */
+  if (!found_pending)
+  {
+      info->pending_trans_guid = *guid_null ();
+      if (xaccTransIsOpen (pending_trans))
+          xaccTransCommitEdit (pending_trans);
+      else if (pending_trans) 
+          g_assert_not_reached();
+
+      pending_trans = NULL;
+  }
+
   /* go to blank on first pass */
   if (info->first_pass)
   {
@@ -466,7 +477,7 @@
     save_loc.phys_col_offset = 0;
   }
 
-  gnc_split_register_add_transaction (reg, trans, split,
+  gnc_split_register_add_transaction (reg, blank_trans, blank_split,
                                       lead_cursor, split_cursor,
                                       multi_line, start_primary_color,
                                       info->blank_split_edited, find_trans,
@@ -524,19 +535,6 @@
     cursor_buffer = NULL;
   }
 
-  /* If we didn't find the pending transaction, it was removed
-   * from the account. */
-  if (!found_pending)
-  {
-      info->pending_trans_guid = *guid_null ();
-      if (xaccTransIsOpen (pending_trans))
-          xaccTransCommitEdit (pending_trans);
-      else if (pending_trans) 
-          g_assert_not_reached();
-
-      pending_trans = NULL;
-  }
-
   /* Set up the hint transaction, split, transaction split, and column. */
   info->cursor_hint_trans = gnc_split_register_get_current_trans (reg);
   info->cursor_hint_split = gnc_split_register_get_current_split (reg);

Modified: gnucash/branches/register-rewrite/src/register/ledger-core/split-register-model.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/ledger-core/split-register-model.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/ledger-core/split-register-model.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1647,7 +1647,7 @@
   char recn;
 
   /* This assumes we reset the flag whenever we change splits.
-   * This happens in LedgerMoveCursor. */
+   * This happens in gnc_split_register_move_cursor(). */
   if (info->change_confirmed)
     return TRUE;
 
@@ -1691,7 +1691,6 @@
       return FALSE;
 
     info->change_confirmed = TRUE;
-    return TRUE;
   }
 
   return TRUE;
@@ -2161,8 +2160,8 @@
 
   /* FIXME: We really only need a due date for 'invoices', not for
    * 'payments' or 'receipts'.  This implies we really only need the
-   * due-date for transactions that credit the RECEIVABLE or debit
-   * the PAYABLE account type.
+   * due-date for transactions that credit the ACCT_TYPE_RECEIVABLE or
+   * debit the ACCT_TYPE_PAYABLE account type.
    */
   gnc_table_model_set_io_flags_handler(
       model, gnc_split_register_get_rate_io_flags, RATE_CELL);

Modified: gnucash/branches/register-rewrite/src/register/ledger-core/split-register.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/ledger-core/split-register.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/ledger-core/split-register.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1366,6 +1366,8 @@
    if (gnc_split_register_handle_exchange (reg, FALSE))
      return TRUE;
 
+   gnc_suspend_gui_refresh ();
+
    /* determine whether we should commit the pending transaction */
    if (pending_trans != trans)
    {
@@ -1379,17 +1381,22 @@
            g_assert_not_reached();
 
        if (trans == blank_trans) {
-           /* Don't begin editing the blank trans, because it's already open */
+           /* Don't begin editing the blank trans, because it's
+              already open, but mark it pending now. */
            g_assert(xaccTransIsOpen(blank_trans));
+           /* This is now the pending transaction */
+           info->pending_trans_guid = *xaccTransGetGUID(blank_trans);
        } else {
            PINFO("beginning edit of trans %p", trans);
            if (gnc_split_register_begin_edit_or_warn(info, trans))
+	   {
+	       gnc_resume_gui_refresh ();
                return FALSE;
+	   }
        }
        pending_trans = trans;
    }
    g_assert(xaccTransIsOpen(trans));
-   gnc_suspend_gui_refresh ();
 
    /* If we are committing the blank split, add it to the account now */
    if (trans == blank_trans)
@@ -1839,37 +1846,37 @@
   switch (sr_type)
   {
     case BANK_REGISTER:
-      return BANK;
+      return ACCT_TYPE_BANK;
     case CASH_REGISTER:
-      return CASH;
+      return ACCT_TYPE_CASH;
     case ASSET_REGISTER:
-      return ASSET;
+      return ACCT_TYPE_ASSET;
     case CREDIT_REGISTER:
-      return CREDIT;
+      return ACCT_TYPE_CREDIT;
     case LIABILITY_REGISTER:
-      return LIABILITY;
+      return ACCT_TYPE_LIABILITY;
     case PAYABLE_REGISTER:
-      return PAYABLE;
+      return ACCT_TYPE_PAYABLE;
     case RECEIVABLE_REGISTER:
-      return RECEIVABLE;
+      return ACCT_TYPE_RECEIVABLE;
     case INCOME_LEDGER:  
     case INCOME_REGISTER:
-      return INCOME;
+      return ACCT_TYPE_INCOME;
     case EXPENSE_REGISTER:
-      return EXPENSE;
+      return ACCT_TYPE_EXPENSE;
     case STOCK_REGISTER:
     case PORTFOLIO_LEDGER:
-      return STOCK;
+      return ACCT_TYPE_STOCK;
     case CURRENCY_REGISTER:
-      return CURRENCY;
+      return ACCT_TYPE_CURRENCY;
     case GENERAL_LEDGER:  
-      return NO_TYPE;
+      return ACCT_TYPE_NONE;
     case EQUITY_REGISTER:
-      return EQUITY;
+      return ACCT_TYPE_EQUITY;
     case SEARCH_LEDGER:
-      return NO_TYPE;
+      return ACCT_TYPE_NONE;
     default:
-      return NO_TYPE;
+      return ACCT_TYPE_NONE;
   }
 }
 


Property changes on: gnucash/branches/register-rewrite/src/register/register-core
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
.deps
.libs
.scm-links
*.lo
*.la
gw-register-core.c
gw-register-core.h
gw-register-core.html
gw-register-core.scm
register
gnucash
g-wrapped


semantic.cache

TAGS

   + Makefile
Makefile.in
.deps
.libs
.scm-links
*.lo
*.la
register
gnucash


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/register/register-core/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-core/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-core/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,7 +1,7 @@
 SUBDIRS = . test
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-register-core.la libgw-register-core.la
+pkglib_LTLIBRARIES = libgncmod-register-core.la
 
 libgncmod_register_core_la_LIBADD = \
   ${top_builddir}/src/gnc-module/libgncmodule.la \
@@ -50,20 +50,6 @@
   table-layout.h \
   table-model.h
 
-libgw_register_core_la_SOURCES = gw-register-core.c
-libgw_register_core_la_LIBADD = \
-  libgncmod-register-core.la \
-  ${G_WRAP_LINK_ARGS}
-
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-register-core.scm gw-register-core-spec.scm
-
-noinst_HEADERS = \
-  gw-register-core.h
-
-EXTRA_DIST = \
-  ${gwmod_DATA}
-
 AM_CFLAGS = \
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/engine \
@@ -72,38 +58,8 @@
   -I${top_srcdir}/src/gnome-utils \
   ${GUILE_INCS} \
   ${GLADE_CFLAGS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GNOME_CFLAGS} \
   ${QOF_CFLAGS} \
   ${GLIB_CFLAGS}
 
-
-if GNUCASH_SEPARATE_BUILDDIR
-#Only needed when srcdir and builddir are different
-SCM_FILE_LINKS = gw-register-core-spec.scm
-endif
-
-.scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
-	$(LN_S) -f . register
-if GNUCASH_SEPARATE_BUILDDIR
-	for X in ${SCM_FILE_LINKS} ; do \
-	  $(LN_S) -f ${srcdir}/$$X . ; \
-	done
-endif
-	touch .scm-links
-
-gw-register-core.scm gw-register-core.c gw-register-core.h: \
-  .scm-links gw-register-core-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (set! %load-path (cons \"${PWD}\" %load-path)) \
-	  (set! %load-path (cons \"${top_srcdir}/src/engine\" %load-path)) \
-	  (primitive-load \"./gw-register-core-spec.scm\") \
-	  (gw:generate-wrapset \"gw-register-core\")"
-
-BUILT_SOURCES = gw-register-core.scm gw-register-core.c gw-register-core.h
-CLEANFILES = gnucash g-wrapped register .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-register-core.html
+CLEANFILES = $(BUILT_SOURCES)

Modified: gnucash/branches/register-rewrite/src/register/register-core/gncmod-register-core.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-core/gncmod-register-core.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-core/gncmod-register-core.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -36,14 +36,6 @@
   return g_strdup("Toolkit-independent GUI for ledger-like table displays");
 }
 
-static void
-lmod(char * mn) 
-{
-  char * form = g_strdup_printf("(use-modules %s)\n", mn);
-  scm_c_eval_string(form);
-  g_free(form);
-}
-
 int
 libgncmod_register_core_LTX_gnc_module_init(int refcount)
 {
@@ -59,7 +51,5 @@
     return FALSE;
   }
 
-  lmod("(g-wrapped gw-register-core)");
-
   return TRUE;
 }

Deleted: gnucash/branches/register-rewrite/src/register/register-core/gw-register-core-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-core/gw-register-core-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-core/gw-register-core-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,33 +0,0 @@
-(define-module (g-wrapped gw-register-core-spec))
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-
-(let ((ws (gw:new-wrapset "gw-register-core")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-register-core))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset) 
-     (list
-      "#include <config.h>\n"
-      "#include <basiccell.h>\n" )))
-  
-  (gw:wrap-as-wct ws '<gnc:basic-cell> "BasicCell*" "const BasicCell*")
-
-  (gw:wrap-function
-   ws
-   'gnc:basic-cell-get-value
-   '(<gw:mchars> callee-owned const)
-   "gnc_basic_cell_get_value"
-   '((<gnc:basic-cell> cell))
-   "Return the value of the cell."))

Modified: gnucash/branches/register-rewrite/src/register/register-core/table-allgui.h
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-core/table-allgui.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-core/table-allgui.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -42,7 +42,6 @@
  *
  * CONCEPTS:
  * The following apply to the rows in a table:
- * -- a phys row can belong to only one virt row at a time.
  * -- a cursor is always the same size as the virt row its on,
  * -- there is only one cursor for a given virt row.
  * -- there is no overlap; a phys row can only belong to one virt row.

Modified: gnucash/branches/register-rewrite/src/register/register-core/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-core/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-core/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -4,7 +4,7 @@
 
 TESTS_ENVIRONMENT= \
    GNC_MODULE_PATH=../../engine:../../gnc-module:../../calculation:.. \
-   GUILE_LOAD_PATH=${G_WRAP_MODULE_DIR}:../../engine:..:../../gnc-module:${top_srcdir}/lib \
+   GUILE_LOAD_PATH=../../engine:..:../../gnc-module:${top_srcdir}/lib \
    LTDL_LIBRARY_PATH=.. \
    LD_LIBRARY_PATH=${top_builddir}/src/gnc-module:${top_builddir}/src/gnc-module/.libs:${top_builddir}/src/engine:${top_builddir}/src/engine/.libs:${top_builddir}/src/calculation:${top_builddir}/src/calculation/.libs:${top_builddir}/src/network-utils:${top_builddir}/src/network-utils/.libs
 

Modified: gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-color.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-color.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-color.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -152,11 +152,9 @@
 void
 gnucash_color_init (void)
 {
-        GdkColormap *colormap = gtk_widget_get_default_colormap ();
-
         /* Allocate the default colors */
-        gdk_color_white (colormap, &gn_white);
-        gdk_color_black (colormap, &gn_black);
+        gnucash_color_alloc_name ("white",  &gn_white);
+        gnucash_color_alloc_name ("black",  &gn_black);
 
         gnucash_color_alloc_name ("gray60", &gn_light_gray);
         gnucash_color_alloc_name ("gray40", &gn_dark_gray);

Modified: gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-item-list.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-item-list.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-gnome/gnucash-item-list.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -460,7 +460,10 @@
 
 	if (NULL == list_store)
 		list_store = gtk_list_store_new (1, G_TYPE_STRING);
+	else
+		g_object_ref(list_store);
 	tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (list_store));
+	g_object_unref(list_store);
 	/* Removed code to enable sorting. Enable it after the list is
 	 * fully populated by calling gnc_item_list_finished_loading(). */
  

Modified: gnucash/branches/register-rewrite/src/register/register-gnome/table-gnome.c
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-gnome/table-gnome.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-gnome/table-gnome.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -132,6 +132,10 @@
         table->ui_data = NULL;
 }
 
+
+/* Um, this function checks that data is not null but never uses it.
+   Weird.  Also, since this function only works with a GnucashRegister
+   widget, maybe some of it should be moved to gnucash-sheet.c. */
 void
 gnc_table_init_gui (gncUIWidget widget, void *data)
 {

Modified: gnucash/branches/register-rewrite/src/register/register-gnome/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/register/register-gnome/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/register/register-gnome/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -4,7 +4,7 @@
 
 TESTS_ENVIRONMENT= \
    GNC_MODULE_PATH=../../engine:../../gnc-module:../../calculation:.. \
-   GUILE_LOAD_PATH=${G_WRAP_MODULE_DIR}:../../engine:..:../../gnc-module:${top_srcdir}/lib \
+   GUILE_LOAD_PATH=../../engine:..:../../gnc-module:${top_srcdir}/lib \
    LTDL_LIBRARY_PATH=.. \
    LD_LIBRARY_PATH=${top_builddir}/src/gnc-module:${top_builddir}/src/gnc-module/.libs:${top_builddir}/src/engine:${top_builddir}/src/engine/.libs:${top_builddir}/src/calculation:${top_builddir}/src/calculation/.libs:${top_builddir}/src/network-utils:${top_builddir}/src/network-utils/.libs
 

Modified: gnucash/branches/register-rewrite/src/report/locale-specific/us/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/locale-specific/us/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/locale-specific/us/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -31,23 +31,27 @@
 endif
 
 .scm-links:
-	rm -f gnucash report locale-specific us 
-	$(LN_S) -f . gnucash
-	$(LN_S) -f . report 
-	$(LN_S) -f ${srcdir} locale-specific 
-	$(LN_S) -f . us 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/report
+	mkdir -p  gnucash/report/locale-specific
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/report/locale-specific; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../../$$A . ; done )
+	( cd gnucash/report; for A in $(gncscmothermod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
+clean-local:
+	$(RM) -rf gnucash
+
 noinst_DATA = .scm-links
 
 EXTRA_DIST = \
   ${gncscmothermod_DATA} \
   ${gncscmmod_DATA} 
 
-CLEANFILES = gnucash report locale-specific us .scm-links
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf-de_DE.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf-de_DE.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf-de_DE.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -68,7 +68,7 @@
 
 (define levelx-collector (make-level-collector MAX-LEVELS))
 
-(define today (gnc:timepair-canonical-day-time
+(define today (timespecCanonicalDayTime
                (cons (current-time) 0)))
 
 (define bdtm
@@ -84,7 +84,7 @@
 
 (define (make-split-list account split-filter-pred)
   (reverse (filter split-filter-pred
-                   (gnc:account-get-split-list account))))
+                   (xaccAccountGetSplitList account))))
 
 ;; returns a predicate that returns true only if a split is
 ;; between early-date and late-date
@@ -92,8 +92,8 @@
                                                  end-date-tp)
   (lambda (split) 
     (let ((tp
-           (gnc:transaction-get-date-posted
-            (gnc:split-get-parent split))))
+           (gnc-transaction-get-date-posted
+            (xaccSplitGetParent split))))
       (and (gnc:timepair-ge-date tp begin-date-tp)
            (gnc:timepair-le-date tp end-date-tp)))))
 
@@ -192,11 +192,11 @@
   (member payer (list 'current 'parent)))
 
 (define (gnc:account-get-txf account)
-  (and (gnc:account-get-tax-related account)
+  (and (xaccAccountGetTaxRelated account)
        (not (equal? (gnc:account-get-txf-code account) 'N000))))
 
 (define (gnc:account-get-txf-code account)
-  (let ((code (gnc:account-get-tax-US-code account)))
+  (let ((code (xaccAccountGetTaxUSCode account)))
     (string->symbol (if code code "N000"))))
 
 (define (gnc:get-txf-format code income?)
@@ -206,7 +206,7 @@
                       code))
 
 (define (gnc:account-get-txf-payer-source account)
-  (let ((pns (gnc:account-get-tax-US-payer-name-source account)))
+  (let ((pns (xaccAccountGetTaxUSPayerNameSource account)))
     (string->symbol (if pns pns "keine"))))
 
 ;; check for duplicate txf codes
@@ -235,7 +235,7 @@
                                        (gnc:account-get-txf-code acc))
                                       "\" has duplicates in "
                                       (number->string cnt) " accounts:")
-                                     (map gnc:account-get-full-name 
+                                     (map gnc-account-get-full-name
                                           (cdr x))))
                              '())))
                      txf-dups-alist)))
@@ -288,12 +288,11 @@
             (make-sub-headers (- max-level 1)))))
 
 (define (render-txf-account account account-value d? date x? x-date)
-  (let* ((print-info (gnc:account-print-info account #t))
+  (let* ((print-info (gnc-account-print-info account #t))
          (txf? (gnc:account-get-txf account)))
     (if (and txf?
-             (not (gnc:numeric-zero-p account-value)))
-        (let* ((type (gw:enum-<gnc:AccountType>-val->sym
-                      (gnc:account-get-type account) #f))
+             (not (gnc-numeric-zero-p account-value)))
+        (let* ((type (xaccAccountGetType account))
                (code (gnc:account-get-txf-code account))
                (date-str (if date
                              (strftime "%d.%m.%Y" (localtime (car date)))
@@ -302,43 +301,43 @@
                                (strftime "%d.%m.%Y" (localtime (car x-date)))
                                #f))
                ;; Only formats 1,3 implemented now! Others are treated as 1.
-               (format (gnc:get-txf-format code (eq? type 'income)))
+               (format (gnc:get-txf-format code (eq? type ACCT-TYPE-INCOME)))
 	       (value (string-append 
-		       (if (eq? type 'income) ;; negate expenses. FIXME: Necessary?
+		       (if (eq? type ACCT-TYPE-INCOME) ;; negate expenses. FIXME: Necessary?
 			   ""
 			   "-")
 		       (number->string 
-			(gnc:numeric-num 
-			 (gnc:numeric-convert account-value (cond 
+			(gnc-numeric-num
+			 (gnc-numeric-convert account-value (cond
 							     ((eq? format 2) 1)
 							     (else 100))
 					      3))))) ;; 3 is the GNC_HOW_TRUNC truncation rounding
 	       (payer-src (gnc:account-get-txf-payer-source account))
                (account-name (let* ((named-acct
 				    (if (eq? payer-src 'parent)
-					(gnc:group-get-parent
-					 (gnc:account-get-parent account))
+					(xaccGroupGetParentAccount
+					 (xaccAccountGetParent account))
 					account))
-				    (name (gnc:account-get-name named-acct)))
+				    (name (xaccAccountGetName named-acct)))
 			       (if name
 				   name
 				   (begin
 				     (display
 				      (string-append
 				       "Failed to get name for account: "
-				       (gnc:account-get-guid named-acct)
+				       (gncAccountGetGUID named-acct)
 				       (if (not (eq? account named-acct))
 					   (string-append
 					    " which is the parent of "
-					    (gnc:account-get-guid account)))
+					    (gncAccountGetGUID account)))
 				       "\n"))
 				     "<NONE> -- See the Terminal Output"))))
-               (action (if (eq? type 'income)
+               (action (if (eq? type ACCT-TYPE-INCOME)
                            (case code
                              ((N286 N488) "ReinvD")
                              (else "Ertraege"))
                            "Aufwendungen"))
-               (category-key (if (eq? type 'income)
+               (category-key (if (eq? type ACCT-TYPE-INCOME)
                                  (gnc:txf-get-category-key 
                                   txf-income-categories code)
                                  (gnc:txf-get-category-key
@@ -387,11 +386,11 @@
   (let* ((account-name (if txf-date	; special split
                            (strftime "%d.%m.%Y" (localtime (car txf-date)))
                            (if (or full-names (equal? level 1))
-                               (gnc:account-get-full-name account)
-                               (gnc:account-get-name account))))
+                               (gnc-account-get-full-name account)
+                               (xaccAccountGetName account))))
          (blue? (gnc:account-get-txf account))
-         (print-info (gnc:account-print-info account #f))
-         (value (gnc:amount->string lx-value print-info))
+         (print-info (gnc-account-print-info account #f))
+         (value (xaccPrintAmount lx-value print-info))
          (value-formatted (if (= 1 level)
                               (gnc:html-markup-b value)
                               value))
@@ -412,7 +411,7 @@
         (txf-check-dups account))
 
     (if (or (not suppress-0) (= level 1)
-            (not (gnc:numeric-zero-p lx-value)))
+            (not (gnc-numeric-zero-p lx-value)))
         (begin
           (gnc:html-table-prepend-row!
            table
@@ -432,12 +431,12 @@
 ;; Returns the Parent if a child or grandchild is valid.
 (define (validate accounts)
   (filter (lambda (a)
-            (if (gnc:account-get-tax-related a)
+            (if (xaccAccountGetTaxRelated a)
                 #t
                 ;; check children
                 (if (null? (validate
-                            (gnc:group-get-subaccounts
-                             (gnc:account-get-children a))))
+                            (xaccGroupGetSubAccountsSorted
+                             (xaccAccountGetChildren a))))
                     #f
                     #t)))
           accounts))
@@ -455,9 +454,9 @@
 
   ;; the number of account generations: children, grandchildren etc.
   (define (num-generations account gen)
-    (let ((children (gnc:account-get-children account)))
-      (if (eq? (gnc:group-get-num-accounts children) 0)
-          (if (and (gnc:account-get-tax-related account)
+    (let ((children (xaccAccountGetChildren account)))
+      (if (eq? (xaccGroupGetNumAccounts children) 0)
+          (if (and (xaccAccountGetTaxRelated account)
                    (txf-special-split? (gnc:account-get-txf-code account)))
               (+ gen 1)		; Est Fed Tax has a extra generation
               gen)	       		; no kids, return input
@@ -483,8 +482,8 @@
          (selected-accounts (if (not (null? user-sel-accnts))
                                 valid-user-sel-accnts
                                 (validate (reverse 
-                                           (gnc:group-get-account-list
-                                            (gnc:get-current-group))))))
+                                           (xaccGroupGetAccountListSorted
+                                            (gnc-get-current-group))))))
          (generations (if (pair? selected-accounts)
                           (apply max (map (lambda (x) (num-generations x 1))
                                           selected-accounts))
@@ -576,7 +575,7 @@
     ;; for quarterly estimated tax payments, we need a different period
     ;; return the sometimes changed (from-est to-est full-year?) dates
     (define (txf-special-splits-period account from-value to-value)
-      (if (and (gnc:account-get-tax-related account)
+      (if (and (xaccAccountGetTaxRelated account)
                (txf-special-split? (gnc:account-get-txf-code account)))
           (let* 
               ((full-year?
@@ -591,7 +590,7 @@
                ;; paymnent from the right year
                (from-est (if full-year?
                              (let ((bdtm (gnc:timepair->date
-                                          (gnc:timepair-canonical-day-time
+                                          (timespecCanonicalDayTime
                                            from-value))))
                                (set-tm:mday bdtm 1) ; 01
                                (set-tm:mon bdtm 2) ; Mar
@@ -600,7 +599,7 @@
                              from-value))
                (to-est (if full-year?
                            (let* ((bdtm (gnc:timepair->date
-                                         (gnc:timepair-canonical-day-time
+                                         (timespecCanonicalDayTime
                                           from-value))))
                              (set-tm:mday bdtm 28) ; 28
                              (set-tm:mon bdtm 1) ; Feb
@@ -623,9 +622,9 @@
                      (+ 1 level)
                      level)))
         (map (lambda (spl) 
-               (let* ((date (gnc:transaction-get-date-posted 
-                             (gnc:split-get-parent spl)))
-                      (amount (gnc:split-get-amount spl))
+               (let* ((date (gnc-transaction-get-date-posted
+                             (xaccSplitGetParent spl)))
+                      (amount (xaccSplitGetAmount spl))
                       ;; TurboTax 1999 and 2000 ignore dates after Dec 31
                       (fudge-date (if (and full-year? 
                                            (gnc:timepair-lt to-value date))
@@ -651,14 +650,13 @@
 	  (length accounts)))
 
     (define (handle-level-x-account level account)
-      (let ((type (gw:enum-<gnc:AccountType>-val->sym
-                   (gnc:account-get-type account) #f)))
+      (let ((type (xaccAccountGetType account)))
 	(set! work-done (+ 1 work-done))
 	(gnc:report-percent-done (* 100 (if (> work-to-do 0)
 					    (/ work-done work-to-do)
 					    1)))
         (if (gnc:account-is-inc-exp? account)
-            (let* ((children (gnc:account-get-children account))
+            (let* ((children (xaccAccountGetChildren account))
                    (to-special #f)	; clear special-splits-period
                    (from-special #f)
                    (childrens-output 
@@ -682,34 +680,34 @@
                                    (handle-level-x-account (+ 1 level) x)
                                    '()))
                              (reverse 
-                              (gnc:group-get-account-list children)))))
+                              (xaccGroupGetAccountListSorted children)))))
 
                    (account-balance 
-                    (if (gnc:account-get-tax-related account)
+                    (if (xaccAccountGetTaxRelated account)
                         (if to-special
                             (gnc:account-get-balance-interval
                              account from-special to-special #f)
                             (gnc:account-get-balance-interval
                              account from-value to-value #f))
-                        (gnc:numeric-zero)))) ; don't add non tax related
+                        (gnc-numeric-zero)))) ; don't add non tax related
 
               (set! account-balance
-                    (gnc:numeric-add-fixed
+                    (gnc-numeric-add-fixed
                      (if (> max-level level)
                          (cadr
                           (lx-collector (+ 1 level)
                                         'getpair
-                                        (gnc:account-get-commodity account)
+                                        (xaccAccountGetCommodity account)
                                         #f))
-                         (gnc:numeric-zero))
+                         (gnc-numeric-zero))
                        ;; make positive
-                       (if (eq? type 'income)
-                           (gnc:numeric-neg account-balance)
+                       (if (eq? type ACCT-TYPE-INCOME)
+                           (gnc-numeric-neg account-balance)
                            account-balance)))
 
               (lx-collector level
                             'add
-                            (gnc:account-get-commodity account)
+                            (xaccAccountGetCommodity account)
                             account-balance)
 
               (let ((level-x-output
@@ -749,11 +747,11 @@
 	  (to-year    (strftime "%Y" (localtime (car to-value))))
           (today-date (strftime "%d.%m.%Y" 
                                 (localtime 
-                                 (car (gnc:timepair-canonical-day-time
+                                 (car (timespecCanonicalDayTime
                                        (cons (current-time) 0))))))
 	  (tax-nr (or 
-		   (gnc:kvp-frame-get-slot-path
-		    (gnc:book-get-slots (gnc:get-current-book))
+		   (kvp-frame-get-slot-path-gslist
+		    (gnc-book-get-slots (gnc-get-current-book))
 		    (append gnc:*kvp-option-path*
 			    (list gnc:*tax-label* gnc:*tax-nr-label*)))
 		   ""))

Modified: gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/locale-specific/us/taxtxf.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -52,7 +52,7 @@
 
 (define levelx-collector (make-level-collector MAX-LEVELS))
 
-(define today (gnc:timepair-canonical-day-time
+(define today (timespecCanonicalDayTime
                (cons (current-time) 0)))
 
 (define bdtm
@@ -68,7 +68,7 @@
 
 (define (make-split-list account split-filter-pred)
   (reverse (filter split-filter-pred
-                   (gnc:account-get-split-list account))))
+                   (xaccAccountGetSplitList account))))
 
 ;; returns a predicate that returns true only if a split is
 ;; between early-date and late-date
@@ -76,8 +76,8 @@
                                                  end-date-tp)
   (lambda (split) 
     (let ((tp
-           (gnc:transaction-get-date-posted
-            (gnc:split-get-parent split))))
+           (gnc-transaction-get-date-posted
+            (xaccSplitGetParent split))))
       (and (gnc:timepair-ge-date tp begin-date-tp)
            (gnc:timepair-le-date tp end-date-tp)))))
 
@@ -176,11 +176,11 @@
   (member payer (list 'current 'parent)))
 
 (define (gnc:account-get-txf account)
-  (and (gnc:account-get-tax-related account)
+  (and (xaccAccountGetTaxRelated account)
        (not (equal? (gnc:account-get-txf-code account) 'N000))))
 
 (define (gnc:account-get-txf-code account)
-  (let ((code (gnc:account-get-tax-US-code account)))
+  (let ((code (xaccAccountGetTaxUSCode account)))
     (string->symbol (if code code "N000"))))
 
 (define (gnc:get-txf-format code income?)
@@ -190,7 +190,7 @@
                       code))
 
 (define (gnc:account-get-txf-payer-source account)
-  (let ((pns (gnc:account-get-tax-US-payer-name-source account)))
+  (let ((pns (xaccAccountGetTaxUSPayerNameSource account)))
     (string->symbol (if pns pns "none"))))
 
 ;; check for duplicate txf codes
@@ -219,7 +219,7 @@
                                        (gnc:account-get-txf-code acc))
                                       "\" has duplicates in "
                                       (number->string cnt) " accounts:")
-                                     (map gnc:account-get-full-name 
+                                     (map gnc-account-get-full-name
                                           (cdr x))))
                              '())))
                      txf-dups-alist)))
@@ -272,13 +272,12 @@
             (make-sub-headers (- max-level 1)))))
 
 (define (render-txf-account account account-value d? date x? x-date)
-  (let* ((print-info (gnc:account-print-info account #t))
-         (value (gnc:amount->string account-value print-info))
+  (let* ((print-info (gnc-account-print-info account #t))
+         (value (xaccPrintAmount account-value print-info))
          (txf? (gnc:account-get-txf account)))
     (if (and txf?
-             (not (gnc:numeric-zero-p account-value)))
-        (let* ((type (gw:enum-<gnc:AccountType>-val->sym
-                      (gnc:account-get-type account) #f))
+             (not (gnc-numeric-zero-p account-value)))
+        (let* ((type (xaccAccountGetType account))
                (code (gnc:account-get-txf-code account))
                (date-str (if date
                              (strftime "%m/%d/%Y" (localtime (car date)))
@@ -287,33 +286,33 @@
                                (strftime "%m/%d/%Y" (localtime (car x-date)))
                                #f))
                ;; Only formats 1,3 implemented now! Others are treated as 1.
-               (format (gnc:get-txf-format code (eq? type 'income)))
+               (format (gnc:get-txf-format code (eq? type ACCT-TYPE-INCOME)))
                (payer-src (gnc:account-get-txf-payer-source account))
                (account-name (let* ((named-acct
 				    (if (eq? payer-src 'parent)
-					(gnc:group-get-parent
-					 (gnc:account-get-parent account))
+					(xaccGroupGetParentAccount
+					 (xaccAccountGetParent account))
 					account))
-				    (name (gnc:account-get-name named-acct)))
+				    (name (xaccAccountGetName named-acct)))
 			       (if name
 				   name
 				   (begin
 				     (display
 				      (string-append
 				       "Failed to get name for account: "
-				       (gnc:account-get-guid named-acct)
+				       (gncAccountGetGUID named-acct)
 				       (if (not (eq? account named-acct))
 					   (string-append
 					    " which is the parent of "
-					    (gnc:account-get-guid account)))
+					    (gncAccountGetGUID account)))
 				       "\n"))
 				     "<NONE> -- See the Terminal Output"))))
-               (action (if (eq? type 'income)
+               (action (if (eq? type ACCT-TYPE-INCOME)
                            (case code
                              ((N286 N488) "ReinvD")
                              (else "Income"))
                            "Expense"))
-               (category-key (if (eq? type 'income)
+               (category-key (if (eq? type ACCT-TYPE-INCOME)
                                  (gnc:txf-get-category-key 
                                   txf-income-categories code)
                                  (gnc:txf-get-category-key
@@ -323,7 +322,7 @@
                                 (substring value 1 (string-length value))
                                 " " account-name)
                                account-name))
-               (value (if (eq? type 'income) ; negate expenses
+               (value (if (eq? type ACCT-TYPE-INCOME) ; negate expenses
                           value
                           (string-append 
                            "$-" (substring value 1 (string-length value)))))
@@ -364,11 +363,11 @@
   (let* ((account-name (if txf-date	; special split
                            (strftime "%Y-%b-%d" (localtime (car txf-date)))
                            (if (or full-names (equal? level 1))
-                               (gnc:account-get-full-name account)
-                               (gnc:account-get-name account))))
+                               (gnc-account-get-full-name account)
+                               (xaccAccountGetName account))))
          (blue? (gnc:account-get-txf account))
-         (print-info (gnc:account-print-info account #f))
-         (value (gnc:amount->string lx-value print-info))
+         (print-info (gnc-account-print-info account #f))
+         (value (xaccPrintAmount lx-value print-info))
          (value-formatted (if (= 1 level)
                               (gnc:html-markup-b value)
                               value))
@@ -389,7 +388,7 @@
         (txf-check-dups account))
 
     (if (or (not suppress-0) (= level 1)
-            (not (gnc:numeric-zero-p lx-value)))
+            (not (gnc-numeric-zero-p lx-value)))
         (begin
           (gnc:html-table-prepend-row!
            table
@@ -409,12 +408,12 @@
 ;; Returns the Parent if a child or grandchild is valid.
 (define (validate accounts)
   (filter (lambda (a)
-            (if (gnc:account-get-tax-related a)
+            (if (xaccAccountGetTaxRelated a)
                 #t
                 ;; check children
                 (if (null? (validate
-                            (gnc:group-get-subaccounts
-                             (gnc:account-get-children a))))
+                            (xaccGroupGetSubAccountsSorted
+                             (xaccAccountGetChildren a))))
                     #f
                     #t)))
           accounts))
@@ -432,9 +431,9 @@
 
   ;; the number of account generations: children, grandchildren etc.
   (define (num-generations account gen)
-    (let ((children (gnc:account-get-children account)))
-      (if (eq? (gnc:group-get-num-accounts children) 0)
-          (if (and (gnc:account-get-tax-related account)
+    (let ((children (xaccAccountGetChildren account)))
+      (if (eq? (xaccGroupGetNumAccounts children) 0)
+          (if (and (xaccAccountGetTaxRelated account)
                    (txf-special-split? (gnc:account-get-txf-code account)))
               (+ gen 1)		; Est Fed Tax has a extra generation
               gen)	       		; no kids, return input
@@ -460,8 +459,8 @@
          (selected-accounts (if (not (null? user-sel-accnts))
                                 valid-user-sel-accnts
                                 (validate (reverse 
-                                           (gnc:group-get-account-list
-                                            (gnc:get-current-group))))))
+                                           (xaccGroupGetAccountListSorted
+                                            (gnc-get-current-group))))))
          (generations (if (pair? selected-accounts)
                           (apply max (map (lambda (x) (num-generations x 1))
                                           selected-accounts))
@@ -553,7 +552,7 @@
     ;; for quarterly estimated tax payments, we need a different period
     ;; return the sometimes changed (from-est to-est full-year?) dates
     (define (txf-special-splits-period account from-value to-value)
-      (if (and (gnc:account-get-tax-related account)
+      (if (and (xaccAccountGetTaxRelated account)
                (txf-special-split? (gnc:account-get-txf-code account)))
           (let* 
               ((full-year?
@@ -568,7 +567,7 @@
                ;; paymnent from the right year
                (from-est (if full-year?
                              (let ((bdtm (gnc:timepair->date
-                                          (gnc:timepair-canonical-day-time
+                                          (timespecCanonicalDayTime
                                            from-value))))
                                (set-tm:mday bdtm 1) ; 01
                                (set-tm:mon bdtm 2) ; Mar
@@ -577,7 +576,7 @@
                              from-value))
                (to-est (if full-year?
                            (let* ((bdtm (gnc:timepair->date
-                                         (gnc:timepair-canonical-day-time
+                                         (timespecCanonicalDayTime
                                           from-value))))
                              (set-tm:mday bdtm 28) ; 28
                              (set-tm:mon bdtm 1) ; Feb
@@ -600,9 +599,9 @@
                      (+ 1 level)
                      level)))
         (map (lambda (spl) 
-               (let* ((date (gnc:transaction-get-date-posted 
-                             (gnc:split-get-parent spl)))
-                      (amount (gnc:split-get-amount spl))
+               (let* ((date (gnc-transaction-get-date-posted
+                             (xaccSplitGetParent spl)))
+                      (amount (xaccSplitGetAmount spl))
                       ;; TurboTax 1999 and 2000 ignore dates after Dec 31
                       (fudge-date (if (and full-year? 
                                            (gnc:timepair-lt to-value date))
@@ -628,15 +627,13 @@
 	  (length accounts)))
 
     (define (handle-level-x-account level account)
-      (let ((type (gw:enum-<gnc:AccountType>-val->sym
-                   (gnc:account-get-type account) #f)))
-
+      (let ((type (xaccAccountGetType account)))
 	(set! work-done (+ 1 work-done))
 	(gnc:report-percent-done (* 100 (if (> work-to-do 0)
 					    (/ work-done work-to-do)
 					    1)))
         (if (gnc:account-is-inc-exp? account)
-            (let* ((children (gnc:account-get-children account))
+            (let* ((children (xaccAccountGetChildren account))
                    (to-special #f)	; clear special-splits-period
                    (from-special #f)
                    (childrens-output 
@@ -660,34 +657,34 @@
                                    (handle-level-x-account (+ 1 level) x)
                                    '()))
                              (reverse 
-                              (gnc:group-get-account-list children)))))
+                              (xaccGroupGetAccountListSorted children)))))
 
                    (account-balance 
-                    (if (gnc:account-get-tax-related account)
+                    (if (xaccAccountGetTaxRelated account)
                         (if to-special
                             (gnc:account-get-balance-interval
                              account from-special to-special #f)
                             (gnc:account-get-balance-interval
                              account from-value to-value #f))
-                        (gnc:numeric-zero)))) ; don't add non tax related
+                        (gnc-numeric-zero)))) ; don't add non tax related
 
               (set! account-balance
-                    (gnc:numeric-add-fixed
+                    (gnc-numeric-add-fixed
                      (if (> max-level level)
                          (cadr
                           (lx-collector (+ 1 level)
                                         'getpair
-                                        (gnc:account-get-commodity account)
+                                        (xaccAccountGetCommodity account)
                                         #f))
-                         (gnc:numeric-zero))
+                         (gnc-numeric-zero))
                        ;; make positive
-                       (if (eq? type 'income)
-                           (gnc:numeric-neg account-balance)
+                       (if (eq? type ACCT-TYPE-INCOME)
+                           (gnc-numeric-neg account-balance)
                            account-balance)))
 
               (lx-collector level
                             'add
-                            (gnc:account-get-commodity account)
+                            (xaccAccountGetCommodity account)
                             account-balance)
 
               (let ((level-x-output
@@ -726,7 +723,7 @@
           (to-date    (strftime "%Y-%b-%d" (localtime (car to-value))))
           (today-date (strftime "D%m/%d/%Y" 
                                 (localtime 
-                                 (car (gnc:timepair-canonical-day-time
+                                 (car (timespecCanonicalDayTime
                                        (cons (current-time) 0)))))))
 
       ;; Now, the main body

Modified: gnucash/branches/register-rewrite/src/report/locale-specific/us/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/locale-specific/us/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/locale-specific/us/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,7 +15,6 @@
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
   --gnc-module-dir ${top_srcdir}/src/engine \
   --gnc-module-dir ${top_builddir}/src/network-utils \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/tax/us \
   --guile-load-dir ${top_srcdir}/src/report/report-system \
@@ -23,8 +22,8 @@
   --guile-load-dir ${top_srcdir}/src/gnome-utils \
   --guile-load-dir ${top_srcdir}/src/gnome \
   --library-dir    ${top_srcdir}/src/gnome-utils \
-  --library-dir    ${top_srcdir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --library-dir    ${top_srcdir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})


Property changes on: gnucash/branches/register-rewrite/src/report/report-gnome
___________________________________________________________________
Name: svn:ignore
   - *.gladep
*.lo
*.la
.scm-links
.deps
.libs
Makefile
Makefile.in
gw-report-gnome.scm
gw-report-gnome.html
gw-report-gnome.h
gw-report-gnome.c
gnucash
report
g-wrapped


semantic.cache

TAGS

   + *.gladep
*.lo
*.la
.scm-links
.deps
.libs
Makefile
Makefile.in
swig-report-gnome.c
gnucash
report


semantic.cache

TAGS


Modified: gnucash/branches/register-rewrite/src/report/report-gnome/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -3,7 +3,7 @@
 # to get the test-link-mumble to link correctly; plz assist.
 PWD := $(shell pwd)
 
-pkglib_LTLIBRARIES = libgncmod-report-gnome.la libgw-report-gnome.la
+pkglib_LTLIBRARIES = libgncmod-report-gnome.la
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \
@@ -18,12 +18,12 @@
   ${GUILE_INCS} \
   ${GTKHTML_CFLAGS} \
   ${GNOME_PRINT_CFLAGS} \
-  ${G_WRAP_COMPILE_ARGS} \
   ${GNOME_CFLAGS} \
   ${QOF_CFLAGS} \
   ${GLIB_CFLAGS}
 
 libgncmod_report_gnome_la_SOURCES = \
+  swig-report-gnome.c \
   dialog-column-view.c \
   dialog-style-sheet.c \
   gnc-plugin-page-report.c \
@@ -44,21 +44,18 @@
   ${top_builddir}/src/gnome-utils/libgncmod-gnome-utils.la \
   ${top_builddir}/src/report/report-system/libgncmod-report-system.la \
   ${GLADE_LIBS} \
-  ${G_WRAP_LINK_ARGS} \
   ${GUILE_LIBS} \
   ${GNOME_PRINT_LIBS} \
   ${GNOME_LIBS} \
   ${QOF_LIBS} \
   ${GLIB_LIBS}
 
-libgw_report_gnome_la_SOURCES = gw-report-gnome.c
-libgw_report_gnome_la_LIBADD = \
-  libgncmod-report-gnome.la \
-  ${G_WRAP_LINK_ARGS}
+if BUILDING_FROM_SVN
+swig-report-gnome.c: report-gnome.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-report-gnome.scm gw-report-gnome-spec.scm
-
 gncmoddir = ${GNC_SHAREDIR}/guile-modules/gnucash/report
 gncmod_DATA = report-gnome.scm
 
@@ -72,47 +69,29 @@
 ui_DATA = \
 	gnc-plugin-page-report-ui.xml
 
-noinst_HEADERS = \
- gw-report-gnome.h
-
 EXTRA_DIST = \
+  report-gnome.i \
   ${glade_DATA} \
-  ${gwmod_DATA} \
   ${gncmod_DATA} \
   ${ui_DATA}
 
 if GNUCASH_SEPARATE_BUILDDIR
 #Only needed when srcdir and builddir are different
-#  for compiling
-SCM_FILE_LINKS = gw-report-gnome-spec.scm
 # for running
-SCM_FILE_LINKS += ${gncmod_DATA}
+SCM_FILE_LINKS = ${gncmod_DATA}
 endif
 
 .scm-links: 
-	rm -f gnucash g-wrapped
-	$(LN_S) -f . gnucash 
-	$(LN_S) -f . g-wrapped 
-	$(LN_S) -f ${srcdir} report 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/report
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/report; for A in $(gncmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
-gw-report-gnome.scm gw-report-gnome.c gw-report-gnome.h: \
-  .scm-links gw-report-gnome-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (set! %load-path (cons \"${PWD}\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/engine\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/app-utils\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/gnome-utils\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/gnome\" %load-path)) \
-	  (primitive-load \"./gw-report-gnome-spec.scm\") \
-	  (gw:generate-wrapset \"gw-report-gnome\")"
-
-BUILT_SOURCES = gw-report-gnome.scm gw-report-gnome.c gw-report-gnome.h
-CLEANFILES = gnucash g-wrapped report .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-report-gnome.html
+CLEANFILES = gnucash report .scm-links ${SCM_FILE_LINKS}
+MAINTAINERCLEANFILES = swig-report-gnome.c

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/dialog-column-view.c
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/dialog-column-view.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/dialog-column-view.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,6 +1,7 @@
 /********************************************************************
  * dialog-column-view.c -- editor for simple column view of reports *
  * Copyright (C) 2001 Bill Gribble <grib at billgribble.com>           *
+ * 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   *
@@ -24,7 +25,7 @@
 
 #include <glib/gi18n.h>
 #include <libguile.h>
-#include <g-wrap-wct.h>
+#include "swig-runtime.h"
 
 #include "dialog-column-view.h"
 #include "dialog-options.h"
@@ -34,10 +35,24 @@
 #include "guile-mappings.h"
 #include "gnc-report.h"
 
+enum available_cols {
+  AVAILABLE_COL_NAME = 0,
+  AVAILABLE_COL_ROW,
+  NUM_AVAILABLE_COLS
+};
+
+enum contents_cols {
+  CONTENTS_COL_NAME = 0,
+  CONTENTS_COL_ROW,
+  CONTENTS_COL_REPORT_ROWS,
+  CONTENTS_COL_REPORT_COLS,
+  NUM_CONTENTS_COLS
+};
+
 struct gncp_column_view_edit {
   GNCOptionWin * optwin;
-  GtkCList  * available;
-  GtkCList  * contents; 
+  GtkTreeView  * available;
+  GtkTreeView  * contents; 
 
   SCM          options; 
   SCM          view;
@@ -50,7 +65,6 @@
   int       contents_selected;
 };
 
-
 static void gnc_column_view_edit_add_cb(GtkButton * button,
                                         gpointer user_data);
 static void gnc_column_view_edit_remove_cb(GtkButton * button,
@@ -99,10 +113,14 @@
   SCM   contents = 
     gnc_option_db_lookup_option(view->odb, "__general", "report-list",
                                 SCM_BOOL_F);
-  SCM   this_report, this_name;
+  SCM   this_report;
   SCM   selection;
-  char  * name[3];
+  const gchar *name;
   int   row, i, id;
+  GtkListStore *store;
+  GtkTreeIter iter;
+  GtkTreePath *path;
+  GtkTreeSelection *tree_selection;
 
   /* Update the list of available reports (left selection box). */
   row = view->available_selected;
@@ -119,18 +137,25 @@
   view->available_list = names;
   scm_gc_protect_object(view->available_list);
 
-  gtk_clist_freeze(view->available);
-  gtk_clist_clear(view->available);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view->available));
+  gtk_list_store_clear(store);
   if(SCM_LISTP(names)) {
     for(i = 0; !SCM_NULLP(names); names = SCM_CDR(names), i++) {
       if (SCM_EQUALP (SCM_CAR(names), selection))
         row = i;
-      name[0] = SCM_STRING_CHARS(scm_call_1(template_menu_name, SCM_CAR(names)));
-      gtk_clist_append(view->available, name);
+      name = SCM_STRING_CHARS(scm_call_1(template_menu_name, SCM_CAR(names)));
+      gtk_list_store_append(store, &iter);
+      gtk_list_store_set(store, &iter,
+			 AVAILABLE_COL_NAME, name,
+			 AVAILABLE_COL_ROW, i,
+			 -1);
     }
   }
-  gtk_clist_select_row(view->available, row, 0);
-  gtk_clist_thaw(view->available);
+  
+  tree_selection = gtk_tree_view_get_selection(view->available);
+  path = gtk_tree_path_new_from_indices(row, -1);
+  gtk_tree_selection_select_path(tree_selection, path);
+  gtk_tree_path_free(path);
 
 
   /* Update the list of selected reports (right selection box). */
@@ -148,8 +173,8 @@
   view->contents_list = contents;
   scm_gc_protect_object(view->contents_list);
 
-  gtk_clist_freeze(view->contents);
-  gtk_clist_clear(view->contents);
+  store = GTK_LIST_STORE(gtk_tree_view_get_model(view->contents));
+  gtk_list_store_clear(store);
   if(SCM_LISTP(contents)) {
     for(i = 0; !SCM_NULLP(contents); contents = SCM_CDR(contents), i++) {
       if (SCM_EQUALP (SCM_CAR(contents), selection))
@@ -157,37 +182,52 @@
 
       id = scm_num2int(SCM_CAAR(contents), SCM_ARG1, __FUNCTION__);
       this_report = gnc_report_find(id);
-      /* this_name = scm_call_1(report_name, this_report); */
-      this_name = scm_call_1(report_menu_name, this_report);
-      name[0] = g_strdup(SCM_STRING_CHARS(this_name));
-      name[1] = g_strdup_printf("%d", scm_num2int(SCM_CADR(SCM_CAR(contents)),
-						  SCM_ARG1, __FUNCTION__));
-      name[2] = g_strdup_printf("%d", scm_num2int(SCM_CADDR(SCM_CAR(contents)),
-						  SCM_ARG1, __FUNCTION__));
-      gtk_clist_append(view->contents, name);
-      g_free(name[0]);
-      g_free(name[1]);
-      g_free(name[2]);
+
+      gtk_list_store_append(store, &iter);
+      gtk_list_store_set
+	(store, &iter,
+	 CONTENTS_COL_NAME, SCM_STRING_CHARS(scm_call_1(report_menu_name,
+							this_report)),
+	 CONTENTS_COL_ROW, i,
+	 CONTENTS_COL_REPORT_COLS, scm_num2int(SCM_CADR(SCM_CAR(contents)),
+					       SCM_ARG1, __FUNCTION__),
+	 CONTENTS_COL_REPORT_ROWS, scm_num2int(SCM_CADDR(SCM_CAR(contents)),
+					       SCM_ARG1, __FUNCTION__),
+	 -1);
     }
   }
-  gtk_clist_select_row(view->contents, row, 0);
-  gtk_clist_thaw(view->contents);
+  
+  tree_selection = gtk_tree_view_get_selection(view->contents);
+  path = gtk_tree_path_new_from_indices(row, -1);
+  gtk_tree_selection_select_path(tree_selection, path);
+  //  gtk_tree_view_scroll_to_cell(view->contents, path, NULL, TRUE, 0.5, 0.0);
+  gtk_tree_path_free(path);
 }
 
 static void
-gnc_column_view_select_avail_cb(GtkCList * clist, gint row, gint col,
-                                GdkEvent * ev, gpointer data)
+gnc_column_view_select_avail_cb(GtkTreeSelection *selection,
+				gnc_column_view_edit *r)
 {
-  gnc_column_view_edit * r = data;
-  r->available_selected = row;  
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+
+  if (gtk_tree_selection_get_selected(selection, &model, &iter))
+    gtk_tree_model_get(model, &iter,
+		       AVAILABLE_COL_ROW, &r->available_selected,
+		       -1);
 }
 
 static void
-gnc_column_view_select_contents_cb(GtkCList * clist, gint row, gint col,
-                                   GdkEvent * ev, gpointer data)
+gnc_column_view_select_contents_cb(GtkTreeSelection *selection,
+				   gnc_column_view_edit *r)
 {
-  gnc_column_view_edit * r = data;
-  r->contents_selected = row;  
+  GtkTreeModel *model;
+  GtkTreeIter iter;
+
+  if (gtk_tree_selection_get_selected(selection, &model, &iter))
+    gtk_tree_model_get(model, &iter,
+		       AVAILABLE_COL_ROW, &r->contents_selected,
+		       -1);
 }
 
 static void
@@ -223,11 +263,17 @@
   SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
   SCM ptr;
   GtkWidget * editor;
+  GtkListStore *store;
+  GtkCellRenderer *renderer;
+  GtkTreeViewColumn *column;
+  GtkTreeSelection *selection;
 
   ptr = scm_call_1(get_editor, view);
   if(ptr != SCM_BOOL_F) {
-    GtkWindow * w = gw_wcp_get_ptr(ptr);
+#define FUNC_NAME "gtk_window_present"
+    GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
     gtk_window_present(w);
+#undef FUNC_NAME
     return NULL;
   }
   else {
@@ -268,8 +314,8 @@
        G_CALLBACK (gnc_column_view_edit_size_cb), r);
 
     editor       = glade_xml_get_widget (xml, "view_contents_table");
-    r->available = GTK_CLIST (glade_xml_get_widget (xml, "available_list"));
-    r->contents  = GTK_CLIST (glade_xml_get_widget (xml, "contents_list"));
+    r->available = GTK_TREE_VIEW (glade_xml_get_widget (xml, "available_view"));
+    r->contents  = GTK_TREE_VIEW (glade_xml_get_widget (xml, "contents_view"));
     r->options   = options;
     r->view      = view;
     r->available_selected = 0;
@@ -278,13 +324,8 @@
     r->contents_list = SCM_EOL;
     r->odb       = gnc_option_db_new(r->options);
 
-    gtk_clist_set_column_auto_resize(r->available, 0, TRUE);
-    gtk_clist_set_column_auto_resize(r->contents, 0, TRUE);
-    gtk_clist_set_column_auto_resize(r->contents, 1, TRUE);
-    gtk_clist_set_column_auto_resize(r->contents, 2, TRUE);
+    gnc_options_dialog_build_contents(r->optwin, r->odb);
 
-    gnc_build_options_dialog_contents(r->optwin, r->odb);
-
     gtk_notebook_append_page(GTK_NOTEBOOK(gnc_options_dialog_notebook
                                           (r->optwin)),
                              editor, 
@@ -295,16 +336,51 @@
     scm_gc_protect_object(r->available_list);
     scm_gc_protect_object(r->contents_list);
 
-    g_signal_connect(G_OBJECT(r->available), "select_row", 
-                     G_CALLBACK (gnc_column_view_select_avail_cb), (gpointer)r);
-    g_signal_connect(G_OBJECT(r->contents), "select_row", 
-                     G_CALLBACK (gnc_column_view_select_contents_cb), (gpointer)r);
+    /* Build the 'available' view */
+    store = gtk_list_store_new (NUM_AVAILABLE_COLS, G_TYPE_STRING, G_TYPE_INT);
+    gtk_tree_view_set_model(r->available, GTK_TREE_MODEL(store));
+    g_object_unref(store);
 
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes("", renderer,
+						      "text", AVAILABLE_COL_NAME,
+						      NULL);
+    gtk_tree_view_append_column(r->available, column);
+
+    selection = gtk_tree_view_get_selection(r->available);
+    g_signal_connect(selection, "changed",
+		     G_CALLBACK(gnc_column_view_select_avail_cb), r);
+
+    /* Build the 'contents' view */
+    store = gtk_list_store_new (NUM_CONTENTS_COLS, G_TYPE_STRING, G_TYPE_INT,
+				G_TYPE_INT, G_TYPE_INT);
+    gtk_tree_view_set_model(r->contents, GTK_TREE_MODEL(store));
+    g_object_unref(store);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Report"), renderer,
+						      "text", CONTENTS_COL_NAME,
+						      NULL);
+    gtk_tree_view_append_column(r->contents, column);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Cols"), renderer,
+						      "text", CONTENTS_COL_REPORT_COLS,
+						      NULL);
+    gtk_tree_view_append_column(r->contents, column);
+
+    renderer = gtk_cell_renderer_text_new();
+    column = gtk_tree_view_column_new_with_attributes(_("Rows"), renderer,
+						      "text", CONTENTS_COL_REPORT_ROWS,
+						      NULL);
+    gtk_tree_view_append_column(r->contents, column);
+
+    selection = gtk_tree_view_get_selection(r->contents);
+    g_signal_connect(selection, "changed",
+		     G_CALLBACK(gnc_column_view_select_contents_cb), r);
+
     update_display_lists(r);
 
-    gtk_clist_column_titles_passive (r->available);
-    gtk_clist_column_titles_passive (r->contents);
-
     gnc_options_dialog_set_apply_cb(r->optwin, 
                                     gnc_column_view_edit_apply_cb, r);
     gnc_options_dialog_set_close_cb(r->optwin, 

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/dialog-style-sheet.c
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/dialog-style-sheet.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/dialog-style-sheet.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -2,6 +2,7 @@
  * dialog-style-sheet.c -- window for configuring HTML style        *
  *                         sheets in GnuCash                        *
  * Copyright (C) 2000 Bill Gribble <grib at billgribble.com>           *
+ * 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   *
@@ -29,6 +30,7 @@
 #include "dialog-style-sheet.h"
 #include "dialog-options.h"
 #include "dialog-utils.h"
+#include "gnc-gtk-utils.h"
 #include "gnc-report.h"
 #include "gnc-ui.h"
 
@@ -145,7 +147,7 @@
     scm_gc_protect_object(ssinfo->stylesheet);
     g_object_ref(gnc_options_dialog_widget(ssinfo->odialog));
 
-    gnc_build_options_dialog_contents(ssinfo->odialog, 
+    gnc_options_dialog_build_contents(ssinfo->odialog,
                                       ssinfo->odb);
     gnc_options_dialog_set_apply_cb(ssinfo->odialog, 
                                     gnc_style_sheet_options_apply_cb,
@@ -170,45 +172,45 @@
   SCM              templates = scm_c_eval_string("(gnc:get-html-templates)");
   SCM              t_name = scm_c_eval_string("gnc:html-style-sheet-template-name");
   SCM              new_ss = SCM_BOOL_F;
-  GtkWidget        * template_entry;
+  GtkWidget        * template_combo;
+  GtkTreeModel     * template_model;
   GtkWidget        * name_entry;
-  GtkWidget        * template_combo;
-  GList            * strings=NULL;
   gint             dialog_retval;
-  const char       * template_str = NULL;
+  char             * template_str = NULL;
   const char       * name_str = NULL;
 
   /* get the new name for the style sheet */
   GladeXML *xml = gnc_glade_xml_new ("report.glade",
                                      "New Style Sheet Dialog");
   GtkWidget * dlg = glade_xml_get_widget (xml, "New Style Sheet Dialog");
-  template_entry = glade_xml_get_widget (xml, "template_entry");
-  template_combo = glade_xml_get_widget (xml, "template_combo");
+  template_combo = glade_xml_get_widget (xml, "template_combobox");
   name_entry     = glade_xml_get_widget (xml, "name_entry");
 
+  /* Erase the initial dummy entry. */
+  template_model = gtk_combo_box_get_model(GTK_COMBO_BOX(template_combo));
+  gtk_list_store_clear(GTK_LIST_STORE(template_model));
+
   /* put in the list of style sheet type names */
   for(; !SCM_NULLP(templates); templates=SCM_CDR(templates)) {
     SCM t = SCM_CAR(templates);
-    strings = g_list_append(strings, SCM_STRING_CHARS(scm_call_1(t_name, t)));
+    gtk_combo_box_append_text(GTK_COMBO_BOX(template_combo),
+			      SCM_STRING_CHARS(scm_call_1(t_name, t)));
   }
+  gtk_combo_box_set_active(GTK_COMBO_BOX(template_combo), 0);
   
-  gtk_combo_set_popdown_strings(GTK_COMBO(template_combo), strings);
-  
-  /* The strings on the list are const.  Just free the list. */
-  g_list_free(strings);
-
   /* get the name */
   gtk_window_set_transient_for (GTK_WINDOW(dlg), GTK_WINDOW(ssd->toplevel));
   dialog_retval = gtk_dialog_run(GTK_DIALOG(dlg));
 
   if(dialog_retval == GTK_RESPONSE_OK) {
-    template_str = gtk_entry_get_text(GTK_ENTRY(template_entry));
+    template_str = gtk_combo_box_get_active_text(GTK_COMBO_BOX(template_combo));
     name_str     = gtk_entry_get_text(GTK_ENTRY(name_entry));
     if(template_str && name_str) {
       new_ss = scm_call_2(make_ss, 
 			  scm_makfrom0str(template_str),
 			  scm_makfrom0str(name_str));
     }
+    g_free(template_str);
   }
 
   gtk_widget_destroy(dlg);
@@ -364,6 +366,7 @@
   ss->list_view  = GTK_TREE_VIEW(glade_xml_get_widget (xml, "style_sheet_list_view"));
   ss->list_store = gtk_list_store_new (N_COLUMNS, G_TYPE_STRING, G_TYPE_POINTER, G_TYPE_POINTER);
   gtk_tree_view_set_model(ss->list_view, GTK_TREE_MODEL(ss->list_store));
+  g_object_unref(ss->list_store);
   renderer = gtk_cell_renderer_text_new ();
   gtk_tree_view_insert_column_with_attributes(ss->list_view, -1,
 					      _("Style Sheet Name"), renderer,

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/gnc-plugin-page-report.c
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/gnc-plugin-page-report.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/gnc-plugin-page-report.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,7 +45,6 @@
 #ifndef HAVE_GLIB26
 #include "gkeyfile.h"
 #endif
-#include <g-wrap-wct.h>
 #include <libguile.h>
 #include <sys/stat.h>
 #include <errno.h>
@@ -67,6 +66,7 @@
 #include "guile-util.h"
 #include "option-util.h"
 #include "window-report.h"
+#include "swig-runtime.h"
 
 #define WINDOW_REPORT_CM_CLASS "window-report"
 
@@ -904,7 +904,12 @@
                 editor = scm_call_1(get_editor, SCM_CAR(edited));
                 scm_call_2(set_editor, SCM_CAR(edited), SCM_BOOL_F);
                 if (editor != SCM_BOOL_F) {
-                        gtk_widget_destroy(GTK_WIDGET(gw_wcp_get_ptr(editor)));
+                    GtkWidget *w = NULL;
+                    #define FUNC_NAME "gtk_widget_destroy"
+                    w = SWIG_MustGetPtr(editor,
+                                        SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+                    #undef FUNC_NAME
+                    gtk_widget_destroy(GTK_WIDGET(w));
                 }
         }
 
@@ -1101,7 +1106,11 @@
 {
         SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
         SCM editor = scm_call_1(get_editor, report);
-        gtk_window_present(gw_wcp_get_ptr(editor));
+        #define FUNC_NAME "gtk_window_present"
+        GtkWidget *w = SWIG_MustGetPtr(editor,
+                                       SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+        #undef FUNC_NAME
+        gtk_window_present(GTK_WINDOW(w));
 }
 
 static void

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/gncmod-report-gnome.c
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/gncmod-report-gnome.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/gncmod-report-gnome.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -52,6 +52,7 @@
   scm_c_eval_string(form);
   g_free(form);
 }
+extern SCM scm_init_sw_report_gnome_module(void);
 
 int
 libgncmod_report_gnome_LTX_gnc_module_init(int refcount)
@@ -67,8 +68,9 @@
   if(!gnc_module_load("gnucash/report/report-system", 0)) {
     return FALSE;
   }
+  scm_init_sw_report_gnome_module();
 
-  lmod ("(g-wrapped gw-report-gnome)");
+  lmod ("(sw_report_gnome)");
   lmod ("(gnucash report report-gnome)");
 
   if (refcount == 0)

Deleted: gnucash/branches/register-rewrite/src/report/report-gnome/gw-report-gnome-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/gw-report-gnome-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/gw-report-gnome-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,86 +0,0 @@
-(define-module (g-wrapped gw-report-gnome-spec))
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(use-modules (g-wrapped gw-engine-spec))
-(use-modules (g-wrapped gw-gnome-utils-spec))
-
-(let ((ws (gw:new-wrapset "gw-report-gnome")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-depends-on ws "gw-engine")
-  (gw:wrapset-depends-on ws "gw-gnome-utils")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-report-gnome))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <config.h>\n"
-      "#include <gtk/gtk.h>\n"
-      "#include <dialog-column-view.h>\n"
-      "#include <gnc-plugin-page-report.h>\n"
-      "#include <window-report.h>\n")))
-
-  (gw:wrap-function
-   ws
-   'gnc:report-window
-   '<gw:void>
-   "reportWindow"
-   '((<gw:int> report-id))
-   "Show report window")
-
-  (gw:wrap-function
-   ws
-   'gnc:print-report
-   '<gw:void>
-   "gnc_print_report"
-   '((<gw:int> report-id))
-   "Print a report with dialog support")
-
-  (gw:wrap-function
-   ws
-   'gnc:report-raise-editor
-   '<gw:void>
-   "gnc_report_raise_editor"
-   '((<gw:scm> report))
-   "Raise the report's editor window")
-
-  (gw:wrap-function
-   ws
-   'gnc:main-window-open-report
-   '<gw:void>
-   "gnc_main_window_open_report"
-   '((<gw:int> report-id) (<gnc:MainWindow*> window))
-   "Show report window")
-
-
-;; This is the function that's responsible for creating and returning
-;; the editor widget for a report's options.
-  (gw:wrap-function
-   ws
-   'gnc:default-options-editor
-   '<gnc:UIWidget>
-   "gnc_report_window_default_params_editor"
-   '((<gw:scm> options) (<gw:scm> report))
-   "Default options editor window for reports")
-
-  (gw:wrap-function
-   ws
-   'gnc:column-view-edit-options
-   '<gnc:UIWidget>
-   "gnc_column_view_edit_options"
-   '((<gw:scm> options) (<gw:scm> view))
-   "Create an editor for a column-view options object")
-  )

Copied: gnucash/branches/register-rewrite/src/report/report-gnome/report-gnome.i (from rev 15058, gnucash/trunk/src/report/report-gnome/report-gnome.i)

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/report-gnome.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/report-gnome.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/report-gnome.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -13,8 +13,7 @@
 (use-modules (ice-9 slib))
 (require 'printf)
 
-(use-modules (g-wrapped gw-core-utils))
-(use-modules (g-wrapped gw-report-gnome))
+(use-modules (sw_report_gnome))
 
 (gnc:module-load "gnucash/gnome-utils" 0)
 (gnc:module-load "gnucash/report/report-system" 0)
@@ -28,15 +27,15 @@
 ;; and returns a widget
 (define (gnc:report-options-editor report) 
   (if (equal? (gnc:report-type report) "Multicolumn View")
-      gnc:column-view-edit-options
-      gnc:default-options-editor))
+      gnc-column-view-edit-options
+      gnc-report-window-default-params-editor))
 
 ;; do not rely on the return value of this function - it has none.
 ;; instead, this function's side-effect is to set the report's editor widget.
 (define (gnc:report-edit-options report) 
   (let* ((editor-widg (gnc:report-editor-widget report)))
     (if editor-widg
-        (gnc:report-raise-editor report)
+        (gnc-report-raise-editor report)
         (begin
           (if (gnc:report-options report) 
               (begin 
@@ -45,7 +44,7 @@
                        (gnc:report-options report)
                        report))
                 (gnc:report-set-editor-widget! report editor-widg))
-              (gnc:warning-dialog #f (_ "This report has no options.")))))))
+              (gnc-warning-dialog '() (_ "This report has no options.")))))))
 
 (define (gnc:add-report-template-menu-items)
   (define *template-items* '())
@@ -79,8 +78,8 @@
                  (lambda (window)
                    (let ((report (gnc:make-report
                                   (gnc:report-template-name template))))
-                     (gnc:main-window-open-report report window)))))
-          (gnc:add-extension item))))
+                     (gnc-main-window-open-report report window)))))
+          (gnc-add-scm-extension item))))
 
   (define (add-template name template)
     (let ((menu-name (gnc:report-template-menu-name template)))
@@ -108,24 +107,24 @@
   (define tax-menu 
     (gnc:make-menu gnc:menuname-taxes (list gnc:menuname-reports)))
 
-  ;; (gnc:add-extension tax-menu)
-  (gnc:add-extension income-expense-menu)
-  (gnc:add-extension asset-liability-menu)
-  (gnc:add-extension utility-menu)
-  (gnc:add-extension custom-menu)
+  ;; (gnc-add-scm-extension tax-menu)
+  (gnc-add-scm-extension income-expense-menu)
+  (gnc-add-scm-extension asset-liability-menu)
+  (gnc-add-scm-extension utility-menu)
+  (gnc-add-scm-extension custom-menu)
 
   ;; run report-hook danglers
-  (gnc:hook-run-danglers gnc:*report-hook*)
+  (gnc:hook-run-danglers HOOK-REPORT)
 
   ;; push reports (new items added on top of menu)
   (gnc:add-report-template-menu-items)
 
   ;; the Welcome to GnuCash "extravaganza" report
-  (gnc:add-extension 
+  (gnc-add-scm-extension
    (gnc:make-menu-item 
     (N_ "Welcome Sample Report")
     (N_ "Welcome-to-GnuCash report screen")
     (list gnc:menuname-reports gnc:menuname-utility "")
     (lambda (window)
-      (gnc:main-window-open-report (gnc:make-welcome-report) window))))
+      (gnc-main-window-open-report (gnc:make-welcome-report) window))))
 )

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/report.glade
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/report.glade	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/report.glade	2007-01-05 17:25:28 UTC (rev 15313)
@@ -131,7 +131,7 @@
 	      <property name="yalign">0.5</property>
 	      <property name="xpad">0</property>
 	      <property name="ypad">0</property>
-	      <property name="mnemonic_widget">template_entry</property>
+	      <property name="mnemonic_widget">template_combobox</property>
 	    </widget>
 	    <packing>
 	      <property name="left_attach">0</property>
@@ -166,63 +166,18 @@
 	  </child>
 
 	  <child>
-	    <widget class="GtkCombo" id="template_combo">
+	    <widget class="GtkComboBox" id="template_combobox">
 	      <property name="visible">True</property>
-	      <property name="value_in_list">False</property>
-	      <property name="allow_empty">True</property>
-	      <property name="case_sensitive">False</property>
-	      <property name="enable_arrow_keys">True</property>
-	      <property name="enable_arrows_always">False</property>
-
-	      <child internal-child="entry">
-		<widget class="GtkEntry" id="template_entry">
-		  <property name="visible">True</property>
-		  <property name="can_focus">True</property>
-		  <property name="editable">True</property>
-		  <property name="visibility">True</property>
-		  <property name="max_length">0</property>
-		  <property name="text" translatable="yes"></property>
-		  <property name="has_frame">True</property>
-		  <property name="invisible_char">*</property>
-		  <property name="activates_default">False</property>
-		</widget>
-	      </child>
-
-	      <child internal-child="list">
-		<widget class="GtkList" id="convertwidget1">
-		  <property name="visible">True</property>
-		  <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-
-		  <child>
-		    <widget class="GtkListItem" id="convertwidget2">
-		      <property name="visible">True</property>
-
-		      <child>
-			<widget class="GtkLabel" id="convertwidget3">
-			  <property name="visible">True</property>
-			  <property name="label" translatable="yes"></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>
-			</widget>
-		      </child>
-		    </widget>
-		  </child>
-		</widget>
-	      </child>
+	      <property name="items">Dummy Entry</property>
+	      <property name="focus_on_click">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>
+	      <property name="x_options">fill</property>
+	      <property name="y_options">fill</property>
 	    </packing>
 	  </child>
 	</widget>
@@ -269,59 +224,14 @@
 	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 	  <child>
-	    <widget class="GtkCList" id="contents_list">
+	    <widget class="GtkTreeView" id="contents_view">
 	      <property name="visible">True</property>
 	      <property name="can_focus">True</property>
-	      <property name="n_columns">3</property>
-	      <property name="column_widths">150,34,25</property>
-	      <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-	      <property name="show_titles">True</property>
-	      <property name="shadow_type">GTK_SHADOW_IN</property>
-
-	      <child>
-		<widget class="GtkLabel" id="label847725">
-		  <property name="label" translatable="yes">Report</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="label847726">
-		  <property name="label" translatable="yes">Cols</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="label847727">
-		  <property name="label" translatable="yes">Rows</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>
+	      <property name="headers_visible">True</property>
+	      <property name="rules_hint">True</property>
+	      <property name="reorderable">False</property>
+	      <property name="enable_search">True</property>
+	      <property name="fixed_height_mode">False</property>
 	    </widget>
 	  </child>
 	</widget>
@@ -342,11 +252,11 @@
 	  <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="xalign">0</property>
 	  <property name="yalign">0.5</property>
 	  <property name="xpad">0</property>
 	  <property name="ypad">0</property>
-	  <property name="mnemonic_widget">available_list</property>
+	  <property name="mnemonic_widget">available_view</property>
 	</widget>
 	<packing>
 	  <property name="left_attach">0</property>
@@ -371,7 +281,7 @@
 	  <property name="yalign">0.5</property>
 	  <property name="xpad">0</property>
 	  <property name="ypad">0</property>
-	  <property name="mnemonic_widget">contents_list</property>
+	  <property name="mnemonic_widget">contents_view</property>
 	</widget>
 	<packing>
 	  <property name="left_attach">2</property>
@@ -577,29 +487,14 @@
 	  <property name="window_placement">GTK_CORNER_TOP_LEFT</property>
 
 	  <child>
-	    <widget class="GtkCList" id="available_list">
+	    <widget class="GtkTreeView" id="available_view">
 	      <property name="visible">True</property>
 	      <property name="can_focus">True</property>
-	      <property name="n_columns">1</property>
-	      <property name="column_widths">80</property>
-	      <property name="selection_mode">GTK_SELECTION_BROWSE</property>
-	      <property name="show_titles">False</property>
-	      <property name="shadow_type">GTK_SHADOW_IN</property>
-
-	      <child>
-		<widget class="GtkLabel" id="label847735">
-		  <property name="label" translatable="yes">label847735</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.5</property>
-		  <property name="yalign">0.5</property>
-		  <property name="xpad">0</property>
-		  <property name="ypad">0</property>
-		</widget>
-	      </child>
+	      <property name="headers_visible">False</property>
+	      <property name="rules_hint">True</property>
+	      <property name="reorderable">False</property>
+	      <property name="enable_search">True</property>
+	      <property name="fixed_height_mode">False</property>
 	    </widget>
 	  </child>
 	</widget>

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,15 +15,13 @@
   --gnc-module-dir ${top_builddir}/src/report/report-gnome \
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
   --gnc-module-dir ${top_srcdir}/src/engine \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/app-utils \
   --guile-load-dir ${top_srcdir}/src/report/report-system \
   --guile-load-dir ${top_srcdir}/src/gnome-utils \
   --guile-load-dir ${top_srcdir}/src/gnome \
   --library-dir    ${top_srcdir}/src/gnome-utils \
-  --library-dir    ${top_srcdir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_srcdir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/report/report-gnome/window-report.c
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-gnome/window-report.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-gnome/window-report.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -33,8 +33,7 @@
 #include <libguile.h>
 #include <sys/stat.h>
 
-#include <g-wrap-wct.h>
-
+#include "swig-runtime.h"
 #include "dialog-options.h"
 #include "file-utils.h"
 #include "gnc-gkeyfile-utils.h"
@@ -151,8 +150,10 @@
 
   ptr = scm_call_1(get_editor, report);
   if(ptr != SCM_BOOL_F) {
-    GtkWindow * w = gw_wcp_get_ptr(ptr);
+    #define FUNC_NAME "gtk_window_present"
+    GtkWindow * w = SWIG_MustGetPtr(ptr, SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
     gtk_window_present(w);
+    #undef FUNC_NAME
     return NULL;
   }
   else {
@@ -173,7 +174,7 @@
     scm_gc_protect_object(prm->scm_options);
     scm_gc_protect_object(prm->cur_report);
     
-    gnc_build_options_dialog_contents(prm->win, prm->db);
+    gnc_options_dialog_build_contents(prm->win, prm->db);
     gnc_option_db_clean(prm->db);
 
     gnc_options_dialog_set_apply_cb(prm->win, 
@@ -192,9 +193,13 @@
 void
 gnc_report_raise_editor(SCM report)
 {
-  SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
-  SCM editor = scm_call_1(get_editor, report);
-  gtk_window_present(gw_wcp_get_ptr(editor));
+    SCM get_editor = scm_c_eval_string("gnc:report-editor-widget");
+    SCM editor = scm_call_1(get_editor, report);
+    #define FUNC_NAME "gtk_window_present"
+    GtkWidget *w = SWIG_MustGetPtr(editor,
+                                   SWIG_TypeQuery("_p_GtkWidget"), 1, 0);
+    #undef FUNC_NAME
+    gtk_window_present(GTK_WINDOW(w));
 }
 
 static gboolean
@@ -228,6 +233,7 @@
   return ok;
 }
 
+/* TODO: unroll start_editor */
 static gboolean
 gnc_html_options_url_cb (const char *location, const char *label,
                          gboolean new_window, GNCURLResult *result)


Property changes on: gnucash/branches/register-rewrite/src/report/report-system
___________________________________________________________________
Name: svn:ignore
   - Makefile
Makefile.in
.scm-links
.deps
.libs
*.lo
*.la
report
gnucash
g-wrapped
semantic.cache
TAGS
gw-report-system.scm
gw-report-system.c
gw-report-system.h
gw-report-system.html

   + Makefile
Makefile.in
.scm-links
.deps
.libs
*.lo
*.la
report
gnucash
semantic.cache
TAGS
swig-report-system.c


Modified: gnucash/branches/register-rewrite/src/report/report-system/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,8 +1,9 @@
 SUBDIRS = . test
 
-pkglib_LTLIBRARIES = libgncmod-report-system.la libgw-report-system.la
+pkglib_LTLIBRARIES = libgncmod-report-system.la
 
 libgncmod_report_system_la_SOURCES = \
+  swig-report-system.c \
   gncmod-report-system.c \
   gnc-report.c
 
@@ -16,13 +17,17 @@
   ${GUILE_LIBS} \
   ${GLIB_LIBS}
 
+if BUILDING_FROM_SVN
+swig-report-system.c: report-system.i
+	$(SWIG) -guile $(SWIG_ARGS) -Linkage module \
+	-I${top_srcdir}/src -o $@ $<
+endif
 
 AM_CFLAGS = \
   -I${top_srcdir}/src \
   -I${top_srcdir}/src/gnc-module \
   -I${top_srcdir}/src/app-utils \
-  ${GLIB_CFLAGS} ${GUILE_INCS} \
-  ${G_WRAP_COMPILE_ARGS}
+  ${GLIB_CFLAGS} ${GUILE_INCS}
 
 gncscmdir = ${GNC_SHAREDIR}/scm
 gncscm_DATA = \
@@ -48,50 +53,27 @@
 
 if GNUCASH_SEPARATE_BUILDDIR
 #For executing test cases
-# for compiling
-SCM_FILE_LINKS = gw-report-system-spec.scm
 # for running
-SCM_FILE_LINKS += \
+SCM_FILE_LINKS = \
   ${gncscmmod_DATA} \
   ${gncscm_DATA}
 endif
 
 .scm-links:
-	rm -f gnucash report g-wrapped
-	$(LN_S) -f . gnucash
-	$(LN_S) -f . report 
-	$(LN_S) -f . g-wrapped
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/report
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
-libgw_report_system_la_SOURCES = gw-report-system.c
-libgw_report_system_la_LIBADD = \
-  libgncmod-report-system.la \
-  ${G_WRAP_LINK_ARGS}
+noinst_DATA = .scm-links
 
-gwmoddir = ${GNC_GWRAP_LIBDIR}
-gwmod_DATA = gw-report-system.scm gw-report-system-spec.scm
+EXTRA_DIST = report-system.i ${gncscmmod_DATA} ${gncscm_DATA}
 
-noinst_HEADERS = gw-report-system.h
-noinst_DATA = .scm-links gw-report-system.h
-
-EXTRA_DIST = ${gncscmmod_DATA} ${gncscm_DATA} ${gwmod_DATA}
-
-gw-report-system.scm gw-report-system.c gw-report-system.h: \
-  .scm-links gw-report-system-spec.scm ${top_builddir}/config.status
-	FLAVOR=gnome $(GUILE) -c \
-	 "(set! %load-path (cons \"${G_WRAP_MODULE_DIR}\" %load-path)) \
-	  (set! %load-path (cons \"${PWD}\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/engine\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/app-utils\" %load-path)) \
-	  (set! %load-path (cons \"${top_builddir}/src/gnome-utils\" %load-path)) \
-	  (primitive-load \"./gw-report-system-spec.scm\") \
-	  (gw:generate-wrapset \"gw-report-system\")"
-
-BUILT_SOURCES = gw-report-system.scm gw-report-system.c gw-report-system.h
-CLEANFILES = gnucash g-wrapped report .scm-links
-DISTCLEANFILES = ${SCM_FILE_LINKS} gw-report-system.html
+CLEANFILES = gnucash report .scm-links ${SCM_FILE_LINKS}
+MAINTAINERCLEANFILES = swig-report-system.c

Modified: gnucash/branches/register-rewrite/src/report/report-system/commodity-utilities.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/commodity-utilities.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/commodity-utilities.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,12 +21,12 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
-(define (gnc:commodity-collector-contains-commodity? collector commodity)
+(define (gnc-commodity-collector-contains-commodity? collector commodity)
     (let ((ret #f))
-        (gnc:commodity-collector-map
+        (gnc-commodity-collector-map
 	    collector
 	    (lambda (comm amt)
-		(set! ret (or ret (gnc:commodity-equiv? comm commodity)))))
+		(set! ret (or ret (gnc-commodity-equiv comm commodity)))))
 	ret
     ))
 
@@ -40,16 +40,16 @@
 ;; 'commodity' != #f ).
 (define (gnc:get-match-commodity-splits 
 	 currency-accounts end-date-tp commodity)
-  (let ((query (gnc:malloc-query))
+  (let ((query (qof-query-create-for-splits))
 	(splits #f))
     
-    (gnc:query-set-book query (gnc:get-current-book))
-    (gnc:query-set-match-non-voids-only! query (gnc:get-current-book))
-    (gnc:query-add-account-match query
+    (qof-query-set-book query (gnc-get-current-book))
+    (gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
+    (xaccQueryAddAccountMatch query
                                  currency-accounts
-                                 'guid-match-any 'query-and)
-    (gnc:query-add-date-match-timepair 
-     query #f end-date-tp #t end-date-tp 'query-and) 
+                                 QOF-GUID-MATCH-ANY QOF-QUERY-AND)
+    (xaccQueryAddDateMatchTS
+     query #f end-date-tp #t end-date-tp QOF-QUERY-AND)
     
     ;; Get the query result, i.e. all splits in currency
     ;; accounts.
@@ -58,22 +58,22 @@
 		  ;; which have two *different* commodities
 		  ;; involved.
 		  (lambda (s) (let ((trans-comm
-				     (gnc:transaction-get-currency 
-				      (gnc:split-get-parent s)))
+				     (xaccTransGetCurrency
+				      (xaccSplitGetParent s)))
 				    (acc-comm
-				     (gnc:account-get-commodity 
-				      (gnc:split-get-account s))))
+				     (xaccAccountGetCommodity
+				      (xaccSplitGetAccount s))))
 				(and
-				 (not (gnc:commodity-equiv? 
+				 (not (gnc-commodity-equiv
 				       trans-comm acc-comm))
 				 (or
 				  (not commodity)
-				  (gnc:commodity-equiv?
+				  (gnc-commodity-equiv
 				   commodity trans-comm)
-				  (gnc:commodity-equiv?
+				  (gnc-commodity-equiv
 				   commodity acc-comm)))))
-		  (gnc:query-get-splits query)))
-    (gnc:free-query query)
+		  (qof-query-run query)))
+    (qof-query-destroy query)
     splits))
 
 ;; Returns a sorted list of all splits in the 'currency-accounts' up
@@ -86,8 +86,8 @@
 					end-date-tp commodity)
 	(lambda (a b)
 	  (gnc:timepair-lt 
-	   (gnc:transaction-get-date-posted (gnc:split-get-parent a))
-	   (gnc:transaction-get-date-posted (gnc:split-get-parent b))))))
+	   (gnc-transaction-get-date-posted (xaccSplitGetParent a))
+	   (gnc-transaction-get-date-posted (xaccSplitGetParent b))))))
 
 
 ;; Returns a list of all splits in the currency-accounts up to
@@ -102,7 +102,7 @@
 
 
 ;; Helper for warnings below.
-(define (gnc:commodity-numeric->string commodity numeric)
+(define (gnc-commodity-numeric->string commodity numeric)
   (gnc:monetary->string
    (gnc:make-gnc-monetary commodity numeric)))
 
@@ -115,7 +115,7 @@
 
 ;; Returns true if the given pricealist element is a non-zero price.
 (define (gnc:price-is-not-zero? elem)
-  (not (gnc:numeric-zero-p (second elem))))
+  (not (gnc-numeric-zero-p (second elem))))
 
 ;; Create a list of all prices of 'price-commodity' measured in the
 ;; currency 'report-currency'. The prices are taken from all splits in
@@ -124,24 +124,24 @@
 ;; 'time' is the timepair when the <gnc:numeric*> 'price' was valid.
 (define (gnc:get-commodity-totalavg-prices
 	 currency-accounts end-date-tp price-commodity report-currency)
-  (let ((total-foreign (gnc:numeric-zero))
-	(total-domestic (gnc:numeric-zero)))
+  (let ((total-foreign (gnc-numeric-zero))
+	(total-domestic (gnc-numeric-zero)))
     (filter 
      gnc:price-is-not-zero?
      (map-in-order
       (lambda (a)
-	(let* ((transaction-comm (gnc:transaction-get-currency 
-				  (gnc:split-get-parent a)))
-	       (account-comm (gnc:account-get-commodity 
-			      (gnc:split-get-account a)))
-	       (share-amount (gnc:numeric-abs
-			      (gnc:split-get-amount a)))
-	       (value-amount (gnc:numeric-abs
-			      (gnc:split-get-value a)))
-	       (transaction-date (gnc:transaction-get-date-posted
-				  (gnc:split-get-parent a)))
+	(let* ((transaction-comm (xaccTransGetCurrency
+				  (xaccSplitGetParent a)))
+	       (account-comm (xaccAccountGetCommodity
+			      (xaccSplitGetAccount a)))
+	       (share-amount (gnc-numeric-abs
+			      (xaccSplitGetAmount a)))
+	       (value-amount (gnc-numeric-abs
+			      (xaccSplitGetValue a)))
+	       (transaction-date (gnc-transaction-get-date-posted
+				  (xaccSplitGetParent a)))
 	       (foreignlist
-		(if (gnc:commodity-equiv? transaction-comm 
+		(if (gnc-commodity-equiv transaction-comm
 					  price-commodity)
 		    (list account-comm
 			  share-amount value-amount)
@@ -149,14 +149,14 @@
 			  value-amount share-amount))))
 	  
 	  ;;(warn "gnc:get-commodity-totalavg-prices: value " 
-	  ;;    (gnc:commodity-numeric->string
+	  ;;    (gnc-commodity-numeric->string
 	  ;;(first foreignlist) (second foreignlist))
 	  ;;      " bought shares "
-	  ;;    (gnc:commodity-numeric->string
+	  ;;    (gnc-commodity-numeric->string
 	  ;;price-commodity (third foreignlist)))
 
 	  ;; Try EURO exchange if necessary
-	  (if (not (gnc:commodity-equiv? (first foreignlist) 
+	  (if (not (gnc-commodity-equiv (first foreignlist)
 					 report-currency))
 	      (let ((exchanged (gnc:exchange-by-euro-numeric
 				(first foreignlist) (second foreignlist)
@@ -169,26 +169,26 @@
 	  
 	  (list
 	   transaction-date
-	   (if (not (gnc:commodity-equiv? (first foreignlist) 
+	   (if (not (gnc-commodity-equiv (first foreignlist)
 					  report-currency))
 	       (begin
 		 (warn "gnc:get-commodity-totalavg-prices: " 
 		       "Sorry, currency exchange not yet implemented:"
-		       (gnc:commodity-numeric->string
+		       (gnc-commodity-numeric->string
 			(first foreignlist) (second foreignlist))
 		       " (buying "
-		       (gnc:commodity-numeric->string
+		       (gnc-commodity-numeric->string
 			price-commodity (third foreignlist))
 		       ") =? "
-		       (gnc:commodity-numeric->string
-			report-currency (gnc:numeric-zero)))
-		 (gnc:numeric-zero))
+		       (gnc-commodity-numeric->string
+			report-currency (gnc-numeric-zero)))
+		 (gnc-numeric-zero))
 	       (begin
-		 (set! total-foreign (gnc:numeric-add-fixed 
+		 (set! total-foreign (gnc-numeric-add-fixed
 				      total-foreign (third foreignlist)))
-		 (set! total-domestic (gnc:numeric-add-fixed 
+		 (set! total-domestic (gnc-numeric-add-fixed
 				       total-domestic (second foreignlist)))
-		 (gnc:numeric-div 
+		 (gnc-numeric-div
 		  total-domestic
 		  total-foreign
 		  GNC-DENOM-AUTO 
@@ -210,7 +210,7 @@
   (let ((currency-accounts 
 	 ;;(filter gnc:account-has-shares?  
 	 ;; -- use all accounts, not only share accounts, since gnucash-1.7
-	 (gnc:group-get-subaccounts (gnc:get-current-group)))
+	 (xaccGroupGetSubAccountsSorted (gnc-get-current-group)))
 	(work-to-do (length commodity-list))
 	(work-done 0))
     (map
@@ -238,32 +238,32 @@
    gnc:price-is-not-zero?
    (map-in-order
     (lambda (a)
-      (let* ((transaction-comm (gnc:transaction-get-currency 
-				(gnc:split-get-parent a)))
-	     (account-comm (gnc:account-get-commodity 
-			    (gnc:split-get-account a)))
-	     (share-amount (gnc:numeric-abs
-			    (gnc:split-get-amount a)))
-	     (value-amount (gnc:numeric-abs
-			    (gnc:split-get-value a)))
-	     (transaction-date (gnc:transaction-get-date-posted
-				(gnc:split-get-parent a)))
+      (let* ((transaction-comm (xaccTransGetCurrency
+				(xaccSplitGetParent a)))
+	     (account-comm (xaccAccountGetCommodity
+			    (xaccSplitGetAccount a)))
+	     (share-amount (gnc-numeric-abs
+			    (xaccSplitGetAmount a)))
+	     (value-amount (gnc-numeric-abs
+			    (xaccSplitGetValue a)))
+	     (transaction-date (gnc-transaction-get-date-posted
+				(xaccSplitGetParent a)))
 	     (foreignlist 
-	      (if (gnc:commodity-equiv? transaction-comm price-commodity)
+	      (if (gnc-commodity-equiv transaction-comm price-commodity)
 		  (list account-comm
 			share-amount value-amount)
 		  (list transaction-comm
 			value-amount share-amount))))
 	
 	;;(warn "get-commodity-inst-prices: value " 
-	;;    (gnc:commodity-numeric->string
+	;;    (gnc-commodity-numeric->string
 	;;   (first foreignlist) (second foreignlist))
 	;; " bought shares "
-	;;(gnc:commodity-numeric->string
+	;;(gnc-commodity-numeric->string
 	;; price-commodity (third foreignlist)))
 	
 	;; Try EURO exchange if necessary
-	(if (not (gnc:commodity-equiv? (first foreignlist) 
+	(if (not (gnc-commodity-equiv (first foreignlist)
 				       report-currency))
 	    (let ((exchanged (gnc:exchange-by-euro-numeric
 			      (first foreignlist) (second foreignlist)
@@ -276,21 +276,21 @@
 	
 	(list
 	 transaction-date
-	 (if (not (gnc:commodity-equiv? (first foreignlist) 
+	 (if (not (gnc-commodity-equiv (first foreignlist)
 					report-currency))
 	     (begin
 	       (warn "get-commodity-inst-prices: " 
 		     "Sorry, currency exchange not yet implemented:"
-		     (gnc:commodity-numeric->string
+		     (gnc-commodity-numeric->string
 		      (first foreignlist) (second foreignlist))
 		     " (buying "
-		     (gnc:commodity-numeric->string
+		     (gnc-commodity-numeric->string
 		      price-commodity (third foreignlist))
 		     ") =? "
-		     (gnc:commodity-numeric->string
-		      report-currency (gnc:numeric-zero)))
-	       (gnc:numeric-zero))
-	     (gnc:numeric-div 
+		     (gnc-commodity-numeric->string
+		      report-currency (gnc-numeric-zero)))
+	       (gnc-numeric-zero))
+	     (gnc-numeric-div
 	      (second foreignlist)
 	      (third foreignlist)
 	      GNC-DENOM-AUTO 
@@ -311,7 +311,7 @@
   (let ((currency-accounts 
 	 ;;(filter gnc:account-has-shares? 
 	 ;; -- use all accounts, not only share accounts, since gnucash-1.7
-	 (gnc:group-get-subaccounts (gnc:get-current-group)))
+	 (xaccGroupGetSubAccountsSorted (gnc-get-current-group)))
 	(work-to-do (length commodity-list))
 	(work-done 0))
     (map
@@ -344,12 +344,12 @@
 		       (last earlierlist))))
     ;;		(if earlier
     ;;		    (warn "earlier" 
-    ;;			  (gnc:print-date (first earlier))
-    ;;			  (gnc:numeric-to-double (second earlier))))
+    ;;			  (gnc-print-date (first earlier))
+    ;;			  (gnc-numeric-to-double (second earlier))))
     ;;		(if later
     ;;		    (warn "later" 
-    ;;			  (gnc:print-date (first later))
-    ;;			  (gnc:numeric-to-double (second later))))
+    ;;			  (gnc-print-date (first later))
+    ;;			  (gnc-numeric-to-double (second later))))
     
     (if (and earlier later)
 	(if (< (abs (gnc:timepair-delta date (first earlier)))
@@ -372,8 +372,8 @@
 		plist date)))
 	  (if price
 	      price
-	      (gnc:numeric-zero)))
-	(gnc:numeric-zero))))
+	      (gnc-numeric-zero)))
+	(gnc-numeric-zero))))
 
 
 
@@ -404,8 +404,8 @@
 	(a 'add (unknown-coll 'total #f))
 	(b 'add 
 	   ;; round to (at least) 8 significant digits
-	   (gnc:numeric-div
-	    (gnc:numeric-mul 
+	   (gnc-numeric-div
+	    (gnc-numeric-mul
 	     (un->known-coll 'total #f) 
 	     ((cdadr known-pair) 'total #f)
 	     GNC-DENOM-AUTO 
@@ -420,13 +420,13 @@
     ;; Go through sumlist.
     (for-each
      (lambda (otherlist)
-       (if (not (gnc:commodity-equiv? (car otherlist) report-commodity))
+       (if (not (gnc-commodity-equiv (car otherlist) report-commodity))
 	   (for-each
 	    (lambda (pair)
 	      ;; Check whether by any accident the report-commodity
 	      ;; appears here.
 	      (if 
-	       (not (gnc:commodity-equiv? (car pair) report-commodity))
+	       (not (gnc-commodity-equiv (car pair) report-commodity))
 	       ;; pair-{a,b}: Try to find either the currency of
 	       ;; otherlist or of pair in reportlist.
 	       (let ((pair-a 
@@ -452,21 +452,21 @@
 		     ;; Find the pair's currency in reportlist. FIXME:
 		     ;; Also try the Euro here.
 		     (pair-b (assoc (car pair) reportlist))
-		     (rate (gnc:numeric-zero)))
+		     (rate (gnc-numeric-zero)))
 		 (if (and (not pair-a) (not pair-b))
 		     ;; If neither the currency of otherlist nor of
 		     ;; pair was found in reportlist then we can't
 		     ;; resolve the exchange rate to this currency.
 		     (warn "gnc:resolve-unknown-comm:" 
 			   "can't calculate rate for "
-			   (gnc:commodity-value->string 
+			   (gnc-commodity-value->string
 			    (list (car pair) ((caadr pair) 'total #f)))
 			   " = "
-			   (gnc:commodity-value->string 
+			   (gnc-commodity-value->string
 			    (list (car otherlist) ((cdadr pair) 'total #f)))
 			   " to "
-			   (gnc:commodity-value->string 
-			    (list report-commodity (gnc:numeric-zero))))
+			   (gnc-commodity-value->string
+			    (list report-commodity (gnc-numeric-zero))))
 		     (if (and pair-a pair-b)
 			 ;; If both currencies are found then something
 			 ;; went wrong inside
@@ -474,10 +474,10 @@
 			 ;; better thing to do in this case.
 			 (warn "gnc:resolve-unknown-comm:" 
 			       "Oops - exchange rate ambiguity error: "
-			       (gnc:commodity-value->string 
+			       (gnc-commodity-value->string
 				(list (car pair) ((caadr pair) 'total #f)))
 			       " = "
-			       (gnc:commodity-value->string 
+			       (gnc-commodity-value->string
 				(list (car otherlist) 
 				      ((cdadr pair) 'total #f))))
 			 (let 
@@ -493,9 +493,9 @@
 					 (make-newrate (caadr pair) 
 						       (cdadr pair) pair-a)))))
 			   ;; (warn "created new rate: "
-			   ;; (gnc:commodity-value->string (list (car
+			   ;; (gnc-commodity-value->string (list (car
 			   ;; newrate) ((caadr newrate) 'total #f))) "
-			   ;; = " (gnc:commodity-value->string (list
+			   ;; = " (gnc-commodity-value->string (list
 			   ;; report-commodity ((cdadr newrate) 'total
 			   ;; #f))))
 			   (set! reportlist (cons newrate reportlist))))))
@@ -505,9 +505,9 @@
 	       (let ((newrate (list (car otherlist) 
 				    (cons (cdadr pair) (caadr pair)))))
 		 ;; (warn "created new rate: "
-		 ;; (gnc:commodity-value->string (list (car newrate)
+		 ;; (gnc-commodity-value->string (list (car newrate)
 		 ;; ((caadr newrate) 'total #f))) " = "
-		 ;; (gnc:commodity-value->string (list
+		 ;; (gnc-commodity-value->string (list
 		 ;; report-commodity ((cdadr newrate) 'total #f))))
 		 (set! reportlist (cons newrate reportlist)))))
 	    (cadr otherlist))))
@@ -530,7 +530,7 @@
   (let ((curr-accounts 
 	 ;;(filter gnc:account-has-shares? ))
 	 ;; -- use all accounts, not only share accounts, since gnucash-1.7
-	 (gnc:group-get-subaccounts (gnc:get-current-group)))
+	 (xaccGroupGetSubAccountsSorted (gnc-get-current-group)))
 	;; sumlist: a multilevel alist. Each element has a commodity
 	;; as key, and another alist as a value. The value-alist's
 	;; elements consist of a commodity as a key, and a pair of two
@@ -551,15 +551,15 @@
 	;; and share-amounts
 	(for-each 
 	 (lambda (a)
-	   (let* ((transaction-comm (gnc:transaction-get-currency 
-				     (gnc:split-get-parent a)))
-		  (account-comm (gnc:account-get-commodity 
-				 (gnc:split-get-account a)))
+	   (let* ((transaction-comm (xaccTransGetCurrency
+				     (xaccSplitGetParent a)))
+		  (account-comm (xaccAccountGetCommodity
+				 (xaccSplitGetAccount a)))
 		  ;; Always use the absolute value here.
-		  (share-amount (gnc:numeric-abs 
-				 (gnc:split-get-amount a)))
-		  (value-amount (gnc:numeric-abs
-				 (gnc:split-get-value a)))
+		  (share-amount (gnc-numeric-abs
+				 (xaccSplitGetAmount a)))
+		  (value-amount (gnc-numeric-abs
+				 (xaccSplitGetValue a)))
 		  (tmp (assoc transaction-comm sumlist))
 		  (comm-list (if (not tmp) 
 				 (assoc account-comm sumlist)
@@ -580,7 +580,7 @@
 		 (let* 
 		     ;; Put the amounts in the right place.
 		     ((foreignlist 
-		       (if (gnc:commodity-equiv? transaction-comm
+		       (if (gnc-commodity-equiv transaction-comm
 						 (car comm-list))
 			   (list account-comm 
 				 share-amount value-amount)
@@ -619,8 +619,8 @@
   (map 
    (lambda (e)
      (list (car e) 
-	   (gnc:numeric-abs
-	    (gnc:numeric-div ((cdadr e) 'total #f) 
+	   (gnc-numeric-abs
+	    (gnc-numeric-div ((cdadr e) 'total #f)
 			     ((caadr e) 'total #f)
 			     GNC-DENOM-AUTO 
 			     (logior (GNC-DENOM-SIGFIGS 8) GNC-RND-ROUND)))))
@@ -642,14 +642,14 @@
 ;; doesn't check for it. Returns a <gnc-monetary>, or #f if at least
 ;; one of the currencies is not in the EURO.
 (define (gnc:exchange-by-euro foreign domestic date)
-  (and (gnc:is-euro-currency domestic)
-       (gnc:is-euro-currency (gnc:gnc-monetary-commodity foreign))
+  (and (gnc-is-euro-currency domestic)
+       (gnc-is-euro-currency (gnc:gnc-monetary-commodity foreign))
        ;; FIXME: implement the date check.
        (gnc:make-gnc-monetary
 	domestic
-	(gnc:convert-from-euro 
+	(gnc-convert-from-euro
 	 domestic
-	 (gnc:convert-to-euro (gnc:gnc-monetary-commodity foreign)
+	 (gnc-convert-to-euro (gnc:gnc-monetary-commodity foreign)
 			      (gnc:gnc-monetary-amount foreign))))))
 
 
@@ -662,7 +662,7 @@
 ;; #f if the commodities don't match.  Therefore, if you use this
 ;; function in a mixed commodity context, stuff will probably crash.
 (define (gnc:exchange-if-same foreign domestic)
-  (if (gnc:commodity-equiv? (gnc:gnc-monetary-commodity foreign) domestic)
+  (if (gnc-commodity-equiv (gnc:gnc-monetary-commodity foreign) domestic)
       foreign
       #f))
 
@@ -684,10 +684,10 @@
 		 (let ((pair (assoc (gnc:gnc-monetary-commodity foreign) 
 				    exchangelist)))
 		   (if (not pair)
-		       (gnc:numeric-zero)
-		       (gnc:numeric-mul (gnc:gnc-monetary-amount foreign) 
+		       (gnc-numeric-zero)
+		       (gnc-numeric-mul (gnc:gnc-monetary-amount foreign)
 					(cadr pair)
-					(gnc:commodity-get-fraction domestic)
+					(gnc-commodity-get-fraction domestic)
 					GNC-RND-ROUND)))))
 	  #f)))))
 
@@ -700,16 +700,16 @@
       (gnc:make-gnc-monetary 
        domestic
        (if price-value
-	   (gnc:numeric-mul (gnc:gnc-monetary-amount foreign) 
+	   (gnc-numeric-mul (gnc:gnc-monetary-amount foreign)
 			    price-value
-			    (gnc:commodity-get-fraction domestic)
+			    (gnc-commodity-get-fraction domestic)
 			    GNC-RND-ROUND)
 	   (begin
 	     (warn "gnc:exchange-by-pricevalue-helper: No price found for "
 		   (gnc:monetary->string foreign) " into "
 		   (gnc:monetary->string
-		    (gnc:make-gnc-monetary domestic (gnc:numeric-zero))))
-	     (gnc:numeric-zero))))
+		    (gnc:make-gnc-monetary domestic (gnc-numeric-zero))))
+	     (gnc-numeric-zero))))
       #f))
 
 ;; Helper for gnc:exchange-by-pricedb-* below. 'price' gets tested for
@@ -723,18 +723,18 @@
        domestic
        (if price
 	   (let ((result
-		  (gnc:numeric-mul (gnc:gnc-monetary-amount foreign) 
-				   (gnc:price-get-value price)
-				   (gnc:commodity-get-fraction domestic)
+		  (gnc-numeric-mul (gnc:gnc-monetary-amount foreign)
+				   (gnc-price-get-value price)
+				   (gnc-commodity-get-fraction domestic)
 				   GNC-RND-ROUND)))
-	     (gnc:price-unref price)
+	     (gnc-price-unref price)
 	     result)
 	   (begin
 	     (warn "gnc:exchange-by-pricedb-helper: No price found for "
 		   (gnc:monetary->string foreign) " into "
 		   (gnc:monetary->string
-		    (gnc:make-gnc-monetary domestic (gnc:numeric-zero))))
-	     (gnc:numeric-zero))))
+		    (gnc:make-gnc-monetary domestic (gnc-numeric-zero))))
+	     (gnc-numeric-zero))))
       #f))
 
 ;; This is another ready-to-use function for calculation of exchange
@@ -751,8 +751,8 @@
 	  (gnc:exchange-if-same foreign domestic)
 	   (gnc:make-gnc-monetary
 	    domestic
-	    (gnc:pricedb-convert-balance-latest-price
-             (gnc:book-get-pricedb (gnc:get-current-book))
+	    (gnc-pricedb-convert-balance-latest-price
+             (gnc-pricedb-get-db (gnc-get-current-book))
 	     (gnc:gnc-monetary-amount foreign)
 	     (gnc:gnc-monetary-commodity foreign)
 	     domestic)))
@@ -774,11 +774,11 @@
 	  (gnc:exchange-if-same foreign domestic)
 	   (gnc:make-gnc-monetary
 	    domestic
-	    (gnc:pricedb-convert-balance-nearest-price
-             (gnc:book-get-pricedb (gnc:get-current-book))
+	    (gnc-pricedb-convert-balance-nearest-price
+             (gnc-pricedb-get-db (gnc-get-current-book))
 	     (gnc:gnc-monetary-amount foreign)
 	     (gnc:gnc-monetary-commodity foreign)
-	     domestic (gnc:timepair-canonical-day-time date))))
+	     domestic (timespecCanonicalDayTime date))))
       #f))
 
 ;; Exchange by the nearest price from pricelist. This function takes
@@ -889,7 +889,7 @@
            (foreign
             'format
             (lambda (curr val)
-              (if (gnc:commodity-equiv? domestic curr)
+              (if (gnc-commodity-equiv domestic curr)
                   (balance 'add domestic val)
                   (balance 'add domestic
                            (gnc:gnc-monetary-amount
@@ -917,9 +917,9 @@
 	(foreign
 	 'format 
 	 (lambda (curr val) 
-	   (if (gnc:commodity-equiv? domestic curr)
+	   (if (gnc-commodity-equiv domestic curr)
 	       (balance 'add domestic val)
-	       (if (gnc:commodity-is-currency? curr)
+	       (if (gnc-commodity-is-currency curr)
 		   (balance 'add curr val)
 		   (balance 'add domestic 
 			    (gnc:gnc-monetary-amount 
@@ -932,9 +932,9 @@
 ;; Returns the number of commodities in a commodity-collector.
 ;; (If this were implemented as a record, I would be able to
 ;; just (length ...) the alist, but....)
-(define (gnc:commodity-collector-commodity-count collector)
+(define (gnc-commodity-collector-commodity-count collector)
     (let ((commodities 0))
-	(gnc:commodity-collector-map
+	(gnc-commodity-collector-map
 	    collector
 		(lambda (comm amt)
 		  (set! commodities (+ commodities 1))))
@@ -944,11 +944,11 @@
 (define (gnc:uniform-commodity? amt report-commodity)
   ;; function to see if the commodity-collector amt
   ;; contains any foreign commodities
-  (let ((elts (gnc:commodity-collector-commodity-count amt))
+  (let ((elts (gnc-commodity-collector-commodity-count amt))
 	)
     (or (equal? elts 0)
 	(and (equal? elts 1)
-	     (gnc:commodity-collector-contains-commodity?
+	     (gnc-commodity-collector-contains-commodity?
 	      amt report-commodity)
 	     )
 	)

Modified: gnucash/branches/register-rewrite/src/report/report-system/gnc-report.c
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/gnc-report.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/gnc-report.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -34,7 +34,7 @@
 
 /* Fow now, this is global, like it was in guile.  It _should_ be per-book. */
 static GHashTable *reports = NULL;
-static int report_next_serial_id = 0;
+static gint report_next_serial_id = 0;
 
 static void
 gnc_report_init_table(void)
@@ -67,7 +67,7 @@
     return report;
 }
 
-int gnc_report_add(SCM report)
+gint gnc_report_add(SCM report)
 {
     SCM get_id = scm_c_eval_string("gnc:report-id");
     SCM value;
@@ -133,7 +133,7 @@
 }
 
 gboolean
-gnc_run_report (int report_id, char ** data)
+gnc_run_report (gint report_id, char ** data)
 {
   const gchar *free_data;
   SCM scm_text;
@@ -157,7 +157,7 @@
 gboolean
 gnc_run_report_id_string (const char * id_string, char **data)
 {
-  int report_id;
+  gint report_id;
 
   g_return_val_if_fail (id_string != NULL, FALSE);
   g_return_val_if_fail (data != NULL, FALSE);

Modified: gnucash/branches/register-rewrite/src/report/report-system/gnc-report.h
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/gnc-report.h	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/gnc-report.h	2007-01-05 17:25:28 UTC (rev 15313)
@@ -28,7 +28,7 @@
 #include <glib.h>
 #include <libguile.h>
 
-gboolean gnc_run_report (int report_id, char ** data);
+gboolean gnc_run_report (gint report_id, char ** data);
 gboolean gnc_run_report_id_string (const char * id_string, char **data);
 
 /**
@@ -40,7 +40,7 @@
 
 SCM gnc_report_find(gint id);
 void gnc_report_remove_by_id(gint id);
-int gnc_report_add(SCM report);
+gint gnc_report_add(SCM report);
 
 void gnc_reports_flush_global(void);
 GHashTable *gnc_reports_get_global(void);

Modified: gnucash/branches/register-rewrite/src/report/report-system/gncmod-report-system.c
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/gncmod-report-system.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/gncmod-report-system.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -38,13 +38,7 @@
   return g_strdup("Core components of GnuCash report generation system");
 }
 
-static void
-lmod(char * mn) 
-{
-  char * form = g_strdup_printf("(use-modules %s)\n", mn);
-  scm_c_eval_string(form);
-  g_free(form);
-}
+extern SCM scm_init_sw_report_system_module(void);
 
 int
 libgncmod_report_system_LTX_gnc_module_init(int refcount) {
@@ -56,8 +50,9 @@
   if(!gnc_module_load("gnucash/app-utils", 0)) {
     return FALSE;
   }
+  scm_init_sw_report_system_module();
   
-  lmod("(gnucash report report-system)");
+  scm_c_eval_string("(use-modules (gnucash report report-system))");
 
   /* if this is the first time the module's being loaded, initialize
    * the relative date system */

Deleted: gnucash/branches/register-rewrite/src/report/report-system/gw-report-system-spec.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/gw-report-system-spec.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/gw-report-system-spec.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -1,45 +0,0 @@
-(define-module (g-wrapped gw-report-system-spec))
-
-(debug-set! maxdepth 100000)
-(debug-set! stack    200000)
-
-(use-modules (g-wrap))
-
-(use-modules (g-wrap gw-standard-spec))
-(use-modules (g-wrap gw-wct-spec))
-(use-modules (g-wrap gw-glib-spec))
-
-(use-modules (g-wrapped gw-engine-spec))
-
-(let ((ws (gw:new-wrapset "gw-report-system")))
-
-  (gw:wrapset-depends-on ws "gw-standard")
-  (gw:wrapset-depends-on ws "gw-wct")
-  (gw:wrapset-depends-on ws "gw-glib")
-
-  (gw:wrapset-set-guile-module! ws '(g-wrapped gw-report-system))
-
-  (gw:wrapset-add-cs-declarations!
-   ws
-   (lambda (wrapset client-wrapset)
-     (list
-      "#include <gnc-report.h>\n"
-      )))
-
-  (gw:wrap-function
-   ws
-   'gnc:find-report
-   '<gw:scm>
-   "gnc_report_find"
-   '((<gw:int> id))
-   "Find report by id")
-
-  (gw:wrap-function
-   ws
-   'gnc:report-add
-   '<gw:int>
-   "gnc_report_add"
-   '((<gw:scm> report))
-   "Add report, returns id")
-
-  )

Modified: gnucash/branches/register-rewrite/src/report/report-system/html-acct-table.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/html-acct-table.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/html-acct-table.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -152,12 +152,12 @@
 ;;         the commodity into which to convert any balances containing
 ;;         foreign currencies.  the balance will be converted using
 ;;         the exchange function exchange-fn. the default is the
-;;         currency returned by (gnc:default-report-currency).  [CAS:
+;;         currency returned by (gnc-default-report-currency).  [CAS:
 ;;         what if I don't want the report to have a
 ;;         "report-commodity"?  Say e.g. I want to show each account
 ;;         balance in its native commodity?  I can see the benefit of
 ;;         individual reports that have a report-commodity using
-;;         gnc:default-report-currency to set the default value for a
+;;         gnc-default-report-currency to set the default value for a
 ;;         report-commodity option.  But, with the default sucked in
 ;;         here, in what is supposed to be a more general api, means
 ;;         reports can't specify NO report-commodity. ]
@@ -268,17 +268,17 @@
 ;;     account-guid: guid
 ;; 
 ;;         the guid of the account in the current row, as returned by
-;;         gnc:account-get-guid.
+;;         gncAccountGetGUID.
 ;; 
 ;;     account-desc: string?
 ;; 
 ;;         the account description of the account in the current row,
-;;         as returned by gnc:account-get-description.
+;;         as returned by xaccAccountGetDescription.
 ;; 
 ;;     account-notes: string?
 ;; 
 ;;         the account notes of the account in the current row, as
-;;         returned by gnc:account-get-notes.
+;;         returned by xaccAccountGetNotes.
 ;; 
 ;;     account-path: string
 ;; 
@@ -295,7 +295,7 @@
 ;;     account-code: string
 ;; 
 ;;         the account of the account in the current row, as returned
-;;         by gnc:account-get-code.
+;;         by xaccAccountGetCode.
 ;; 
 ;;     account-anchor: text(maybe?)
 ;; 
@@ -406,13 +406,7 @@
 ;;     account-commodity: commodity
 ;; 
 ;;         returns the default commodity of the account in the current
-;;         row, as returned by gnc:account-get-commodity. the g-wrap
-;;         documentation string reads: "Get the commodity in which the
-;;         account is denominated." note: afaik, gnucash accounts can
-;;         only contain one commodity; but it's plausible that future
-;;         releases may permit mixed-commodity accounts, so it's
-;;         probably safest not to assume that an account contains only
-;;         its default commodity.
+;;         row, as returned by xaccAccountGetCommodity. 
 ;; 
 ;;     account-type: account_type
 ;; 
@@ -551,14 +545,14 @@
 
 ;; some useful predicates to export
 (define (gnc:account-code-less-p a b)
-  (string<? (gnc:account-get-code a)
-	    (gnc:account-get-code b)))
+  (string<? (xaccAccountGetCode a)
+	    (xaccAccountGetCode b)))
 (define (gnc:account-name-less-p a b)
-  (string<? (gnc:account-get-name a)
-	    (gnc:account-get-name b)))
+  (string<? (xaccAccountGetName a)
+	    (xaccAccountGetName b)))
 (define (gnc:account-path-less-p a b)
-  (string<? (gnc:account-get-full-name a)
-	    (gnc:account-get-full-name b)))
+  (string<? (gnc-account-get-full-name a)
+	    (gnc-account-get-full-name b)))
 
 (define (gnc:html-acct-table-add-accounts! acct-table accounts)
   ;; 
@@ -599,7 +593,7 @@
 	 (end-date (or (get-val env 'end-date)
 		       (cons 'absolute (cons (current-time) 0))))
 	 (report-commodity (or (get-val env 'report-commodity)
-			       (gnc:default-report-currency)))
+			       (gnc-default-report-currency)))
          ;; BUG: other code expects a real function here, maybe
          ;; someone was thinking price-source?
 	 (exchange-fn (or (get-val env 'exchange-fn)
@@ -631,7 +625,7 @@
 				 )
 				))
 	 ;; local variables
-	 (toplvl-accts (gnc:group-get-account-list (gnc:get-current-group)))
+	 (toplvl-accts (xaccGroupGetAccountListSorted (gnc-get-current-group)))
 	 (acct-depth-reached 0)
 	 (logi-depth-reached (if depth-limit (- depth-limit 1) 0))
 	 (disp-depth-reached 0)
@@ -696,14 +690,14 @@
 	(let ((this-collector
 	       (my-get-balance-nosub account start-date end-date)))
 	  (for-each
-	   (lambda (x) (if x (gnc:commodity-collector-merge this-collector x)))
+	   (lambda (x) (if x (gnc-commodity-collector-merge this-collector x)))
 	   (gnc:group-map-all-accounts
 	    (lambda (a)
 	      ;; Important: Calculate the balance if and only if the
 	      ;; account a is shown, i.e. (use-acct? a) == #t.
 	      (and (use-acct? a)
 		   (my-get-balance-nosub a start-date end-date)))
-	    (gnc:account-get-children account)))
+	    (xaccAccountGetChildren account)))
 	  this-collector))
 
       
@@ -718,23 +712,23 @@
 	   (let* ((subaccts (gnc:account-get-immediate-subaccounts acct))
 		  ;; assign output parameters
 		  (account acct)
-		  (account-name (gnc:account-get-name acct))
-		  (account-code (gnc:account-get-code acct))
-		  (account-path (gnc:account-get-full-name acct))
+		  (account-name (xaccAccountGetName acct))
+		  (account-code (xaccAccountGetCode acct))
+		  (account-path (gnc-account-get-full-name acct))
 		  (account-anchor (gnc:html-account-anchor acct))
-		  (account-parent (gnc:account-get-parent-account acct))
+		  (account-parent (xaccAccountGetParentAccount acct))
 		  (account-children subaccts)
 		  (account-depth acct-depth)
 		  (logical-depth logi-depth)
-		  (account-commodity (gnc:account-get-commodity acct))
-		  (account-type (gnc:account-get-type acct))
-		  ;; N.B.: gnc:account-get-type-string really should be
+		  (account-commodity (xaccAccountGetCommodity acct))
+		  (account-type (xaccAccountGetType acct))
+		  ;; N.B.: xaccAccountGetTypeStr really should be
 		  ;; called gnc:account-type-get-string
-		  (account-type-string (gnc:account-get-type-string
-					(gnc:account-get-type acct)))
-		  (account-guid (gnc:account-get-guid acct))
-		  (account-description (gnc:account-get-description acct))
-		  (account-notes (gnc:account-get-notes acct))
+		  (account-type-string (xaccAccountGetTypeStr
+					(xaccAccountGetType acct)))
+		  (account-guid (gncAccountGetGUID acct))
+		  (account-description (xaccAccountGetDescription acct))
+		  (account-notes (xaccAccountGetNotes acct))
                   ;; These next two are commodity-collectors.
 		  (account-bal (my-get-balance-nosub
 				acct start-date end-date))
@@ -788,7 +782,7 @@
 	     (or (not (use-acct? acct))
 		 ;; ok, so we'll consider parent accounts with zero
 		 ;; recursive-bal to be zero balance leaf accounts
-		 (and (gnc:commodity-collector-allzero? recursive-bal)
+		 (and (gnc-commodity-collector-allzero? recursive-bal)
 		      (equal? zero-mode 'omit-leaf-acct))
 		 (begin
 		   (set! row-env
@@ -817,7 +811,7 @@
 	     (or (not (use-acct? acct))
 		 (not subtotal-mode)
 		 ;; ditto that remark concerning zero recursive-bal...
-		 (and (gnc:commodity-collector-allzero? recursive-bal)
+		 (and (gnc-commodity-collector-allzero? recursive-bal)
 		      (equal? zero-mode 'omit-leaf-acct))
 		 ;; ignore use-acct for subtotals...?
 		 ;; (not (use-acct? acct))
@@ -1058,7 +1052,7 @@
 	(gnc:html-table-append-row/markup! html-table row-markup row)
 	(gnc:html-table-append-row! html-table row))))
 
-(define (gnc:commodity-table amount report-commodity exchange-fn)
+(define (gnc-commodity-table amount report-commodity exchange-fn)
   ;; this creates a small two-column table listing each commodity
   ;; balance and its respective report balance.  note that this
   ;; shows report-commodity amounts twice: first as a commodity
@@ -1067,7 +1061,7 @@
   ;; readable.
   (let* ((table (gnc:make-html-table))
 	 )
-    (gnc:commodity-collector-map
+    (gnc-commodity-collector-map
      amount
      (lambda (curr val)
        (let ((bal (gnc:make-gnc-monetary curr val)))
@@ -1175,14 +1169,14 @@
 			       (or (if (equal? mode #t) 'show-balance mode)
 				   'show-balance)
 			       ))
-		  (reverse-balance (gnc:account-reverse-balance? acct))
+		  (reverse-balance (gnc-reverse-balance acct))
 		  (native-comm?
 		   (lambda (amt)
 		     (gnc:uniform-commodity? amt report-commodity)))
                   ;; amount is either a <gnc:monetary> or #f
 		  (amount (and comm-amt
 			       (if (and (equal? zero-mode 'omit-balance)
-                                        (gnc:commodity-collector-allzero?
+                                        (gnc-commodity-collector-allzero?
                                          comm-amt)
                                         )
 				   #f
@@ -1204,7 +1198,7 @@
                                                    (equal?
                                                     row-type 'account-row)
                                                    )
-                                              gnc:commodity-table
+                                              gnc-commodity-table
                                               gnc:sum-collector-commodity
                                               )
                                           amt
@@ -1216,7 +1210,7 @@
 ; 						  (equal?
 ; 						   row-type 'account-row)
 ; 						  )
-; 					     (gnc:commodity-table
+; 					     (gnc-commodity-table
 ; 					      amt
 ; 					      report-commodity
 ; 					      exchange-fn)

Modified: gnucash/branches/register-rewrite/src/report/report-system/html-barchart.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/html-barchart.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/html-barchart.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -273,7 +273,7 @@
                (let ((n (read)))
                  (if (number? n) n 0.0)))))
           ((gnc:gnc-numeric? elt)
-           (gnc:numeric-to-double elt))
+           (gnc-numeric-to-double elt))
           (#t 
            0.0)))
   

Modified: gnucash/branches/register-rewrite/src/report/report-system/html-piechart.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/html-piechart.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/html-piechart.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -143,7 +143,7 @@
                   (let ((n (read)))
                     (if (number? n) (abs n) 0.0)))))
              ((gnc:gnc-numeric? elt)
-              (abs (gnc:numeric-to-double elt)))
+              (abs (gnc-numeric-to-double elt)))
              (#t 
               0.0)))
      nlist))

Modified: gnucash/branches/register-rewrite/src/report/report-system/html-scatter.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/html-scatter.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/html-scatter.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -134,7 +134,7 @@
                (let ((n (read)))
                  (if (number? n) n 0.0)))))
           ((gnc:gnc-numeric? elt)
-           (gnc:numeric-to-double elt))
+           (gnc-numeric-to-double elt))
           (#t 
            0.0)))
   

Modified: gnucash/branches/register-rewrite/src/report/report-system/html-style-info.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/html-style-info.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/html-style-info.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -281,12 +281,12 @@
   datum)
 
 (define (gnc:default-html-gnc-numeric-renderer datum params)
-  (gnc:amount->string datum (gnc:default-print-info #f)))
+  (xaccPrintAmount datum (gnc-default-print-info #f)))
 
 (define (gnc:default-html-gnc-monetary-renderer datum params)
-  (let* ((result (gnc:amount->string 
+  (let* ((result (xaccPrintAmount
 		  (gnc:gnc-monetary-amount datum) 
-		  (gnc:commodity-print-info 
+		  (gnc-commodity-print-info
 		   (gnc:gnc-monetary-commodity datum) #t)))
 	 (ind (string-index result (integer->char 164))))
     (if ind
@@ -295,9 +295,9 @@
 	result)))
 
 (define (gnc:default-html-number-renderer datum params)  
-  (gnc:amount->string
-   (gnc:double-to-gnc-numeric datum 100 GNC-RND-ROUND)
-   (gnc:default-print-info #f)))
+  (xaccPrintAmount
+   (double-to-gnc-numeric datum 100 GNC-RND-ROUND)
+   (gnc-default-print-info #f)))
 
 
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

Modified: gnucash/branches/register-rewrite/src/report/report-system/html-style-sheet.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/html-style-sheet.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/html-style-sheet.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -126,7 +126,7 @@
   (record-accessor <html-style-sheet> 'style))
 
 (define gnc:current-saved-stylesheets
-  (gnc:build-dotgnucash-path "stylesheets-2.0"))
+  (gnc-build-dotgnucash-path "stylesheets-2.0"))
 
 (define (gnc:save-style-sheet-options) 
   (let ((port (false-if-exception

Modified: gnucash/branches/register-rewrite/src/report/report-system/html-utilities.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/html-utilities.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/html-utilities.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -30,26 +30,26 @@
       (list)))
 
 (define (gnc:register-guid type guid)
-  (gnc:html-build-url gnc:url-type-register (string-append type guid) #f))
+  (gnc-build-url URL-TYPE-REGISTER (string-append type guid) ""))
 
 (define (gnc:account-anchor-text acct)
-  (gnc:register-guid "acct-guid=" (gnc:account-get-guid acct)))
+  (gnc:register-guid "acct-guid=" (gncAccountGetGUID acct)))
 
 (define (gnc:split-anchor-text split)
-  (gnc:register-guid "split-guid=" (gnc:split-get-guid split)))
+  (gnc:register-guid "split-guid=" (gncSplitGetGUID split)))
 
 (define (gnc:transaction-anchor-text trans)
-  (gnc:register-guid "trans-guid=" (gnc:transaction-get-guid trans)))
+  (gnc:register-guid "trans-guid=" (gncTransGetGUID trans)))
 
 (define (gnc:report-anchor-text report-id)
-  (gnc:html-build-url gnc:url-type-report
+  (gnc-build-url URL-TYPE-REPORT
 		      (string-append "id=" (number->string report-id))
-		      #f))
+		      ""))
 
 (define (gnc:price-anchor-text price)
-  (gnc:html-build-url gnc:url-type-price
-		      (string-append "price-guid=" (gnc:price-get-guid price))
-		      #f))
+  (gnc-build-url URL-TYPE-PRICE
+		      (string-append "price-guid=" (gncPriceGetGUID price))
+		      ""))
 
 ;; Make a new report and return the anchor to it. The new report of
 ;; type 'reportname' will have the option values copied from
@@ -81,11 +81,11 @@
   (gnc:make-html-text (if acct
                           (gnc:html-markup-anchor
                            (gnc:account-anchor-text acct)
-                           (gnc:account-get-name acct))
+                           (xaccAccountGetName acct))
                           "")))
 
 (define (gnc:html-split-anchor split text)
-  (gnc:make-html-text (if (gnc:split-get-account split)
+  (gnc:make-html-text (if (xaccSplitGetAccount split)
                           (gnc:html-markup-anchor
                            (gnc:split-anchor-text split)
                            text)
@@ -102,7 +102,7 @@
                            (gnc:price-anchor-text price)
 			   (if value
 			       value
-			       (gnc:price-get-value price)))
+			       (gnc-price-get-value price)))
                           value)))
 
 (define (gnc:assign-colors num-colors)
@@ -266,13 +266,13 @@
     (if (and (not is-stock-account?)
 	     ;; FIXME: need to check whether we really have only one
 	     ;; foreign currency if is-stock-account==#t.
-	     (gnc:commodity-equiv? my-commodity report-commodity))
+	     (gnc-commodity-equiv my-commodity report-commodity))
 	;; usual case: the account balance in terms of report
 	;; commodity
 	(commodity-row-helper! 
 	 my-name #f
 	 (if balance 
-	     (gnc:commodity-collector-assoc 
+	     (gnc-commodity-collector-assoc
 	      balance report-commodity reverse-balance?)
 	     #f)
 	 main-row-style)
@@ -281,7 +281,7 @@
 	;; (loop below). Is also used if is-stock-account? is true.
 	(let ((my-balance 
 	       (if balance 
-		   (gnc:commodity-collector-assoc 
+		   (gnc-commodity-collector-assoc
 		    balance my-commodity reverse-balance?) #f)))
 	  (set! already-printed my-commodity)
 	  (commodity-row-helper! 
@@ -294,12 +294,12 @@
     ;; balance and its corresponding value in the
     ;; report-currency. One row for each non-report-currency. 
     (if (and balance (not is-stock-account?))
-	(gnc:commodity-collector-map
+	(gnc-commodity-collector-map
 	 balance 
 	 (lambda (curr val)
-	   (if (or (gnc:commodity-equiv? curr report-commodity)
+	   (if (or (gnc-commodity-equiv curr report-commodity)
 		   (and already-printed
-			(gnc:commodity-equiv? curr already-printed)))
+			(gnc-commodity-equiv curr already-printed)))
 	       '()
 	       (let ((bal 
 		      (if reverse-balance?
@@ -428,8 +428,8 @@
   (let ((table (gnc:make-html-table))
 	(work-to-do 0)
 	(work-done 0)
-	(topl-accounts (gnc:group-get-account-list 
-			(gnc:get-current-group))))
+	(topl-accounts (xaccGroupGetAccountListSorted
+			(gnc-get-current-group))))
 
     ;; The following functions are defined inside build-acct-table
     ;; to avoid passing tons of arguments which are constant anyway
@@ -456,7 +456,7 @@
       (let ((this-collector (my-get-balance-nosub account)))
 	(for-each 
 	 (lambda (x) (if x 
-			 (gnc:commodity-collector-merge 
+			 (gnc-commodity-collector-merge
 			  this-collector x )))
 	 (gnc:group-map-all-accounts
 	  (lambda (a)
@@ -464,7 +464,7 @@
 	    ;; account a is shown, i.e. (use-acct? a) == #t.
 	    (and (use-acct? a)
 		 (my-get-balance-nosub a)))
-	  (gnc:account-get-children account)))
+	  (xaccAccountGetChildren account)))
 	this-collector))
 
     ;; Use this account in the account hierarchy? Check against the
@@ -474,7 +474,7 @@
     (define (use-acct? a)
       (or (member a accounts)
 	  (and show-subaccts? 
-	       (let ((parent (gnc:account-get-parent-account a)))
+	       (let ((parent (xaccAccountGetParentAccount a)))
 		 (and parent
 		      (use-acct? parent))))))
 
@@ -482,7 +482,7 @@
     ;; preference.
     (define (show-acct? a)
       (and (or show-zero-entries?
-	       (not (gnc:commodity-collector-allzero? 
+	       (not (gnc-commodity-collector-allzero?
 		     (my-get-balance a))))
 	   (use-acct? a)))
 
@@ -491,8 +491,8 @@
     (define (sort-fn accts)
       (sort accts
 	    (lambda (a b) 
-	      (string<? (gnc:account-get-code a)
-			(gnc:account-get-code b)))))
+	      (string<? (xaccAccountGetCode a)
+			(xaccAccountGetCode b)))))
 
     ;; Remove the last appended row iff *all* its fields are empty
     ;; (==#f) or have an html-table-cell which in turn is empty
@@ -537,9 +537,9 @@
       (if show-other-curr?
 	  (add-commodity-rows! current-depth 
 			       (gnc:html-account-anchor acct)
-			       (gnc:account-get-commodity acct) 
+			       (xaccAccountGetCommodity acct)
 			       (my-get-balance acct)
-			       (gnc:account-reverse-balance? acct)
+			       (gnc-reverse-balance acct)
 			       (gnc:account-has-shares? acct)
 			       row-style row-style
 			       #f #f)
@@ -548,7 +548,7 @@
 	   (gnc:html-account-anchor acct)
 	   (gnc:sum-collector-commodity (my-get-balance acct) 
 					report-commodity exchange-fn)
-	   (gnc:account-reverse-balance? acct)
+	   (gnc-reverse-balance acct)
 	   row-style
 	       #f #f))))
   
@@ -627,9 +627,9 @@
 	       ;; includes the appropriate subaccounts.)
 	       (let ((subbalance (gnc:accounts-get-balance-helper 
 				  subaccounts my-get-balance 
-				  gnc:account-reverse-balance?)))
+				  gnc-reverse-balance)))
 		 (if thisbalance 
-		     (gnc:commodity-collector-merge subbalance thisbalance))
+		     (gnc-commodity-collector-merge subbalance thisbalance))
 		 subbalance)
 	       heading-style
 	       #t #f)))))
@@ -662,7 +662,7 @@
 			       subaccts
 			       (gnc:accounts-get-balance-helper 
 				(list acct) my-get-balance-nosub 
-				gnc:account-reverse-balance?)
+				gnc-reverse-balance)
 			       show-parent-total?))))
 	   (sort-fn accnts)))))
 
@@ -751,18 +751,18 @@
 		 ((exchanged 
 		   (exchange-fn 
 		    (gnc:make-gnc-monetary commodity 
-					   (gnc:numeric-create 1000 1))
+					   (gnc-numeric-create 1000 1))
 		    common-commodity)))
 	       (gnc:html-table-append-row! 
 		table
 		(list 
 		 (gnc:make-gnc-monetary commodity 
-					(gnc:numeric-create 1 1))
+					(gnc-numeric-create 1 1))
 		 (gnc:make-gnc-monetary
 		  common-commodity
-		  (gnc:numeric-div
+		  (gnc-numeric-div
 		   (gnc:gnc-monetary-amount exchanged)
-		   (gnc:numeric-create 1000 1)
+		   (gnc-numeric-create 1000 1)
 		   GNC-DENOM-AUTO 
 		   (logior (GNC-DENOM-SIGFIGS 6) 
 			   GNC-RND-ROUND)))))))
@@ -794,9 +794,9 @@
     (gnc:html-text-append!
      p
      (gnc:html-markup-h2 (string-append
-			  report-title-string
+			  (_ report-title-string)
 			  ":"))
-     (gnc:html-markup-h2 (_ ""))
+     (gnc:html-markup-h2 "")
      (gnc:html-markup-p
       (_ "This report requires you to specify certain report options.")))
     (if report-id
@@ -804,10 +804,10 @@
 	 p
 	 (gnc:html-markup-p
 	  (gnc:html-markup-anchor
-	   (gnc:html-build-url gnc:url-type-options
+	   (gnc-build-url URL-TYPE-OPTIONS
 			       (string-append "report-id="
 					      (sprintf #f "%a" report-id))
-			       #f)
+			       "")
 	   (_ "Edit report options")))))
     p))
 
@@ -818,7 +818,7 @@
     (gnc:html-text-append! 
      p 
      (gnc:html-markup-h2 (string-append 
-			  report-title-string
+			  (_ report-title-string)
 			  ":"))
      (gnc:html-markup-h2 (_ "No accounts selected"))
      (gnc:html-markup-p
@@ -828,10 +828,10 @@
 	 p 
 	 (gnc:html-markup-p
 	  (gnc:html-markup-anchor
-	   (gnc:html-build-url gnc:url-type-options
+	   (gnc-build-url URL-TYPE-OPTIONS
 			       (string-append "report-id="
 					      (sprintf #f "%a" report-id))
-			       #f)
+			       "")
 	   (_ "Edit report options")))))
     p))
 
@@ -850,9 +850,9 @@
 	 p 
 	 (gnc:html-markup-p
 	  (gnc:html-markup-anchor
-	   (gnc:html-build-url gnc:url-type-options
+	   (gnc-build-url URL-TYPE-OPTIONS
 			       (string-append "report-id="
 					      (sprintf #f "%a" report-id))
-			       #f)
+			       "")
 	   (_ "Edit report options")))))
     p))

Modified: gnucash/branches/register-rewrite/src/report/report-system/options-utilities.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/options-utilities.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/options-utilities.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -146,7 +146,7 @@
     pagename name-report-currency
     sort-tag 
     (N_ "Select the currency to display the values of this report in.")
-    (gnc:default-report-currency))))
+    (gnc-default-report-currency))))
 
 ;; These are common options for the selection of the report's
 ;; currency/commodity.

Copied: gnucash/branches/register-rewrite/src/report/report-system/report-system.i (from rev 15058, gnucash/trunk/src/report/report-system/report-system.i)

Modified: gnucash/branches/register-rewrite/src/report/report-system/report-system.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/report-system.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/report-system.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -13,8 +13,6 @@
 (use-modules (srfi srfi-19))
 (use-modules (gnucash gnc-module))
 
-(use-modules (g-wrap gw-glib))
-
 (require 'hash-table)
 
 (gnc:module-load "gnucash/engine" 0)
@@ -25,7 +23,7 @@
 (export gnc:get-match-commodity-splits)
 (export gnc:get-match-commodity-splits-sorted)
 (export gnc:get-all-commodity-splits )
-(export gnc:commodity-numeric->string)
+(export gnc-commodity-numeric->string)
 (export gnc:exchange-by-euro-numeric)
 (export gnc:get-commodity-totalavg-prices)
 (export gnc:get-commoditylist-totalavg-prices)
@@ -48,7 +46,7 @@
 (export gnc:case-exchange-time-fn)
 (export gnc:sum-collector-commodity)
 (export gnc:sum-collector-stocks)
-(export gnc:commodity-collector-contains-commodity?)
+(export gnc-commodity-collector-contains-commodity?)
 
 ;; options-utilities.scm 
 
@@ -441,7 +439,7 @@
 (export gnc:html-table-add-labeled-amount-line!)
 (export gnc:html-table-add-account-balances)
 (export gnc:second-html-build-acct-table)
-(export gnc:commodity-table)
+(export gnc-commodity-table)
 (export gnc:uniform-commodity?)
 
 ;; html-table.scm 
@@ -554,7 +552,7 @@
 
 (export list-ref-safe)
 (export list-set-safe!)
-(export gnc:commodity-value->string)
+(export gnc-commodity-value->string)
 (export gnc:monetary->string)
 (export gnc:account-has-shares?)
 (export gnc:account-is-stock?)
@@ -573,7 +571,7 @@
 (export gnc:make-value-collector)
 (export gnc:make-numeric-collector)
 (export gnc:make-commodity-collector)
-(export gnc:commodity-collector-commodity-count)
+(export gnc-commodity-collector-commodity-count)
 (export gnc:account-get-balance-at-date)
 (export gnc:account-get-comm-balance-at-date)
 (export gnc:accounts-get-balance-helper)
@@ -595,7 +593,7 @@
 (export gnc:report-percent-done)
 (export gnc:report-finished)
 (export gnc:accounts-count-splits)
-(export gnc:commodity-collector-allzero?)
+(export gnc-commodity-collector-allzero?)
 (export gnc:account-get-trans-type-balance-interval)
 (export gnc:account-get-pos-trans-total-interval)
 (export gnc:double-col)
@@ -616,4 +614,4 @@
 (load-from-path "report-utilities.scm")
 (load-from-path "report.scm")
 
-(gnc:hook-add-dangler gnc:*save-options-hook* gnc:save-style-sheet-options)
+(gnc-hook-add-scm-dangler HOOK-SAVE-OPTIONS gnc:save-style-sheet-options)

Modified: gnucash/branches/register-rewrite/src/report/report-system/report-utilities.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/report-utilities.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/report-utilities.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -38,54 +38,44 @@
 
 ;; pair is a list of one gnc:commodity and one gnc:numeric
 ;; value. Deprecated -- use <gnc-monetary> instead.
-(define (gnc:commodity-value->string pair)
-  (gnc:amount->string 
-   (cadr pair) (gnc:commodity-print-info (car pair) #t)))
+(define (gnc-commodity-value->string pair)
+  (xaccPrintAmount
+   (cadr pair) (gnc-commodity-print-info (car pair) #t)))
 
 ;; Just for convenience. But in reports you should rather stick to the
 ;; style-info mechanism and simple plug the <gnc-monetary> into the
 ;; html-renderer.
 (define (gnc:monetary->string value)
-  (gnc:amount->string 
+  (xaccPrintAmount
    (gnc:gnc-monetary-amount value) 
-   (gnc:commodity-print-info (gnc:gnc-monetary-commodity value) #t)))
+   (gnc-commodity-print-info (gnc:gnc-monetary-commodity value) #t)))
 
 ;; True if the account is of type currency, stock, or mutual-fund
 (define (gnc:account-has-shares? account)
-  ;; FYI: The val->sym function used to be called 
-  ;; gw:enum-GNCAccountType-val->sym
-  (let ((type (gw:enum-<gnc:AccountType>-val->sym
-               (gnc:account-get-type account)
-               #f)))
-    (member type '(stock mutual-fund currency))))
+  (let ((type (xaccAccountGetType account)))
+    (member type (list ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY))))
 
 ;; True if the account is of type stock or mutual-fund
 (define (gnc:account-is-stock? account)
-  (let ((type (gw:enum-<gnc:AccountType>-val->sym
-               (gnc:account-get-type account)
-               #f)))
-    (member type '(stock mutual-fund))))
+  (let ((type (xaccAccountGetType account)))
+    (member type (list ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL))))
 
 ;; True if the account is of type income or expense
 
 (define (gnc:account-is-inc-exp? account)
-  (let ((type (gw:enum-<gnc:AccountType>-val->sym
-               (gnc:account-get-type account)
-               #f)))
-    (member type '(income expense))))
+  (let ((type (xaccAccountGetType account)))
+    (member type (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE))))
 
 ;; Returns only those accounts out of the list <accounts> which have
 ;; one of the type identifiers in typelist.
 (define (gnc:filter-accountlist-type typelist accounts)
   (filter (lambda (a) 
-	    (member (gw:enum-<gnc:AccountType>-val->sym
-		     (gnc:account-get-type a) #f)
-		    typelist) )
+	    (member (xaccAccountGetType a) typelist))
 	  accounts))
 
 ;; Decompose a given list of accounts 'accounts' into an alist
 ;; according to their types. Each element of alist is a list, whose
-;; first element is the type-symbol, e.g. 'assets, and the rest (cdr)
+;; first element is the type, e.g. ACCT-TYPE-ASSET, and the rest (cdr)
 ;; of the element is the list of accounts which belong to that
 ;; category.
 (define (gnc:decompose-accountlist accounts)
@@ -93,37 +83,42 @@
 		    (car x)
 		    (gnc:filter-accountlist-type (cdr x) accounts)))
        (list
-	(cons 'asset
-	      '(asset bank cash checking savings money-market receivable
-		      stock mutual-fund currency))
-	(cons 'liability '(liability payable credit credit-line))
-	(cons 'equity '(equity))
-	(cons 'income '(income))
-	(cons 'expense '(expense)))))
+	(cons ACCT-TYPE-ASSET
+	      (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH
+                    ACCT-TYPE-CHECKING ACCT-TYPE-SAVINGS
+                    ACCT-TYPE-MONEYMRKT ACCT-TYPE-RECEIVABLE
+                    ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
+                    ACCT-TYPE-CURRENCY))
+	(cons ACCT-TYPE-LIABILITY
+              (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
+                    ACCT-TYPE-CREDITLINE))
+	(cons ACCT-TYPE-EQUITY (list ACCT-TYPE-EQUITY))
+	(cons ACCT-TYPE-INCOME (list ACCT-TYPE-INCOME))
+	(cons ACCT-TYPE-EXPENSE (list ACCT-TYPE-EXPENSE)))))
 
 ;; Returns the name of the account type as a string, and in its plural
-;; form (as opposed to gnc:account-get-type-string which gives the
+;; form (as opposed to xaccAccountGetTypeStr which gives the
 ;; singular form of the word).
 (define (gnc:account-get-type-string-plural type)
   (assoc-ref
    (list 
-    (cons 'bank (_ "Bank"))
-    (cons 'cash (_ "Cash"))
-    (cons 'credit (_ "Credits"))
-    (cons 'asset (_ "Assets"))
-    (cons 'liability (_ "Liabilities"))
-    (cons 'stock (_ "Stocks"))
-    (cons 'mutual-fund (_ "Mutual Funds"))
-    (cons 'currency (_ "Currencies"))
-    (cons 'income (_ "Income"))
-    (cons 'expense (_ "Expenses"))
-    (cons 'equity (_ "Equities"))
-    (cons 'checking (_ "Checking"))
-    (cons 'savings (_ "Savings"))
-    (cons 'money-market (_ "Money Market"))
-    (cons 'receivable (_ "Accounts Receivable"))
-    (cons 'payable (_ "Accounts Payable"))
-    (cons 'credit-line (_ "Credit Lines")))
+    (cons ACCT-TYPE-BANK (_ "Bank"))
+    (cons ACCT-TYPE-CASH (_ "Cash"))
+    (cons ACCT-TYPE-CREDIT (_ "Credits"))
+    (cons ACCT-TYPE-ASSET (_ "Assets"))
+    (cons ACCT-TYPE-LIABILITY (_ "Liabilities"))
+    (cons ACCT-TYPE-STOCK (_ "Stocks"))
+    (cons ACCT-TYPE-MUTUAL (_ "Mutual Funds"))
+    (cons ACCT-TYPE-CURRENCY (_ "Currencies"))
+    (cons ACCT-TYPE-INCOME (_ "Income"))
+    (cons ACCT-TYPE-EXPENSE (_ "Expenses"))
+    (cons ACCT-TYPE-EQUITY (_ "Equities"))
+    (cons ACCT-TYPE-CHECKING (_ "Checking"))
+    (cons ACCT-TYPE-SAVINGS (_ "Savings"))
+    (cons ACCT-TYPE-MONEYMRKT (_ "Money Market"))
+    (cons ACCT-TYPE-RECEIVABLE (_ "Accounts Receivable"))
+    (cons ACCT-TYPE-PAYABLE (_ "Accounts Payable"))
+    (cons ACCT-TYPE-CREDITLINE (_ "Credit Lines")))
    type))
 
 ;; Get the list of all different commodities that are used within the
@@ -131,10 +126,10 @@
 (define (gnc:accounts-get-commodities accounts exclude-commodity)
   (delete exclude-commodity
 	  (delete-duplicates
-	   (sort (map gnc:account-get-commodity accounts) 
+	   (sort (map xaccAccountGetCommodity accounts)
 		 (lambda (a b) 
-		   (string<? (or (gnc:commodity-get-mnemonic a) "")
-			     (or (gnc:commodity-get-mnemonic b) "")))))))
+		   (string<? (or (gnc-commodity-get-mnemonic a) "")
+			     (or (gnc-commodity-get-mnemonic b) "")))))))
 
 
 ;; Returns the depth of the current account hierarchy, that is, the
@@ -152,10 +147,10 @@
 			(+ 1 (accounts-get-children-depth children)))))
 		accounts)))
   (accounts-get-children-depth 
-   (gnc:group-get-account-list (gnc:get-current-group))))
+   (xaccGroupGetAccountListSorted (gnc-get-current-group))))
 
 (define (gnc:split-get-corr-account-full-name split)
-  (gnc:split-get-corr-account-full-name-internal split))
+  (xaccSplitGetCorrAccountFullName split))
 
 
 ;; get children that are the direct descendant of this acct
@@ -167,12 +162,12 @@
            (with-output-to-string (lambda () (write a2)))))
       (string=? a1-str a2-str)))
   
-  (let* ((group (gnc:account-get-children acct))
-         (children (gnc:group-get-subaccounts group))
+  (let* ((group (xaccAccountGetChildren acct))
+         (children (xaccGroupGetSubAccountsSorted group))
          (retval '()))
     (for-each 
      (lambda (child)
-       (if (acctptr-eq? acct (gnc:account-get-parent-account child))
+       (if (acctptr-eq? acct (xaccAccountGetParentAccount child))
            (begin 
              (set! retval (cons child retval)))))
      children)
@@ -180,15 +175,15 @@
 
 ;; get all children of this account 
 (define (gnc:account-get-all-subaccounts acct)
-  (let ((group (gnc:account-get-children acct)))
-    (gnc:group-get-subaccounts group)))
+  (let ((group (xaccAccountGetChildren acct)))
+    (xaccGroupGetSubAccountsSorted group)))
 
 ;; Get all children of this list of accounts.
 (define (gnc:acccounts-get-all-subaccounts accountlist)
   (append-map 
    (lambda (a)
-     (gnc:group-get-subaccounts
-      (gnc:account-get-children a)))
+     (xaccGroupGetSubAccountsSorted
+      (xaccAccountGetChildren a)))
    accountlist))
 
 ;;; Here's a statistics collector...  Collects max, min, total, and makes
@@ -308,11 +303,11 @@
 ;; Same as above but with gnc:numeric
 (define (gnc:make-numeric-collector)
   (let ;;; values
-      ((value (gnc:numeric-zero)))
+      ((value (gnc-numeric-zero)))
     (lambda (action amount)  ;;; Dispatch function
       (case action
 	((add) (if (gnc:gnc-numeric? amount) 
-		  (set! value (gnc:numeric-add-fixed amount value))
+		  (set! value (gnc-numeric-add-fixed amount value))
 		  (gnc:warn 
 		   "gnc:numeric-collector called with wrong argument: " amount)))
 	((total) value)
@@ -356,7 +351,7 @@
 ;;   'getpair <commodity> signreverse?: Returns the two-element-list
 ;;       with the <commodity> and its corresponding balance. If
 ;;       <commodity> doesn't exist, the balance will be
-;;       (gnc:numeric-zero). If signreverse? is true, the result's
+;;       (gnc-numeric-zero). If signreverse? is true, the result's
 ;;       sign will be reversed.
 ;;   (internal) 'list #f #f: get the association list of 
 ;;       commodity->numeric-collector
@@ -394,7 +389,7 @@
       (cond ((null? clist) '())
 	    (else (add-commodity-value 
 		   (caar clist) 
-		   (gnc:numeric-neg
+		   (gnc-numeric-neg
 		    (gnc:numeric-collector-total (cadar clist))))
 		  (minus-commodity-clist (cdr clist)))))
 
@@ -413,9 +408,9 @@
       (let ((pair (assoc c commoditylist)))
 	(cons c (cons 
 	      (if (not pair)
-		  (gnc:numeric-zero)
+		  (gnc-numeric-zero)
 		  (if sign?
-		      (gnc:numeric-neg 
+		      (gnc-numeric-neg
 		       (gnc:numeric-collector-total (cadr pair)))
 		      (gnc:numeric-collector-total (cadr pair))))
 	      '()))))
@@ -427,9 +422,9 @@
       (let ((pair (assoc c commoditylist)))
 	(gnc:make-gnc-monetary
 	 c (if (not pair)
-	       (gnc:numeric-zero)
+	       (gnc-numeric-zero)
 	       (if sign?
-		   (gnc:numeric-neg 
+		   (gnc-numeric-neg
 		    (gnc:numeric-collector-total (cadr pair)))
 		   (gnc:numeric-collector-total (cadr pair)))))))
     
@@ -438,9 +433,9 @@
       (case action
 	((add) (add-commodity-value commodity amount))
 	((merge) (add-commodity-clist 
-		 (gnc:commodity-collector-list commodity)))
+		 (gnc-commodity-collector-list commodity)))
 	((minusmerge) (minus-commodity-clist
-		      (gnc:commodity-collector-list commodity)))
+		      (gnc-commodity-collector-list commodity)))
 	((format) (process-commodity-list commodity commoditylist))
 	((reset) (set! commoditylist '()))
 	((getpair) (getpair commodity amount))
@@ -456,28 +451,28 @@
 ;; CAS: ugh.  Having two usages is even *more* confusing, so let's
 ;; please settle on one or the other.  What's Step 2?  How 'bout
 ;; documenting the new functions?
-(define (gnc:commodity-collector-add collector commodity amount)
+(define (gnc-commodity-collector-add collector commodity amount)
   (collector 'add commodity amount))
-(define (gnc:commodity-collector-merge collector other-collector)
+(define (gnc-commodity-collector-merge collector other-collector)
   (collector 'merge other-collector #f))
-(define (gnc:commodity-collector-minusmerge collector other-collector)
+(define (gnc-commodity-collector-minusmerge collector other-collector)
   (collector 'minusmerge other-collector #f))
-(define (gnc:commodity-collector-map collector function)
+(define (gnc-commodity-collector-map collector function)
   (collector 'format function #f))
-(define (gnc:commodity-collector-assoc collector commodity sign?)
+(define (gnc-commodity-collector-assoc collector commodity sign?)
   (collector 'getmonetary commodity sign?))
-(define (gnc:commodity-collector-assoc-pair collector commodity sign?)
+(define (gnc-commodity-collector-assoc-pair collector commodity sign?)
   (collector 'getpair commodity sign?))
-(define (gnc:commodity-collector-list collector)
+(define (gnc-commodity-collector-list collector)
   (collector 'list #f #f))
 
 ;; Returns zero if all entries in this collector are zero.
-(define (gnc:commodity-collector-allzero? collector)
+(define (gnc-commodity-collector-allzero? collector)
   (let ((result #t))
-    (gnc:commodity-collector-map 
+    (gnc-commodity-collector-map
      collector
      (lambda (commodity amount)
-       (if (not (gnc:numeric-zero-p amount))
+       (if (not (gnc-numeric-zero-p amount))
 	   (set! result #f))))
     result))
 
@@ -488,8 +483,8 @@
 (define (gnc:account-get-balance-at-date account date include-children?)
   (let ((collector (gnc:account-get-comm-balance-at-date
                     account date include-children?)))
-    (cadr (gnc:commodity-collector-assoc-pair 
-	   collector (gnc:account-get-commodity account) #f))))
+    (cadr (gnc-commodity-collector-assoc-pair
+	   collector (xaccAccountGetCommodity account) #f))))
 
 ;; This works similar as above but returns a commodity-collector, 
 ;; thus takes care of children accounts with different currencies.
@@ -501,33 +496,33 @@
   (let ((balance-collector
          (if include-children?
              (gnc:group-get-comm-balance-at-date
-              (gnc:account-get-children account) date)
+              (xaccAccountGetChildren account) date)
              (gnc:make-commodity-collector)))
-	  (query (gnc:malloc-query))
+	  (query (qof-query-create-for-splits))
 	  (splits #f))
       
-      (gnc:query-set-book query (gnc:get-current-book))
-      (gnc:query-add-single-account-match query account 'query-and)
-      (gnc:query-add-date-match-timepair query #f date #t date 'query-and) 
-      (gnc:query-set-sort-order query
-				(list gnc:split-trans gnc:trans-date-posted)
-				(list gnc:query-default-sort)
+      (qof-query-set-book query (gnc-get-current-book))
+      (xaccQueryAddSingleAccountMatch query account QOF-QUERY-AND)
+      (xaccQueryAddDateMatchTS query #f date #t date QOF-QUERY-AND)
+      (qof-query-set-sort-order query
+				(list SPLIT-TRANS TRANS-DATE-POSTED)
+				(list QUERY-DEFAULT-SORT)
 				'())
-      (gnc:query-set-sort-increasing query #t #t #t)
-      (gnc:query-set-max-results query 1)
+      (qof-query-set-sort-increasing query #t #t #t)
+      (qof-query-set-max-results query 1)
       
-      (set! splits (gnc:query-get-splits query))
-      (gnc:free-query query)
+      (set! splits (qof-query-run query))
+      (qof-query-destroy query)
 
       (if (and splits (not (null? splits)))
-	  (gnc:commodity-collector-add balance-collector 
-				       (gnc:account-get-commodity account)
-				       (gnc:split-get-balance (car splits))))
+	  (gnc-commodity-collector-add balance-collector
+				       (xaccAccountGetCommodity account)
+				       (xaccSplitGetBalance (car splits))))
       balance-collector))
 
 ;; Adds all accounts' balances, where the balances are determined with
 ;; the get-balance-fn. The reverse-balance-fn
-;; (e.g. gnc:account-reverse-balance?) should return #t if the
+;; (e.g. gnc-reverse-balance) should return #t if the
 ;; account's balance sign should get reversed. Returns a
 ;; commodity-collector.
 (define (gnc:accounts-get-balance-helper 
@@ -536,8 +531,8 @@
     (for-each 
      (lambda (acct)
        ((if (reverse-balance-fn acct)
-	    gnc:commodity-collector-minusmerge 
-	    gnc:commodity-collector-merge)
+	    gnc-commodity-collector-minusmerge
+	    gnc-commodity-collector-merge)
 	collector (get-balance-fn acct)))
      accounts)
     collector))
@@ -549,7 +544,7 @@
 (define (gnc:accounts-get-comm-total-profit accounts 
 					    get-balance-fn)
   (gnc:accounts-get-balance-helper
-   (gnc:filter-accountlist-type '(income expense) accounts)
+   (gnc:filter-accountlist-type (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE) accounts)
    get-balance-fn
    (lambda(x) #t)))
 
@@ -559,7 +554,7 @@
 (define (gnc:accounts-get-comm-total-income accounts 
 					    get-balance-fn)
   (gnc:accounts-get-balance-helper
-   (gnc:filter-accountlist-type '(income) accounts)
+   (gnc:filter-accountlist-type (list ACCT-TYPE-INCOME) accounts)
    get-balance-fn
    (lambda(x) #t)))
 
@@ -569,7 +564,7 @@
 (define (gnc:accounts-get-comm-total-expense accounts 
                                              get-balance-fn)
   (gnc:accounts-get-balance-helper
-   (gnc:filter-accountlist-type '(expense) accounts)
+   (gnc:filter-accountlist-type (list ACCT-TYPE-EXPENSE) accounts)
    get-balance-fn
    (lambda(x) #t)))
 
@@ -590,7 +585,7 @@
   (let ((this-collector (gnc:make-commodity-collector)))
     (for-each 
      (lambda (x) 
-       (gnc:commodity-collector-merge this-collector x))
+       (gnc-commodity-collector-merge this-collector x))
      (gnc:group-map-all-accounts
       (lambda (account)
 	(gnc:account-get-comm-balance-at-date 
@@ -604,8 +599,8 @@
 (define (gnc:account-get-balance-interval account from to include-children?)
   (let ((collector (gnc:account-get-comm-balance-interval
                     account from to include-children?)))
-    (cadr (gnc:commodity-collector-assoc-pair 
-	   collector (gnc:account-get-commodity account) #f))))
+    (cadr (gnc-commodity-collector-assoc-pair
+	   collector (xaccAccountGetCommodity account) #f))))
 
 ;; the version which returns a commodity-collector
 (define (gnc:account-get-comm-balance-interval 
@@ -615,7 +610,7 @@
   ;; instead of the plain date.
   (let ((this-collector (gnc:account-get-comm-balance-at-date 
 			 account to include-children?)))
-    (gnc:commodity-collector-minusmerge
+    (gnc-commodity-collector-minusmerge
      this-collector
      (gnc:account-get-comm-balance-at-date
       account
@@ -627,7 +622,7 @@
 (define (gnc:group-get-comm-balance-interval group from to)
   (let ((this-collector (gnc:make-commodity-collector)))
     (for-each (lambda (x) 
-		(gnc:commodity-collector-merge this-collector x))
+		(gnc-commodity-collector-merge this-collector x))
 	      (gnc:group-map-all-accounts
 	       (lambda (account)
 		 (gnc:account-get-comm-balance-interval 
@@ -640,7 +635,7 @@
 (define (gnc:accountlist-get-comm-balance-interval accountlist from to)
   (let ((collector (gnc:make-commodity-collector)))
     (for-each (lambda (account)
-                (gnc:commodity-collector-merge 
+                (gnc-commodity-collector-merge
                  collector (gnc:account-get-comm-balance-interval 
                             account from to #f)))
               accountlist)
@@ -649,7 +644,7 @@
 (define (gnc:accountlist-get-comm-balance-at-date accountlist date)
    (let ((collector (gnc:make-commodity-collector)))
     (for-each (lambda (account)
-                (gnc:commodity-collector-merge 
+                (gnc-commodity-collector-merge
                  collector (gnc:account-get-comm-balance-at-date 
                             account date #f)))
               accountlist)
@@ -657,43 +652,43 @@
 
 ;; utility function - ensure that a query matches only non-voids.  Destructive.
 (define (gnc:query-set-match-non-voids-only! query book)
-  (let ((temp-query (gnc:malloc-query)))
-     (gnc:query-set-book temp-query book)
+  (let ((temp-query (qof-query-create-for-splits)))
+     (qof-query-set-book temp-query book)
      
-     (gnc:query-add-cleared-match
+     (xaccQueryAddClearedMatch
 	     temp-query
-	     'cleared-match-voided
-	     'query-and)
+	     CLEARED-VOIDED
+	     QOF-QUERY-AND)
 
-     (set! temp-query (gnc:query-invert temp-query))
+     (set! temp-query (qof-query-invert temp-query))
 
-     (set! query (gnc:query-merge query temp-query 'query-and))))
+     (set! query (qof-query-merge query temp-query QOF-QUERY-AND))))
 
 ;; utility function - ensure that a query matches only voids.  Destructive
 
 (define (gnc:query-set-match-voids-only! query book)
-  (let ((temp-query (gnc:malloc-query)))
-     (gnc:query-set-book temp-query book)
+  (let ((temp-query (qof-query-create-for-splits)))
+     (qof-query-set-book temp-query book)
      
-     (gnc:query-add-cleared-match
+     (xaccQueryAddClearedMatch
 	     temp-query
-	     'cleared-match-voided
-	     'query-and)
+	     CLEARED-VOIDED
+	     QOF-QUERY-AND)
 
-     (set! query (gnc:query-merge query temp-query 'query-and))))
+     (set! query (qof-query-merge query temp-query QOF-QUERY-AND))))
 
 (define (gnc:split-voided? split)
-  (let ((trans (gnc:split-get-parent split)))
-    (gnc:transaction-get-void-status trans)))
+  (let ((trans (xaccSplitGetParent split)))
+    (xaccTransGetVoidStatus trans)))
 
 (define (gnc:report-starting report-name)
-  (gnc:window-show-progress (sprintf #f
+  (gnc-window-show-progress (sprintf #f
 				     (_ "Building '%s' report ...")
 				     (gnc:gettext report-name))
 			    0))
 
 (define (gnc:report-render-starting report-name)
-  (gnc:window-show-progress (sprintf #f
+  (gnc-window-show-progress (sprintf #f
 				     (_ "Rendering '%s' report ...")
 				     (if (string-null? report-name)
 					 (gnc:gettext "Untitled")
@@ -701,15 +696,15 @@
 			    0))
 
 (define (gnc:report-percent-done percent)
-  (gnc:window-show-progress #f percent))
+  (gnc-window-show-progress "" percent))
 
 (define (gnc:report-finished)
-  (gnc:window-show-progress #f -1))
+  (gnc-window-show-progress "" -1))
 
 ;; function to count the total number of splits to be iterated
 (define (gnc:accounts-count-splits accounts)
   (if (not (null? accounts))
-      (+ (length (gnc:account-get-split-list (car accounts)))
+      (+ (length (xaccAccountGetSplitList (car accounts)))
 	 (gnc:accounts-count-splits (cdr accounts)))
       0))
 
@@ -717,38 +712,38 @@
 ;; the type is an alist '((str "match me") (cased #f) (regexp #f))
 (define (gnc:account-get-trans-type-balance-interval
 	 group type start-date-tp end-date-tp)
-  (let* ((query (gnc:malloc-query))
+  (let* ((query (qof-query-create-for-splits))
 	 (splits #f)
 	 (get-val (lambda (alist key)
 		    (let ((lst (assoc-ref alist key)))
 		      (if lst (car lst) lst))))
 	 (matchstr (get-val type 'str))
-	 (case-sens (if (get-val type 'cased) 1 0))
-	 (regexp (if (get-val type 'regexp) 1 0))
+	 (case-sens (if (get-val type 'cased) #t #f))
+	 (regexp (if (get-val type 'regexp) #t #f))
 	 (total (gnc:make-commodity-collector))
 	 )
-    (gnc:query-set-book query (gnc:get-current-book))
-    (gnc:query-set-match-non-voids-only! query (gnc:get-current-book))
-    (gnc:query-add-account-match query group 'guid-match-any 'query-and)
-    (gnc:query-add-date-match-timepair
+    (qof-query-set-book query (gnc-get-current-book))
+    (gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
+    (xaccQueryAddAccountMatch query group QOF-GUID-MATCH-ANY QOF-QUERY-AND)
+    (xaccQueryAddDateMatchTS
      query
      (and start-date-tp #t) start-date-tp
-     (and end-date-tp #t) end-date-tp 'query-and)
-    (gnc:query-add-description-match
-     query matchstr case-sens regexp 'query-and)
+     (and end-date-tp #t) end-date-tp QOF-QUERY-AND)
+    (xaccQueryAddDescriptionMatch
+     query matchstr case-sens regexp QOF-QUERY-AND)
     
-    (set! splits (gnc:query-get-splits query))
+    (set! splits (qof-query-run query))
     (map (lambda (split)
-		(let* ((shares (gnc:split-get-amount split))
-		       (acct-comm (gnc:account-get-commodity
-				   (gnc:split-get-account split)))
+		(let* ((shares (xaccSplitGetAmount split))
+		       (acct-comm (xaccAccountGetCommodity
+				   (xaccSplitGetAccount split)))
 		       )
-		  (gnc:commodity-collector-add total acct-comm shares)
+		  (gnc-commodity-collector-add total acct-comm shares)
 		  )
 		)
 	 splits
 	 )
-    (gnc:free-query query)
+    (qof-query-destroy query)
     total
     )
   )
@@ -757,58 +752,58 @@
 ;; *ignores* any closing entries
 (define (gnc:account-get-pos-trans-total-interval
 	 group type start-date-tp end-date-tp)
-  (let* ((str-query (gnc:malloc-query))
-	 (sign-query (gnc:malloc-query))
+  (let* ((str-query (qof-query-create-for-splits))
+	 (sign-query (qof-query-create-for-splits))
 	 (total-query #f)
          (splits #f)
 	 (get-val (lambda (alist key)
 		    (let ((lst (assoc-ref alist key)))
 		      (if lst (car lst) lst))))
 	 (matchstr (get-val type 'str))
-	 (case-sens (if (get-val type 'cased) 1 0))
-	 (regexp (if (get-val type 'regexp) 1 0))
+	 (case-sens (if (get-val type 'cased) #t #f))
+	 (regexp (if (get-val type 'regexp) #t #f))
 	 (pos? (if (get-val type 'positive) #t #f))
          (total (gnc:make-commodity-collector))
          )
-    (gnc:query-set-book str-query (gnc:get-current-book))
-    (gnc:query-set-book sign-query (gnc:get-current-book))
-    (gnc:query-set-match-non-voids-only! str-query (gnc:get-current-book))
-    (gnc:query-set-match-non-voids-only! sign-query (gnc:get-current-book))
-    (gnc:query-add-account-match str-query group 'guid-match-any 'query-and)
-    (gnc:query-add-account-match sign-query group 'guid-match-any 'query-and)
-    (gnc:query-add-date-match-timepair
+    (qof-query-set-book str-query (gnc-get-current-book))
+    (qof-query-set-book sign-query (gnc-get-current-book))
+    (gnc:query-set-match-non-voids-only! str-query (gnc-get-current-book))
+    (gnc:query-set-match-non-voids-only! sign-query (gnc-get-current-book))
+    (xaccQueryAddAccountMatch str-query group QOF-GUID-MATCH-ANY QOF-QUERY-AND)
+    (xaccQueryAddAccountMatch sign-query group QOF-GUID-MATCH-ANY QOF-QUERY-AND)
+    (xaccQueryAddDateMatchTS
      str-query
      (and start-date-tp #t) start-date-tp
-     (and end-date-tp #t) end-date-tp 'query-and)
-    (gnc:query-add-date-match-timepair
+     (and end-date-tp #t) end-date-tp QOF-QUERY-AND)
+    (xaccQueryAddDateMatchTS
      sign-query
      (and start-date-tp #t) start-date-tp
-     (and end-date-tp #t) end-date-tp 'query-and)
-    (gnc:query-add-description-match
-     str-query matchstr case-sens regexp 'query-and)
+     (and end-date-tp #t) end-date-tp QOF-QUERY-AND)
+    (xaccQueryAddDescriptionMatch
+     str-query matchstr case-sens regexp QOF-QUERY-AND)
     (set! total-query
 	  ;; this is a tad inefficient, but its a simple way to accomplish
 	  ;; description match inversion...
 	  (if pos?
-	      (gnc:query-merge sign-query str-query 'query-and)
-	      (gnc:query-merge
-	       sign-query (gnc:query-invert str-query) 'query-and)
+	      (qof-query-merge sign-query str-query QOF-QUERY-AND)
+	      (qof-query-merge
+	       sign-query (qof-query-invert str-query) QOF-QUERY-AND)
 	      ))
     
-    (set! splits (gnc:query-get-splits total-query))
+    (set! splits (qof-query-run total-query))
     (map (lambda (split)
-	   (let* ((shares (gnc:split-get-amount split))
-		  (acct-comm (gnc:account-get-commodity
-			      (gnc:split-get-account split)))
+	   (let* ((shares (xaccSplitGetAmount split))
+		  (acct-comm (xaccAccountGetCommodity
+			      (xaccSplitGetAccount split)))
 		  )
-	     (or (gnc:numeric-negative-p shares)
-		 (gnc:commodity-collector-add total acct-comm shares)
+	     (or (gnc-numeric-negative-p shares)
+		 (gnc-commodity-collector-add total acct-comm shares)
 		 )
 	     )
 	   )
          splits
          )
-    (gnc:free-query total-query)
+    (qof-query-destroy total-query)
     total
     )
   )
@@ -827,7 +822,7 @@
 		    report-commodity
 		    exchange-fn)))
 	 (amt (and sum (gnc:gnc-monetary-amount sum)))
-	 (neg? (and amt (gnc:numeric-negative-p amt)))
+	 (neg? (and amt (gnc-numeric-negative-p amt)))
 	 (bal (if neg?
 		  (let ((bal (gnc:make-commodity-collector)))
 		    (bal 'minusmerge signed-balance #f)
@@ -839,9 +834,9 @@
 		   exchange-fn))
 	 (balance
 	  (if (gnc:uniform-commodity? bal report-commodity)
-	      (if (gnc:numeric-zero-p amt) #f bal-sum)
+	      (if (gnc-numeric-zero-p amt) #f bal-sum)
 	      (if show-comm?
-		  (gnc:commodity-table bal report-commodity exchange-fn)
+		  (gnc-commodity-table bal report-commodity exchange-fn)
 		  bal-sum)
 	      ))
 	 )

Modified: gnucash/branches/register-rewrite/src/report/report-system/report.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/report.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/report.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,7 +21,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (use-modules (gnucash main))
-(use-modules (g-wrapped gw-report-system)) 
+(use-modules (sw_report_system))
 
 ;; This hash should contain all the reports available and will be used
 ;; to generate the reports menu whenever a new window opens and to
@@ -98,8 +98,10 @@
 	      (hash-set! *gnc:_report-templates_*
 			 (gnc:report-template-name report-rec) report-rec)
 	      (begin
-		(gnc:error (_ "Refusing to add custom report with the same name as an existing report."))
-		(gnc:error (_ "Please edit your saved-reports file and delete the section for: " name))
+		;; FIXME: We should pass the top-level window
+		;; instead of the '() to gnc-error-dialog, but I
+		;; have no idea where to get it from.
+		(gnc-error-dialog '() (string-append (_ "A custom report with this name already exists. Either rename the report to store it with a different name, or edit your saved-reports file and delete the section with the following name: ") name ))
 		)))
         (gnc:warn "gnc:define-report: bad report"))))
 
@@ -264,7 +266,7 @@
                (cb r))))
        options))
 
-    (gnc:report-set-id! r (gnc:report-add r))
+    (gnc:report-set-id! r (gnc-report-add r))
     (gnc:report-id r))
   )
 
@@ -272,7 +274,7 @@
 (define (gnc:restore-report id template-name options)
   (let ((r ((record-constructor <report>)
             template-name id options #t #t #f #f)))
-    (gnc:report-add r))
+    (gnc-report-add r))
   )
 
 
@@ -390,7 +392,7 @@
     (gnc:report-type report))))
 
 (define gnc:current-saved-reports
-  (gnc:build-dotgnucash-path "saved-reports-2.0"))
+  (gnc-build-dotgnucash-path "saved-reports-2.0"))
 
 (define (gnc:report-save-to-savefile report)
   (let ((conf-file-name gnc:current-saved-reports))
@@ -431,10 +433,10 @@
 ;; looks up the report by id and renders it with gnc:report-render-html
 ;; marks the cursor busy during rendering; returns the html
 (define (gnc:report-run id)
-  (let ((report (gnc:find-report id))
+  (let ((report (gnc-report-find id))
 	(start-time (gettimeofday))
 	(html #f))
-    (gnc:set-busy-cursor #f #t)
+    (gnc-set-busy-cursor '() #t)
     (gnc:backtrace-if-exception 
      (lambda ()
        (if report
@@ -445,7 +447,7 @@
 ;;	     (newline)
 ;;	     (display html) (newline)
 	     ))))
-    (gnc:unset-busy-cursor #f)
+    (gnc-unset-busy-cursor '())
     html))
 
 

Modified: gnucash/branches/register-rewrite/src/report/report-system/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/report-system/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/report-system/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,15 +15,14 @@
   --gnc-module-dir ${top_builddir}/src/network-utils \
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
   --gnc-module-dir ${top_srcdir}/src/engine \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/gnome-utils \
   --guile-load-dir ${top_srcdir}/src/gnome \
   --guile-load-dir ${top_srcdir}/src/app-utils \
   --guile-load-dir ${top_srcdir}/src/report/report-system \
   --library-dir    ${top_srcdir}/src/gnome-utils \
-  --library-dir    ${top_srcdir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --library-dir    ${top_srcdir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -43,19 +43,23 @@
 endif
 
 .scm-links:
-	rm -f gnucash report
-	$(LN_S) -f . gnucash
-	$(LN_S) -f ${srcdir} report 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/report
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
+clean-local:
+	$(RM) -rf gnucash
+
 noinst_DATA = .scm-links
 
 EXTRA_DIST = ${gncscmmod_DATA}
 
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/account-piecharts.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/account-piecharts.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/account-piecharts.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -110,7 +110,7 @@
       (lambda ()
         (gnc:filter-accountlist-type 
          account-types
-         (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       (lambda (accounts)
         (list #t
               (gnc:filter-accountlist-type
@@ -200,8 +200,8 @@
         (chart (gnc:make-html-piechart))
         (topl-accounts (gnc:filter-accountlist-type 
                         account-types
-                        (gnc:group-get-account-list 
-                         (gnc:get-current-group)))))
+                        (xaccGroupGetAccountListSorted
+                         (gnc-get-current-group)))))
 
     ;; Returns true if the account a was selected in the account
     ;; selection option.
@@ -227,7 +227,7 @@
                            account-levels))
            (combined '())
            (other-anchor "")
-           (print-info (gnc:commodity-print-info report-currency #t)))
+           (print-info (gnc-commodity-print-info report-currency #t)))
 
       ;; Converts a commodity-collector into one single double
       ;; number, depending on the report currency and the
@@ -239,7 +239,7 @@
         ;; everything foreign gets converted
         ;; (gnc:sum-collector-commodity) based on the weighted
         ;; average of all past transactions.
-        (gnc:numeric-to-double 
+        (gnc-numeric-to-double
          (gnc:gnc-monetary-amount
           (gnc:sum-collector-commodity 
            c report-currency 
@@ -311,16 +311,16 @@
 			(cond
 			 ((eq? sort-method 'acct-code)
 			  (lambda (a b) 
-			    (string<? (gnc:account-get-code (cadr a))
-				      (gnc:account-get-code (cadr b)))))
+			    (string<? (xaccAccountGetCode (cadr a))
+				      (xaccAccountGetCode (cadr b)))))
 			 ((eq? sort-method 'alphabetical)
 			  (lambda (a b) 
 			    (string<? ((if show-fullname?
-					   gnc:account-get-full-name
-					   gnc:account-get-name) (cadr a))
+					   gnc-account-get-full-name
+					   xaccAccountGetName) (cadr a))
 				      ((if show-fullname?
-					   gnc:account-get-full-name
-					   gnc:account-get-name) (cadr b)))))
+					   gnc-account-get-full-name
+					   xaccAccountGetName) (cadr b)))))
 			 (else
 			  (lambda (a b) (> (car a) (car b)))))))
 
@@ -377,8 +377,8 @@
                                  (list gnc:pagename-general 
                                        gnc:optname-reportname
                                        ((if show-fullname?
-                                            gnc:account-get-full-name
-                                            gnc:account-get-name) acct))))))))
+                                            gnc-account-get-full-name
+                                            xaccAccountGetName) acct))))))))
                    combined)))
               (gnc:html-piechart-set-button-1-slice-urls! 
                chart urls)
@@ -401,19 +401,19 @@
                        (if do-intervals?
                            (sprintf #f
                                     (_ "%s to %s")
-                                    (gnc:print-date from-date-tp) 
-                                    (gnc:print-date to-date-tp))
+                                    (gnc-print-date from-date-tp)
+                                    (gnc-print-date to-date-tp))
                            (sprintf #f
                                     (_ "Balance at %s")
-                                    (gnc:print-date to-date-tp)))
+                                    (gnc-print-date to-date-tp)))
                        (if show-total?
                            (let ((total (apply + (unzip1 combined))))
                              (sprintf
                               #f ": %s"
-                              (gnc:amount->string
-                               (gnc:double-to-gnc-numeric
+                              (xaccPrintAmount
+                               (double-to-gnc-numeric
                                 total
-                                (gnc:commodity-get-fraction report-currency)
+                                (gnc-commodity-get-fraction report-currency)
                                 GNC-RND-ROUND)
                                print-info)))
                            "")))
@@ -426,16 +426,16 @@
                            (if (string? (cadr pair))
 			       (cadr pair)
 			       ((if show-fullname?
-				    gnc:account-get-full-name
-				    gnc:account-get-name) (cadr pair)))
+				    gnc-account-get-full-name
+				    xaccAccountGetName) (cadr pair)))
 			       'pre " " (_ "and") " " 'post)
 			   (if show-total?
 			       (string-append 
 				" - "
-				(gnc:amount->string
-				 (gnc:double-to-gnc-numeric
+				(xaccPrintAmount
+				 (double-to-gnc-numeric
 				  (car pair)
-				  (gnc:commodity-get-fraction report-currency)
+				  (gnc-commodity-get-fraction report-currency)
 				  GNC-RND-ROUND)
 				 print-info))
 			       "")))
@@ -479,12 +479,15 @@
  (list 
   ;; reportname, account-types, do-intervals?, 
   ;; menu-reportname, menu-tip
-  (list reportname-income '(income) #t menuname-income menutip-income (lambda (x) #t))
-  (list reportname-expense '(expense) #t menuname-expense menutip-expense (lambda (x) #f))
-  (list reportname-assets 
-        '(asset bank cash checking savings money-market receivable
-                stock mutual-fund currency)
+  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t))
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f))
+  (list reportname-assets
+        (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CHECKING
+              ACCT-TYPE-SAVINGS ACCT-TYPE-MONEYMRKT
+              ACCT-TYPE-RECEIVABLE ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
+              ACCT-TYPE-CURRENCY)
         #f menuname-assets menutip-assets (lambda (x) #f))
   (list reportname-liabilities 
-        '(liability payable credit credit-line)
+        (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
+              ACCT-TYPE-CREDITLINE)
         #f menuname-liabilities menutip-liabilities (lambda (x) #t))))

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/account-summary.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/account-summary.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/account-summary.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -24,7 +24,7 @@
 ;;    summary to no more than daily resolution.
 ;;    
 ;;    The Company Name field does not currently default to the name
-;;    in (gnc:get-current-book).
+;;    in (gnc-get-current-book).
 ;;    
 ;;    The variables in this code could use more consistent naming.
 ;;    
@@ -133,12 +133,12 @@
     (add-option
       (gnc:make-string-option
       gnc:pagename-general optname-report-title
-      "a" opthelp-report-title reportname))
+      "a" opthelp-report-title (_ reportname)))
     (add-option
       (gnc:make-string-option
       gnc:pagename-general optname-party-name
       "b" opthelp-party-name ""))
-    ;; this should default to company name in (gnc:get-current-book)
+    ;; this should default to company name in (gnc-get-current-book)
     ;; does anyone know the function to get the company name??
 
     ;; date at which to report balance
@@ -153,9 +153,12 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
-	 (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
+	 (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
      options gnc:pagename-accounts optname-depth-limit
@@ -321,7 +324,7 @@
     
     (gnc:html-document-set-title! 
      doc (string-append company-name " " report-title " "
-			(gnc:print-date date-tp))
+			(gnc-print-date date-tp))
      )
     
     (if (null? accounts)
@@ -376,11 +379,11 @@
 	  ;; accounts)...
 	  (split-up-accounts (gnc:decompose-accountlist accounts))
 	  (all-accounts
-	   (append (assoc-ref split-up-accounts 'income)
-		   (assoc-ref split-up-accounts 'expense)
-		   (assoc-ref split-up-accounts 'asset)
-		   (assoc-ref split-up-accounts 'liability)
-		   (assoc-ref split-up-accounts 'equity)
+	   (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+		   (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)
+		   (assoc-ref split-up-accounts ACCT-TYPE-ASSET)
+		   (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY)
+		   (assoc-ref split-up-accounts ACCT-TYPE-EQUITY)
 		   ))
 	  ;; (all-accounts (map (lambda (X) (cadr X)) split-up-accounts))
 	  ;; ^ will not do what we want
@@ -489,8 +492,8 @@
                 report-commodity exchange-fn 
                 (append-map
                  (lambda (a)
-                   (gnc:group-get-subaccounts
-                    (gnc:account-get-children a)))
+                   (xaccGroupGetSubAccountsSorted
+                    (xaccAccountGetChildren a)))
                  accounts))))
 	  )
 	)

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/advanced-portfolio.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/advanced-portfolio.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/advanced-portfolio.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -151,8 +151,8 @@
       "b"
       (N_ "Stock Accounts to report on")
       (lambda () (filter gnc:account-is-stock?
-                         (gnc:group-get-subaccounts
-                          (gnc:get-current-group))))
+                         (xaccGroupGetSubAccountsSorted
+                          (gnc-get-current-group))))
       (lambda (accounts) (list  #t 
                                 (filter gnc:account-is-stock? accounts)))
       #t))
@@ -188,72 +188,71 @@
     (gnc:option-value (get-op section name)))
   
   (define (split-account-type? split type)
-    (eq? type 
-         (gw:enum-<gnc:AccountType>-val->sym (gnc:account-get-type (gnc:split-get-account split)) #f)))
+    (eq? type (xaccAccountGetType (xaccSplitGetAccount split))))
 
   (define (same-split? s1 s2)
-    (string=? (gnc:split-get-guid s1) (gnc:split-get-guid s2)))
+    (string=? (gncSplitGetGUID s1) (gncSplitGetGUID s2)))
 
   (define (same-account? a1 a2)
-    (string=? (gnc:account-get-guid a1) (gnc:account-get-guid a2)))
+    (string=? (gncAccountGetGUID a1) (gncAccountGetGUID a2)))
   
   ;; this builds a list for basis calculation and handles average, fifo and filo methods
   ;; the list is cons cells of (units-of-stock . price-per-unit)... average method produces only one
   ;; cell that mutates to the new average. Need to add a date checker so that we allow for prices
   ;; coming in out of order, such as a transfer with a price adjusted to carryover the basis.
   (define (basis-builder b-list b-units b-value b-method)
-    (if (gnc:numeric-positive-p b-units)
+    (if (gnc-numeric-positive-p b-units)
 	(case b-method
 	  ((average-basis) 
            (if (not (eqv? b-list '()))
-               (list (cons (gnc:numeric-add b-units 
+               (list (cons (gnc-numeric-add b-units
                                             (caar b-list) 10000 GNC-RND-ROUND) 
-                           (gnc:numeric-div 
-                            (gnc:numeric-add b-value
-                                             (gnc:numeric-mul (caar b-list)
+                           (gnc-numeric-div
+                            (gnc-numeric-add b-value
+                                             (gnc-numeric-mul (caar b-list)
                                                               (cdar b-list) 
                                                               10000 GNC-RND-ROUND)
                                              10000 GNC-RND-ROUND)
-                            (gnc:numeric-add b-units 
+                            (gnc-numeric-add b-units
                                              (caar b-list) 10000 GNC-RND-ROUND)
                             10000 GNC-RND-ROUND)))
                (append b-list 
-                       (list (cons b-units (gnc:numeric-div 
+                       (list (cons b-units (gnc-numeric-div
                                             b-value b-units 10000 
                                             GNC-RND-ROUND))))))
 	  (else (append b-list 
-                        (list (cons b-units (gnc:numeric-div 
+                        (list (cons b-units (gnc-numeric-div
                                              b-value b-units 10000 
                                              GNC-RND-ROUND))))))
 	(if (not (eqv? b-list '()))
 	    (case b-method
 	      ((fifo-basis) 
-               (if (not (= -1 (gnc:numeric-compare 
-                               (gnc:numeric-abs b-units) (caar b-list))))
-                   (basis-builder (cdr b-list) (gnc:numeric-add 
+               (if (not (= -1 (gnc-numeric-compare
+                               (gnc-numeric-abs b-units) (caar b-list))))
+                   (basis-builder (cdr b-list) (gnc-numeric-add
                                                 b-units 
                                                 (caar b-list) 10000 GNC-RND-ROUND) 
                                   b-value b-method)
-                   (append (list (cons (gnc:numeric-add 
+                   (append (list (cons (gnc-numeric-add
                                         b-units 
                                         (caar b-list) 10000 GNC-RND-ROUND) 
                                        (cdar b-list))) (cdr b-list))))
 	      ((filo-basis) 
-               (if (not (= -1 (gnc:numeric-compare 
-                               (gnc:numeric-abs b-units) (caar (reverse b-list)))))
+               (if (not (= -1 (gnc-numeric-compare
+                               (gnc-numeric-abs b-units) (caar (reverse b-list)))))
                    (basis-builder (reverse (cdr (reverse b-list))) 
-                                  (gnc:numeric-add 
+                                  (gnc-numeric-add
                                    b-units 
                                    (caar (reverse b-list)) 
                                    10000 GNC-RND-ROUND) 
                                   b-value b-method)
                    (append (cdr (reverse b-list)) 
-                           (list (cons (gnc:numeric-add 
+                           (list (cons (gnc-numeric-add
                                         b-units 
                                         (caar (reverse b-list)) 10000 GNC-RND-ROUND) 
                                        (cdar (reverse b-list)))))))
 	      ((average-basis) 
-               (list (cons (gnc:numeric-add 
+               (list (cons (gnc-numeric-add
                             (caar b-list) b-units 10000 GNC-RND-ROUND) 
                            (cdar b-list)))))
 	    '()
@@ -264,17 +263,17 @@
   ;; sum up the contents of the b-list built by basis-builder above
   (define (sum-basis b-list)
     (if (not (eqv? b-list '()))
-	(gnc:numeric-add (gnc:numeric-mul (caar b-list) (cdar b-list) 100 GNC-RND-ROUND) 
+	(gnc-numeric-add (gnc-numeric-mul (caar b-list) (cdar b-list) 100 GNC-RND-ROUND)
 			 (sum-basis (cdr b-list)) 100 GNC-RND-ROUND)
-	(gnc:numeric-zero)
+	(gnc-numeric-zero)
 	)
     )
   
   ;; sum up the total number of units in the b-list built by basis-builder above
   (define (units-basis b-list)
     (if (not (eqv? b-list '()))
-	(gnc:numeric-add (caar b-list) (units-basis (cdr b-list)) 100 GNC-RND-ROUND)
-	(gnc:numeric-zero)
+	(gnc-numeric-add (caar b-list) (units-basis (cdr b-list)) 100 GNC-RND-ROUND)
+	(gnc-numeric-zero)
 	)
     )
 
@@ -286,7 +285,7 @@
                                 total-gain total-ugain)
 
    (let ((share-print-info
-	  (gnc:share-print-info-places
+	  (gnc-share-print-info-places
 	   (inexact->exact (get-option gnc:pagename-display
       			       optname-shares-digits)))))
     
@@ -295,10 +294,10 @@
           (let* ((row-style (if odd-row? "normal-row" "alternate-row"))
                  (current (car accounts))
                  (rest (cdr accounts))
-                 (name (gnc:account-get-name current))
-                 (commodity (gnc:account-get-commodity current))
-                 (ticker-symbol (gnc:commodity-get-mnemonic commodity))
-                 (listing (gnc:commodity-get-namespace commodity))
+                 (name (xaccAccountGetName current))
+                 (commodity (xaccAccountGetCommodity current))
+                 (ticker-symbol (gnc-commodity-get-mnemonic commodity))
+                 (listing (gnc-commodity-get-namespace commodity))
                  (unit-collector (gnc:account-get-comm-balance-at-date
                                   current to-date #f))
                  (units (cadr (unit-collector 'getpair commodity #f)))
@@ -319,15 +318,15 @@
 				 (car price-list) #f))
 		 ;; if there is no price, set a sane commod-currency for those zero-share 
 		 ;; accounts. if its a no price account with shares, we'll get a currency later.
-		 (commod-currency (if price (gnc:price-get-currency price) currency))
+		 (commod-currency (if price (gnc-price-get-currency price) currency))
                  (value (exchange-fn (gnc:make-gnc-monetary commodity units) currency))
 
-		 (txn-value (gnc:numeric-zero))
+		 (txn-value (gnc-numeric-zero))
 		 (txn-date to-date)
 		 (pricing-txn #f)
 		 (use-txn #f)
 		 (basis-list '())
-		 (txn-units (gnc:numeric-zero))
+		 (txn-units (gnc-numeric-zero))
 		 )
 
 
@@ -336,31 +335,33 @@
 	     (lambda (split)
 	       (set! work-done (+ 1 work-done))
 	       (gnc:report-percent-done (* 100 (/ work-done work-to-do)))
-	       (let ((parent (gnc:split-get-parent split)))
-		 (if (gnc:timepair-le (gnc:transaction-get-date-posted parent) to-date)
+	       (let ((parent (xaccSplitGetParent split)))
+		 (if (gnc:timepair-le (gnc-transaction-get-date-posted parent) to-date)
 		     (begin
 		       (for-each
 			(lambda (s)
 			  ;; If this is an asset type account for buy or sell, then grab a 
 			  ;; currency and a txn-value for later computation
 			  (cond
-			   ((and (not (same-account? current (gnc:split-get-account s))) 
-				 (not (or(split-account-type? s 'expense)
-					 (split-account-type? s 'income))))
+			   ((and (not (same-account? current (xaccSplitGetAccount s)))
+				 (not (or (split-account-type?
+                                           s ACCT-TYPE-EXPENSE)
+					  (split-account-type?
+                                           s ACCT-TYPE-INCOME))))
 
 			    ;;only change the commod-currency if price failed
-			    (if (not price) (set! commod-currency (gnc:account-get-commodity (gnc:split-get-account s))))
-			    (set! txn-value (gnc:numeric-abs (gnc:split-get-value s)));;FIXME use gnc:split-get-share-price
-			    (set! txn-date (gnc:transaction-get-date-posted parent))
+			    (if (not price) (set! commod-currency (xaccAccountGetCommodity (xaccSplitGetAccount s))))
+			    (set! txn-value (gnc-numeric-abs (xaccSplitGetValue s)));;FIXME use xaccSplitGetSharePrice
+			    (set! txn-date (gnc-transaction-get-date-posted parent))
 			    (set! pricing-txn parent)
 			    )
-			   ((same-account? current (gnc:split-get-account s))
-			    (set! txn-units (gnc:split-get-amount s)))
+			   ((same-account? current (xaccSplitGetAccount s))
+			    (set! txn-units (xaccSplitGetAmount s)))
 			    
 			      )
 			  )
 
-			(gnc:transaction-get-splits parent))
+			(xaccTransGetSplitList parent))
 
 
 		       ;; go build the basis-list
@@ -375,54 +376,54 @@
 			(lambda (s)
 			  (cond
 			   ((same-split? s split) 
-;;                       (gnc:debug "amount " (gnc:numeric-to-double (gnc:split-get-amount s))
-;;                                  " acct " (gnc:account-get-name (gnc:split-get-account s)) )
-;;                       (gnc:debug "value " (gnc:numeric-to-double (gnc:split-get-value s))
-;;                                  " in " (gnc:commodity-get-printname commod-currency)
-;;                                  " from " (gnc:transaction-get-description (gnc:split-get-parent s)))
+;;                       (gnc:debug "amount " (gnc-numeric-to-double (xaccSplitGetAmount s))
+;;                                  " acct " (xaccAccountGetName (xaccSplitGetAccount s)) )
+;;                       (gnc:debug "value " (gnc-numeric-to-double (xaccSplitGetValue s))
+;;                                  " in " (gnc-commodity-get-printname commod-currency)
+;;                                  " from " (xaccTransGetDescription (xaccSplitGetParent s)))
 			    (cond
-			     ((or include-gains (not (gnc:numeric-zero-p (gnc:split-get-amount s))))
-			      (unitscoll 'add commodity (gnc:split-get-amount s)) ;; Is the stock transaction?
+			     ((or include-gains (not (gnc-numeric-zero-p (xaccSplitGetAmount s))))
+			      (unitscoll 'add commodity (xaccSplitGetAmount s)) ;; Is the stock transaction?
 ;; these lines do nothing, but are in a debug so I'm leaving it, just in case. asw.			     
-;;			      (if (< 0 (gnc:numeric-to-double
-;;					(gnc:split-get-amount s)))
+;;			      (if (< 0 (gnc-numeric-to-double
+;;					(xaccSplitGetAmount s)))
 
 
 ;;				  (set! totalunits
 ;;					(+ totalunits
-;;					   (gnc:numeric-to-double (gnc:split-get-amount s))))
+;;					   (gnc-numeric-to-double (xaccSplitGetAmount s))))
 ;;				  )
 
 
 ;;			      (set! totalunityears
 ;;				    (+ totalunityears 
-;;				       (* (gnc:numeric-to-double (gnc:split-get-amount s)) 
+;;				       (* (gnc-numeric-to-double (xaccSplitGetAmount s))
 ;;					  (gnc:date-year-delta 
-;;					   (car (gnc:transaction-get-date-posted parent))
+;;					   (car (gnc-transaction-get-date-posted parent))
 ;;					   (current-time))))) 
 			      (cond 
-			       ((gnc:numeric-negative-p (gnc:split-get-value s))
+			       ((gnc-numeric-negative-p (xaccSplitGetValue s))
 				(moneyoutcoll
 				 'add commod-currency
-				 (gnc:numeric-neg (gnc:split-get-value s))))
+				 (gnc-numeric-neg (xaccSplitGetValue s))))
 			       (else (moneyincoll 
 				      'add commod-currency
-				      (gnc:numeric-neg (gnc:split-get-value s))))))))
+				      (gnc-numeric-neg (xaccSplitGetValue s))))))))
 			 
-			   ((split-account-type? s 'expense)
-			     (brokeragecoll 'add commod-currency (gnc:split-get-value s)))
+			   ((split-account-type? s ACCT-TYPE-EXPENSE)
+			     (brokeragecoll 'add commod-currency (xaccSplitGetValue s)))
 			   
-			   ((split-account-type? s 'income)
-			     (dividendcoll 'add commod-currency (gnc:split-get-value s)))
+			   ((split-account-type? s ACCT-TYPE-INCOME)
+			     (dividendcoll 'add commod-currency (xaccSplitGetValue s)))
 			   )
 			  )
-			(gnc:transaction-get-splits parent)
+			(xaccTransGetSplitList parent)
 			)
 		       )
 		     )
 		 )
 	       )
-	     (gnc:account-get-split-list current)
+	     (xaccAccountGetSplitList current)
 	     )
 ;;          (gnc:debug "totalunits" totalunits)
 ;;          (gnc:debug "totalunityears" totalunityears)
@@ -431,24 +432,24 @@
 	    ;; and if we have a choice, use whichever is newest.
 	    (set! use-txn (if (not price) #t 
 			      (if prefer-pricelist #f
-				  (if (not (gnc:timepair-le txn-date (gnc:price-get-time price)))
+				  (if (not (gnc:timepair-le txn-date (gnc-price-get-time price)))
 				      #t #f))))
 
 	    ;; okay we're using the txn, so make a new price, value etc. and warn the user
 	    (if use-txn
 		(begin
-		  (set! price (if (not (gnc:numeric-zero-p txn-units))
+		  (set! price (if (not (gnc-numeric-zero-p txn-units))
 				  (gnc:make-gnc-monetary commod-currency
-							 (gnc:numeric-div txn-value
-									  (gnc:numeric-abs txn-units)
+							 (gnc-numeric-div txn-value
+									  (gnc-numeric-abs txn-units)
 									  100 GNC-RND-ROUND))
-				  (gnc:make-gnc-monetary commod-currency (gnc:numeric-zero))))
+				  (gnc:make-gnc-monetary commod-currency (gnc-numeric-zero))))
 
 		  (set! value (if price (gnc:make-gnc-monetary commod-currency 
-						     (gnc:numeric-mul units 
+						     (gnc-numeric-mul units
 								      (gnc:gnc-monetary-amount price)
 								      100 GNC-RND-ROUND))
-				  (gnc:make-gnc-monetary commod-currency (gnc:numeric-zero))))
+				  (gnc:make-gnc-monetary commod-currency (gnc-numeric-zero))))
 		  (set! warn-price-dirty #t)
 		  )  
 		)
@@ -464,17 +465,17 @@
 
 
 	    
-	  (if (or include-empty (not (gnc:numeric-zero-p units)))
+	  (if (or include-empty (not (gnc-numeric-zero-p units)))
 	    (let* ((moneyin (gnc:monetary-neg
 			    (gnc:sum-collector-commodity moneyincoll currency exchange-fn)))
 		  (moneyout (gnc:sum-collector-commodity moneyoutcoll currency exchange-fn))
 		  ;; just so you know, gain == realized gain, ugain == un-realized gain, bothgain, well..
 		  (gain (gnc:sum-collector-commodity gaincoll currency exchange-fn))
 		  (ugain (gnc:make-gnc-monetary currency 
-						(gnc:numeric-sub (gnc:gnc-monetary-amount (exchange-fn value currency))
+						(gnc-numeric-sub (gnc:gnc-monetary-amount (exchange-fn value currency))
 								 (sum-basis basis-list) 
 								 100 GNC-RND-ROUND)))
-		  (bothgain (gnc:make-gnc-monetary currency  (gnc:numeric-add (gnc:gnc-monetary-amount gain)
+		  (bothgain (gnc:make-gnc-monetary currency  (gnc-numeric-add (gnc:gnc-monetary-amount gain)
 									      (gnc:gnc-monetary-amount ugain)
 									      100 GNC-RND-ROUND)))
 
@@ -492,7 +493,7 @@
 	      (if show-symbol (append! activecols (list ticker-symbol)))
 	      (if show-listing (append! activecols (list listing)))
 	      (if show-shares (append! activecols (list (gnc:make-html-table-header-cell/markup
- 	        "number-cell" (gnc:amount->string units share-print-info)))))
+ 	        "number-cell" (xaccPrintAmount units share-print-info)))))
 	      (if show-price (append! activecols (list (gnc:make-html-table-header-cell/markup
 	        "number-cell"
 	        (if use-txn
@@ -503,8 +504,8 @@
 	 	    (gnc:html-price-anchor
 	 	     price
 	 	     (gnc:make-gnc-monetary
-	  	     (gnc:price-get-currency price)
-		     (gnc:price-get-value price)))
+	  	     (gnc-price-get-currency price)
+		     (gnc-price-get-value price)))
 		    )))))
  	      (append! activecols (list (if use-txn "*" " ")
 					(gnc:make-html-table-header-cell/markup 
@@ -518,11 +519,11 @@
 										
 										
 					(gnc:make-html-table-header-cell/markup "number-cell" 
-					    (let ((moneyinvalue (gnc:numeric-to-double 
+					    (let ((moneyinvalue (gnc-numeric-to-double
 								 (gnc:gnc-monetary-amount moneyin))))
 					      (if (= 0.0 moneyinvalue)
 						  (sprintf #f "%.2f%%" moneyinvalue)
-						  (sprintf #f "%.2f%%" (* 100 (/ (gnc:numeric-to-double 
+						  (sprintf #f "%.2f%%" (* 100 (/ (gnc-numeric-to-double
 									     (gnc:gnc-monetary-amount bothgain))
 									    moneyinvalue))))))
 					 )
@@ -537,7 +538,7 @@
 	      )
 	    (table-add-stock-rows-internal rest odd-row?)
             )
-            (gnc:price-list-destroy price-list)
+            (gnc-price-list-destroy price-list)
 	    )))
 
     (set! work-to-do (gnc:accounts-count-splits accounts))
@@ -587,30 +588,30 @@
     (gnc:html-document-set-title!
      document (string-append 
                report-title
-               (sprintf #f " %s" (gnc:print-date to-date))))
+               (sprintf #f " %s" (gnc-print-date to-date))))
 
     (if (not (null? accounts))
         ; at least 1 account selected
         (let* ((exchange-fn (gnc:case-exchange-fn price-source currency to-date))
-               (pricedb (gnc:book-get-pricedb (gnc:get-current-book)))
+               (pricedb (gnc-pricedb-get-db (gnc-get-current-book)))
                (price-fn
                 (case price-source
                   ((pricedb-latest) 
                    (lambda (foreign date) 
-                    (gnc:pricedb-lookup-latest-any-currency pricedb foreign)))
+                    (gnc-pricedb-lookup-latest-any-currency pricedb foreign)))
                   ((pricedb-nearest) 
                    (lambda (foreign date) 
-                    (gnc:pricedb-lookup-nearest-in-time-any-currency
-		     pricedb foreign (gnc:timepair-canonical-day-time date))))
+                    (gnc-pricedb-lookup-nearest-in-time-any-currency
+		     pricedb foreign (timespecCanonicalDayTime date))))
 		  ((pricedb-latest-before)
 		   (lambda (foreign date)
-		     (gnc:pricedb-lookup-latest-before-any-currency
-		      pricedb foreign (gnc:timepair-canonical-day-time date))))))
+		     (gnc-pricedb-lookup-latest-before-any-currency
+		      pricedb foreign (timespecCanonicalDayTime date))))))
 	       (headercols (list (_ "Account")))
 	       (totalscols (list (gnc:make-html-table-cell/markup "total-label-cell" (_ "Total"))))
-	       (sum-total-both-gains (gnc:numeric-zero))
-	       (sum-total-gain (gnc:numeric-zero))
-	       (sum-total-ugain (gnc:numeric-zero)))
+	       (sum-total-both-gains (gnc-numeric-zero))
+	       (sum-total-gain (gnc-numeric-zero))
+	       (sum-total-ugain (gnc-numeric-zero)))
 
 	  ;;begin building lists for which columns to display
           (if show-symbol 
@@ -653,7 +654,7 @@
 
 	  (set! sum-total-gain (gnc:sum-collector-commodity total-gain currency exchange-fn))
 	  (set! sum-total-ugain (gnc:sum-collector-commodity total-ugain currency exchange-fn))
-	  (set! sum-total-both-gains (gnc:make-gnc-monetary currency (gnc:numeric-add (gnc:gnc-monetary-amount sum-total-gain)
+	  (set! sum-total-both-gains (gnc:make-gnc-monetary currency (gnc-numeric-add (gnc:gnc-monetary-amount sum-total-gain)
 										      (gnc:gnc-monetary-amount sum-total-ugain)
 										      100 GNC-RND-ROUND)))
 
@@ -682,12 +683,12 @@
 				"total-number-cell" sum-total-both-gains)
 			       (gnc:make-html-table-cell/markup
 				"total-number-cell" 
-				(let ((totalinvalue (gnc:numeric-to-double 
+				(let ((totalinvalue (gnc-numeric-to-double
 						     (gnc:gnc-monetary-amount (gnc:monetary-neg (gnc:sum-collector-commodity 
 									       total-moneyin currency exchange-fn))))))
 				  (if (= 0.0 totalinvalue) 
 				      (sprintf #f "%.2f%%" totalinvalue) 
-				      (sprintf #f "%.2f%%" (* 100 (/ (gnc:numeric-to-double 
+				      (sprintf #f "%.2f%%" (* 100 (/ (gnc-numeric-to-double
 								      (gnc:gnc-monetary-amount sum-total-both-gains))
 										   totalinvalue))))))
 			       ))

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/average-balance.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/average-balance.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/average-balance.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -71,10 +71,13 @@
                  ;; otherwise get some accounts -- here as an
                  ;; example we get the asset and liability stuff
                  (gnc:filter-accountlist-type
-                  '(bank cash credit asset liability payable receivable) 
-                  ;; or: '(bank cash checking savings stock
-                  ;; mutual-fund money-market)
-                  (gnc:group-get-account-list (gnc:get-current-group)))))))
+                  (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+                        ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+                        ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE)
+                  ;; or: (list ACCT-TYPE-BANK ACCT-TYPE-CASH
+                  ;; ACCT-TYPE-CHECKING ACCT-TYPE-SAVINGS ACCT-TYPE-STOCK
+                  ;; ACCT-TYPE-MUTUAL ACCT-TYPE-MONEYMRKT)
+                  (xaccGroupGetAccountListSorted (gnc-get-current-group)))))))
       #f #t))
 
     ;; Display tab
@@ -137,8 +140,8 @@
                         gain-loss-accum)
       (set! data-rows
             (cons 
-             (list (gnc:print-date interval-start)
-                   (gnc:print-date interval-end)
+             (list (gnc-print-date interval-start)
+                   (gnc-print-date interval-end)
                    (/ (stats-accum 'total #f)
                       (gnc:timepair-delta interval-start 
                                           interval-end))
@@ -156,8 +159,8 @@
     (define (get-split-value split date)
       (monetary->double
        (gnc:make-gnc-monetary
-        (gnc:account-get-commodity (gnc:split-get-account split))
-        (gnc:split-get-amount split))
+        (xaccAccountGetCommodity (xaccSplitGetAccount split))
+        (xaccSplitGetAmount split))
        date))
     
     ;; calculate the statistics for one interval - returns a list 
@@ -192,14 +195,14 @@
 
         (define (split-recurse)
           (if (or (null? splits) (gnc:timepair-gt 
-                                  (gnc:transaction-get-date-posted 
-                                   (gnc:split-get-parent
+                                  (gnc-transaction-get-date-posted
+                                   (xaccSplitGetParent
                                     (car splits))) to)) 
               #f
               (let* 
                   ((split (car splits))
-                   (split-time (gnc:transaction-get-date-posted 
-                                (gnc:split-get-parent split)))
+                   (split-time (gnc-transaction-get-date-posted
+                                (xaccSplitGetParent split)))
                    ;; FIXME: Which date should we use here? The 'to'
                    ;; date? the 'split-time'?
                    (split-amt (get-split-value split split-time)))
@@ -303,7 +306,7 @@
               (list-all-zeros? (cdr alist)))))
     
     (define (monetary->double foreign-monetary date)
-      (gnc:numeric-to-double
+      (gnc-numeric-to-double
        (gnc:gnc-monetary-amount
         (exchange-fn foreign-monetary report-currency date))))
 
@@ -311,7 +314,7 @@
     ;;(warn commodity-list)
 
     (if (not (null? accounts))
-        (let ((query (gnc:malloc-query))
+        (let ((query (qof-query-create-for-splits))
               (splits '())
               (data '()))
 
@@ -337,11 +340,11 @@
 
           ;; initialize the query to find splits in the right 
           ;; date range and accounts
-          (gnc:query-set-book query (gnc:get-current-book))
+          (qof-query-set-book query (gnc-get-current-book))
 
 	  ;; for balance purposes, we don't need to do this, but it cleans up
 	  ;; the table display.
-          (gnc:query-set-match-non-voids-only! query (gnc:get-current-book))
+          (gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
           ;; add accounts to the query (include subaccounts 
           ;; if requested)
 	  (gnc:report-percent-done 25)
@@ -362,18 +365,18 @@
                       (delete-duplicates (append accounts subaccts)))))
 	  (gnc:report-percent-done 30)
 
-          (gnc:query-add-account-match query accounts 'guid-match-any 'query-and)
+          (xaccQueryAddAccountMatch query accounts QOF-GUID-MATCH-ANY QOF-QUERY-AND)
           
           ;; match splits between start and end dates 
-          (gnc:query-add-date-match-timepair
-           query #t begindate #t enddate 'query-and)
-          (gnc:query-set-sort-order query
-				    (list gnc:split-trans gnc:trans-date-posted)
-				    (list gnc:query-default-sort)
+          (xaccQueryAddDateMatchTS
+           query #t begindate #t enddate QOF-QUERY-AND)
+          (qof-query-set-sort-order query
+				    (list SPLIT-TRANS TRANS-DATE-POSTED)
+				    (list QUERY-DEFAULT-SORT)
 				    '())
           
           ;; get the query results 
-          (set! splits (gnc:query-get-splits query))
+          (set! splits (qof-query-run query))
 	  (gnc:report-percent-done 40)
           
           ;; find the net starting balance for the set of accounts 
@@ -382,11 +385,11 @@
                  accounts 
                  (lambda (acct) (gnc:account-get-comm-balance-at-date 
                                  acct beforebegindate #f))
-                 gnc:account-reverse-balance?))
+                 gnc-reverse-balance))
 	  (gnc:report-percent-done 50)
 
           (set! startbal 
-                (gnc:numeric-to-double
+                (gnc-numeric-to-double
                  (gnc:gnc-monetary-amount
                   (gnc:sum-collector-commodity 
                    startbal

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/balance-sheet.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/balance-sheet.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/balance-sheet.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -22,7 +22,7 @@
 ;;    sheet to no more than daily resolution.
 ;;    
 ;;    The Company Name field does not currently default to the name
-;;    in (gnc:get-current-book).
+;;    in (gnc-get-current-book).
 ;;    
 ;;    Line & column alignments still do not conform with
 ;;    textbook accounting practice (they're close though!).
@@ -151,12 +151,12 @@
     (add-option
       (gnc:make-string-option
       gnc:pagename-general optname-report-title
-      "a" opthelp-report-title reportname))
+      "a" opthelp-report-title (_ reportname)))
     (add-option
       (gnc:make-string-option
       gnc:pagename-general optname-party-name
       "b" opthelp-party-name ""))
-    ;; this should default to company name in (gnc:get-current-book)
+    ;; this should default to company name in (gnc-get-current-book)
     ;; does anyone know the function to get the company name??
     ;; (GnuCash is *so* well documented... sigh)
     
@@ -177,9 +177,12 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
-	 (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
+	 (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
      options gnc:pagename-accounts optname-depth-limit
@@ -337,14 +340,14 @@
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
          (asset-accounts
-	  (assoc-ref split-up-accounts 'asset))
+	  (assoc-ref split-up-accounts ACCT-TYPE-ASSET))
          (liability-accounts
-	  (assoc-ref split-up-accounts 'liability))
+	  (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY))
+         (income-expense-accounts
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
          (equity-accounts
-          (assoc-ref split-up-accounts 'equity))
-         (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (assoc-ref split-up-accounts ACCT-TYPE-EQUITY))
 	 
          (doc (gnc:make-html-document))
 	 ;; this can occasionally put extra (blank) columns in our
@@ -366,7 +369,7 @@
       (define allow-same-column-totals #t)
       (let* ((neg? (and signed-balance
 			neg-label
-			(gnc:numeric-negative-p
+			(gnc-numeric-negative-p
 			 (gnc:gnc-monetary-amount
 			  (gnc:sum-collector-commodity
 			   signed-balance report-commodity exchange-fn)))))
@@ -406,7 +409,7 @@
     ;;(gnc:warn "account names" liability-account-names)
     (gnc:html-document-set-title! 
      doc (string-append company-name " " report-title " "
-			(gnc:print-date date-tp))
+			(gnc-print-date date-tp))
      )
     
     (if (null? accounts)
@@ -520,7 +523,7 @@
                                                 report-commodity
                                                 weighted-fn)))
 		 
-                 (unrealized-gain (gnc:numeric-sub-fixed value cost)))
+                 (unrealized-gain (gnc-numeric-sub-fixed value cost)))
 	    
             (unrealized-gain-collector 'add report-commodity unrealized-gain)
 	    )
@@ -641,13 +644,13 @@
 	  ;; we omit retianed earnings & unrealized gains
 	  ;; from the balance report, if zero, since they
 	  ;; are not present on normal balance sheets
-	  (and (not (gnc:commodity-collector-allzero?
+	  (and (not (gnc-commodity-collector-allzero?
 		     retained-earnings))
 	       (add-subtotal-line right-table
 				  (_ "Retained Earnings")
 				  (_ "Retained Losses")
 				  retained-earnings))
-	  (and (not (gnc:commodity-collector-allzero?
+	  (and (not (gnc-commodity-collector-allzero?
 		     unrealized-gain-collector))
 	       (add-subtotal-line right-table
 				  (_ "Unrealized Gains")

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/budget.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/budget.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/budget.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -34,7 +34,7 @@
 (require 'sort)
 
 (gnc:module-load "gnucash/report/report-system" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc:html-build-url
+(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 (define reportname (N_ "Budget Report"))
 
@@ -90,8 +90,9 @@
      optname-accounts "a" 2
      (lambda ()
        (gnc:filter-accountlist-type
-        '(asset liability income expense)
-        (gnc:group-get-subaccounts (gnc:get-current-group))))
+        (list ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY ACCT-TYPE-INCOME
+                          ACCT-TYPE-EXPENSE)
+        (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
      #f)
 
     ;; Set the general page as default option tab
@@ -106,24 +107,25 @@
   (define (gnc:html-table-add-budget-line!
            html-table rownum colnum
            budget acct exchange-fn)
-    (let* ((num-periods (gnc:budget-get-num-periods budget))
+    (let* ((num-periods (gnc-budget-get-num-periods budget))
            (period 0)
            )
       (while (< period num-periods)
              (let* ((bgt-col (+ (* period 2) colnum 1))
                     (act-col (+ 1 bgt-col))
 
-                    (comm (gnc:account-get-commodity acct))
-                    (numeric-val (gnc:budget-get-account-period-value
+                    (comm (xaccAccountGetCommodity acct))
+                    (bgt-unset? (not (gnc-budget-is-account-period-value-set 
+                                      budget acct period)))
+                    (numeric-val (gnc-budget-get-account-period-value
                                   budget acct period))
 
-                    (bgt-val (gnc:make-gnc-monetary
-                              comm numeric-val))
-                    (numeric-val (gnc:budget-get-account-period-actual-value
+                    (bgt-val (if bgt-unset? "."
+                                 (gnc:make-gnc-monetary comm numeric-val)))
+                    (numeric-val (gnc-budget-get-account-period-actual-value
                                   budget acct period))
-                    (act-val (gnc:make-gnc-monetary
-                              comm numeric-val))
-                    (reverse-balance? (gnc:account-reverse-balance? acct))
+                    (act-val (gnc:make-gnc-monetary comm numeric-val))
+                    (reverse-balance? (gnc-reverse-balance acct))
                     )
 
                (cond (reverse-balance? (set! act-val
@@ -145,7 +147,7 @@
     )
   (define (gnc:html-table-add-budget-headers!
            html-table colnum budget)
-    (let* ((num-periods (gnc:budget-get-num-periods budget))
+    (let* ((num-periods (gnc-budget-get-num-periods budget))
            (period 0)
            )
 
@@ -157,18 +159,18 @@
       (while (< period num-periods)
              (let* ((bgt-col (+ (* period 2) colnum 1))
                     (act-col (+ 1 bgt-col))
-                    (date (gnc:budget-get-period-start-date budget period))
+                    (date (gnc-budget-get-period-start-date budget period))
                     )
                (gnc:html-table-set-cell!
-                html-table 0 bgt-col (gnc:print-date date))
+                html-table 0 bgt-col (gnc-print-date date))
 
                (gnc:html-table-set-cell!
                 html-table
-                1 bgt-col "Bgt")
+                1 bgt-col (_ "Bgt")) ;; Translators: Abbreviation for "Budget"
 
                (gnc:html-table-set-cell!
                 html-table
-                1 act-col "Act")
+                1 act-col (_ "Act")) ;; Translators: Abbreviation for "Actual"
 
                (set! period (+ period 1))
                )
@@ -249,10 +251,10 @@
 
     ;; is account in list of accounts?
     (define (same-account? a1 a2)
-      (string=? (gnc:account-get-guid a1) (gnc:account-get-guid a2)))
+      (string=? (gncAccountGetGUID a1) (gncAccountGetGUID a2)))
 
     (define (same-split? s1 s2)
-      (string=? (gnc:split-get-guid s1) (gnc:split-get-guid s2)))
+      (string=? (gncSplitGetGUID s1) (gncSplitGetGUID s2)))
 
     (define account-in-list?
       (lambda (account accounts)
@@ -277,12 +279,12 @@
 
     ;; helper for sorting of account list
     (define (account-full-name<? a b)
-      (string<? (gnc:account-get-full-name a) (gnc:account-get-full-name b)))
+      (string<? (gnc-account-get-full-name a) (gnc-account-get-full-name b)))
 
     ;; helper for account depth
     (define (account-get-depth account)
       (define (account-get-depth-internal account-internal depth)
-        (let ((parent (gnc:account-get-parent-account account-internal)))
+        (let ((parent (xaccAccountGetParentAccount account-internal)))
           (if parent
             (account-get-depth-internal parent (+ depth 1))
             depth)))
@@ -329,8 +331,8 @@
                )
 
           (gnc:html-document-set-title!
-           doc (sprintf #f (_ "%s - %s")
-                        report-name (gnc:budget-get-name budget)))
+           doc (sprintf #f (_ "%s: %s")
+                        report-name (gnc-budget-get-name budget)))
 
           (set! accounts (sort accounts account-full-name<?))
 

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/cash-flow.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/cash-flow.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/cash-flow.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -36,7 +36,7 @@
 (require 'sort)
 
 (gnc:module-load "gnucash/report/report-system" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc:html-build-url
+(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 (define reportname (N_ "Cash Flow"))
 
@@ -91,8 +91,9 @@
      optname-accounts "a" 2
      (lambda ()
        (gnc:filter-accountlist-type 
-        '(bank cash asset stock mutual-fund)
-        (gnc:group-get-subaccounts (gnc:get-current-group))))
+        (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-ASSET
+              ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL)
+        (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
      #f)
     
     ;; Set the general page as default option tab
@@ -150,10 +151,10 @@
 
     ;; is account in list of accounts?
     (define (same-account? a1 a2)
-      (string=? (gnc:account-get-guid a1) (gnc:account-get-guid a2)))
+      (string=? (gncAccountGetGUID a1) (gncAccountGetGUID a2)))
 
     (define (same-split? s1 s2) 
-      (string=? (gnc:split-get-guid s1) (gnc:split-get-guid s2)))
+      (string=? (gncSplitGetGUID s1) (gncSplitGetGUID s2)))
 
     (define account-in-list?
       (lambda (account accounts)
@@ -178,12 +179,12 @@
 
     ;; helper for sorting of account list
     (define (account-full-name<? a b)
-      (string<? (gnc:account-get-full-name a) (gnc:account-get-full-name b)))
+      (string<? (gnc-account-get-full-name a) (gnc-account-get-full-name b)))
 
     ;; helper for account depth
     (define (account-get-depth account)
       (define (account-get-depth-internal account-internal depth)
-        (let ((parent (gnc:account-get-parent-account account-internal)))
+        (let ((parent (xaccAccountGetParentAccount account-internal)))
           (if parent
             (account-get-depth-internal parent (+ depth 1))
             depth)))
@@ -203,7 +204,7 @@
     (gnc:html-document-set-title! 
      doc (sprintf #f (_ "%s - %s to %s for")
 		  (get-option gnc:pagename-general gnc:optname-reportname)
-                  (gnc:print-date from-date-tp) (gnc:print-date to-date-tp)))
+                  (gnc-print-date from-date-tp) (gnc-print-date to-date-tp)))
 
 
     ;; add subaccounts if requested
@@ -250,51 +251,51 @@
               (if (not (null? accounts-internal))
                 (let* ((current (car accounts-internal))
                        (rest (cdr accounts-internal))
-                       (name (gnc:account-get-name current))
-                       (curr-commodity (gnc:account-get-commodity current))
+                       (name (xaccAccountGetName current))
+                       (curr-commodity (xaccAccountGetCommodity current))
                       )
 
-                  ;(gnc:debug "calc-money-in-out-internal---" name "---" (gnc:commodity-get-printname curr-commodity))
+                  ;(gnc:debug "calc-money-in-out-internal---" name "---" (gnc-commodity-get-printname curr-commodity))
 
                   (for-each
                     (lambda (split)
 		      (set! work-done (+ 1 work-done))
 		      (gnc:report-percent-done (* 85 (/ work-done splits-to-do)))
-                      (let ((parent (gnc:split-get-parent split)))
-                        (if (and (gnc:timepair-le (gnc:transaction-get-date-posted parent) to-date-tp)
-                                 (gnc:timepair-ge (gnc:transaction-get-date-posted parent) from-date-tp))
-                          (let* ((parent-description (gnc:transaction-get-description parent))
-                                 (parent-currency (gnc:transaction-get-currency parent)))
+                      (let ((parent (xaccSplitGetParent split)))
+                        (if (and (gnc:timepair-le (gnc-transaction-get-date-posted parent) to-date-tp)
+                                 (gnc:timepair-ge (gnc-transaction-get-date-posted parent) from-date-tp))
+                          (let* ((parent-description (xaccTransGetDescription parent))
+                                 (parent-currency (xaccTransGetCurrency parent)))
                             ;(gnc:debug parent-description
                             ;           " - " 
-                            ;           (gnc:commodity-get-printname parent-currency))
+                            ;           (gnc-commodity-get-printname parent-currency))
                             (for-each
                               (lambda (s)
-                                (let* ((s-account (gnc:split-get-account s))
-                                       (s-amount (gnc:split-get-amount s))
-                                       (s-value (gnc:split-get-value s))
-                                       (s-commodity (gnc:account-get-commodity s-account)))
+                                (let* ((s-account (xaccSplitGetAccount s))
+                                       (s-amount (xaccSplitGetAmount s))
+                                       (s-value (xaccSplitGetValue s))
+                                       (s-commodity (xaccAccountGetCommodity s-account)))
 				  ;; Check if this is a dangling split
 				  ;; and print a warning
 				  (if (not s-account)
 				      (display
 				       (string-append
 					"WARNING: s-account is NULL for split: "
-					(gnc:split-get-guid s) "\n")))
+					(gncSplitGetGUID s) "\n")))
 
-                                  ;(gnc:debug (gnc:account-get-name s-account))
+                                  ;(gnc:debug (xaccAccountGetName s-account))
                                   (if (and	 ;; make sure we don't have
 				       s-account ;;  any dangling splits
 				       (not (account-in-list? s-account accounts)))
 				      (if (not (split-in-list? s seen-split-list))
 					  (begin  
 					    (set! seen-split-list (cons s seen-split-list))
-					    (if (gnc:numeric-negative-p s-value)
+					    (if (gnc-numeric-negative-p s-value)
 						(let ((pair (account-in-alist s-account money-in-alist)))
-						  ;(gnc:debug "in:" (gnc:commodity-get-printname s-commodity)
-						;	     (gnc:numeric-to-double s-amount) 
-						;	     (gnc:commodity-get-printname parent-currency)
-						;	     (gnc:numeric-to-double s-value))
+						  ;(gnc:debug "in:" (gnc-commodity-get-printname s-commodity)
+						;	     (gnc-numeric-to-double s-amount)
+						;	     (gnc-commodity-get-printname parent-currency)
+						;	     (gnc-numeric-to-double s-value))
 						  (if (not pair)
 						      (begin
 							(set! pair (list s-account (gnc:make-commodity-collector)))
@@ -305,17 +306,17 @@
 						      )
 						  (let ((s-account-in-collector (cadr pair))
 							(s-report-value (to-report-currency parent-currency
-											    (gnc:numeric-neg s-value)
-											    (gnc:transaction-get-date-posted
+											    (gnc-numeric-neg s-value)
+											    (gnc-transaction-get-date-posted
 											     parent))))
 						    (money-in-collector 'add report-currency s-report-value)
 						    (s-account-in-collector 'add report-currency s-report-value))
 						  )
 						(let ((pair (account-in-alist s-account money-out-alist)))
-						  ;(gnc:debug "out:" (gnc:commodity-get-printname s-commodity)
-						;	     (gnc:numeric-to-double s-amount) 
-						;	     (gnc:commodity-get-printname parent-currency)
-						;	     (gnc:numeric-to-double s-value))
+						  ;(gnc:debug "out:" (gnc-commodity-get-printname s-commodity)
+						;	     (gnc-numeric-to-double s-amount)
+						;	     (gnc-commodity-get-printname parent-currency)
+						;	     (gnc-numeric-to-double s-value))
 						  (if (not pair)
 						      (begin
 							(set! pair (list s-account (gnc:make-commodity-collector)))
@@ -327,7 +328,7 @@
 						  (let ((s-account-out-collector (cadr pair))
 							(s-report-value (to-report-currency parent-currency
 											    s-value
-											    (gnc:transaction-get-date-posted
+											    (gnc-transaction-get-date-posted
 											     parent))))
 						    (money-out-collector 'add report-currency s-report-value)
 						    (s-account-out-collector 'add report-currency s-report-value))
@@ -338,13 +339,13 @@
 				      )
 				  )
 				)
-                              (gnc:transaction-get-splits parent)
+                              (xaccTransGetSplitList parent)
                             )
                           )
                         )
                       )
                     )
-                    (gnc:account-get-split-list current)
+                    (xaccAccountGetSplitList current)
                   )
 
                   (calc-money-in-out-internal rest))))
@@ -389,8 +390,8 @@
                                  (gnc:html-markup-anchor
                                    (gnc:account-anchor-text account)
                                    (if show-full-names?
-                                     (gnc:account-get-full-name account)
-                                     (gnc:account-get-name account))))))
+                                     (gnc-account-get-full-name account)
+                                     (xaccAccountGetName account))))))
                   
                   (set! account-disp-list (cons anchor account-disp-list))
                 )
@@ -438,8 +439,8 @@
                     (gnc:html-markup-anchor
                       (gnc:account-anchor-text acct)
                       (if show-full-names?
-                        (gnc:account-get-full-name acct)
-                        (gnc:account-get-name acct))))
+                        (gnc-account-get-full-name acct)
+                        (xaccAccountGetName acct))))
                   (gnc:make-html-table-header-cell/markup
                    "number-cell" (gnc:sum-collector-commodity (cadr pair) report-currency exchange-fn))))
               )
@@ -483,8 +484,8 @@
                     (gnc:html-markup-anchor
                       (gnc:account-anchor-text acct)
                       (if show-full-names?
-                        (gnc:account-get-full-name acct)
-                        (gnc:account-get-name acct))))
+                        (gnc-account-get-full-name acct)
+                        (xaccAccountGetName acct))))
                   (gnc:make-html-table-header-cell/markup
                    "number-cell" (gnc:sum-collector-commodity (cadr pair) report-currency exchange-fn))))
               )

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/category-barchart.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/category-barchart.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/category-barchart.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -116,7 +116,7 @@
       (lambda ()
         (gnc:filter-accountlist-type 
          account-types
-         (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       (lambda (accounts)
         (list #t
               (gnc:filter-accountlist-type account-types accounts)))
@@ -212,8 +212,8 @@
         (chart (gnc:make-html-barchart))
         (topl-accounts (gnc:filter-accountlist-type 
                         account-types
-                        (gnc:group-get-account-list 
-                         (gnc:get-current-group)))))
+                        (xaccGroupGetAccountListSorted
+                         (gnc-get-current-group)))))
     
     ;; Returns true if the account a was selected in the account
     ;; selection option.
@@ -243,7 +243,7 @@
                ;; created.
                (date-string-list
                 (map (lambda (date-list-item)
-                       (gnc:print-date
+                       (gnc-print-date
                         (if do-intervals?
                             (car date-list-item)
                             date-list-item)))
@@ -257,7 +257,7 @@
           (define (collector->double c date)
             ;; Future improvement: Let the user choose which kind of
             ;; currency combining she want to be done. 
-            (gnc:numeric-to-double 
+            (gnc-numeric-to-double
              (gnc:gnc-monetary-amount
               (gnc:sum-collector-commodity 
                c report-currency 
@@ -370,16 +370,16 @@
 			  (cond
 			   ((eq? sort-method 'acct-code)
 			    (lambda (a b) 
-			      (string<? (gnc:account-get-code (car a))
-					(gnc:account-get-code (car b)))))
+			      (string<? (xaccAccountGetCode (car a))
+					(xaccAccountGetCode (car b)))))
 			   ((eq? sort-method 'alphabetical)
 			    (lambda (a b) 
 			      (string<? ((if show-fullname?
-					     gnc:account-get-full-name
-					     gnc:account-get-name) (car a))
+					     gnc-account-get-full-name
+					     xaccAccountGetName) (car a))
 					((if show-fullname?
-					     gnc:account-get-full-name
-					     gnc:account-get-name) (car b)))))
+					     gnc-account-get-full-name
+					     xaccAccountGetName) (car b)))))
 			   (else
 			    (lambda (a b)
 			      (> (apply + (cadr a))
@@ -406,8 +406,8 @@
                              (if do-intervals?
                                  (_ "%s to %s")
                                  (_ "Balances %s to %s"))
-                             (gnc:print-date from-date-tp) 
-                             (gnc:print-date to-date-tp)))
+                             (gnc-print-date from-date-tp)
+                             (gnc-print-date to-date-tp)))
              (gnc:html-barchart-set-width! chart width)
              (gnc:html-barchart-set-height! chart height)
              
@@ -416,7 +416,7 @@
              ;; FIXME: axis labels are not yet supported by
              ;; libguppitank.
              (gnc:html-barchart-set-y-axis-label!
-              chart (gnc:commodity-get-mnemonic report-currency))
+              chart (gnc-commodity-get-mnemonic report-currency))
              (gnc:html-barchart-set-row-labels-rotated?! chart #t)
              (gnc:html-barchart-set-stacked?! chart stacked?)
              ;; If this is a stacked barchart, then reverse the legend.
@@ -468,8 +468,8 @@
                            (if (string? (car pair))
                                (car pair)
                                ((if show-fullname?
-                                    gnc:account-get-full-name
-                                    gnc:account-get-name) (car pair)))
+                                    gnc-account-get-full-name
+                                    xaccAccountGetName) (car pair)))
 			   'pre " " (_ "and") " " 'post))
                          all-data))
              (gnc:html-barchart-set-col-colors! 
@@ -507,8 +507,8 @@
                                (list gnc:pagename-general 
                                      gnc:optname-reportname
                                      ((if show-fullname?
-                                          gnc:account-get-full-name
-                                          gnc:account-get-name) acct))))))))
+                                          gnc-account-get-full-name
+                                          xaccAccountGetName) acct))))))))
                     all-data)))
                (gnc:html-barchart-set-button-1-bar-urls! 
                 chart (append urls urls))
@@ -554,12 +554,15 @@
  (list 
   ;; reportname, account-types, do-intervals?, 
   ;; menu-reportname, menu-tip
-  (list reportname-income '(income) #t menuname-income menutip-income (lambda (x) #t))
-  (list reportname-expense '(expense) #t menuname-expense menutip-expense (lambda (x) #f))
+  (list reportname-income (list ACCT-TYPE-INCOME) #t menuname-income menutip-income (lambda (x) #t))
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) #t menuname-expense menutip-expense (lambda (x) #f))
   (list reportname-assets 
-        '(asset bank cash checking savings money-market receivable
-                stock mutual-fund currency)
+        (list ACCT-TYPE-ASSET ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CHECKING
+              ACCT-TYPE-SAVINGS ACCT-TYPE-MONEYMRKT
+              ACCT-TYPE-RECEIVABLE ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL
+              ACCT-TYPE-CURRENCY)
         #f menuname-assets menutip-assets (lambda (x) #f))
   (list reportname-liabilities 
-        '(liability payable credit credit-line)
+        (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-CREDIT
+              ACCT-TYPE-CREDITLINE)
         #f menuname-liabilities menutip-liabilities (lambda (x) #t))))

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/daily-reports.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/daily-reports.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/daily-reports.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -102,7 +102,7 @@
       (lambda ()
         (gnc:filter-accountlist-type 
          account-types
-         (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       (lambda (accounts)
         (list #t
               (gnc:filter-accountlist-type
@@ -170,8 +170,8 @@
     (define (get-split-value split date)
       (monetary->double
        (gnc:make-gnc-monetary
-        (gnc:account-get-commodity (gnc:split-get-account split))
-        (gnc:split-get-amount split))
+        (xaccAccountGetCommodity (xaccSplitGetAccount split))
+        (xaccSplitGetAmount split))
        date))
     
     ;; calculate the statistics for one interval - returns a list 
@@ -206,14 +206,14 @@
 
         (define (split-recurse)
           (if (or (null? splits) (gnc:timepair-gt 
-                                  (gnc:transaction-get-date-posted 
-                                   (gnc:split-get-parent
+                                  (gnc-transaction-get-date-posted
+                                   (xaccSplitGetParent
                                     (car splits))) to)) 
               #f
               (let* 
                   ((split (car splits))
-                   (split-time (gnc:transaction-get-date-posted 
-                                (gnc:split-get-parent split)))
+                   (split-time (gnc-transaction-get-date-posted
+                                (xaccSplitGetParent split)))
                    ;; FIXME: Which date should we use here? The 'to'
                    ;; date? the 'split-time'?
                    (split-amt (get-split-value split split-time)))
@@ -306,7 +306,7 @@
          
          (commodity-list #f)
          (exchange-fn #f)
-         (print-info (gnc:commodity-print-info report-currency #t))
+         (print-info (gnc-commodity-print-info report-currency #t))
         
          (beforebegindate (gnc:timepair-end-day-time 
                            (gnc:timepair-previous-day from-date-tp)))
@@ -314,11 +314,11 @@
          (chart (gnc:make-html-piechart))
          (topl-accounts (gnc:filter-accountlist-type 
                          account-types
-                         (gnc:group-get-account-list 
-                          (gnc:get-current-group)))))
+                         (xaccGroupGetAccountListSorted
+                          (gnc-get-current-group)))))
     
     (define (monetary->double foreign-monetary date)
-      (gnc:numeric-to-double
+      (gnc-numeric-to-double
        (gnc:gnc-monetary-amount
         (exchange-fn foreign-monetary report-currency date))))
     
@@ -338,7 +338,7 @@
               (filter proc (cdr l)))))
     
     (if (not (null? accounts))
-        (let* ((query (gnc:malloc-query))
+        (let* ((query (qof-query-create-for-splits))
                (splits '())
                (data '())
                ;; startbal will be a commodity-collector
@@ -378,11 +378,11 @@
           
           ;; initialize the query to find splits in the right 
           ;; date range and accounts
-          (gnc:query-set-book query (gnc:get-current-book))
+          (qof-query-set-book query (gnc-get-current-book))
           
 	  ;; for balance purposes, we don't need to do this, but it cleans up
 	  ;; the table display.
-          (gnc:query-set-match-non-voids-only! query (gnc:get-current-book))
+          (gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
           ;; add accounts to the query (include subaccounts 
           ;; if requested)
 	  (gnc:report-percent-done 25)
@@ -403,18 +403,18 @@
                       (delete-duplicates (append accounts subaccts)))))
 	  (gnc:report-percent-done 30)
           
-          (gnc:query-add-account-match query accounts 'guid-match-any 'query-and)
+          (xaccQueryAddAccountMatch query accounts QOF-GUID-MATCH-ANY QOF-QUERY-AND)
           
           ;; match splits between start and end dates 
-          (gnc:query-add-date-match-timepair
-           query #t from-date-tp #t to-date-tp 'query-and)
-          (gnc:query-set-sort-order query
-				    (list gnc:split-trans gnc:trans-date-posted)
-				    (list gnc:query-default-sort)
+          (xaccQueryAddDateMatchTS
+           query #t from-date-tp #t to-date-tp QOF-QUERY-AND)
+          (qof-query-set-sort-order query
+				    (list SPLIT-TRANS TRANS-DATE-POSTED)
+				    (list QUERY-DEFAULT-SORT)
 				    '())
           
           ;; get the query results 
-          (set! splits (gnc:query-get-splits query))
+          (set! splits (qof-query-run query))
 	  (gnc:report-percent-done 40)
           
           ;; find the net starting balance for the set of accounts 
@@ -423,11 +423,11 @@
                  accounts 
                  (lambda (acct) (gnc:account-get-comm-balance-at-date 
                                  acct beforebegindate #f))
-                 gnc:account-reverse-balance?))
+                 gnc-reverse-balance))
 	  (gnc:report-percent-done 50)
           
           (set! startbal 
-                (gnc:numeric-to-double
+                (gnc-numeric-to-double
                  (gnc:gnc-monetary-amount
                   (gnc:sum-collector-commodity 
                    startbal
@@ -463,10 +463,10 @@
                                     (string-append
                                      (car p)
                                      " - "
-                                     (gnc:amount->string
-                                      (gnc:double-to-gnc-numeric
+                                     (xaccPrintAmount
+                                      (double-to-gnc-numeric
                                        (cadr p)
-                                       (gnc:commodity-get-fraction report-currency)
+                                       (gnc-commodity-get-fraction report-currency)
                                        GNC-RND-ROUND)
                                       print-info))
                                     (car p)))
@@ -482,16 +482,16 @@
                    chart (string-append
                           (sprintf #f
                                    (_ "%s to %s")
-                                   (gnc:print-date from-date-tp) 
-                                   (gnc:print-date to-date-tp))
+                                   (gnc-print-date from-date-tp)
+                                   (gnc-print-date to-date-tp))
                           (if show-total?
                               (let ((total (apply + daily-totals)))
                                 (sprintf
                                  #f ": %s"
-                                 (gnc:amount->string
-                                  (gnc:double-to-gnc-numeric
+                                 (xaccPrintAmount
+                                  (double-to-gnc-numeric
                                    total
-                                   (gnc:commodity-get-fraction report-currency)
+                                   (gnc-commodity-get-fraction report-currency)
                                    GNC-RND-ROUND)
                                   print-info)))
                               "")))
@@ -531,5 +531,5 @@
 
  (list 
   ;; reportname, account-types, menu-reportname, menu-tip
-  (list reportname-income '(income) menuname-income menutip-income)
-  (list reportname-expense '(expense) menuname-expense menutip-expense)))
+  (list reportname-income (list ACCT-TYPE-INCOME) menuname-income menutip-income)
+  (list reportname-expense (list ACCT-TYPE-EXPENSE) menuname-expense menutip-expense)))

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/equity-statement.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/equity-statement.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/equity-statement.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -107,12 +107,12 @@
     (add-option
       (gnc:make-string-option
       (N_ "General") optname-report-title
-      "a" opthelp-report-title reportname))
+      "a" opthelp-report-title (_ reportname)))
     (add-option
       (gnc:make-string-option
       (N_ "General") optname-party-name
       "b" opthelp-party-name ""))
-    ;; this should default to company name in (gnc:get-current-book)
+    ;; this should default to company name in (gnc-get-current-book)
     ;; does anyone know the function to get the company name??
     ;; (GnuCash is *so* well documented... sigh)
     
@@ -129,9 +129,12 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
-	 (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
+         (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       #f #t))
     
     ;; all about currencies
@@ -237,14 +240,15 @@
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
          (asset-accounts
-          (assoc-ref split-up-accounts 'asset))
+          (assoc-ref split-up-accounts ACCT-TYPE-ASSET))
          (liability-accounts
-          (assoc-ref split-up-accounts 'liability))
+          (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY))
          (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
          (equity-accounts
-          (assoc-ref split-up-accounts 'equity))
+          (assoc-ref split-up-accounts ACCT-TYPE-EQUITY))
+
 	 ;; N.B.: equity-accounts will also contain drawing accounts
 	 ;; these must still be split-out and itemized separately
 	 (capital-accounts #f)
@@ -276,8 +280,8 @@
 		  (string-append "%s %s "
 				 (_ "For Period Covering %s to %s"))
 		  company-name report-title
-                  (gnc:print-date start-date-printable)
-                  (gnc:print-date end-date-tp)))
+                  (gnc-print-date start-date-printable)
+                  (gnc-print-date end-date-tp)))
     
     (if (null? accounts)
 	
@@ -340,8 +344,8 @@
 	       (period-for (if terse-period?
 			       (string-append " " (_ "for Period"))
 			       (sprintf #f (string-append ", " (_ "%s to %s"))
-					(gnc:print-date start-date-printable)
-					(gnc:print-date end-date-tp))
+					(gnc-print-date start-date-printable)
+					(gnc-print-date end-date-tp))
 			       ))
 	       )
 	  
@@ -351,7 +355,7 @@
 		   exchange-fn rule? row-style)
 	    (let* ((neg? (and amount
 			      neg-label
-			      (gnc:numeric-negative-p
+			      (gnc-numeric-negative-p
 			       (gnc:gnc-monetary-amount
 				(gnc:sum-collector-commodity
 				 amount report-commodity exchange-fn)))))
@@ -367,7 +371,7 @@
 		    (or (and (gnc:uniform-commodity? pos-bal report-commodity)
 			     bal)
 			(and show-fcur?
-			     (gnc:commodity-table
+			     (gnc-commodity-table
 			      pos-bal report-commodity exchange-fn))
 			bal
 			))
@@ -409,7 +413,7 @@
 						  report-commodity
 						  weighted-fn)))
 		   
-		   (unrealized-gain (gnc:numeric-sub-fixed value cost)))
+		   (unrealized-gain (gnc-numeric-sub-fixed value cost)))
 	      
 	      (unrealized-gain-collector 'add report-commodity unrealized-gain)
 	      unrealized-gain-collector
@@ -582,7 +586,7 @@
 	  (report-line
 	   build-table
 	   (string-append (_ "Capital") ", "
-			  (gnc:print-date start-date-printable))
+			  (gnc-print-date start-date-printable))
 	   #f start-total-equity
 	   1 start-exchange-fn #f "primary-subheading"
 	   )
@@ -607,7 +611,7 @@
 	   withdrawals
 	   0 end-exchange-fn #f #f
 	   )
-	  (or (gnc:commodity-collector-allzero? net-unrealized-gains)
+	  (or (gnc-commodity-collector-allzero? net-unrealized-gains)
 	      (report-line
 	       build-table 
 	       (_ "Unrealized Gains")
@@ -626,7 +630,7 @@
 	  (report-line
 	   build-table 
 	   (string-append (_ "Capital") ", "
-			  (gnc:print-date end-date-tp))
+			  (gnc-print-date end-date-tp))
 	   #f
 	   end-total-equity
 	   1 end-exchange-fn #f "primary-subheading"
@@ -639,8 +643,8 @@
           (and show-rates?
 	       (let* ((curr-tbl (gnc:make-html-table))
 		      (headers (list
-				(gnc:print-date start-date-printable)
-				(gnc:print-date end-date-tp)
+				(gnc-print-date start-date-printable)
+				(gnc-print-date end-date-tp)
 				)
 			       )
 		      (then (gnc:html-make-exchangerates

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/general-journal.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/general-journal.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/general-journal.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -48,7 +48,7 @@
 (define (general-journal-options-generator)
   
   (let* ((options (gnc:report-template-new-options/name regrptname))
-	 (query (gnc:malloc-query))
+	 (query (qof-query-create-for-splits))
 	 )
     
     (define (set-option! section name value)
@@ -60,19 +60,19 @@
     ;; however, may be of issue here. Since I don't know if the
     ;; Register Report properly ignores voided transactions, I'll err
     ;; on the side of safety by excluding them from the query....
-    (gnc:query-set-book query (gnc:get-current-book))
-    (gnc:query-set-match-non-voids-only! query (gnc:get-current-book))
-    (gnc:query-set-sort-order query
-			      (list gnc:split-trans gnc:trans-date-posted)
-			      (list gnc:query-default-sort)
+    (qof-query-set-book query (gnc-get-current-book))
+    (gnc:query-set-match-non-voids-only! query (gnc-get-current-book))
+    (qof-query-set-sort-order query
+			      (list SPLIT-TRANS TRANS-DATE-POSTED)
+			      (list QUERY-DEFAULT-SORT)
 			      '())
-    (gnc:query-set-sort-increasing query #t #t #t)
+    (qof-query-set-sort-increasing query #t #t #t)
 
-    (gnc:query-add-account-match
+    (xaccQueryAddAccountMatch
      query
-     (gnc:group-get-subaccounts (gnc:book-get-template-group (gnc:get-current-book)))
-     'guid-match-none
-     'query-and)
+     (xaccGroupGetSubAccountsSorted (gnc-book-get-template-group (gnc-get-current-book)))
+     QOF-GUID-MATCH-NONE
+     QOF-QUERY-AND)
 
     ;; set the "__reg" options required by the Register Report...
     (for-each
@@ -80,18 +80,18 @@
        (set-option! "__reg" (car l) (cadr l)))
      ;; One list per option here with: option-name, default-value
      (list
-      (list "query" (gnc:query->scm query)) ;; think this wants an scm...
+      (list "query" (gnc-query2scm query)) ;; think this wants an scm...
       (list "journal" #t)
       (list "double" #t)
-      (list "debit-string" (N_ "Debit"))
-      (list "credit-string" (N_ "Credit"))
+      (list "debit-string" (_ "Debit"))
+      (list "credit-string" (_ "Credit"))
       )
      )
     ;; we'll leave query malloc'd in case this is required by the C side...
     
     ;; set options in the general tab...
     (set-option!
-     gnc:pagename-general (N_ "Title") (N_ "General Journal"))
+     gnc:pagename-general (N_ "Title") (_ reportname))
     ;; we can't (currently) set the Report name here
     ;; because it is automatically set to the template
     ;; name... :(

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/income-statement.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/income-statement.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/income-statement.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -10,7 +10,7 @@
 ;;    statement to no more than daily resolution.
 ;;    
 ;;    The Company Name field does not currently default to the name
-;;    in (gnc:get-current-book).
+;;    in (gnc-get-current-book).
 ;;    
 ;;    Line & column alignments may still not conform with
 ;;    textbook accounting practice (they're close though!).
@@ -134,12 +134,12 @@
     (add-option
       (gnc:make-string-option
       gnc:pagename-general optname-report-title
-      "a" opthelp-report-title reportname))
+      "a" opthelp-report-title (_ reportname)))
     (add-option
       (gnc:make-string-option
       gnc:pagename-general optname-party-name
       "b" opthelp-party-name ""))
-    ;; this should default to company name in (gnc:get-current-book)
+    ;; this should default to company name in (gnc-get-current-book)
     ;; does anyone know the function to get the company name??
     ;; (GnuCash is *so* well documented... sigh)
     
@@ -157,8 +157,8 @@
       (lambda ()
 	(gnc:filter-accountlist-type
 	 ;; select, by default, only income and expense accounts
-	 '(income expense)
-	 (gnc:group-get-subaccounts (gnc:get-current-group))))
+	 (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
+	 (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
      options gnc:pagename-accounts optname-depth-limit
@@ -334,11 +334,11 @@
 	 
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
-	 (revenue-accounts (assoc-ref split-up-accounts 'income))
-	 (expense-accounts (assoc-ref split-up-accounts 'expense))
+	 (revenue-accounts (assoc-ref split-up-accounts ACCT-TYPE-INCOME))
+	 (expense-accounts (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE))
          (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
 	 
          (doc (gnc:make-html-document))
 	 ;; this can occasionally put extra (blank) columns in our
@@ -360,7 +360,7 @@
       (define allow-same-column-totals #t)
       (let* ((neg? (and signed-balance
 			neg-label
-			(gnc:numeric-negative-p
+			(gnc-numeric-negative-p
 			 (gnc:gnc-monetary-amount
 			  (gnc:sum-collector-commodity
 			   signed-balance report-commodity exchange-fn)))))
@@ -397,8 +397,8 @@
 		  (string-append "%s %s "
 				 (_ "For Period Covering %s to %s"))
 		  company-name report-title
-                  (gnc:print-date start-date-printable)
-                  (gnc:print-date end-date-tp)))
+                  (gnc-print-date start-date-printable)
+                  (gnc-print-date end-date-tp)))
     
     (if (null? accounts)
 	
@@ -431,8 +431,8 @@
 	       (period-for (if terse-period?
 			       (string-append " " (_ "for Period"))
 			       (sprintf #f (string-append ", " (_ "%s to %s"))
-					(gnc:print-date start-date-printable)
-					(gnc:print-date end-date-tp))
+					(gnc-print-date start-date-printable)
+					(gnc-print-date end-date-tp))
 			       )
 			   )
 	       )
@@ -443,7 +443,7 @@
 		   exchange-fn rule? row-style)
 	    (let* ((neg? (and amount
 			      neg-label
-			      (gnc:numeric-negative-p
+			      (gnc-numeric-negative-p
 			       (gnc:gnc-monetary-amount
 				(gnc:sum-collector-commodity
 				 amount report-commodity exchange-fn)))))
@@ -459,7 +459,7 @@
 		    (or (and (gnc:uniform-commodity? pos-bal report-commodity)
 			     bal)
 			(and show-fcur?
-			     (gnc:commodity-table
+			     (gnc-commodity-table
 			      pos-bal report-commodity exchange-fn))
 			bal
 			))

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/net-barchart.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/net-barchart.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/net-barchart.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -88,7 +88,7 @@
          (if inc-exp?
              gnc:account-is-inc-exp?
              (lambda (account) (not (gnc:account-is-inc-exp? account))))
-         (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       (lambda (accounts)
         (list #t
               (filter 
@@ -193,7 +193,7 @@
     ;; 'report-currency' according to the exchange-fn. Returns a
     ;; double.
     (define (collector->double c date)
-      (gnc:numeric-to-double
+      (gnc-numeric-to-double
        (gnc:gnc-monetary-amount
         (gnc:sum-collector-commodity 
          c report-currency 
@@ -246,23 +246,23 @@
             (date-string-list (map 
                                (if inc-exp?
                                    (lambda (date-list-item)
-                                     (gnc:print-date
+                                     (gnc-print-date
                                       (car date-list-item)))
-                                   gnc:print-date)
+                                   gnc-print-date)
                                dates-list)))
 
        (set! assets-list
              (process-datelist
               (if inc-exp? 
                   accounts
-                  (assoc-ref classified-accounts 'asset))
+                  (assoc-ref classified-accounts ACCT-TYPE-ASSET))
               dates-list #t))
        (gnc:report-percent-done 70)
        (set! liability-list
              (process-datelist
               (if inc-exp?
                   accounts
-                  (assoc-ref classified-accounts 'liability))
+                  (assoc-ref classified-accounts ACCT-TYPE-LIABILITY))
               dates-list #f))
        (gnc:report-percent-done 80)
        (set! net-list
@@ -274,13 +274,13 @@
        (gnc:html-barchart-set-subtitle!
         chart (sprintf #f
                        (_ "%s to %s")
-                       (gnc:print-date from-date-tp) 
-                       (gnc:print-date to-date-tp)))
+                       (gnc-print-date from-date-tp)
+                       (gnc-print-date to-date-tp)))
        (gnc:html-barchart-set-width! chart width)
        (gnc:html-barchart-set-height! chart height)
        (gnc:html-barchart-set-row-labels! chart date-string-list)
        (gnc:html-barchart-set-y-axis-label!
-        chart (gnc:commodity-get-mnemonic report-currency))
+        chart (gnc-commodity-get-mnemonic report-currency))
        ;; Determine whether we have enough space for horizontal labels
        ;; -- kind of a hack. Assumptions: y-axis labels and legend
        ;; require 200 pixels, and each x-axes label needs 60 pixels.

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/portfolio.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/portfolio.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/portfolio.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -72,8 +72,8 @@
       "b"
       (N_ "Stock Accounts to report on")
       (lambda () (filter gnc:account-is-stock?
-                         (gnc:group-get-subaccounts
-                          (gnc:get-current-group))))
+                         (xaccGroupGetSubAccountsSorted
+                          (gnc-get-current-group))))
       (lambda (accounts) (list  #t 
                                 (filter gnc:account-is-stock? accounts)))
       #t))
@@ -110,7 +110,7 @@
                                 exchange-fn price-fn include-empty collector)
 
    (let ((share-print-info
-	  (gnc:share-print-info-places
+	  (gnc-share-print-info-places
 	   (inexact->exact (get-option gnc:pagename-general
 				       optname-shares-digits)))))
 
@@ -119,9 +119,9 @@
           (let* ((row-style (if odd-row? "normal-row" "alternate-row"))
                  (current (car accounts))
                  (rest (cdr accounts))
-                 (commodity (gnc:account-get-commodity current))
-                 (ticker-symbol (gnc:commodity-get-mnemonic commodity))
-                 (listing (gnc:commodity-get-namespace commodity))
+                 (commodity (xaccAccountGetCommodity current))
+                 (ticker-symbol (gnc-commodity-get-mnemonic commodity))
+                 (listing (gnc-commodity-get-namespace commodity))
                  (unit-collector (gnc:account-get-comm-balance-at-date
                                   current to-date #f))
                  (units (cadr (unit-collector 'getpair commodity #f)))
@@ -132,7 +132,7 @@
 
 	    (set! work-done (+ 1 work-done))
 	    (gnc:report-percent-done (* 100 (/ work-done work-to-do)))
-	    (if (or include-empty (not (gnc:numeric-zero-p units)))
+	    (if (or include-empty (not (gnc-numeric-zero-p units)))
 		(begin (collector 'add currency (gnc:gnc-monetary-amount value))
 		       (gnc:html-table-append-row/markup!
 			table
@@ -142,16 +142,16 @@
 			      listing
 			      (gnc:make-html-table-header-cell/markup
 			       "number-cell" 
-			       (gnc:amount->string units share-print-info))
+			       (xaccPrintAmount units share-print-info))
 			      (gnc:make-html-table-header-cell/markup
 			       "number-cell"
 			       (gnc:html-price-anchor
 				(car price-info)
-				(gnc:make-gnc-monetary (gnc:price-get-currency (car price-info))
-						       (gnc:price-get-value (car price-info)))))
+				(gnc:make-gnc-monetary (gnc-price-get-currency (car price-info))
+						       (gnc-price-get-value (car price-info)))))
 			      (gnc:make-html-table-header-cell/markup
 			       "number-cell" value)))
-		       ;;(display (sprintf #f "Shares: %6.6d  " (gnc:numeric-to-double units)))
+		       ;;(display (sprintf #f "Shares: %6.6d  " (gnc-numeric-to-double units)))
 		       ;;(display units) (newline)
 		       (table-add-stock-rows-internal rest (not odd-row?)))
 		(table-add-stock-rows-internal rest odd-row?)))))
@@ -184,7 +184,7 @@
     (gnc:html-document-set-title!
      document (string-append 
                report-title
-               (sprintf #f " %s" (gnc:print-date to-date))))
+               (sprintf #f " %s" (gnc-print-date to-date))))
 
     ;(gnc:debug "accounts" accounts)
     (if (not (null? accounts))
@@ -192,7 +192,7 @@
                                 (append 
                                  (gnc:acccounts-get-all-subaccounts 
                                   accounts) accounts) currency))
-               (pricedb (gnc:book-get-pricedb (gnc:get-current-book)))
+               (pricedb (gnc-pricedb-get-db (gnc-get-current-book)))
 	       (exchange-fn (gnc:case-exchange-fn price-source currency to-date))
                (price-fn
                 (case price-source
@@ -206,21 +206,21 @@
                   ((pricedb-latest) 
                    (lambda (foreign date) 
                      (let ((price
-                            (gnc:pricedb-lookup-latest-any-currency
+                            (gnc-pricedb-lookup-latest-any-currency
                              pricedb foreign)))
                        (if (and price (> (length price) 0))
-                           (let ((v (gnc:price-get-value (car price))))
+                           (let ((v (gnc-price-get-value (car price))))
                              (cons (car price) v))
-                           (cons #f (gnc:numeric-zero))))))
+                           (cons #f (gnc-numeric-zero))))))
                   ((pricedb-nearest) 
                    (lambda (foreign date) 
                      (let ((price
-                            (gnc:pricedb-lookup-nearest-in-time-any-currency 
-                             pricedb foreign (gnc:timepair-canonical-day-time date))))
+                            (gnc-pricedb-lookup-nearest-in-time-any-currency
+                             pricedb foreign (timespecCanonicalDayTime date))))
                        (if (and price (> (length price) 0))
-                           (let ((v (gnc:price-get-value (car price))))
+                           (let ((v (gnc-price-get-value (car price))))
                              (cons (car price) v))
-                           (cons #f (gnc:numeric-zero)))))))))
+                           (cons #f (gnc-numeric-zero)))))))))
           
           (gnc:html-table-set-col-headers!
            table

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/price-scatter.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/price-scatter.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/price-scatter.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -77,7 +77,7 @@
       pagename-price optname-price-commodity
       "e"
       (N_ "Calculate the price of this commodity.")
-      (gnc:locale-default-iso-currency-code)))
+      (gnc-locale-default-iso-currency-code)))
 
     (add-option
      (gnc:make-multichoice-option
@@ -166,8 +166,8 @@
          (document (gnc:make-html-document))
          (chart (gnc:make-html-scatter))
          (currency-accounts 
-          (filter gnc:account-has-shares? (gnc:group-get-subaccounts
-                                           (gnc:get-current-group))))
+          (filter gnc:account-has-shares? (xaccGroupGetSubAccountsSorted
+                                           (gnc-get-current-group))))
          (data '()))
 
     ;; Short helper for all the warnings below
@@ -182,12 +182,12 @@
      chart report-title)
     (gnc:html-scatter-set-subtitle!
      chart (string-append
-            (gnc:commodity-get-mnemonic price-commodity)
+            (gnc-commodity-get-mnemonic price-commodity)
             " - "
             (sprintf #f
                      (_ "%s to %s")
-                     (gnc:print-date from-date-tp) 
-                     (gnc:print-date to-date-tp))))
+                     (gnc-print-date from-date-tp)
+                     (gnc-print-date to-date-tp))))
     (gnc:html-scatter-set-width! chart width)
     (gnc:html-scatter-set-height! chart height)
     (gnc:html-scatter-set-marker! chart 
@@ -200,7 +200,7 @@
                                     ((filledsquare) "filled square")))
     (gnc:html-scatter-set-markercolor! chart mcolor)
     (gnc:html-scatter-set-y-axis-label!
-     chart (gnc:commodity-get-mnemonic report-currency))
+     chart (gnc-commodity-get-mnemonic report-currency))
     (gnc:html-scatter-set-x-axis-label!
      chart (case interval
              ((DayDelta) (N_ "Days"))
@@ -210,7 +210,7 @@
              ((YearDelta) (N_ "Years"))))
 
     (if 
-     (not (gnc:commodity-equiv? report-currency price-commodity))
+     (not (gnc-commodity-equiv report-currency price-commodity))
      (begin
        (if (not (null? currency-accounts))
            (set!
@@ -226,10 +226,10 @@
                 price-commodity report-currency))
               ((pricedb)
                (map (lambda (p)
-                      (list (gnc:price-get-time p)
-                            (gnc:price-get-value p)))
-                    (gnc:pricedb-get-prices
-                     (gnc:book-get-pricedb (gnc:get-current-book))
+                      (list (gnc-price-get-time p)
+                            (gnc-price-get-value p)))
+                    (gnc-pricedb-get-prices
+                     (gnc-pricedb-get-db (gnc-get-current-book))
                      price-commodity report-currency)))
               )))
 
@@ -242,14 +242,14 @@
 
        ;; some output
        ;;(warn "data" (map (lambda (x) (list
-       ;;			(gnc:print-date (car x))
-       ;;		(gnc:numeric-to-double (second x))))
+       ;;			(gnc-print-date (car x))
+       ;;		(gnc-numeric-to-double (second x))))
        ;; data))
        
        ;; convert the gnc:numeric's to doubles
        (set! data (map (lambda (x) 
                          (list (first x) 
-                               (gnc:numeric-to-double (second x))))
+                               (gnc-numeric-to-double (second x))))
                        data))
 
        ;; convert the dates to the weird x-axis scaling of the

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/register.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/register.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/register.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -114,65 +114,65 @@
     (reverse heading-list)))
 
 (define (gnc:split-get-balance-display split)
-  (let ((account (gnc:split-get-account split))
-        (balance (gnc:split-get-balance split)))
-    (if (and account (gnc:account-reverse-balance? account))
-        (gnc:numeric-neg balance)
+  (let ((account (xaccSplitGetAccount split))
+        (balance (xaccSplitGetBalance split)))
+    (if (and account (gnc-reverse-balance account))
+        (gnc-numeric-neg balance)
         balance)))
 
 (define (add-split-row table split column-vector row-style
                        transaction-info? split-info? double?)
   (let* ((row-contents '())
-         (parent (gnc:split-get-parent split))
-         (account (gnc:split-get-account split))
+         (parent (xaccSplitGetParent split))
+         (account (xaccSplitGetAccount split))
          (currency (if account
-                       (gnc:account-get-commodity account)
-                       (gnc:default-currency)))
-         (damount (gnc:split-get-amount split))
+                       (xaccAccountGetCommodity account)
+                       (gnc-default-currency)))
+         (damount (xaccSplitGetAmount split))
          (split-value (gnc:make-gnc-monetary currency damount)))
 
     (if (date-col column-vector)
         (addto! row-contents
                 (if transaction-info?
-                    (gnc:print-date 
-                     (gnc:transaction-get-date-posted parent))
+                    (gnc-print-date
+                     (gnc-transaction-get-date-posted parent))
                     " ")))
     (if (num-col column-vector)
         (addto! row-contents
                 (if transaction-info?
-                    (gnc:transaction-get-num parent)
+                    (xaccTransGetNum parent)
                     (if split-info?
-                        (gnc:split-get-action split)
+                        (xaccSplitGetAction split)
                         " "))))
     (if (description-col column-vector)
         (addto! row-contents
                 (if transaction-info?
-                    (gnc:transaction-get-description parent)
+                    (xaccTransGetDescription parent)
                     (if split-info?
-                        (gnc:split-get-memo split)
+                        (xaccSplitGetMemo split)
                         " "))))
     (if (account-col column-vector)
         (addto! row-contents
                 (if split-info?
                     (if transaction-info?
                         (let ((other-split
-                               (gnc:split-get-other-split split)))
+                               (xaccSplitGetOtherSplit split)))
                           (if other-split
-                              (gnc:account-get-full-name
-                               (gnc:split-get-account other-split))
+                              (gnc-account-get-full-name
+                               (xaccSplitGetAccount other-split))
                               (_ "-- Split Transaction --")))
-                        (gnc:account-get-full-name account))
+                        (gnc-account-get-full-name account))
                     " ")))
     (if (shares-col column-vector)
         (addto! row-contents
                 (if split-info?
-                    (gnc:split-get-amount split)
+                    (xaccSplitGetAmount split)
                     " ")))
     (if (price-col column-vector)
         (addto! row-contents 
                 (if split-info?
                     (gnc:make-gnc-monetary
-                     currency (gnc:split-get-share-price split))
+                     currency (xaccSplitGetSharePrice split))
                     " ")))
     (if (amount-single-col column-vector)
         (addto! row-contents
@@ -182,7 +182,7 @@
                      (gnc:html-split-anchor split split-value))
                     " ")))
     (if (debit-col column-vector)
-        (if (gnc:numeric-positive-p (gnc:gnc-monetary-amount split-value))
+        (if (gnc-numeric-positive-p (gnc:gnc-monetary-amount split-value))
             (addto! row-contents
                     (if split-info?
                         (gnc:make-html-table-cell/markup
@@ -191,7 +191,7 @@
                         " "))
             (addto! row-contents " ")))
     (if (debit-col column-vector)
-        (if (gnc:numeric-negative-p (gnc:gnc-monetary-amount split-value))
+        (if (gnc-numeric-negative-p (gnc:gnc-monetary-amount split-value))
             (addto! row-contents
                     (if split-info?
                         (gnc:make-html-table-cell/markup
@@ -228,7 +228,7 @@
             (addto! row-contents
                     (gnc:make-html-table-cell/size
                      1 (- (num-columns-required column-vector) count)
-                     (gnc:transaction-get-notes parent)))
+                     (xaccTransGetNotes parent)))
             (gnc:html-table-append-row/markup! table row-style
                                                (reverse row-contents)))))
     split-value))
@@ -246,7 +246,7 @@
     (gnc:register-option gnc:*report-options* new-option))
 
   (gnc:register-reg-option
-   (gnc:make-query-option "__reg" "query" #f))
+   (gnc:make-query-option "__reg" "query" '()))
   (gnc:register-reg-option
    (gnc:make-internal-option "__reg" "journal" #f))
   (gnc:register-reg-option
@@ -337,16 +337,16 @@
       (define (colspan monetary)
         (cond
          ((amount-single-col used-columns) (amount-single-col used-columns))
-         ((gnc:numeric-negative-p (gnc:gnc-monetary-amount monetary))
+         ((gnc-numeric-negative-p (gnc:gnc-monetary-amount monetary))
           (credit-col used-columns))
          (else (debit-col used-columns))))
 
       (define (display-subtotal monetary)
         (if (amount-single-col used-columns)
-            (if (and leader (gnc:account-reverse-balance? leader))
+            (if (and leader (gnc-reverse-balance leader))
                 (gnc:monetary-neg monetary)
                 monetary)
-            (if (gnc:numeric-negative-p (gnc:gnc-monetary-amount monetary))
+            (if (gnc-numeric-negative-p (gnc:gnc-monetary-amount monetary))
                 (gnc:monetary-neg monetary)
                 monetary)))
 
@@ -373,14 +373,14 @@
 
   (define (add-other-split-rows split table used-columns row-style)
     (define (other-rows-driver split parent table used-columns i)
-      (let ((current (gnc:transaction-get-split parent i)))
-        (if current
+      (let ((current (xaccTransGetSplit parent i)))
+        (if (not (null? current))
             (begin
               (add-split-row table current used-columns row-style #f #t #f)
               (other-rows-driver split parent table
                                  used-columns (+ i 1))))))
 
-    (other-rows-driver split (gnc:split-get-parent split)
+    (other-rows-driver split (xaccSplitGetParent split)
                        table used-columns 0))
 
   (define (do-rows-with-subtotals leader
@@ -429,12 +429,12 @@
                            (gnc:gnc-monetary-commodity split-value)
                            (gnc:gnc-monetary-amount split-value))
 
-	  (if (gnc:numeric-positive-p (gnc:gnc-monetary-amount split-value))
+	  (if (gnc-numeric-positive-p (gnc:gnc-monetary-amount split-value))
 	      (debit-collector 'add
 			       (gnc:gnc-monetary-commodity split-value)
 			       (gnc:gnc-monetary-amount split-value)))
 
-	  (if (gnc:numeric-negative-p (gnc:gnc-monetary-amount split-value))
+	  (if (gnc-numeric-negative-p (gnc:gnc-monetary-amount split-value))
 	      (credit-collector 'add
 			       (gnc:gnc-monetary-commodity split-value)
 			       (gnc:gnc-monetary-amount split-value)))
@@ -452,7 +452,7 @@
 				  credit-collector))))
 
   (define (splits-leader splits)
-    (let ((accounts (map gnc:split-get-account splits)))
+    (let ((accounts (map xaccSplitGetAccount splits)))
       (if (null? accounts) #f
           (begin
             (set! accounts (cons (car accounts)
@@ -532,7 +532,7 @@
      (list
       (string-append
        (_ "Date") ":&nbsp;"
-       (string-expand (gnc:print-date (cons (current-time) 0))
+       (string-expand (gnc-print-date (cons (current-time) 0))
                       #\space "&nbsp;"))
       (make-client-table address)))
     (set-last-row-style!
@@ -559,13 +559,13 @@
     (if invoice?
         (set! title (_ "Invoice")))
 
-    (set! query (gnc:scm->query query-scm))
+    (set! query (gnc-scm2query query-scm))
 
-    (gnc:query-set-book query (gnc:get-current-book))
+    (qof-query-set-book query (gnc-get-current-book))
 
     (set! splits (if journal?
-                     (gnc:query-get-splits-unique-trans query)
-                     (gnc:query-get-splits query)))
+                     (xaccQueryGetSplitsUniqueTrans query)
+                     (qof-query-run query)))
 
     (set! table (make-split-table splits
                                   (gnc:report-options report-obj)
@@ -602,7 +602,7 @@
     (gnc:html-document-set-title! document title)
     (gnc:html-document-add-object! document table)
 
-    (gnc:free-query query)
+    (qof-query-destroy query)
 
     document))
 

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/standard-reports.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/standard-reports.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/standard-reports.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -91,8 +91,7 @@
 
 (define (gnc:register-report-create account split query journal? double?
 				    title debit-string credit-string)
-  (let* ((acct-type-code (gnc:account-get-type account))
-	 (acct-type (gw:enum-<gnc:AccountType>-val->sym acct-type-code #f))
+  (let* ((acct-type (xaccAccountGetType account))
 	 (create-fcn (lookup-register-report acct-type split)))
     (gnc:debug "create-fcn: " create-fcn)
     (if create-fcn

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,15 +15,14 @@
   --gnc-module-dir ${top_builddir}/src/network-utils \
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
   --gnc-module-dir ${top_srcdir}/src/engine \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/scm \
   --guile-load-dir ${top_srcdir}/src/app-utils \
   --guile-load-dir ${top_srcdir}/src/gnome-utils \
   --guile-load-dir ${top_srcdir}/src/gnome \
   --guile-load-dir ${top_srcdir}/src/report/report-system \
   --library-dir    ${top_builddir}/src/gnome-utils \
-  --library-dir    ${top_builddir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --library-dir    ${top_builddir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/transaction.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/transaction.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/transaction.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -71,16 +71,16 @@
                            corresponding-acc-code))
 
 (define (split-account-full-name-same-p a b)
-  (= (gnc:split-compare-account-full-names a b) 0))
+  (= (xaccSplitCompareAccountFullNames a b) 0))
 
 (define (split-account-code-same-p a b)
-  (= (gnc:split-compare-account-codes a b) 0))
+  (= (xaccSplitCompareAccountCodes a b) 0))
 
 (define (split-same-corr-account-full-name-p a b)
-  (= (gnc:split-compare-other-account-full-names a b) 0))
+  (= (xaccSplitCompareOtherAccountFullNames a b) 0))
 
 (define (split-same-corr-account-code-p a b)
-  (= (gnc:split-compare-other-account-codes a b) 0))
+  (= (xaccSplitCompareOtherAccountCodes a b) 0))
 
 (define (timepair-same-year tp-a tp-b)
   (= (gnc:timepair-get-year tp-a)
@@ -97,18 +97,18 @@
           (gnc:timepair-get-month tp-b))))
 
 (define (split-same-month-p a b)
-  (let ((tp-a (gnc:transaction-get-date-posted (gnc:split-get-parent a)))
-        (tp-b (gnc:transaction-get-date-posted (gnc:split-get-parent b))))
+  (let ((tp-a (gnc-transaction-get-date-posted (xaccSplitGetParent a)))
+        (tp-b (gnc-transaction-get-date-posted (xaccSplitGetParent b))))
     (timepair-same-month tp-a tp-b)))
 
 (define (split-same-quarter-p a b)
-  (let ((tp-a (gnc:transaction-get-date-posted (gnc:split-get-parent a)))
-        (tp-b (gnc:transaction-get-date-posted (gnc:split-get-parent b))))
+  (let ((tp-a (gnc-transaction-get-date-posted (xaccSplitGetParent a)))
+        (tp-b (gnc-transaction-get-date-posted (xaccSplitGetParent b))))
     (timepair-same-quarter tp-a tp-b)))
 
 (define (split-same-year-p a b)
-  (let ((tp-a (gnc:transaction-get-date-posted (gnc:split-get-parent a)))
-        (tp-b (gnc:transaction-get-date-posted (gnc:split-get-parent b))))
+  (let ((tp-a (gnc-transaction-get-date-posted (xaccSplitGetParent a)))
+        (tp-b (gnc-transaction-get-date-posted (xaccSplitGetParent b))))
     (timepair-same-year tp-a tp-b)))
 
 (define (set-last-row-style! table tag . rest)
@@ -134,20 +134,20 @@
         (string-append 
            ;; display account code?
            (if show-account-code
-                 (string-append (gnc:account-get-code account) " ")
+                 (string-append (xaccAccountGetCode account) " ")
                  "")
            ;; display account name?
            (if show-account-name
                  ;; display full account name?
                  (if show-account-full-name
-                      (gnc:account-get-full-name account)
-                      (gnc:account-get-name account))
+                      (gnc-account-get-full-name account)
+                      (xaccAccountGetName account))
                  ""))))
 
 ;; render an account subheading - column-vector determines what is displayed
 (define (render-account-subheading
          split table width subheading-style column-vector)
-  (let ((account (gnc:split-get-account split)))
+  (let ((account (xaccSplitGetAccount split)))
     (add-subheading-row (gnc:make-html-text
                          (gnc:html-markup-anchor
                            (gnc:account-anchor-text account)
@@ -159,7 +159,7 @@
 
 (define (render-corresponding-account-subheading 
          split table width subheading-style column-vector)
-  (let ((account (gnc:split-get-account (gnc:split-get-other-split split))))
+  (let ((account (xaccSplitGetAccount (xaccSplitGetOtherSplit split))))
     (add-subheading-row (gnc:make-html-text
                          (gnc:html-markup-anchor
                            (gnc:account-anchor-text account)
@@ -172,22 +172,22 @@
 (define (render-month-subheading split table width subheading-style column-vector)
   (add-subheading-row (gnc:date-get-month-year-string
                       (gnc:timepair->date 
-                       (gnc:transaction-get-date-posted
-                        (gnc:split-get-parent split))))
+                       (gnc-transaction-get-date-posted
+                        (xaccSplitGetParent split))))
                      table width subheading-style))
 
 (define (render-quarter-subheading split table width subheading-style column-vector)
   (add-subheading-row (gnc:date-get-quarter-year-string 
                       (gnc:timepair->date 
-                       (gnc:transaction-get-date-posted
-                        (gnc:split-get-parent split))))
+                       (gnc-transaction-get-date-posted
+                        (xaccSplitGetParent split))))
                      table width subheading-style))
 
 (define (render-year-subheading split table width subheading-style column-vector)
   (add-subheading-row (gnc:date-get-year-string 
                       (gnc:timepair->date 
-                       (gnc:transaction-get-date-posted
-                        (gnc:split-get-parent split))))
+                       (gnc-transaction-get-date-posted
+                        (xaccSplitGetParent split))))
                       table width subheading-style))
 
 
@@ -227,7 +227,7 @@
 (define (render-account-subtotal 
          table width split total-collector subtotal-style column-vector export?)
     (add-subtotal-row table width 
-                      (total-string (account-namestring (gnc:split-get-account split)
+                      (total-string (account-namestring (xaccSplitGetAccount split)
                                                         (used-sort-account-code      column-vector)
                                                         #t
                                                         (used-sort-account-full-name column-vector)))
@@ -236,8 +236,8 @@
 (define (render-corresponding-account-subtotal
          table width split total-collector subtotal-style column-vector export?)
     (add-subtotal-row table width
-                      (total-string (account-namestring (gnc:split-get-account 
-                                                          (gnc:split-get-other-split split))
+                      (total-string (account-namestring (xaccSplitGetAccount
+                                                          (xaccSplitGetOtherSplit split))
                                                         (used-sort-account-code      column-vector)
                                                         #t
                                                         (used-sort-account-full-name column-vector)))
@@ -245,8 +245,8 @@
 
 (define (render-month-subtotal
          table width split total-collector subtotal-style column-vector export?)
-  (let ((tm (gnc:timepair->date (gnc:transaction-get-date-posted
-                                 (gnc:split-get-parent split)))))
+  (let ((tm (gnc:timepair->date (gnc-transaction-get-date-posted
+                                 (xaccSplitGetParent split)))))
     (add-subtotal-row table width 
                       (total-string (gnc:date-get-month-year-string tm))
                       total-collector subtotal-style export?)))
@@ -254,16 +254,16 @@
 
 (define (render-quarter-subtotal
          table width split total-collector subtotal-style column-vector export?)
-  (let ((tm (gnc:timepair->date (gnc:transaction-get-date-posted
-                                 (gnc:split-get-parent split)))))
+  (let ((tm (gnc:timepair->date (gnc-transaction-get-date-posted
+                                 (xaccSplitGetParent split)))))
     (add-subtotal-row table width 
                       (total-string (gnc:date-get-quarter-year-string tm))
                      total-collector subtotal-style export?)))
 
 (define (render-year-subtotal
          table width split total-collector subtotal-style column-vector export?)
-  (let ((tm (gnc:timepair->date (gnc:transaction-get-date-posted
-                                 (gnc:split-get-parent split)))))
+  (let ((tm (gnc:timepair->date (gnc-transaction-get-date-posted
+                                 (xaccSplitGetParent split)))))
     (add-subtotal-row table width 
                       (total-string (strftime "%Y" tm))
                       total-collector subtotal-style export?)))
@@ -277,8 +277,11 @@
 
 (define account-types-to-reverse-assoc-list
   (list (cons 'none '())
-        (cons 'income-expense '(income expense))
-        (cons 'credit-accounts '(liability payable equity credit income))))
+        (cons 'income-expense
+              (list ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE))
+        (cons 'credit-accounts
+              (list ACCT-TYPE-LIABILITY ACCT-TYPE-PAYABLE ACCT-TYPE-EQUITY
+                    ACCT-TYPE-CREDIT ACCT-TYPE-INCOME))))
 
 (define (used-date columns-used)
   (vector-ref columns-used 0))
@@ -412,57 +415,56 @@
 
   (let* ((row-contents '())
 	 (dummy  (gnc:debug "split is originally" split))
-         (parent (gnc:split-get-parent split))
-         (account (gnc:split-get-account split))
-         (account-type (gw:enum-<gnc:AccountType>-val->sym
-                        (gnc:account-get-type account) #f))
+         (parent (xaccSplitGetParent split))
+         (account (xaccSplitGetAccount split))
+         (account-type (xaccAccountGetType account))
          (currency (if account
-                       (gnc:account-get-commodity account)
-                       (gnc:default-currency)))
+                       (xaccAccountGetCommodity account)
+                       (gnc-default-currency)))
 	 (report-currency (if (opt-val gnc:pagename-general optname-common-currency)
 			       (opt-val gnc:pagename-general optname-currency)
 			       currency))
          (damount (if (gnc:split-voided? split)
-					 (gnc:split-void-former-amount split)
-					 (gnc:split-get-amount split)))
-	 (trans-date (gnc:transaction-get-date-posted parent))
+					 (xaccSplitVoidFormerAmount split)
+					 (xaccSplitGetAmount split)))
+	 (trans-date (gnc-transaction-get-date-posted parent))
 	 (split-value (gnc:exchange-by-pricedb-nearest
 		       (gnc:make-gnc-monetary 
 			currency
 			(if (member account-type account-types-to-reverse) 
-			    (gnc:numeric-neg damount)
+			    (gnc-numeric-neg damount)
 			    damount))
 		       report-currency
 		       ;; Use midday as the transaction time so it matches a price
 		       ;; on the same day.  Otherwise it uses midnight which will
 		       ;; likely match a price on the previous day
-		       (gnc:timepair-canonical-day-time trans-date))))
+		       (timespecCanonicalDayTime trans-date))))
     
     (if (used-date column-vector)
         (addto! row-contents
                 (if transaction-row?
-                    (gnc:print-date (gnc:transaction-get-date-posted parent))
+                    (gnc-print-date (gnc-transaction-get-date-posted parent))
                     " ")))
     (if (used-reconciled-date column-vector)
         (addto! row-contents
-		(let ((date (gnc:split-get-reconciled-date split)))
+		(let ((date (gnc-split-get-date-reconciled split)))
 		  (if (equal? date (cons 0 0))
 		      " "
-		      (gnc:print-date date)))))
+		      (gnc-print-date date)))))
     (if (used-num column-vector)
         (addto! row-contents
                 (if transaction-row?
-                    (gnc:transaction-get-num parent)
+                    (xaccTransGetNum parent)
                     " ")))
     (if (used-description column-vector)
         (addto! row-contents
                 (if transaction-row?
-                    (gnc:transaction-get-description parent)
+                    (xaccTransGetDescription parent)
                     " ")))
     
     (if (used-memo column-vector)
         (addto! row-contents
-                (gnc:split-get-memo split)))
+                (xaccSplitGetMemo split)))
     
     (if (or (used-account-name column-vector) (used-account-code column-vector))
        (addto! row-contents (account-namestring account
@@ -471,31 +473,31 @@
                                                 (used-account-full-name column-vector))))
     
     (if (or (used-other-account-name column-vector) (used-other-account-code column-vector))
-       (addto! row-contents (account-namestring (gnc:split-get-account
-                                                   (gnc:split-get-other-split split))
+       (addto! row-contents (account-namestring (xaccSplitGetAccount
+                                                   (xaccSplitGetOtherSplit split))
                                                 (used-other-account-code      column-vector)
                                                 (used-other-account-name      column-vector)
                                                 (used-other-account-full-name column-vector))))
     
     (if (used-shares column-vector)
-        (addto! row-contents (gnc:split-get-amount split)))
+        (addto! row-contents (xaccSplitGetAmount split)))
     (if (used-price column-vector)
         (addto! 
          row-contents 
-         (gnc:make-gnc-monetary (gnc:transaction-get-currency parent)
-                                (gnc:split-get-share-price split))))
+         (gnc:make-gnc-monetary (xaccTransGetCurrency parent)
+                                (xaccSplitGetSharePrice split))))
     (if (used-amount-single column-vector)
         (addto! row-contents
                 (gnc:make-html-table-cell/markup "number-cell"
                                                  (gnc:html-transaction-anchor parent split-value))))
     (if (used-amount-double-positive column-vector)
-        (if (gnc:numeric-positive-p (gnc:gnc-monetary-amount split-value))
+        (if (gnc-numeric-positive-p (gnc:gnc-monetary-amount split-value))
             (addto! row-contents
                     (gnc:make-html-table-cell/markup "number-cell"
                                                      (gnc:html-transaction-anchor parent split-value)))
             (addto! row-contents " ")))
     (if (used-amount-double-negative column-vector)
-        (if (gnc:numeric-negative-p (gnc:gnc-monetary-amount split-value))
+        (if (gnc-numeric-negative-p (gnc:gnc-monetary-amount split-value))
             (addto! row-contents
                     (gnc:make-html-table-cell/markup
                      "number-cell" (gnc:html-transaction-anchor parent (gnc:monetary-neg split-value))))
@@ -503,12 +505,12 @@
     (if (used-running-balance column-vector)
 	(begin
 	  (gnc:debug "split is " split)
-	  (gnc:debug "split get balance:" (gnc:split-get-balance split))
+	  (gnc:debug "split get balance:" (xaccSplitGetBalance split))
 	  (addto! row-contents
 		  (gnc:make-html-table-cell/markup
 		   "number-cell"
 		   (gnc:make-gnc-monetary currency
-					  (gnc:split-get-balance split))))))
+					  (xaccSplitGetBalance split))))))
 	(gnc:html-table-append-row/markup! table row-style
                                        (reverse row-contents))
     split-value))
@@ -545,7 +547,7 @@
     gnc:pagename-general optname-common-currency
     "e" (N_ "Convert all transactions into a common currency") #f
     #f
-    (lambda (x) (gnc:option-db-set-option-selectable-by-name
+    (lambda (x) (gnc-option-db-set-option-selectable-by-name
 		 gnc:*transaction-report-options*
 		 gnc:pagename-general
 		 optname-currency
@@ -570,9 +572,12 @@
     ;; select, by default, all accounts...
     (lambda ()
       (gnc:filter-accountlist-type 
-       '(bank cash credit asset liability stock mutual-fund currency
-	      payable receivable equity income expense)
-       (gnc:group-get-subaccounts (gnc:get-current-group))))
+       (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+             ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+             ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+             ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+             ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
+       (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
     #f #t))
 
   (gnc:register-trep-option
@@ -582,14 +587,14 @@
     (lambda ()
       ;; FIXME : gnc:get-current-accounts disappeared.
       (let ((current-accounts '())
-	    (num-accounts (gnc:group-get-num-accounts
-			   (gnc:get-current-group)))
-	    (first-account (gnc:group-get-account
-			    (gnc:get-current-group) 0)))
+	    (num-accounts (xaccGroupGetNumAccounts
+			   (gnc-get-current-group)))
+	    (first-account (xaccGroupGetAccount
+			    (gnc-get-current-group) 0)))
 	(cond ((not (null? current-accounts))
 	       (list (car current-accounts)))
 	      ((> num-accounts 0) (list first-account))
-	      (else ()))))
+	      (else '()))))
     #f #t))
 
   (gnc:register-trep-option
@@ -710,10 +715,10 @@
       'account-name
       key-choice-list #f
       (lambda (x)
-        (gnc:option-db-set-option-selectable-by-name
+        (gnc-option-db-set-option-selectable-by-name
          options pagename-sorting optname-prime-subtotal
          (and (member x subtotal-enabled) #t))
-        (gnc:option-db-set-option-selectable-by-name
+        (gnc-option-db-set-option-selectable-by-name
          options pagename-sorting optname-prime-date-subtotal
          (if (member x date-sorting-types) #t #f)))))
     
@@ -761,10 +766,10 @@
       'register-order
       key-choice-list #f
       (lambda (x)
-        (gnc:option-db-set-option-selectable-by-name
+        (gnc-option-db-set-option-selectable-by-name
          options pagename-sorting optname-sec-subtotal
          (and (member x subtotal-enabled) #t))
-        (gnc:option-db-set-option-selectable-by-name
+        (gnc-option-db-set-option-selectable-by-name
          options pagename-sorting optname-sec-date-subtotal
          (if (member x date-sorting-types) #t #f)))))
     
@@ -848,8 +853,8 @@
 
 
 (define (display-date-interval begin end)
-  (let ((begin-string (gnc:print-date begin))
-        (end-string (gnc:print-date end)))
+  (let ((begin-string (gnc-print-date begin))
+        (end-string (gnc-print-date end)))
     (sprintf #f (_ "From %s To %s") begin-string end-string)))
 
 (define (get-primary-subtotal-style options)
@@ -917,8 +922,8 @@
   (define (add-other-split-rows split table used-columns
                                 row-style account-types-to-reverse)
     (define (other-rows-driver split parent table used-columns i)
-      (let ((current (gnc:transaction-get-split parent i)))
-        (cond ((not current) #f)
+      (let ((current (xaccTransGetSplit parent i)))
+        (cond ((null? current) #f)
               ((equal? current split)
                (other-rows-driver split parent table used-columns (+ i 1)))
               (else (begin
@@ -927,7 +932,7 @@
                       (other-rows-driver split parent table used-columns
                                          (+ i 1)))))))
 
-    (other-rows-driver split (gnc:split-get-parent split)
+    (other-rows-driver split (xaccSplitGetParent split)
                        table used-columns 0))
 
   (define (do-rows-with-subtotals splits 
@@ -1114,43 +1119,43 @@
 ;;  (let* ((used-columns (build-column-used options))) ;; tpo: gives unbound variable options?
     (let* ((used-columns (build-column-used (gnc:report-options report-obj))))
       (list (cons 'account-name  (vector 
-                                  (list gnc:split-account-fullname)
+                                  (list SPLIT-ACCT-FULLNAME)
                                   split-account-full-name-same-p 
                                   render-account-subheading
                                   render-account-subtotal))
             (cons 'account-code  (vector 
-                                  (list gnc:split-account gnc:account-code)
+                                  (list SPLIT-ACCOUNT ACCOUNT-CODE-)
                                   split-account-code-same-p
                                   render-account-subheading
                                   render-account-subtotal))
             (cons 'exact-time    (vector
-                                  (list gnc:split-trans gnc:trans-date-posted)
+                                  (list SPLIT-TRANS TRANS-DATE-POSTED)
                                   #f #f #f))
             (cons 'date          (vector
-                                  (list gnc:split-trans gnc:trans-date-posted)
+                                  (list SPLIT-TRANS TRANS-DATE-POSTED)
                                   #f #f #f))
             (cons 'reconciled-date (vector
-                                  (list gnc:split-date-reconciled)
+                                  (list SPLIT-DATE-RECONCILED)
                                   #f #f #f))
             (cons 'register-order (vector
-                                  (list gnc:query-default-sort)
+                                  (list QUERY-DEFAULT-SORT)
                                   #f #f #f))
             (cons 'corresponding-acc-name
                                  (vector
-                                  (list gnc:split-corr-account-fullname)
+                                  (list SPLIT-CORR-ACCT-NAME)
                                   split-same-corr-account-full-name-p 
                                   render-corresponding-account-subheading
                                   render-corresponding-account-subtotal))
             (cons 'corresponding-acc-code
                                  (vector
-                                  (list gnc:split-corr-account-code)
+                                  (list SPLIT-CORR-ACCT-CODE)
                                   split-same-corr-account-code-p 
                                   render-corresponding-account-subheading
                                   render-corresponding-account-subtotal))
-            (cons 'amount        (vector (list gnc:split-value) #f #f #f))
-            (cons 'description   (vector (list gnc:split-trans gnc:trans-desc) #f #f #f))
-            (cons 'number        (vector (list gnc:split-trans gnc:trans-num) #f #f #f))
-            (cons 'memo          (vector (list gnc:split-memo) #f #f #f))
+            (cons 'amount        (vector (list SPLIT-VALUE) #f #f #f))
+            (cons 'description   (vector (list SPLIT-TRANS TRANS-DESCRIPTION) #f #f #f))
+            (cons 'number        (vector (list SPLIT-TRANS TRANS-NUM) #f #f #f))
+            (cons 'memo          (vector (list SPLIT-MEMO) #f #f #f))
             (cons 'none          (vector '() #f #f #f)))))
 
   (define date-comp-funcs-assoc-list
@@ -1213,7 +1218,7 @@
      3 2))
 
   (define (get-other-account-names account-list)
-    ( map (lambda (acct)  (gnc:account-get-full-name acct)) account-list))
+    ( map (lambda (acct)  (gnc-account-get-full-name acct)) account-list))
 
   (define (is-filter-member split account-list splits-ok?)
     (let ((fullname (gnc:split-get-corr-account-full-name split)))
@@ -1222,8 +1227,8 @@
 	  ;; Yep, this is a split transaction.
 
 	  (if splits-ok?
-	      (let* ((txn (gnc:split-get-parent split))
-		     (splits (gnc:transaction-get-splits txn)))
+	      (let* ((txn (xaccSplitGetParent split))
+		     (splits (xaccTransGetSplitList txn)))
 
 		;; Walk through the list of splits.
 		;; if we reach the end, return #f
@@ -1234,7 +1239,7 @@
 		      #f
 		      (let* ((this (car splits))
 			     (rest (cdr splits))
-			     (acct (gnc:split-get-account this)))
+			     (acct (xaccSplitGetAccount this)))
 			(if (and (not (eq? this split))
 				 (member acct account-list))
 			    #t
@@ -1268,38 +1273,38 @@
         (secondary-order (opt-val pagename-sorting "Secondary Sort Order"))
 	(void-status (opt-val gnc:pagename-accounts optname-void-transactions))
         (splits '())
-        (query (gnc:malloc-query)))
+        (query (qof-query-create-for-splits)))
 
     ;;(gnc:warn "accts in trep-renderer:" c_account_1)
     ;;(gnc:warn "Report Account names:" (get-other-account-names c_account_1))
 
     (if (not (or (null? c_account_1) (and-map not c_account_1)))
         (begin
-          (gnc:query-set-book query (gnc:get-current-book))
+          (qof-query-set-book query (gnc-get-current-book))
 	      ;;(gnc:warn "query is:" query)
-          (gnc:query-add-account-match query
+          (xaccQueryAddAccountMatch query
                                        c_account_1
-                                       'guid-match-any 'query-and)
-          (gnc:query-add-date-match-timepair
-           query #t begindate #t enddate 'query-and)
-          (gnc:query-set-sort-order query
+                                       QOF-GUID-MATCH-ANY QOF-QUERY-AND)
+          (xaccQueryAddDateMatchTS
+           query #t begindate #t enddate QOF-QUERY-AND)
+          (qof-query-set-sort-order query
 				    (get-query-sortkey primary-key)
 				    (get-query-sortkey secondary-key)
 				    '())
 
-          (gnc:query-set-sort-increasing query
+          (qof-query-set-sort-increasing query
                                          (eq? primary-order 'ascend)
                                          (eq? secondary-order 'ascend)
                                          #t)
 
 	  (case void-status
 	   ((non-void-only) 
-	    (gnc:query-set-match-non-voids-only! query (gnc:get-current-book)))
+	    (gnc:query-set-match-non-voids-only! query (gnc-get-current-book)))
 	   ((void-only)
-	    (gnc:query-set-match-voids-only! query (gnc:get-current-book)))
+	    (gnc:query-set-match-voids-only! query (gnc-get-current-book)))
 	   (else #f))
 
-          (set! splits (gnc:query-get-splits query))
+          (set! splits (qof-query-run query))
 
           ;;(gnc:warn "Splits in trep-renderer:" splits)
 
@@ -1359,7 +1364,7 @@
                 (gnc:html-document-add-object!
                  document 
                  table)
-                (gnc:free-query query))
+                (qof-query-destroy query))
               ;; error condition: no splits found
               (let ((p (gnc:make-html-text)))
                 (gnc:html-text-append! 

Modified: gnucash/branches/register-rewrite/src/report/standard-reports/trial-balance.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/standard-reports/trial-balance.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/standard-reports/trial-balance.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -16,7 +16,7 @@
 ;;    balance to no more than daily resolution.
 ;;    
 ;;    The Company Name field does not currently default to the name
-;;    in (gnc:get-current-book).
+;;    in (gnc-get-current-book).
 ;;    
 ;;    Progress bar functionality is currently mostly broken.
 ;;    
@@ -144,12 +144,12 @@
     (add-option
       (gnc:make-string-option
       (N_ "General") optname-report-title
-      "a" opthelp-report-title reportname))
+      "a" opthelp-report-title (_ reportname)))
     (add-option
       (gnc:make-string-option
       (N_ "General") optname-party-name
       "b" opthelp-party-name ""))
-    ;; this should default to company name in (gnc:get-current-book)
+    ;; this should default to company name in (gnc-get-current-book)
     
     ;; the period over which to collect adjusting/closing entries and
     ;; date at which to report the balance
@@ -180,9 +180,12 @@
       opthelp-accounts
       (lambda ()
 	(gnc:filter-accountlist-type 
-	 '(bank cash credit asset liability stock mutual-fund currency
-		payable receivable equity income expense)
-	 (gnc:group-get-subaccounts (gnc:get-current-group))))
+         (list ACCT-TYPE-BANK ACCT-TYPE-CASH ACCT-TYPE-CREDIT
+               ACCT-TYPE-ASSET ACCT-TYPE-LIABILITY
+               ACCT-TYPE-STOCK ACCT-TYPE-MUTUAL ACCT-TYPE-CURRENCY
+               ACCT-TYPE-PAYABLE ACCT-TYPE-RECEIVABLE
+               ACCT-TYPE-EQUITY ACCT-TYPE-INCOME ACCT-TYPE-EXPENSE)
+	 (xaccGroupGetSubAccountsSorted (gnc-get-current-group))))
       #f #t))
     (gnc:options-add-account-levels!
      options gnc:pagename-accounts optname-depth-limit
@@ -343,14 +346,15 @@
          ;; decompose the account list
          (split-up-accounts (gnc:decompose-accountlist accounts))
          (asset-accounts
-	  (assoc-ref split-up-accounts 'asset))
+          (assoc-ref split-up-accounts ACCT-TYPE-ASSET))
          (liability-accounts
-	  (assoc-ref split-up-accounts 'liability))
+          (assoc-ref split-up-accounts ACCT-TYPE-LIABILITY))
+         (income-expense-accounts
+          (append (assoc-ref split-up-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-accounts ACCT-TYPE-EXPENSE)))
          (equity-accounts
-          (assoc-ref split-up-accounts 'equity))
-         (income-expense-accounts
-          (append (assoc-ref split-up-accounts 'income)
-                  (assoc-ref split-up-accounts 'expense)))
+          (assoc-ref split-up-accounts ACCT-TYPE-EQUITY))
+
 	 ;; (all-accounts (map (lambda (X) (cadr X)) split-up-accounts))
 	 ;; ^ will not do what we want
 	 (all-accounts
@@ -360,20 +364,20 @@
 	 ;; same for gross adjustment accounts...
 	 (split-up-ga-accounts (gnc:decompose-accountlist ga-accounts))
 	 (all-ga-accounts
-          (append (assoc-ref split-up-ga-accounts 'asset)
-                  (assoc-ref split-up-ga-accounts 'liability)
-                  (assoc-ref split-up-ga-accounts 'equity)
-                  (assoc-ref split-up-ga-accounts 'income)
-                  (assoc-ref split-up-ga-accounts 'expense)))
+          (append (assoc-ref split-up-ga-accounts ACCT-TYPE-ASSET)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-LIABILITY)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-EQUITY)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-ga-accounts ACCT-TYPE-EXPENSE)))
 	 (split-up-is-accounts (gnc:decompose-accountlist is-accounts))
 	 
 	 ;; same for income statement accounts...
 	 (all-is-accounts
-          (append (assoc-ref split-up-is-accounts 'asset)
-                  (assoc-ref split-up-is-accounts 'liability)
-                  (assoc-ref split-up-is-accounts 'equity)
-                  (assoc-ref split-up-is-accounts 'income)
-                  (assoc-ref split-up-is-accounts 'expense)))
+          (append (assoc-ref split-up-is-accounts ACCT-TYPE-ASSET)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-LIABILITY)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-EQUITY)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-INCOME)
+                  (assoc-ref split-up-is-accounts ACCT-TYPE-EXPENSE)))
 	 
 	 (doc (gnc:make-html-document))
          ;; exchange rates calculation parameters
@@ -383,8 +387,8 @@
 	 (period-for (if terse-period?
 			 (string-append " " (_ "for Period"))
 			 (sprintf #f (string-append ", " (_ "%s to %s"))
-				  (gnc:print-date start-date-printable)
-				  (gnc:print-date end-date-tp))
+				  (gnc-print-date start-date-printable)
+				  (gnc-print-date end-date-tp))
 			 ))
 	 )
     
@@ -392,12 +396,12 @@
      doc (if (equal? report-variant 'current)
 	     (sprintf #f (string-append "%s %s %s")
 		      company-name report-title
-		      (gnc:print-date end-date-tp))
+		      (gnc-print-date end-date-tp))
 	     (sprintf #f (string-append "%s %s "
 					(_ "For Period Covering %s to %s"))
 		      company-name report-title
-		      (gnc:print-date start-date-printable)
-		      (gnc:print-date end-date-tp))
+		      (gnc-print-date start-date-printable)
+		      (gnc-print-date end-date-tp))
 	     )
      )
     
@@ -483,7 +487,7 @@
 	  (define (tot-abs-amt-cell amt)
 	    (let* ((neg-amt (gnc:make-commodity-collector))
 		   (rv (report-val amt))
-		   (neg? (gnc:numeric-negative-p
+		   (neg? (gnc-numeric-negative-p
 			  (gnc:gnc-monetary-amount rv)))
 		   (cell #f)
 		   )
@@ -543,7 +547,7 @@
                                                 report-commodity
                                                 weighted-fn)))
 		 
-                 (unrealized-gain (gnc:numeric-sub-fixed value cost)))
+                 (unrealized-gain (gnc-numeric-sub-fixed value cost)))
 	    
             (unrealized-gain-collector 'add report-commodity unrealized-gain)
 	    )
@@ -816,7 +820,7 @@
 	  ;; 
 	  ;; we omit unrealized gains from the balance report, if
 	  ;; zero, since they are not present on normal trial balances
-	  (and (not (gnc:commodity-collector-allzero?
+	  (and (not (gnc-commodity-collector-allzero?
 		     unrealized-gain-collector))
 	       (let* ((ug-row (+ header-rows
 				 (gnc:html-acct-table-num-rows

Modified: gnucash/branches/register-rewrite/src/report/stylesheets/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/stylesheets/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/stylesheets/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -45,16 +45,20 @@
 endif
 
 .scm-links:
-	rm -f gnucash report
-	$(LN_S) -f . gnucash
-	$(LN_S) -f ${srcdir} report 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/report
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
+clean-local:
+	$(RM) -rf gnucash
+
 noinst_DATA = .scm-links
 
 uidir = $(GNC_UI_DIR)
@@ -63,5 +67,5 @@
 
 EXTRA_DIST = ${gncscmmod_DATA}
 
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-easy.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-easy.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-easy.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -327,7 +327,7 @@
               (gnc:html-markup-b prepared-for)
               (gnc:html-markup-br)
               (_ "Date: ")
-              (gnc:print-date 
+              (gnc-print-date
                (cons (current-time) 0)))
 
              ;; title only 

Modified: gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-fancy.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-fancy.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/stylesheets/stylesheet-fancy.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -322,7 +322,7 @@
               (gnc:html-markup-b prepared-for)
               (gnc:html-markup-br)
               (_ "Date: ")
-              (gnc:print-date 
+              (gnc-print-date
                (cons (current-time) 0)))
 
              ;; title only 

Modified: gnucash/branches/register-rewrite/src/report/stylesheets/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/stylesheets/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/stylesheets/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -16,15 +16,14 @@
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
   --gnc-module-dir ${top_srcdir}/src/engine \
   --guile-load-dir ${top_srcdir}/src/scm \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/app-utils \
   --guile-load-dir ${top_srcdir}/src/report/report-system \
   --guile-load-dir ${top_srcdir}/src/report/stylesheets \
   --guile-load-dir ${top_builddir}/src/gnome-utils \
   --guile-load-dir ${top_builddir}/src/gnome \
   --library-dir    ${top_builddir}/src/gnome-utils \
-  --library-dir    ${top_builddir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof \
+  --library-dir    ${top_builddir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/report/utility-reports/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/utility-reports/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/utility-reports/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -21,9 +21,10 @@
   hello-world.scm \
   utility-reports.scm \
   view-column.scm \
-  welcome-to-gnucash.scm \
-  test-graphing.scm
+  welcome-to-gnucash.scm
 
+#  test-graphing.scm -- not intended for general public?!? Surely not translated at all.
+
 if GNUCASH_SEPARATE_BUILDDIR
 #For separate build directory
 SCM_FILE_LINKS = \
@@ -31,19 +32,23 @@
 endif
 
 .scm-links:
-	rm -f gnucash report
-	$(LN_S) -f . gnucash
-	$(LN_S) -f ${srcdir} report 
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
+	mkdir -p  gnucash/report
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/report; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
+clean-local:
+	$(RM) -rf gnucash
+
 noinst_DATA = .scm-links
 
 EXTRA_DIST = ${gncscmmod_DATA}
 
-CLEANFILES = gnucash report .scm-links
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/report/utility-reports/hello-world.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/utility-reports/hello-world.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/utility-reports/hello-world.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,7 +12,7 @@
 (debug-enable 'backtrace)
 
 (gnc:module-load "gnucash/report/report-system" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc:html-build-url
+(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 ;; This function will generate a set of options that GnuCash
 ;; will use to display a dialog where the user can select
@@ -149,8 +149,7 @@
     ;; This is an account list option. The user can select one
     ;; or (possibly) more accounts from the list of accounts
     ;; in the current file. Values are scheme handles to actual
-    ;; C pointers to accounts. They can be used in conjunction
-    ;; with the wrapped C functions in gnucash/src/g-wrap/gnc.gwp.
+    ;; C pointers to accounts. 
     ;; The #f value indicates that any account will be accepted.
     ;; Instead of a #f values, you could provide a function that
     ;; accepts a list of account values and returns a pair. If
@@ -249,7 +248,7 @@
 
     ;; these are samples of different date options. for a simple
     ;; date with day, month, and year but no time you should use
-    ;; gnc:print-date
+    ;; gnc-print-date
     (let ((time-string (strftime "%X" (localtime (current-time))))
           (date-string (strftime "%x" (localtime (car date-val))))
           (date-string2 (strftime "%x %X" (localtime (car date2-val))))
@@ -391,7 +390,7 @@
 
         ;; Here we print the value of the number option formatted as
         ;; currency. When printing currency values, you should use
-        ;; the function (gnc:amount->string), which is defined in
+        ;; the function (xaccPrintAmount), which is defined in
         ;; report-utilities. This functions will format the number
         ;; appropriately in the current locale. Don't try to format
         ;; it yourself -- it will be wrong in other locales.
@@ -399,9 +398,9 @@
          (gnc:html-markup/format
           (_ "The number option formatted as currency is %s.")
           (gnc:html-markup-b
-           (gnc:amount->string
+           (xaccPrintAmount
             (gnc:make-gnc-numeric (inexact->exact num-val) 1)
-            (gnc:default-print-info #f)))))))
+            (gnc-default-print-info #f)))))))
 
       ;; you can add as many objects as you want.  Here's another 
       ;; one.  We'll make a single-column table of the selected list 
@@ -430,8 +429,8 @@
       ;; need to do is pass the HREF "gnc-register:account=My
       ;; Account Name" to html-markup-anchor.  The account name
       ;; passed must be the "full" account name that you get from
-      ;; gnc:account-get-full-name.  You should build this url using
-      ;; (gnc:html-build-url ...)
+      ;; gnc-account-get-full-name.  You should build this url using
+      ;; (gnc-build-url ...)
       ;;
       ;; html-markup-anchor takes the link to jump to as its first
       ;; arg and then puts the remaining args in the body of the
@@ -447,12 +446,12 @@
              (map 
               (lambda (acct)
                 (gnc:html-markup-anchor 
-		 (gnc:html-build-url gnc:url-type-register
+		 (gnc-build-url URL-TYPE-REGISTER
 				     (string-append "account=" 
-						    (gnc:account-get-full-name
+						    (gnc-account-get-full-name
 						     acct))
-				     #f)
-                 (gnc:account-get-name acct)))
+				     "")
+                 (xaccAccountGetName acct)))
               accounts))))
           (gnc:html-document-add-object!
            document

Modified: gnucash/branches/register-rewrite/src/report/utility-reports/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/report/utility-reports/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/utility-reports/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -15,7 +15,6 @@
   --gnc-module-dir ${top_srcdir}/src/gnc-module \
   --gnc-module-dir ${top_srcdir}/src/engine \
   --guile-load-dir ${top_srcdir}/src/scm \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_srcdir}/src/app-utils \
   --guile-load-dir ${top_srcdir}/src/gnome-utils \
   --guile-load-dir ${top_srcdir}/src/gnome \
@@ -23,7 +22,7 @@
   --guile-load-dir ${top_srcdir}/src/report/utility-reports \
   --library-dir    ${top_builddir}/src/gnome-utils \
   --library-dir    ${top_builddir}/src/gnome \
-  --library-dir    ${G_WRAP_LIB_DIR}
+  --library-dir    ${top_builddir}/lib/libqof/qof
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/report/utility-reports/test-graphing.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/utility-reports/test-graphing.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/utility-reports/test-graphing.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,7 +12,7 @@
 (debug-enable 'backtrace)
 
 (gnc:module-load "gnucash/report/report-system" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc:html-build-url
+(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 (define (simple-pie-chart)
   (let ((chart (gnc:make-html-piechart)))

Modified: gnucash/branches/register-rewrite/src/report/utility-reports/utility-reports.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/utility-reports/utility-reports.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/utility-reports/utility-reports.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -12,6 +12,6 @@
 (use-modules (gnucash report view-column))
 (use-modules (gnucash report welcome-to-gnucash))
 
-(use-modules (gnucash report test-graphing))
+;;(use-modules (gnucash report test-graphing))
 
 (re-export gnc:make-welcome-report)

Modified: gnucash/branches/register-rewrite/src/report/utility-reports/view-column.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/utility-reports/view-column.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/utility-reports/view-column.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -30,12 +30,12 @@
 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (ice-9 slib))
 (use-modules (gnucash gnc-module))
-(use-modules (g-wrapped gw-report-system))
+(use-modules (sw_report_system))
 
 (require 'printf)
 
 (gnc:module-load "gnucash/report/report-system" 0)
-(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc:html-build-url
+(gnc:module-load "gnucash/gnome-utils" 0) ;for gnc-build-url
 
 (define (make-options)
   (let* ((options (gnc:new-options))
@@ -96,7 +96,7 @@
 	       (begin 
 		 (set! callback 
 		       (make-child-options-callback
-			report (gnc:find-report child)))
+			report (gnc-report-find child)))
 		 (set! report-info 
 		       (list child rowspan colspan callback))))
 	   (set! new-reports (cons report-info new-reports))))
@@ -115,7 +115,7 @@
        ;; hash is an attempt to compute how many columnc are
        ;; actually used in a row; items with non-1 rowspans will take
        ;; up cells in the row without actually being in the row.
-       (let* ((subreport (gnc:find-report (car report-info)))
+       (let* ((subreport (gnc-report-find (car report-info)))
 	      (colspan (cadr report-info))
 	      (rowspan (caddr report-info))
 	      (opt-callback (cadddr report-info))
@@ -166,19 +166,19 @@
 	  report-table 
 	  (list (gnc:make-html-text 
 		 (gnc:html-markup-anchor
-		  (gnc:html-build-url 
-		   gnc:url-type-options
+		  (gnc-build-url
+		   URL-TYPE-OPTIONS
 		   (string-append "report-id=" 
 				  (sprintf #f "%a" (car report-info)))
-		   #f)
+		   "")
 		  (_ "Edit Options"))
 		 "&nbsp;"
 		 (gnc:html-markup-anchor
-		  (gnc:html-build-url
-		   gnc:url-type-report
+		  (gnc-build-url
+		   URL-TYPE-REPORT
 		   (string-append "id=" 
 				  (sprintf #f "%a" (car report-info)))
-		   #f)
+		   "")
 		  (_ "Single Report")))))
 
 	 ;; add the report-table to the toplevel-cell
@@ -217,7 +217,7 @@
 	   (gnc:lookup-option options "__general" "report-list"))))
     (for-each 
      (lambda (child)
-       (gnc:report-set-dirty?! (gnc:find-report (car child)) #t))
+       (gnc:report-set-dirty?! (gnc-report-find (car child)) #t))
      reports)))
 
 (define (cleanup-options report)

Modified: gnucash/branches/register-rewrite/src/report/utility-reports/welcome-to-gnucash.scm
===================================================================
--- gnucash/branches/register-rewrite/src/report/utility-reports/welcome-to-gnucash.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/report/utility-reports/welcome-to-gnucash.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -25,7 +25,7 @@
 
 (use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash gnc-module))
-(use-modules (g-wrapped gw-report-system))
+(use-modules (sw_report_system))
 
 (gnc:module-load "gnucash/report/report-system" 0)
 
@@ -42,16 +42,16 @@
       (gnc:option-set-value 
        (gnc:lookup-option options section name) value))
 
-    (set! options (gnc:report-options (gnc:find-report view)))
+    (set! options (gnc:report-options (gnc-report-find view)))
     (set-option! "General" "Report name" (_ "Welcome to GnuCash"))
     (set-option! "General" "Number of columns" 2)
 
     ;; mark the reports as needing to be saved 
-    (gnc:report-set-needs-save?! (gnc:find-report sub-welcome) #t)
-    (gnc:report-set-needs-save?! (gnc:find-report sub-accounts) #t)
-    (gnc:report-set-needs-save?! (gnc:find-report sub-expense-pie) #t)
-    (gnc:report-set-needs-save?! (gnc:find-report sub-income-pie) #t)
-    (gnc:report-set-needs-save?! (gnc:find-report sub-bar) #t)
+    (gnc:report-set-needs-save?! (gnc-report-find sub-welcome) #t)
+    (gnc:report-set-needs-save?! (gnc-report-find sub-accounts) #t)
+    (gnc:report-set-needs-save?! (gnc-report-find sub-expense-pie) #t)
+    (gnc:report-set-needs-save?! (gnc-report-find sub-income-pie) #t)
+    (gnc:report-set-needs-save?! (gnc-report-find sub-bar) #t)
 
     (set-option! "__general" "report-list" 
                  (list (list sub-welcome 1 1 #f)
@@ -60,13 +60,13 @@
                        (list sub-income-pie 1 1 #f)
                        (list sub-bar 2 1 #f)))
     
-    (set! options (gnc:report-options (gnc:find-report sub-expense-pie)))
+    (set! options (gnc:report-options (gnc-report-find sub-expense-pie)))
     (set-option! "Display" "Plot Width" 400)
     
-    (set! options (gnc:report-options (gnc:find-report sub-income-pie)))
+    (set! options (gnc:report-options (gnc-report-find sub-income-pie)))
     (set-option! "Display" "Plot Width" 400)
     
-    (set! options (gnc:report-options (gnc:find-report sub-bar)))
+    (set! options (gnc:report-options (gnc-report-find sub-bar)))
     (set-option! "Display" "Plot Width" 800)
 
     view))

Modified: gnucash/branches/register-rewrite/src/scm/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/scm/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/scm/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -30,15 +30,19 @@
 endif
 
 .scm-links: 
-	rm -f gnucash
-	$(LN_S) -f ${srcdir} gnucash
+	$(RM) -rf gnucash
+	mkdir -p  gnucash
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../$$A . ; done )
 	touch .scm-links
 
+clean-local:
+	$(RM) -rf gnucash
+
 SCM_FILES = ${gncscm_DATA} ${gncscmmod_DATA}
 
 EXTRA_DIST = \
@@ -54,10 +58,10 @@
 build-config.scm: ${srcdir}/build-config.scm.in Makefile
 	rm -f $@.tmp
 	sed < $< > $@.tmp \
-            -e 's:@-VERSION-@:${VERSION}:' \
-            -e 's:@-GNC_HELPDIR-@:${GNC_HELPDIR}:'
+            -e 's#@-VERSION-@#${VERSION}#' \
+            -e 's#@-GNC_HELPDIR-@#${GNC_HELPDIR}#'
 	mv $@.tmp $@
 
-CLEANFILES = gnucash .scm-links
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}
 MAINTAINERCLEANFILES = build-config.scm

Modified: gnucash/branches/register-rewrite/src/scm/command-line.scm
===================================================================
--- gnucash/branches/register-rewrite/src/scm/command-line.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/scm/command-line.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -84,7 +84,7 @@
 where 'default expands to the default path, and 'current expands to \
 the current value of the path.")
          (let ((result (cons
-                        (gnc:build-dotgnucash-path "html")
+                        (gnc-build-dotgnucash-path "html")
                         gnc:_install-doc-path_)))
          (lambda () result))))
 

Modified: gnucash/branches/register-rewrite/src/scm/main-window.scm
===================================================================
--- gnucash/branches/register-rewrite/src/scm/main-window.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/scm/main-window.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -28,33 +28,14 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 
-(define (gnc:main-window-book-open-handler session)
-  (define (try-load file-suffix)
-    (let ((file (gnc:build-book-path file-suffix)))
-      ;; make sure the books directory is there 
-      (if (access? file F_OK)
-          (if (not (false-if-exception (primitive-load file)))
-              (begin
-                (gnc:warn "failure loading " file)
-                #f))
-          #f)))
-
-  (let* ((book-url (gnc:session-get-url session))
-	 (conf-file-name (gnc:html-encode-string book-url))
-	 (dead-reports '()))
-    (if conf-file-name 
-        (try-load conf-file-name))
-
-    ))
-
 (define (gnc:main-window-properties-cb)
-  (let* ((book (gnc:get-current-book))
-	 (slots (gnc:book-get-slots book)))
+  (let* ((book (gnc-get-current-book))
+	 (slots (gnc-book-get-slots book)))
 
     (define (changed_cb)
-      (gnc:book-kvp-changed book))
+      (qof-book-kvp-changed book))
 			    
-    (gnc:kvp-option-dialog gnc:id-book
+    (gnc:kvp-option-dialog QOF-ID-BOOK-SCM
 			   slots (_ "Book Options")
 			   changed_cb)))
 

Modified: gnucash/branches/register-rewrite/src/scm/main.scm
===================================================================
--- gnucash/branches/register-rewrite/src/scm/main.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/scm/main.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -23,9 +23,7 @@
     (default-duplicate-binding-handler 'last))
 (use-modules (ice-9 slib))
 
-(use-modules (g-wrap gw-wct))
-(use-modules (g-wrapped gw-core-utils))
-(use-modules (g-wrapped gw-gnc))
+(use-modules (gnucash core-utils))
 
 ;; Load the srfis (eventually, we should see where these are needed
 ;; and only have the use-modules statements in those files).
@@ -80,6 +78,7 @@
 ;; executable code until the end of the file if you can help it.
 ;; These are needed for a guile 1.3.4 bug
 (debug-enable 'debug)
+(debug-enable 'backtrace)
 (read-enable 'positions)
 
 (debug-set! maxdepth 100000)
@@ -87,9 +86,6 @@
 
 ;;(use-modules (ice-9 statprof))
 
-(define (gnc:setup-debugging)
-  (if (gnc:debugging?)
-      (debug-enable 'backtrace)))
 
 ;; various utilities
 
@@ -183,7 +179,7 @@
   (newline))
 
 (define (gnc:debug . items)
-  (if (gnc:debugging?)
+  (if (gnc-is-debugging)
       (begin
         (display "gnucash: [D] ")
         (for-each (lambda (i) (write i)) items)
@@ -229,7 +225,6 @@
 
   ;; Now the fun begins.
   (gnc:debug "starting up (1).")
-  (gnc:setup-debugging)
 
   ;; Now we can load a bunch of files.
   (load-from-path "command-line.scm") ;; depends on app-utils (N_, etc.)...

Modified: gnucash/branches/register-rewrite/src/scm/price-quotes.scm
===================================================================
--- gnucash/branches/register-rewrite/src/scm/price-quotes.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/scm/price-quotes.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -27,12 +27,10 @@
 (export gnc:price-quotes-install-sources)
 
 (use-modules (gnucash process))
-(use-modules (www main))
-(use-modules (srfi srfi-1))
-(use-modules (gnucash main) (g-wrapped gw-gnc)) ;; FIXME: delete after we finish modularizing.
+(use-modules (gnucash main)) ;; FIXME: delete after we finish modularizing.
 (use-modules (gnucash gnc-module))
-(use-modules (g-wrapped gw-core-utils))
-(use-modules (g-wrapped gw-gnome-utils))
+(use-modules (gnucash core-utils))
+(use-modules (sw_gnome_utils)) ;; for gnucash-ui-is-running
 
 (gnc:module-load "gnucash/app-utils" 0)
 
@@ -243,7 +241,7 @@
 ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
 
 (define gnc:*finance-quote-check*
-  (g:find-program-in-path "gnc-fq-check"))
+  (g-find-program-in-path "gnc-fq-check"))
 
 (define (gnc:fq-check-sources)
   (let ((program #f))
@@ -291,7 +289,7 @@
 ;; src/engine/gnc-pricedb.h
 
 (define gnc:*finance-quote-helper*
-  (g:find-program-in-path "gnc-fq-helper"))
+  (g-find-program-in-path "gnc-fq-helper"))
 
 (define (gnc:fq-get-quotes requests)
   ;; requests should be a list where each item is of the form
@@ -397,9 +395,9 @@
     ;;                     (commodity-4 currency-4 tz-4) ...)
     ;;  ...)
 
-    (let* ((ct (gnc:book-get-commodity-table book))
+    (let* ((ct (gnc-commodity-table-get-table book))
 	   (big-list
-	    (gnc:commodity-table-get-quotable-commodities-info
+	    (gnc-commodity-table-get-quotable-commodities
 	     ct))
 	   (commodity-list #f)
 	   (currency-list (filter
@@ -445,14 +443,14 @@
     (if (equal? (car fq-call-data) "currency")
         (map (lambda (quote-item-info)
                (list (car fq-call-data)
-                     (gnc:commodity-get-mnemonic (car quote-item-info))
-                     (gnc:commodity-get-mnemonic (cadr quote-item-info))))
+                     (gnc-commodity-get-mnemonic (car quote-item-info))
+                     (gnc-commodity-get-mnemonic (cadr quote-item-info))))
              (cdr fq-call-data))
         (list
          (cons (car fq-call-data)
                (map
                 (lambda (quote-item-info)
-                  (gnc:commodity-get-mnemonic (car quote-item-info)))
+                  (gnc-commodity-get-mnemonic (car quote-item-info)))
                 (cdr fq-call-data))))))
 
   (define (fq-results->commod-tz-quote-triples fq-call-data fq-results)
@@ -539,11 +537,11 @@
            (price #f)
            (price-type #f)
            (currency-str (assq-ref quote-data 'currency))
-           (commodity-table (gnc:book-get-commodity-table book))
+           (commodity-table (gnc-commodity-table-get-table book))
            (currency
             (and commodity-table
                  (string? currency-str)
-                 (gnc:commodity-table-lookup commodity-table
+                 (gnc-commodity-table-lookup commodity-table
                                              "ISO4217"
                                              (string-upcase currency-str)))))
 
@@ -566,7 +564,7 @@
       ;; FIXME: SIGFIGS is not what we want here...
       (if price
           (set! price
-                (gnc:double-to-gnc-numeric price
+                (double-to-gnc-numeric price
                                            GNC-DENOM-AUTO
                                            (logior (GNC-DENOM-SIGFIGS 9)
                                                    GNC-RND-ROUND))))
@@ -577,32 +575,32 @@
 
       (if (not (and commodity currency gnc-time price price-type))
           (string-append
-           currency-str ":" (gnc:commodity-get-mnemonic commodity))
-          (let ((gnc-price (gnc:price-create book)))
+           currency-str ":" (gnc-commodity-get-mnemonic commodity))
+          (let ((gnc-price (gnc-price-create book)))
             (if (not gnc-price)
                 (string-append
-                 currency-str ":" (gnc:commodity-get-mnemonic commodity))
+                 currency-str ":" (gnc-commodity-get-mnemonic commodity))
                 (begin
-                  (gnc:price-set-commodity gnc-price commodity)
-                  (gnc:price-set-currency gnc-price currency)
-                  (gnc:price-set-time gnc-price gnc-time)
-                  (gnc:price-set-source gnc-price "Finance::Quote")
-                  (gnc:price-set-type gnc-price price-type)
-                  (gnc:price-set-value gnc-price price)
+                  (gnc-price-set-commodity gnc-price commodity)
+                  (gnc-price-set-currency gnc-price currency)
+                  (gnc-price-set-time gnc-price gnc-time)
+                  (gnc-price-set-source gnc-price "Finance::Quote")
+                  (gnc-price-set-type gnc-price price-type)
+                  (gnc-price-set-value gnc-price price)
                   gnc-price))))))
 
   (define (book-add-prices! book prices)
-    (let ((pricedb (gnc:book-get-pricedb book)))
+    (let ((pricedb (gnc-pricedb-get-db book)))
       (for-each
        (lambda (price)
-         (gnc:pricedb-add-price pricedb price)
-         (gnc:price-unref price))
+         (gnc-pricedb-add-price pricedb price)
+         (gnc-price-unref price))
        prices)))
 
   ;; FIXME: uses of gnc:warn in here need to be cleaned up.  Right
   ;; now, they'll result in funny formatting.
 
-  (let* ((group (gnc:book-get-group book))
+  (let* ((group (xaccGetAccountGroup book))
          (fq-call-data (book->commodity->fq-call-data book))
          (fq-calls (and fq-call-data
                         (apply append
@@ -620,9 +618,9 @@
                              (if (car cq-pair)
                                  #f
                                  (string-append
-                                  (gnc:commodity-get-namespace (cdr cq-pair))
+                                  (gnc-commodity-get-namespace (cdr cq-pair))
                                   ":"
-                                  (gnc:commodity-get-mnemonic (cdr cq-pair)))))
+                                  (gnc-commodity-get-mnemonic (cdr cq-pair)))))
                            commod-tz-quote-triples)))
          ;; strip out the "bad" ones from above.
          (ok-syms
@@ -633,47 +631,47 @@
     (cond
      ((eq? fq-call-data #f)
       (set! keep-going? #f)
-      (if (gnc:ui-is-running?)
-          (gnc:error-dialog window (_ "No commodities marked for quote retrieval."))
+      (if (gnucash-ui-is-running)
+          (gnc-error-dialog window (_ "No commodities marked for quote retrieval."))
 	  (gnc:warn (_ "No commodities marked for quote retrieval."))))
      ((eq? fq-results #f)
       (set! keep-going? #f)
-      (if (gnc:ui-is-running?)
-          (gnc:error-dialog window (_ "Unable to get quotes or diagnose the problem."))
+      (if (gnucash-ui-is-running)
+          (gnc-error-dialog window (_ "Unable to get quotes or diagnose the problem."))
 	  (gnc:warn (_ "Unable to get quotes or diagnose the problem."))))
      ((member 'missing-lib fq-results)
       (set! keep-going? #f)
-      (if (gnc:ui-is-running?)
-          (gnc:error-dialog window
+      (if (gnucash-ui-is-running)
+          (gnc-error-dialog window
            (_ "You are missing some needed Perl libraries.
 Run 'gnc-fq-update' as root to install them."))
           (gnc:warn (_ "You are missing some needed Perl libraries.
 Run 'gnc-fq-update' as root to install them.") "\n")))
      ((member 'system-error fq-results)
       (set! keep-going? #f)
-      (if (gnc:ui-is-running?)
-          (gnc:error-dialog window
+      (if (gnucash-ui-is-running)
+          (gnc-error-dialog window
            (_ "There was a system error while retrieving the price quotes."))
           (gnc:warn (_ "There was a system error while retrieving the price quotes.") "\n")))
      ((not (list? (car fq-results)))
       (set! keep-going? #f)
-      (if (gnc:ui-is-running?)
-          (gnc:error-dialog window
+      (if (gnucash-ui-is-running)
+          (gnc-error-dialog window
            (_ "There was an unknown error while retrieving the price quotes."))
           (gnc:warn (_ "There was an unknown error while retrieving the price quotes.") "\n")))
-     ((and (not commod-tz-quote-triples) (gnc:ui-is-running?))
-      (gnc:error-dialog window
+     ((and (not commod-tz-quote-triples) (gnucash-ui-is-running))
+      (gnc-error-dialog window
        (_ "Unable to get quotes or diagnose the problem."))
        (set! keep-going? #f))
      ((not commod-tz-quote-triples)
       (gnc:warn (_ "Unable to get quotes or diagnose the problem."))
       (set! keep-going? #f))
      ((not (null? problem-syms))
-      (if (gnc:ui-is-running?)
+      (if (gnucash-ui-is-running)
           (if (and ok-syms (not (null? ok-syms)))
               (set!
                keep-going?
-               (gnc:verify-dialog window #t
+               (gnc-verify-dialog window #t
                 (call-with-output-string
                  (lambda (p)
                    (display (_ "Unable to retrieve quotes for these items:") p)
@@ -683,7 +681,7 @@
                    (newline p)
                    (display (_ "Continue using only the good quotes?") p)))))
               (begin
-                (gnc:error-dialog window
+                (gnc-error-dialog window
                  (call-with-output-string
                   (lambda (p)
                     (display
@@ -709,10 +707,10 @@
                           (commodity-tz-quote-triple->price book triple))
                         ok-syms)))
        (if (any string? prices)
-           (if (gnc:ui-is-running?)
+           (if (gnucash-ui-is-running)
                (set!
                 keep-going?
-                (gnc:verify-dialog window #t
+                (gnc-verify-dialog window #t
                  (call-with-output-string
                   (lambda (p)
                     (display (_ "Unable to create prices for these items:") p)
@@ -737,30 +735,6 @@
                                    (lambda (x) (not (string? x)))
                                    prices)))))))
 
-(define (gnc:add-quotes-to-book-at-url url)
-  (let* ((session (gnc:url->loaded-session (gnc:get-current-session) url #f #f))
-         (quote-ok? #f))
-    (gnc:debug "in add-quotes-to-book-at-url")
-    (if session
-	(begin
-          (gnc:debug "about to call gnc:book-add-quotes")
-	  (set! quote-ok? (and (gnc:book-add-quotes #f
-				(gnc:session-get-book session))))
-
-          (gnc:debug "done gnc:book-add-quotes:" quote-ok?)
-	  (if (not quote-ok?) (gnc:error "book-add-quotes failed"))
-	  (gnc:session-save session)
-	  (if (not (eq? 'no-err
-			(gw:enum-<gnc:BackendError>-val->sym
-			 (gnc:session-get-error session) #f)))
-	      (set! quote-ok? #f))
-	  (if (not quote-ok?)
-	      (gnc:error "session-save failed " 
-                         (gnc:session-get-error session)))
-	  (gnc:session-destroy session))
-	(gnc:error "book-add-quotes unable to open file"))
-    quote-ok?))
-
 ; (define (get-1-quote exchange . items)
 ;   (let ((cmd (apply list 'fetch exchange items))
 ; 	(quoter (run-sub-process #f
@@ -780,4 +754,4 @@
     (if (list? sources)
 	(begin
 	  (gnc:msg "Found Finance::Quote version " (car sources))
-	  (gnc:quote-source-set-fq-installed (cdr sources))))))
+	  (gnc-quote-source-set-fq-installed (cdr sources))))))

Modified: gnucash/branches/register-rewrite/src/scm/printing/print-check.scm
===================================================================
--- gnucash/branches/register-rewrite/src/scm/printing/print-check.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/scm/printing/print-check.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -101,7 +101,7 @@
 	 (frac-part (inexact->exact 
                      (truncate 
                       (+ (/ .5 100) (* 100 (- amount int-part))))))
-	 (ps (gnc:print-session-create #t))
+	 (ps (gnc-print-session-create #t))
 	 (format #f)
 	 (offset #f)
 	 (date-string "")
@@ -146,71 +146,71 @@
 	    (begin
 	      (display "translate by ") (display (cadr translate-pos))
 	      (display " ") (display (caddr translate-pos)) (newline)
-	      (gnc:print-session-translate ps (cadr translate-pos)
+	      (gnc-print-session-translate ps (cadr translate-pos)
 					   (caddr translate-pos)))))
 
       (let ((rotate-angle (assq 'rotate format)))
-	(if rotate-angle (gnc:print-session-rotate ps (cdr rotate-angle))))
+	(if rotate-angle (gnc-print-session-rotate ps (cdr rotate-angle))))
 
       (let ((date-pos (assq 'date format)))
-        (gnc:print-session-moveto ps (cadr date-pos) 
+        (gnc-print-session-moveto ps (cadr date-pos)
                                   (+ offset (caddr date-pos)))
-        (gnc:print-session-text ps date-string))
+        (gnc-print-session-text ps date-string))
       
       (let ((payee-pos (assq 'payee format)))
-        (gnc:print-session-moveto ps (cadr payee-pos) 
+        (gnc-print-session-moveto ps (cadr payee-pos)
                                   (+ offset (caddr payee-pos)))
-        (gnc:print-session-text ps payee))
+        (gnc-print-session-text ps payee))
       
       (let ((number-pos (assq 'amount-number format)))
-        (gnc:print-session-moveto ps (cadr number-pos) 
+        (gnc-print-session-moveto ps (cadr number-pos)
                                   (+ offset (caddr number-pos)))
-        (gnc:print-session-text ps (printable-value amount 100)))
+        (gnc-print-session-text ps (printable-value amount 100)))
       
       (let ((words-pos (assq 'amount-words format)))
-        (gnc:print-session-moveto ps (cadr words-pos) 
+        (gnc-print-session-moveto ps (cadr words-pos)
                                   (+ offset (caddr words-pos)))
-        (gnc:print-session-text ps (number-to-words amount 100)))
+        (gnc-print-session-text ps (number-to-words amount 100)))
 
       (if (not (eq? (print-check-format:format format-info) 'wallet))
         (let ((memo-pos (assq 'memo format)))
-          (gnc:print-session-moveto ps (cadr memo-pos) 
+          (gnc-print-session-moveto ps (cadr memo-pos)
                                     (+ offset (caddr memo-pos)))
-          (gnc:print-session-text ps memo)))
+          (gnc-print-session-text ps memo)))
 
       (if (eq? (print-check-format:format format-info) 'wallet)
         (begin
            (let ((memo-pos (assq 'memo format)))
-             (gnc:print-session-moveto ps (cadr memo-pos) 
+             (gnc-print-session-moveto ps (cadr memo-pos)
                                   (+ offset (caddr memo-pos)))
              (if (< (string-length memo) 28)
-	          (gnc:print-session-text ps memo)
-	          (gnc:print-session-text ps (substring memo 0 27))))
+	          (gnc-print-session-text ps memo)
+	          (gnc-print-session-text ps (substring memo 0 27))))
            (let ((memostub-pos (assq 'memo-stub format)))
-             (gnc:print-session-moveto ps (cadr memostub-pos) 
+             (gnc-print-session-moveto ps (cadr memostub-pos)
                                   (+ offset (caddr memostub-pos)))
              (if (< (string-length memo) 22)
 	            (set! memo-stub-text memo)
 	            (set! memo-stub-text (substring memo 0 20)))
-             (gnc:print-session-text ps memo-stub-text))
+             (gnc-print-session-text ps memo-stub-text))
         
            (let ((datestub-pos (assq 'date-stub format)))
-              (gnc:print-session-moveto ps (cadr datestub-pos) 
+              (gnc-print-session-moveto ps (cadr datestub-pos)
                                   (+ offset (caddr datestub-pos)))
-             (gnc:print-session-text ps date-string))
+             (gnc-print-session-text ps date-string))
         
            (let ((payeestub-pos (assq 'payee-stub format)))
-                (gnc:print-session-moveto ps (cadr payeestub-pos) 
+                (gnc-print-session-moveto ps (cadr payeestub-pos)
                                   (+ offset (caddr payeestub-pos)))
               (if (< (string-length payee) 22)
 	            (set! payee-stub-text payee)
 	            (set! payee-stub-text (substring payee 0 20)))
-             (gnc:print-session-text ps payee-stub-text))
+             (gnc-print-session-text ps payee-stub-text))
         
            (let ((amountstub-pos (assq 'amount-stub format)))
-             (gnc:print-session-moveto ps (cadr amountstub-pos) 
+             (gnc-print-session-moveto ps (cadr amountstub-pos)
                                   (+ offset (caddr amountstub-pos)))
-             (gnc:print-session-text ps (printable-value amount 100)))))
+             (gnc-print-session-text ps (printable-value amount 100)))))
 
-      (gnc:print-session-done ps)))))
+      (gnc-print-session-done ps)))))
 

Modified: gnucash/branches/register-rewrite/src/tax/us/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/tax/us/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/tax/us/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -28,21 +28,25 @@
 endif
 
 .scm-links:
-	rm -f gnucash tax
-	$(LN_S) -f . gnucash
-	$(LN_S) -f . tax 
+	$(RM) -rf gnucash
+	mkdir -p gnucash
+	mkdir -p gnucash/tax
 if GNUCASH_SEPARATE_BUILDDIR
 	for X in ${SCM_FILE_LINKS} ; do \
 	  $(LN_S) -f ${srcdir}/$$X . ; \
 	done
 endif
+	( cd gnucash/tax; for A in $(gncscmmod_DATA) ; do $(LN_S) -f ../../$$A . ; done )
 	touch .scm-links
 
+clean-local:
+	$(RM) -rf gnucash
+
 noinst_DATA = .scm-links
 
 EXTRA_DIST = \
   ${gncscmmod_DATA} \
   ${gncscm_DATA}
 
-CLEANFILES = gnucash tax .scm-links
+CLEANFILES = .scm-links
 DISTCLEANFILES = ${SCM_FILE_LINKS}

Modified: gnucash/branches/register-rewrite/src/tax/us/test/Makefile.am
===================================================================
--- gnucash/branches/register-rewrite/src/tax/us/test/Makefile.am	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/tax/us/test/Makefile.am	2007-01-05 17:25:28 UTC (rev 15313)
@@ -13,12 +13,10 @@
   --gnc-module-dir ${top_srcdir}/src/tax/us \
   --guile-load-dir ${top_builddir}/src/scm \
   --guile-load-dir ${top_builddir}/lib \
-  --guile-load-dir ${G_WRAP_MODULE_DIR} \
   --guile-load-dir ${top_builddir}/src/gnome-utils \
   --guile-load-dir ${top_builddir}/src/gnome \
   --library-dir ${top_builddir}/src/gnome-utils \
-  --library-dir ${top_builddir}/src/gnome \
-  --library-dir ${G_WRAP_LIB_DIR}
+  --library-dir ${top_builddir}/src/gnome
 
 TESTS_ENVIRONMENT := \
   $(shell ${top_srcdir}/src/gnc-test-env --no-exports ${GNC_TEST_DEPS})

Modified: gnucash/branches/register-rewrite/src/tax/us/txf-de_DE.scm
===================================================================
--- gnucash/branches/register-rewrite/src/tax/us/txf-de_DE.scm	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/tax/us/txf-de_DE.scm	2007-01-05 17:25:28 UTC (rev 15313)
@@ -129,4 +129,4 @@
     "a" (N_ "The electronic tax number of your business") ""))
   )
 
-(gnc:register-kvp-option-generator gnc:id-book book-options-generator)
+(gnc-register-kvp-option-generator QOF-ID-BOOK-SCM book-options-generator)

Modified: gnucash/branches/register-rewrite/src/test-core/test-stuff.c
===================================================================
--- gnucash/branches/register-rewrite/src/test-core/test-stuff.c	2007-01-04 21:23:48 UTC (rev 15312)
+++ gnucash/branches/register-rewrite/src/test-core/test-stuff.c	2007-01-05 17:25:28 UTC (rev 15313)
@@ -124,17 +124,13 @@
 }
 
 gboolean
-do_test_call(
-    gboolean result,
-    const char* test_title,
-    const char* filename,
-    int line )
+do_test_call(gboolean result, const char* test_title, const char* filename,
+             int line )
 {
-	if( result ) {
+	if (result)
 		success_args( test_title, filename, line, "" );
-	} else {
+        else
 		failure_args( test_title, filename, line, "" );
-	}
 
 	return result;
 }



More information about the gnucash-changes mailing list